forked from brianchirls/Seriously.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added gulp build file to create full and customized bundles of effects.
- Loading branch information
1 parent
424f844
commit d8ddcad
Showing
6 changed files
with
183 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.svn | ||
.DS_Store | ||
__MACOSX | ||
node_modules/ | ||
|
||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
var gulp = require('gulp'), | ||
rjs = require('gulp-requirejs'), | ||
concat = require('gulp-concat'), | ||
uglify = require('gulp-uglify'), | ||
gzip = require('gulp-gzip'), | ||
rimraf = require('gulp-rimraf'), | ||
gutil = require('gulp-util'), | ||
argv = require('yargs').argv; | ||
|
||
|
||
gulp.task('default', function () { | ||
return gulp.src('app/tmp', {read: false}) | ||
.pipe(clean()); | ||
}); | ||
|
||
|
||
|
||
gulp.task('build', ['buildCombine']); | ||
|
||
|
||
gulp.task('test', function() { | ||
// TODO: broken test with window.clearTimeout | ||
var qunit = require('node-qunit-phantomjs'); | ||
qunit('./test/index.html'); | ||
}); | ||
|
||
|
||
|
||
gulp.task('jshint', function() { | ||
|
||
var jshint = require('gulp-jshint'); | ||
|
||
return gulp.src(['./seriously.js', './effects/**.js']) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')) | ||
|
||
}); | ||
|
||
|
||
gulp.task('clean', function() { | ||
gulp.src(['./build/**.js','./build/**.js.gz'], { read: false }) | ||
.pipe(rimraf()); | ||
}); | ||
|
||
|
||
gulp.task('buildCombine', function() { | ||
|
||
var effects = getListOfEffects(); | ||
var files = (effects.include.length ? effects.include : ['./effects/*.js']) | ||
.concat(effects.exclude); | ||
|
||
var isCustom = effects.include.length || effects.exclude.length; | ||
|
||
gulp.src(['./seriously.js'].concat(files)) | ||
|
||
// concat all files and minify | ||
.pipe(concat('seriously.min' + (isCustom ? '.custom' : '') + '.js')) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest('./build/')) | ||
|
||
// gzip | ||
.pipe(gzip()) | ||
.pipe(gulp.dest('./build/')); | ||
|
||
}); | ||
|
||
|
||
|
||
|
||
function getListOfEffects() { | ||
|
||
var fs = require('fs'); | ||
|
||
var onFileChecked = function(err, stat) { | ||
|
||
if(err == null) { | ||
gutil.log(gutil.colors.green(this)); | ||
} | ||
else { | ||
gutil.log('Missing:', gutil.colors.red(this)); | ||
} | ||
} | ||
|
||
var effects, | ||
include = [], | ||
exclude = []; | ||
|
||
if(argv.inc) { | ||
include = argv.inc.split(' ').map(function(itm) { | ||
var filepath = './effects/seriously.' + itm + '.js'; | ||
fs.stat(filepath, onFileChecked.bind(filepath)); | ||
return filepath; | ||
}); | ||
} | ||
|
||
if(argv.exc) { | ||
exclude = argv.exc.split(' ').map(function(itm) { | ||
var filepath = './effects/seriously.' + itm + '.js'; | ||
return filepath; | ||
}); | ||
} | ||
|
||
|
||
return { | ||
include : include, | ||
exclude : exclude | ||
}; | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "Seriously.js", | ||
"version": "0.1.0", | ||
"main" : "serously.js", | ||
"author": "Brian Chirls <[email protected]>", | ||
"description": "Seriously.js is a real-time, node-based video compositor for the web. Inspired by professional software such as After Effects and Nuke, Seriously.js renders high-quality video effects, but allows them to be dynamic and interactive.", | ||
"engines" :{ | ||
"node" : "^0.12.2", | ||
"npm" : "^2.6.0" | ||
}, | ||
|
||
"devDependencies": { | ||
"gulp" : "3.9.0", | ||
"gulp-util" : "^3.0.6", | ||
"gulp-rimraf" : "^0.1.1", | ||
"gulp-requirejs" : "0.1.3", | ||
"gulp-concat" : "^2.6.0", | ||
"gulp-uglify" : "^1.4.0", | ||
"gulp-gzip" : "^1.2.0", | ||
"event-stream" : "^3.3.1", | ||
"gulp-if" : "1.2.5", | ||
"yargs" : "^3.4.0", | ||
"gulp-jshint" : "^1.11.2", | ||
"node-qunit-phantomjs" : "x" | ||
}, | ||
|
||
"dependencies": { | ||
|
||
}, | ||
|
||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/brianchirls/Seriously.js" | ||
}, | ||
|
||
"bugs": { | ||
"url": "https://github.com/brianchirls/Seriously.js/issues" | ||
}, | ||
|
||
"scripts": { | ||
|
||
} | ||
} | ||
|
||
|