From 8f440761693aeb80a469aba3aa4fec17e43458f5 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 2 Feb 2016 16:34:29 -0600 Subject: [PATCH] chore(): steps to run local npm ionic-framework --- gulpfile.js | 8 +++++--- scripts/README.md | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 4b2678e2c5..906576c4a9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,7 +15,7 @@ var connect = require('gulp-connect'); var docsConfig = require('./scripts/config.json'); var flagConfig = { - string: ['port', 'version', 'ngVersion', 'animations'], + string: ['port', 'version', 'ngVersion', 'animations', 'strip-debug'], boolean: ['dry-run'], alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'}, default: { port: 8000 } @@ -154,9 +154,10 @@ function tsCompile(options, cacheName){ gulp.task('transpile.no-typecheck', function(){ var gulpif = require('gulp-if'); var stripDebug = require('gulp-strip-debug'); + var shouldStripDebug = (IS_RELEASE && flags['strip-debug'] !== 'false'); return tsCompile(tscOptionsNoTypeCheck, 'no-typecheck') - .pipe(gulpif(IS_RELEASE, stripDebug())) + .pipe(gulpif(shouldStripDebug, stripDebug())) .pipe(gulp.dest('dist')); }); @@ -165,12 +166,13 @@ gulp.task('typecheck', ['transpile.typecheck']); gulp.task('transpile.typecheck', function(){ var merge = require('merge2'); var stripDebug = require('gulp-strip-debug'); + var shouldStripDebug = (IS_RELEASE && flags['strip-debug'] !== 'false'); var result = tsCompile(tscOptions, 'typecheck'); var js = result.js; var dts = result.dts; - if (IS_RELEASE) { + if (shouldStripDebug) { js = js.pipe(stripDebug()); } diff --git a/scripts/README.md b/scripts/README.md index 336b685b23..403996dee2 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -33,6 +33,26 @@ 2. `gulp docs --doc-version=2.0.0` to build a specific API version +### Building NPM Module for Local Testing + +From `ionic` repo root directory: + +1. `gulp package --strip-debug false` +2. `cd dist` +3. `sudo npm link` +4. After ionic changes: `gulp transpile.no-typecheck --strip-debug false` + +From Testing App root directory: + +1. `npm link ionic-framework` +2. `ionic serve` or `ionic run` or whatever + +When done: + +1. In testing app, `npm uninstall ionic-framework` +2. In ionic repo, `sudo gulp clean` + + ### Running Snapshot 1. Install [Protractor](https://angular.github.io/protractor/#/): `npm install -g protractor` @@ -75,6 +95,6 @@ ### Releasing API Demos -Ionic API demos are automatically compiled and deployed to the [ionic staging site](http://ionic-site-staging.herokuapp.com/) on every commit. No action is necessary. +Ionic API demos are automatically compiled and deployed to the [ionic staging site](http://ionic-site-staging.herokuapp.com/) on every commit. No action is necessary. -If you'd like to manually update the demos, clone the [`ionic-site`](https://github.com/driftyco/ionic-site) repo as a sibling of `ionic`. From `ionic` run gulp docs, and it'll compile and copy the demos to the `ionic-site` repo, ready for testing or committing. +If you'd like to manually update the demos, clone the [`ionic-site`](https://github.com/driftyco/ionic-site) repo as a sibling of `ionic`. From `ionic` run gulp docs, and it'll compile and copy the demos to the `ionic-site` repo, ready for testing or committing.