From 5b30c79697e60a6f0b1fb184a7354fd41f34e276 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Mon, 10 Aug 2015 18:51:41 -0500 Subject: [PATCH] npm publish task wip --- gulpfile.js | 18 +++++++++++++++++- package.json | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6a76842646..5587f06703 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -168,7 +168,11 @@ function transpile(moduleType) { } gulp.task('transpile.system', function() { return transpile("system"); }); -gulp.task('transpile.common', function() { return transpile("common"); }); +gulp.task('transpile.common', function() { + // necessary for publish task, remove if we ever do incremental builds with cjs + cache.caches && delete cache.caches.transpile; + return transpile("common"); +}); gulp.task('transpile', ['transpile.system']); gulp.task('bundle.ionic', ['transpile'], function() { @@ -317,4 +321,16 @@ gulp.task('docs', function() { } catch (err) { console.log(err.stack); } +}); + +gulp.task('publish', function(done) { + runSequence( + 'clean', + ['bundle', 'sass', 'fonts'], + 'transpile.common', + function() { + var packageJSONContents = '{\n "name": "ionic2",\n "version": "2.0.0-alpha.1",\n "license": "Apache-2.0",\n "repository": {\n "type": "git",\n "url": "https://github.com/driftyco/ionic2.git"\n }\n}\n'; + fs.writeFile("dist/package.json", packageJSONContents, done); + } + ) }) diff --git a/package.json b/package.json index 155993a0af..d7a016632c 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "ionic2", + "version": "2.0.0-alpha.1", + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/driftyco/ionic2.git" }, - "version": "0.0.0", "devDependencies": { "angular2-bundle": "tlancina/angular2-bundle", "canonical-path": "0.0.2",