mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
build(publish): gulp publish task
This commit is contained in:
45
gulpfile.js
45
gulpfile.js
@ -243,7 +243,7 @@ gulp.task('e2e.build', function() {
|
|||||||
fs.readFileSync('scripts/e2e/e2e.template.html')
|
fs.readFileSync('scripts/e2e/e2e.template.html')
|
||||||
)({
|
)({
|
||||||
buildConfig: buildConfig
|
buildConfig: buildConfig
|
||||||
})
|
});
|
||||||
var testTemplate = _.template(fs.readFileSync('scripts/e2e/e2e.template.js'));
|
var testTemplate = _.template(fs.readFileSync('scripts/e2e/e2e.template.js'));
|
||||||
|
|
||||||
var platforms = [
|
var platforms = [
|
||||||
@ -397,14 +397,49 @@ gulp.task('src', function(done){
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('package', ['src'], function(){
|
gulp.task('publish', ['src'], function(done){
|
||||||
return gulp.src([
|
var _ = require('lodash');
|
||||||
|
var fs = require('fs');
|
||||||
|
var distDir = 'dist';
|
||||||
|
|
||||||
|
gulp.src([
|
||||||
'scripts/npm/.npmignore',
|
'scripts/npm/.npmignore',
|
||||||
'scripts/npm/package.json',
|
|
||||||
'scripts/npm/README.md',
|
'scripts/npm/README.md',
|
||||||
'*tooling/**/*'
|
'*tooling/**/*'
|
||||||
])
|
])
|
||||||
.pipe(gulp.dest('dist'));
|
.pipe(gulp.dest(distDir));
|
||||||
|
|
||||||
|
var inquirer = require('inquirer');
|
||||||
|
inquirer.prompt([
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
name: 'ionicVersion',
|
||||||
|
message: '\n\n\nWhat ionic-framework alpha version number will this be?'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
name: 'angularVersion',
|
||||||
|
message: '\nWhat angular2 beta version number is a peer dependency?'
|
||||||
|
}
|
||||||
|
], function(answers) {
|
||||||
|
var packageTemplate = _.template(fs.readFileSync('scripts/npm/package.json'));
|
||||||
|
fs.writeFileSync(distDir + '/package.json', packageTemplate(answers));
|
||||||
|
|
||||||
|
var spawn = require('child_process').spawn;
|
||||||
|
var npmCmd = spawn('npm', ['publish', './' + distDir]);
|
||||||
|
|
||||||
|
npmCmd.stdout.on('data', function (data) {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
npmCmd.stderr.on('data', function (data) {
|
||||||
|
console.log('npm err: ' + data);
|
||||||
|
});
|
||||||
|
|
||||||
|
npmCmd.on('close', function() {
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
require('./scripts/docs/gulp-tasks')(gulp, flags)
|
require('./scripts/docs/gulp-tasks')(gulp, flags)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ionic-framework",
|
"name": "ionic-framework",
|
||||||
"version": "2.0.0-alpha.44",
|
"version": "2.0.0-alpha.<%= ionicVersion %>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -15,6 +15,6 @@
|
|||||||
"shelljs": "0.5.3"
|
"shelljs": "0.5.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"angular2": "2.0.0-beta.0"
|
"angular2": "2.0.0-beta.<%= angularVersion %>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user