-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82d98fe
commit 3a2f532
Showing
7 changed files
with
160 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- '0.10' | ||
- "0.12" | ||
- "4" | ||
- "5" | ||
- "6" | ||
deploy: | ||
provider: npm | ||
email: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,92 @@ | ||
var gulp = require('gulp'), | ||
$ = require('gulp-load-plugins')(), | ||
del = require('del'), | ||
exec = require('child_process').exec, | ||
merge = require('merge-stream'), | ||
runSequence = require('run-sequence'), | ||
vinylPaths = require('vinyl-paths'); | ||
var gulp = require('gulp'), | ||
$ = require('gulp-load-plugins')(), | ||
del = require('del'), | ||
exec = require('child_process').exec, | ||
merge = require('merge-stream'), | ||
runSequence = require('run-sequence'), | ||
vinylPaths = require('vinyl-paths'); | ||
|
||
var commitMessage = ''; | ||
|
||
// Script | ||
gulp.task('lint', function () { | ||
return gulp.src('lib/scripts/*') | ||
.pipe($.eslint({ | ||
useEslintrc: true, | ||
rules: { | ||
'no-console': 2 | ||
} | ||
})) | ||
.pipe($.eslint.format()) | ||
.pipe($.eslint.failOnError()); | ||
gulp.task('lint', function() { | ||
return gulp.src('lib/scripts/*') | ||
.pipe($.eslint({ | ||
rules: { | ||
'no-console': 2 | ||
} | ||
})) | ||
.pipe($.eslint.format()) | ||
.pipe($.eslint.failOnError()); | ||
}); | ||
|
||
gulp.task('scripts', ['lint'], function () { | ||
return gulp.src(['index.js']) | ||
.pipe($.umd({ | ||
exports: function () { | ||
return 'disableScroll'; | ||
}, | ||
namespace: function () { | ||
return 'disableScroll'; | ||
} | ||
})) | ||
.pipe($.replace('module.exports = disableScroll;\n\n', '')) | ||
.pipe($.rename('disable-scroll.js')) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.uglify()) | ||
.pipe($.rename('disable-scroll.min.js')) | ||
.pipe(gulp.dest('dist')); | ||
gulp.task('scripts', ['lint'], function() { | ||
return gulp.src(['index.js']) | ||
.pipe($.umd({ | ||
exports: function() { | ||
return 'disableScroll'; | ||
}, | ||
namespace: function() { | ||
return 'disableScroll'; | ||
} | ||
})) | ||
.pipe($.replace('module.exports = disableScroll;\n\n', '')) | ||
.pipe($.rename('disable-scroll.js')) | ||
.pipe(gulp.dest('dist')) | ||
.pipe($.uglify()) | ||
.pipe($.rename('disable-scroll.min.js')) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('clean', function (cb) { | ||
return del(['dist/*'], cb); | ||
gulp.task('clean', function(cb) { | ||
return del(['dist/*'], cb); | ||
}); | ||
|
||
gulp.task('get-commit', function (cb) { | ||
exec('git log -1 --pretty=%s && git log -1 --pretty=%b', function (err, stdout, stderr) { | ||
var parts = stdout.replace('\n\n', '').split('\n'); | ||
gulp.task('get-commit', function(cb) { | ||
exec('git log -1 --pretty=%s && git log -1 --pretty=%b', function(err, stdout) { | ||
var parts = stdout.replace('\n\n', '').split('\n'); | ||
|
||
commitMessage = parts[0]; | ||
if (parts[1]) { | ||
commitMessage += ' — ' + parts[1]; | ||
} | ||
commitMessage = parts[0]; | ||
if (parts[1]) { | ||
commitMessage += ' — ' + parts[1]; | ||
} | ||
|
||
cb(err); | ||
}); | ||
cb(err); | ||
}); | ||
}); | ||
|
||
gulp.task('gh-pages', function () { | ||
gulp.task('gh-pages', function() { | ||
|
||
var clean, | ||
push; | ||
var clean, | ||
push; | ||
|
||
clean = gulp.src('.publish/.DS_Store') | ||
.pipe(vinylPaths(del)); | ||
clean = gulp.src('.publish/.DS_Store') | ||
.pipe(vinylPaths(del)); | ||
|
||
push = gulp.src([ | ||
'index.html', | ||
'dist/**/*' | ||
], { base: './' }) | ||
.pipe($.ghPages({ | ||
branch: 'gh-pages', | ||
message: commitMessage, | ||
force: true | ||
})); | ||
push = gulp.src([ | ||
'index.html', | ||
'dist/**/*' | ||
], { base: './' }) | ||
.pipe($.ghPages({ | ||
branch: 'gh-pages', | ||
message: commitMessage, | ||
force: true | ||
})); | ||
|
||
return merge(clean, push); | ||
return merge(clean, push); | ||
}); | ||
|
||
gulp.task('deploy-pages', function (cb) { | ||
runSequence(['build', 'get-commit'], 'gh-pages', cb); | ||
gulp.task('deploy-pages', function(cb) { | ||
runSequence(['build', 'get-commit'], 'gh-pages', cb); | ||
}); | ||
|
||
gulp.task('serve', function () { | ||
gulp.watch('index.js', ['build']); | ||
gulp.task('serve', function() { | ||
gulp.watch('index.js', ['build']); | ||
}); | ||
|
||
gulp.task('build', function (cb) { | ||
process.env.NODE_ENV = 'production'; | ||
runSequence('clean', 'scripts', cb); | ||
gulp.task('build', function(cb) { | ||
process.env.NODE_ENV = 'production'; | ||
runSequence('clean', 'scripts', cb); | ||
}); | ||
|
||
gulp.task('default', ['build']); |
Oops, something went wrong.