[Pkg-javascript-commits] [sockjs-client] 244/350: Add gulp tasks for releases

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit 5e5d636ef2266a331ee22a6a805b950a93aef1ee
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Mon Oct 27 17:40:56 2014 -0400

    Add gulp tasks for releases
---
 gulpfile.js    | 41 +++++++++++++++++++++++++++++++++++++++--
 lib/version.js |  2 +-
 package.json   |  3 ++-
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/gulpfile.js b/gulpfile.js
index 2628a39..975e6de 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -12,7 +12,9 @@ var util = require('util')
   , mocha = require('gulp-mocha')
   , eslint = require('gulp-eslint')
   , rename = require('gulp-rename')
+  , header = require('gulp-header')
   , pkg = require('./package.json')
+  , fs = require('fs')
   ;
 
 var libName = 'sockjs-' + pkg.version
@@ -27,6 +29,8 @@ var libName = 'sockjs-' + pkg.version
     }
   ;
 
+var banner = '/* sockjs-client v<%= pkg.version %> | http://sockjs.org | MIT license */\n';
+
 gulp.task('test', function () {
   gulp.src('tests/node.js', {read: false})
     .pipe(mocha());
@@ -42,6 +46,10 @@ gulp.task('watch', function () {
   gulp.watch('tests/*.js', ['test']);
 });
 
+gulp.task('write-version', function () {
+  fs.writeFileSync('./lib/version.js', "module.exports = '" + pkg.version + "';");
+});
+
 gulp.task('testbundle', ['browserify:min'], function() {
   return gulp.src('./build/' + libName + '.min.js')
     .pipe(rename('sockjs.js'))
@@ -58,7 +66,7 @@ gulp.task('testbundle-debug', ['browserify'], function() {
     .pipe(gulp.dest('./tests/html/lib/'));
 });
 
-gulp.task('browserify', function () {
+gulp.task('browserify', ['write-version'], function () {
   return browserify(util._extend({
       debug: true
     }, browserifyOptions))
@@ -67,12 +75,13 @@ gulp.task('browserify', function () {
     .pipe(source('sockjs.js'))
     .pipe(buffer())
     .pipe(sourcemaps.init({ loadMaps: true }))
+      .pipe(header(banner, { pkg: pkg }))
     .pipe(sourcemaps.write('./'))
     .pipe(gulp.dest('./build/'))
     ;
 });
 
-gulp.task('browserify:min', function () {
+gulp.task('browserify:min', ['write-version'], function () {
   return browserify(browserifyOptions)
     .ignore('querystring')
     .exclude('debug')
@@ -88,6 +97,34 @@ gulp.task('browserify:min', function () {
         pure_funcs: ['debug']
       }
     }))
+    .pipe(header(banner, { pkg: pkg }))
     .pipe(gulp.dest('./build/'))
     ;
 });
+
+gulp.task('release', ['browserify', 'browserify:min'], function () {
+  // sockjs-{version}.min.js
+  gulp.src('./build/' + libName + '.min.js')
+    .pipe(gulp.dest('./dist/'));
+
+  // sockjs-{version}.js
+  gulp.src('./build/sockjs.js')
+    .pipe(rename(libName + '.js'))
+    .pipe(gulp.dest('./dist/'));
+});
+
+gulp.task('stable-release', function () {
+  var bower = require('./bower.json');
+  bower.version = pkg.version;
+  fs.writeFileSync('./bower.json', JSON.stringify(bower, null, 2));
+
+  // sockjs.min.js
+  gulp.src('./build/' + libName + '.min.js')
+    .pipe(rename('sockjs.min.js'))
+    .pipe(gulp.dest('./dist/'));
+
+  // sockjs.js
+  gulp.src('./build/sockjs.js')
+    .pipe(rename('sockjs.js'))
+    .pipe(gulp.dest('./dist/'));
+});
diff --git a/lib/version.js b/lib/version.js
index f66632a..3550d00 100644
--- a/lib/version.js
+++ b/lib/version.js
@@ -1 +1 @@
-module.exports = '1.0.0-alpha1';
+module.exports = '1.0.0-beta.1';
\ No newline at end of file
diff --git a/package.json b/package.json
index e46ea4f..0a7b155 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "sockjs-client",
   "description": "SockJS-client is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.",
-  "version": "1.0.0-rc1",
+  "version": "1.0.0-beta.1",
   "author": "Bryce Kahle",
   "browser": {
     "./lib/transport/driver/websocket.js": "./lib/transport/browser/websocket.js",
@@ -36,6 +36,7 @@
     "expect.js": "~0.3.1",
     "gulp": "^3.8.8",
     "gulp-eslint": "~0.1.8",
+    "gulp-header": "^1.2.2",
     "gulp-mocha": "~1.1.1",
     "gulp-rename": "~1.2.0",
     "gulp-sourcemaps": "~1.2.4",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list