mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(build): add validate task to gulp that will run linting tools and testing tools
This commit is contained in:
53
gulpfile.js
53
gulpfile.js
@ -222,8 +222,14 @@ gulp.task('transpile', function(){
|
|||||||
|
|
||||||
var tscOpts = getTscOptions(TYPECHECK ? 'typecheck' : undefined);
|
var tscOpts = getTscOptions(TYPECHECK ? 'typecheck' : undefined);
|
||||||
var tsResult = tsCompile(tscOpts, 'transpile')
|
var tsResult = tsCompile(tscOpts, 'transpile')
|
||||||
|
.on('error', function(err) {
|
||||||
|
console.log(err.message);
|
||||||
|
});
|
||||||
|
|
||||||
if (TYPECHECK) {
|
if (TYPECHECK) {
|
||||||
|
tsResult.on('error', function(err) {
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
var merge = require('merge2');
|
var merge = require('merge2');
|
||||||
var js = tsResult.js;
|
var js = tsResult.js;
|
||||||
var dts = tsResult.dts;
|
var dts = tsResult.dts;
|
||||||
@ -249,10 +255,7 @@ function tsCompile(options, cacheName){
|
|||||||
'!ionic/**/*.spec.ts'
|
'!ionic/**/*.spec.ts'
|
||||||
])
|
])
|
||||||
.pipe(cache(cacheName, { optimizeMemory: true }))
|
.pipe(cache(cacheName, { optimizeMemory: true }))
|
||||||
.pipe(tsc(options, undefined, tscReporter))
|
.pipe(tsc(options, undefined, tscReporter));
|
||||||
.on('error', function(error) {
|
|
||||||
console.log(error.message);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -327,6 +330,21 @@ gulp.task('copy.scss', function() {
|
|||||||
.pipe(gulp.dest('dist'));
|
.pipe(gulp.dest('dist'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lint the scss files using a ruby gem
|
||||||
|
*/
|
||||||
|
gulp.task('lint.scss', function() {
|
||||||
|
var scsslint = require('gulp-scss-lint');
|
||||||
|
|
||||||
|
return gulp.src([
|
||||||
|
'ionic/**/*.scss',
|
||||||
|
'!ionic/components/*/test/**/*',
|
||||||
|
'!ionic/util/test/*'
|
||||||
|
])
|
||||||
|
.pipe(scsslint())
|
||||||
|
.pipe(scsslint.failReporter());
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies miscellaneous scripts to dist.
|
* Copies miscellaneous scripts to dist.
|
||||||
*/
|
*/
|
||||||
@ -719,10 +737,8 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
|||||||
*/
|
*/
|
||||||
gulp.task('prerelease', function(done){
|
gulp.task('prerelease', function(done){
|
||||||
runSequence(
|
runSequence(
|
||||||
'tslint',
|
'validate',
|
||||||
'prepare',
|
'prepare',
|
||||||
'build.release',
|
|
||||||
'karma',
|
|
||||||
'package',
|
'package',
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
@ -858,8 +874,11 @@ gulp.task('publish.npm', function(done) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('publish.nightly', ['build.release'], function(done){
|
/**
|
||||||
runSequence('git-pull-latest', 'nightly', done);
|
* Execute this task to validate current code and then
|
||||||
|
*/
|
||||||
|
gulp.task('publish.nightly', function(done){
|
||||||
|
runSequence('git-pull-latest', 'validate', 'nightly', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -945,11 +964,25 @@ gulp.task('tooling', function(){
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate Task
|
||||||
|
* - This task
|
||||||
|
*/
|
||||||
|
gulp.task('validate', function(done) {
|
||||||
|
runSequence(
|
||||||
|
'lint.scss',
|
||||||
|
'tslint',
|
||||||
|
'build.release',
|
||||||
|
'karma',
|
||||||
|
done
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TS LINT
|
* TS LINT
|
||||||
*/
|
*/
|
||||||
gulp.task('tslint', function(done) {
|
gulp.task('tslint', function() {
|
||||||
var tslint = require('gulp-tslint');
|
var tslint = require('gulp-tslint');
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
'ionic/**/*.ts',
|
'ionic/**/*.ts',
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
"gulp-remember": "^0.3.0",
|
"gulp-remember": "^0.3.0",
|
||||||
"gulp-rename": "~1.2.0",
|
"gulp-rename": "~1.2.0",
|
||||||
"gulp-sass": "^2.0.4",
|
"gulp-sass": "^2.0.4",
|
||||||
|
"gulp-scss-lint": "^0.3.9",
|
||||||
"gulp-shell": "^0.4.0",
|
"gulp-shell": "^0.4.0",
|
||||||
"gulp-strip-debug": "^1.1.0",
|
"gulp-strip-debug": "^1.1.0",
|
||||||
"gulp-tslint": "^4.3.4",
|
"gulp-tslint": "^4.3.4",
|
||||||
@ -91,4 +92,4 @@
|
|||||||
"path": "node_modules/ionic-cz-conventional-changelog"
|
"path": "node_modules/ionic-cz-conventional-changelog"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user