Skip to content

Commit d1b8446

Browse files
committed
Merge pull request #1 from driftyco/2.0
2.0
2 parents c594c43 + 4ba9eb0 commit d1b8446

File tree

8 files changed

+103
-47
lines changed

8 files changed

+103
-47
lines changed

circle.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ general:
22
branches:
33
ignore:
44
- ins_n_outs
5+
dependencies:
6+
cache_directories:
7+
- "~/ionic-site" # cache ionic-site
58
machine:
69
node:
710
version: 4.1.0

gulpfile.js

+50-30
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,16 @@ function buildDemoSass(isProductionMode) {
689689
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
690690

691691
// requires bundle.system to be run once
692-
gulp.task('karma', ['tests'], function() {
692+
gulp.task('karma', ['tests'], function(done) {
693693
var karma = require('karma').server;
694-
return karma.start({ configFile: __dirname + '/scripts/karma/karma.conf.js' })
694+
karma.start({
695+
configFile: __dirname + '/scripts/karma/karma.conf.js'
696+
}, function(result) {
697+
if (result > 0) {
698+
return done(new Error('Karma exited with an error'));
699+
}
700+
done();
701+
});
695702
});
696703

697704
gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
@@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
710717
* some prerelease magic (see 'prepare') and copies npm package and tooling
711718
* files to dist.
712719
*/
713-
gulp.task('prerelease', ['prepare', 'build.release'], function(done){
714-
runSequence('package', done);
720+
gulp.task('prerelease', function(done){
721+
runSequence(
722+
'tslint',
723+
'prepare',
724+
'build.release',
725+
'karma',
726+
'package',
727+
done
728+
);
715729
});
716730

717731
/**
@@ -723,25 +737,10 @@ gulp.task('release', ['publish.npm', 'publish.github']);
723737
* Pulls latest, ensures there are no unstaged/uncommitted changes, updates
724738
* package.json minor version and generates CHANGELOG for release.
725739
*/
726-
gulp.task('prepare', function(){
727-
var execSync = require('child_process').execSync;
728-
var spawnSync = require('child_process').spawnSync;
740+
gulp.task('prepare', ['git-pull-latest'], function(){
729741
var semver = require('semver');
730742
var fs = require('fs');
731743
var changelog = require('gulp-conventional-changelog');
732-
var self = this;
733-
734-
//Check for uncommitted changes
735-
var gitStatusResult = execSync('git status --porcelain');
736-
if (gitStatusResult.toString().length > 0) {
737-
return fail('You have uncommitted changes, please stash or commit them before running prepare');
738-
}
739-
740-
//Pull latest
741-
var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']);
742-
if (gitPullResult.status !== 0) {
743-
fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString());
744-
}
745744

746745
//Update package.json version
747746
var packageJSON = require('./package.json');
@@ -754,15 +753,31 @@ gulp.task('prepare', function(){
754753
preset: 'angular'
755754
}))
756755
.pipe(gulp.dest('./'));
756+
});
757757

758758

759-
function fail(msg) {
759+
gulp.task('git-pull-latest', function() {
760+
var execSync = require('child_process').execSync;
761+
var spawnSync = require('child_process').spawnSync;
762+
763+
function fail(context, msg) {
760764
// remove gulp's 'Finished 'task' after 10ms' message
761-
self.removeAllListeners('task_stop');
765+
context.removeAllListeners('task_stop');
762766
console.error('Prepare aborted.');
763767
console.error(msg);
764768
}
765769

770+
//Check for uncommitted changes
771+
var gitStatusResult = execSync('git status --porcelain');
772+
if (gitStatusResult.toString().length > 0) {
773+
return fail(this, 'You have uncommitted changes, please stash or commit them before running prepare');
774+
}
775+
776+
//Pull latest
777+
var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']);
778+
if (gitPullResult.status !== 0) {
779+
fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString());
780+
}
766781
});
767782

768783
/**
@@ -843,11 +858,14 @@ gulp.task('publish.npm', function(done) {
843858
});
844859
});
845860

861+
gulp.task('publish.nightly', ['build.release'], function(done){
862+
runSequence('git-pull-latest', 'nightly', done);
863+
});
846864

847865
/**
848866
* Publishes a new tag to npm with a nightly tag.
849867
*/
850-
gulp.task('publish.nightly', function(done) {
868+
gulp.task('nightly', ['package'], function(done) {
851869
var fs = require('fs');
852870
var spawn = require('child_process').spawn;
853871
var packageJSON = require('./package.json');
@@ -872,6 +890,8 @@ gulp.task('publish.nightly', function(done) {
872890
.concat(createUniqueHash())
873891
.join('-');
874892

893+
fs.writeFileSync('./package.json', JSON.stringify(packageJSON, null, 2));
894+
875895
var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']);
876896

877897
npmCmd.stdout.on('data', function (data) {
@@ -925,11 +945,11 @@ gulp.task('tooling', function(){
925945
/**
926946
* TS LINT
927947
*/
928-
gulp.task("tslint", function() {
929-
var tslint = require("gulp-tslint");
930-
gulp.src([
931-
'ionic/**/*.ts',
932-
'!ionic/**/test/**/*',
933-
]).pipe(tslint())
934-
.pipe(tslint.report('verbose'));
948+
gulp.task('tslint', function(done) {
949+
var tslint = require('gulp-tslint');
950+
return gulp.src([
951+
'ionic/**/*.ts',
952+
'!ionic/**/test/**/*',
953+
]).pipe(tslint())
954+
.pipe(tslint.report('verbose'));
935955
});

ionic/components/img/img.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class Img {
8484
}
8585

8686
private _loaded(isLoaded: boolean) {
87-
this._elementRef.nativeElement.classList[isLoaded ? 'add': 'remove']('img-loaded');
87+
this._elementRef.nativeElement.classList[isLoaded ? 'add' : 'remove']('img-loaded');
8888
}
8989

9090
enable(shouldEnable: boolean) {

ionic/components/input/input.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ import {Platform} from '../../platform/platform';
5555
* <ion-input type="tel"></ion-input>
5656
* </ion-item>
5757
*
58-
* <ion-item clearInput>
59-
* <ion-input placeholder="Username"></ion-input>
58+
* <ion-item>
59+
* <ion-input placeholder="Username" clearInput></ion-input>
6060
* </ion-item>
6161
* ```
6262
*

ionic/platform/platform.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class Platform {
190190
triggerReady() {
191191
this._zone.run(() => {
192192
this._readyResolve();
193-
})
193+
});
194194
}
195195

196196
/**
@@ -741,5 +741,5 @@ export interface PlatformVersion {
741741
str?: string;
742742
num?: number;
743743
major?: number;
744-
minor?: number
744+
minor?: number;
745745
}

scripts/ci/deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function run {
2828
fi
2929

3030
# Install gulp globally for site deploy script.
31-
npm install -g gulp
31+
# npm install -g gulp
3232

3333
if [[ "$IS_RELEASE" == "true" ]]; then
3434
echo "RELEASE DETECTED!"

scripts/docs/deploy.sh

+19-7
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,37 @@ function init {
1212
cd ..
1313
SITE_PATH=$(readJsonProp "config.json" "sitePath")
1414
SITE_DIR=$IONIC_DIR/$SITE_PATH
15+
DOCS_DEST=$(readJsonProp "config.json" "docsDest")
1516

16-
./git/clone.sh --repository="driftyco/ionic-site" \
17-
--directory="$SITE_DIR" \
18-
--branch="master"
17+
if [ ! -d "$SITE_DIR" ]; then
18+
echo "checking out"
19+
./git/clone.sh --repository="driftyco/ionic-site" \
20+
--directory="$SITE_DIR" \
21+
--branch="master" \
22+
--depth=1
23+
else
24+
echo "using existing"
25+
cd $SITE_DIR
26+
git reset --hard
27+
git pull origin master
28+
cd $IONIC_DIR/scripts
29+
fi
1930
}
2031

2132
function run {
2233
cd ..
2334
VERSION=$(readJsonProp "package.json" "version")
2435

2536
#compile API Demos
26-
gulp demos --production=true
37+
./node_modules/.bin/gulp demos --production=true
2738

2839
# process new docs
29-
gulp docs --doc-version="$VERSION_NAME"
40+
rm -R $DOCS_DEST/api
41+
./node_modules/.bin/gulp docs --doc-version="$VERSION_NAME"
3042

3143
# compile sass vars json for ionic-site docs
32-
gulp docs.sass-variables
33-
cp tmp/sass.json $SITE_DIR/docs/v2/theming/overriding-ionic-variables/
44+
./node_modules/.bin/gulp docs.sass-variables
45+
cp tmp/sass.json $DOCS_DEST/theming/overriding-ionic-variables/
3446

3547
# CD in to the site dir to commit updated docs
3648
cd $SITE_DIR

scripts/docs/templates/common.template.html

+25-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,31 @@
2424
<@- endmacro -@>
2525

2626
<@ macro returnObject(params) -@>
27-
<@- if params -@><br>
28-
<@- for param in params -@>
29-
<code><$ param.type $></code> <span class="fixed-width"><$ param.key $></span> <$ param.description $><br>
30-
<@- endfor @>
27+
<@- if params -@>
28+
<table class="table returns-object-table param-table">
29+
<thead>
30+
<tr>
31+
<th>Property</th>
32+
<th>Type</th>
33+
<th>Details</th>
34+
</tr>
35+
</thead>
36+
<tbody>
37+
<@ for param in params @>
38+
<tr>
39+
<td class="fixed-width">
40+
<$ param.key $>
41+
</td>
42+
<td>
43+
<$ param.type | code $>
44+
</td>
45+
<td>
46+
<$ param.description | marked $>
47+
</td>
48+
</tr>
49+
<@ endfor @>
50+
</tbody>
51+
</table>
3152
<@- endif @>
3253
<@- endmacro -@>
3354

0 commit comments

Comments
 (0)