diff --git a/circle.yml b/circle.yml index 60d75cf33d..059964c447 100644 --- a/circle.yml +++ b/circle.yml @@ -2,6 +2,9 @@ general: branches: ignore: - ins_n_outs +dependencies: + cache_directories: + - "~/ionic-site" # cache ionic-site machine: node: version: 4.1.0 diff --git a/gulpfile.js b/gulpfile.js index 5bd20cb8bd..a57798c09a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -689,9 +689,16 @@ function buildDemoSass(isProductionMode) { require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig); // requires bundle.system to be run once -gulp.task('karma', ['tests'], function() { +gulp.task('karma', ['tests'], function(done) { var karma = require('karma').server; - return karma.start({ configFile: __dirname + '/scripts/karma/karma.conf.js' }) + karma.start({ + configFile: __dirname + '/scripts/karma/karma.conf.js' + }, function(result) { + if (result > 0) { + return done(new Error('Karma exited with an error')); + } + done(); + }); }); gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() { @@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() { * some prerelease magic (see 'prepare') and copies npm package and tooling * files to dist. */ -gulp.task('prerelease', ['prepare', 'build.release'], function(done){ - runSequence('package', done); +gulp.task('prerelease', function(done){ + runSequence( + 'tslint', + 'prepare', + 'build.release', + 'karma', + 'package', + done + ); }); /** @@ -723,25 +737,10 @@ gulp.task('release', ['publish.npm', 'publish.github']); * Pulls latest, ensures there are no unstaged/uncommitted changes, updates * package.json minor version and generates CHANGELOG for release. */ -gulp.task('prepare', function(){ - var execSync = require('child_process').execSync; - var spawnSync = require('child_process').spawnSync; +gulp.task('prepare', ['git-pull-latest'], function(){ var semver = require('semver'); var fs = require('fs'); var changelog = require('gulp-conventional-changelog'); - var self = this; - - //Check for uncommitted changes - var gitStatusResult = execSync('git status --porcelain'); - if (gitStatusResult.toString().length > 0) { - return fail('You have uncommitted changes, please stash or commit them before running prepare'); - } - - //Pull latest - var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']); - if (gitPullResult.status !== 0) { - fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString()); - } //Update package.json version var packageJSON = require('./package.json'); @@ -754,15 +753,31 @@ gulp.task('prepare', function(){ preset: 'angular' })) .pipe(gulp.dest('./')); +}); - function fail(msg) { +gulp.task('git-pull-latest', function() { + var execSync = require('child_process').execSync; + var spawnSync = require('child_process').spawnSync; + + function fail(context, msg) { // remove gulp's 'Finished 'task' after 10ms' message - self.removeAllListeners('task_stop'); + context.removeAllListeners('task_stop'); console.error('Prepare aborted.'); console.error(msg); } + //Check for uncommitted changes + var gitStatusResult = execSync('git status --porcelain'); + if (gitStatusResult.toString().length > 0) { + return fail(this, 'You have uncommitted changes, please stash or commit them before running prepare'); + } + + //Pull latest + var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']); + if (gitPullResult.status !== 0) { + fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString()); + } }); /** @@ -843,11 +858,14 @@ gulp.task('publish.npm', function(done) { }); }); +gulp.task('publish.nightly', ['build.release'], function(done){ + runSequence('git-pull-latest', 'nightly', done); +}); /** * Publishes a new tag to npm with a nightly tag. */ -gulp.task('publish.nightly', function(done) { +gulp.task('nightly', ['package'], function(done) { var fs = require('fs'); var spawn = require('child_process').spawn; var packageJSON = require('./package.json'); @@ -872,6 +890,8 @@ gulp.task('publish.nightly', function(done) { .concat(createUniqueHash()) .join('-'); + fs.writeFileSync('./package.json', JSON.stringify(packageJSON, null, 2)); + var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']); npmCmd.stdout.on('data', function (data) { @@ -925,11 +945,11 @@ gulp.task('tooling', function(){ /** * TS LINT */ -gulp.task("tslint", function() { - var tslint = require("gulp-tslint"); - gulp.src([ - 'ionic/**/*.ts', - '!ionic/**/test/**/*', - ]).pipe(tslint()) - .pipe(tslint.report('verbose')); +gulp.task('tslint', function(done) { + var tslint = require('gulp-tslint'); + return gulp.src([ + 'ionic/**/*.ts', + '!ionic/**/test/**/*', + ]).pipe(tslint()) + .pipe(tslint.report('verbose')); }); diff --git a/ionic/components/img/img.ts b/ionic/components/img/img.ts index c2b49f30c3..45a6ca04d8 100644 --- a/ionic/components/img/img.ts +++ b/ionic/components/img/img.ts @@ -84,7 +84,7 @@ export class Img { } private _loaded(isLoaded: boolean) { - this._elementRef.nativeElement.classList[isLoaded ? 'add': 'remove']('img-loaded'); + this._elementRef.nativeElement.classList[isLoaded ? 'add' : 'remove']('img-loaded'); } enable(shouldEnable: boolean) { diff --git a/ionic/components/input/input.ts b/ionic/components/input/input.ts index 22d8454239..ac78841df7 100644 --- a/ionic/components/input/input.ts +++ b/ionic/components/input/input.ts @@ -55,8 +55,8 @@ import {Platform} from '../../platform/platform'; * * * - * - * + * + * * * ``` * diff --git a/ionic/components/input/test/clear-input/main.html b/ionic/components/input/test/clear-input/main.html index e3f743570e..5569b943ea 100644 --- a/ionic/components/input/test/clear-input/main.html +++ b/ionic/components/input/test/clear-input/main.html @@ -11,7 +11,7 @@ Text 1: - + diff --git a/ionic/platform/platform.ts b/ionic/platform/platform.ts index 9655e9258c..b1ace1d408 100644 --- a/ionic/platform/platform.ts +++ b/ionic/platform/platform.ts @@ -190,7 +190,7 @@ export class Platform { triggerReady() { this._zone.run(() => { this._readyResolve(); - }) + }); } /** @@ -741,5 +741,5 @@ export interface PlatformVersion { str?: string; num?: number; major?: number; - minor?: number + minor?: number; } diff --git a/scripts/ci/deploy.sh b/scripts/ci/deploy.sh index 5cfa54fe25..67a7b8b1f1 100755 --- a/scripts/ci/deploy.sh +++ b/scripts/ci/deploy.sh @@ -28,7 +28,7 @@ function run { fi # Install gulp globally for site deploy script. - npm install -g gulp + # npm install -g gulp if [[ "$IS_RELEASE" == "true" ]]; then echo "RELEASE DETECTED!" diff --git a/scripts/docs/deploy.sh b/scripts/docs/deploy.sh index f3ef689d28..a8c2a41fc6 100755 --- a/scripts/docs/deploy.sh +++ b/scripts/docs/deploy.sh @@ -12,10 +12,21 @@ function init { cd .. SITE_PATH=$(readJsonProp "config.json" "sitePath") SITE_DIR=$IONIC_DIR/$SITE_PATH + DOCS_DEST=$(readJsonProp "config.json" "docsDest") - ./git/clone.sh --repository="driftyco/ionic-site" \ - --directory="$SITE_DIR" \ - --branch="master" + if [ ! -d "$SITE_DIR" ]; then + echo "checking out" + ./git/clone.sh --repository="driftyco/ionic-site" \ + --directory="$SITE_DIR" \ + --branch="master" \ + --depth=1 + else + echo "using existing" + cd $SITE_DIR + git reset --hard + git pull origin master + cd $IONIC_DIR/scripts + fi } function run { @@ -23,14 +34,15 @@ function run { VERSION=$(readJsonProp "package.json" "version") #compile API Demos - gulp demos --production=true + ./node_modules/.bin/gulp demos --production=true # process new docs - gulp docs --doc-version="$VERSION_NAME" + rm -R $DOCS_DEST/api + ./node_modules/.bin/gulp docs --doc-version="$VERSION_NAME" # compile sass vars json for ionic-site docs - gulp docs.sass-variables - cp tmp/sass.json $SITE_DIR/docs/v2/theming/overriding-ionic-variables/ + ./node_modules/.bin/gulp docs.sass-variables + cp tmp/sass.json $DOCS_DEST/theming/overriding-ionic-variables/ # CD in to the site dir to commit updated docs cd $SITE_DIR diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 5a6675653f..15ca4cba13 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -24,10 +24,31 @@ angular_controller: APIDemoCtrl <@ endif @> <@- endmacro -@> <@ macro returnObject(params) -@> - <@- if params -@> - <@- for param in params -@> - <$ param.type $> <$ param.key $> <$ param.description $> - <@- endfor @> + <@- if params -@> + + + + Property + Type + Details + + + + <@ for param in params @> + + + <$ param.key $> + + + <$ param.type | code $> + + + <$ param.description | marked $> + + + <@ endfor @> + + <@- endif @> <@- endmacro -@>
<$ param.type $>