Skip to content

Commit

Permalink
Added gulp build file to create full and customized bundles of effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikejames committed Sep 9, 2015
1 parent 424f844 commit d8ddcad
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.svn
.DS_Store
__MACOSX
node_modules/


15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ or images that are served from the same domain, unless they are served
with [CORS headers](http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/).
Firefox, Chrome and Opera support CORS for video, but Safari and Internet Explorer do not, and videos served with CORS are rare. So for now, it is best to host your own video files.

##Building for deployment

```
gulp build
```

or for custom builds

```
gulp build --inc "invert hue-saturation"
gulp build --exc "sketch"
```



## Contributing

Bug fixes, new features, effects and examples are welcome and appreciated. Please follow the [Contributing Guidelines](https://github.com/brianchirls/Seriously.js/wiki/Contributing).
Expand Down
7 changes: 7 additions & 0 deletions build/seriously.min.js

Large diffs are not rendered by default.

Binary file added build/seriously.min.js.gz
Binary file not shown.
110 changes: 110 additions & 0 deletions gulpfile.js
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
};

}
45 changes: 45 additions & 0 deletions package.json
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": {

}
}


0 comments on commit d8ddcad

Please sign in to comment.