├── lib
├── plugins
│ ├── img.js
│ ├── rev.js
│ ├── index.js
│ ├── link.js
│ └── script.js
├── support
│ └── reload.js
└── utils
│ ├── index.js
│ └── fetch.js
├── test
├── fixtures
│ ├── img
│ │ └── expected
│ │ │ ├── .gitignore
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ ├── 5.jpg
│ │ │ └── 6.jpg
│ ├── init
│ │ ├── expected
│ │ │ ├── .gitattributes
│ │ │ ├── robots.txt
│ │ │ ├── apple-touch-icon-114x114-precomposed.png
│ │ │ ├── package.json
│ │ │ ├── .gitignore
│ │ │ ├── crossdomain.xml
│ │ │ ├── LICENSE-MIT
│ │ │ ├── humans.txt
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── apple-touch-icon-precomposed.png
│ │ │ ├── apple-touch-icon-57x57-precomposed.png
│ │ │ ├── apple-touch-icon-72x72-precomposed.png
│ │ │ ├── readme.md
│ │ │ ├── favicon.ico
│ │ │ ├── 404.html
│ │ │ ├── index.html
│ │ │ ├── apple-touch-icon-144x144-precomposed.png
│ │ │ └── grunt.js
│ │ └── rjs.gruntfile.js
│ ├── rjs
│ │ ├── expected
│ │ │ ├── sub
│ │ │ │ └── betaSub.js
│ │ │ ├── alpha.js
│ │ │ ├── beta.js
│ │ │ ├── main.js
│ │ │ └── plugins.js
│ │ ├── sample
│ │ │ ├── sub
│ │ │ │ └── betaSub.js
│ │ │ ├── main.js
│ │ │ ├── alpha.js
│ │ │ └── beta.js
│ │ └── grunt.js
│ ├── rjs-almond
│ │ ├── expected
│ │ │ ├── sub
│ │ │ │ └── betaSub.js
│ │ │ ├── alpha.js
│ │ │ ├── beta.js
│ │ │ ├── plugins.js
│ │ │ └── main.js
│ │ ├── sample
│ │ │ ├── sub
│ │ │ │ └── betaSub.js
│ │ │ ├── main.js
│ │ │ ├── alpha.js
│ │ │ └── beta.js
│ │ └── grunt.js
│ ├── css
│ │ ├── ui
│ │ │ └── widget.css
│ │ ├── grunt.js
│ │ ├── app.css
│ │ ├── style.css
│ │ └── expected.css
│ ├── tar
│ │ └── test.tgz
│ ├── default
│ │ ├── 1.png
│ │ ├── 2.png
│ │ ├── 3.png
│ │ ├── 4.png
│ │ ├── 5.jpg
│ │ ├── 6.jpg
│ │ ├── grunt.js
│ │ ├── build.minify.html
│ │ ├── index.html
│ │ ├── expected.html
│ │ └── usemin.html
│ ├── usemin
│ │ ├── tmpl.hbs
│ │ ├── tmpl.mustache
│ │ ├── expected
│ │ │ ├── tmpl.hbs
│ │ │ └── tmpl.mustache
│ │ ├── index.html
│ │ └── reved.html
│ └── html
│ │ └── index.html
├── mocha.opts
├── features
│ ├── template.feature
│ ├── docs.feature
│ ├── rjs.feature
│ ├── img.feature
│ ├── tar.feature
│ ├── init.feature
│ ├── css.feature
│ ├── default.feature
│ ├── html.feature
│ ├── usemin.feature
│ └── steps
│ │ └── default.js
└── tasks
│ ├── minify.js
│ ├── default.js
│ ├── test-docs.js
│ ├── test-html.js
│ ├── test-img.js
│ ├── test-tar.js
│ ├── test-css.js
│ ├── test-init.js
│ ├── test-rjs.js
│ └── test-usemin.js
├── vendor
├── optipng-0.7.1-win32
│ ├── OptiPNG.url
│ ├── optipng.exe
│ └── doc
│ │ ├── authors.txt
│ │ ├── optipng.man.pdf
│ │ ├── license.txt
│ │ └── todo.txt
└── jpegtran-8d
│ └── jpegtran.exe
├── .gitignore
├── .gitmodules
├── support
├── docs
│ ├── pages.txt
│ ├── package.json
│ └── readme.md
├── pre-commit
├── grunt-docs.js
├── grunt-inspect.js
└── grunt-test.js
├── readme.md
├── h5bp.js
├── tasks
├── util.js
├── init
│ ├── templates
│ │ ├── rjs.json
│ │ └── defaults.json
│ └── h5bp
│ │ ├── prompts.txt
│ │ ├── notes.txt
│ │ ├── readme.md
│ │ └── gruntfile.js
├── docs.js
├── rev.js
├── rjs.js
├── css.js
├── h5bp.js
├── tar.js
├── html.js
├── serve.js
├── dom.js
└── img.js
├── LICENSE.md
├── package.json
├── bin
├── h5bp
└── help.txt
├── docs
├── api
│ ├── lib
│ │ └── docs
│ │ │ ├── img.html
│ │ │ └── rev.html
│ └── tasks
│ │ └── docs
│ │ └── main.html
└── css
│ ├── white.css
│ └── grey.css
├── grunt.js
└── documentation.md
/lib/plugins/img.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/plugins/rev.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/img/expected/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/test/fixtures/rjs/expected/sub/betaSub.js:
--------------------------------------------------------------------------------
1 | define({name:"betaSubName"})
--------------------------------------------------------------------------------
/test/mocha.opts:
--------------------------------------------------------------------------------
1 | --reporter spec
2 | --timeout 15000
3 | --slow 1500
4 |
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/expected/sub/betaSub.js:
--------------------------------------------------------------------------------
1 | define({name:"betaSubName"})
--------------------------------------------------------------------------------
/test/fixtures/rjs/sample/sub/betaSub.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'betaSubName'
3 | });
4 |
--------------------------------------------------------------------------------
/test/fixtures/css/ui/widget.css:
--------------------------------------------------------------------------------
1 | .css-reved .img-5 { background: url('../../img/5.jpg'); }
2 |
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/sample/sub/betaSub.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'betaSubName'
3 | });
4 |
--------------------------------------------------------------------------------
/test/fixtures/rjs/expected/alpha.js:
--------------------------------------------------------------------------------
1 | define(["require","exports","module"],function(a,b){b.name="alpha"})
--------------------------------------------------------------------------------
/test/fixtures/rjs/sample/main.js:
--------------------------------------------------------------------------------
1 | require(['alpha', 'beta'], function (alpha, beta) {
2 | });
3 |
4 |
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/OptiPNG.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=http://optipng.sourceforge.net/
3 |
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/sample/main.js:
--------------------------------------------------------------------------------
1 | require(['alpha', 'beta'], function (alpha, beta) {
2 | });
3 |
4 |
--------------------------------------------------------------------------------
/test/fixtures/rjs/expected/beta.js:
--------------------------------------------------------------------------------
1 | define(["./sub/betaSub"],function(a){return{name:"beta",subName:a.name}})
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/expected/alpha.js:
--------------------------------------------------------------------------------
1 | define(["require","exports","module"],function(a,b){b.name="alpha"})
--------------------------------------------------------------------------------
/test/fixtures/rjs/sample/alpha.js:
--------------------------------------------------------------------------------
1 | define(function(require, exports) {
2 | exports.name = 'alpha';
3 | });
4 |
--------------------------------------------------------------------------------
/test/fixtures/tar/test.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/tar/test.tgz
--------------------------------------------------------------------------------
/test/fixtures/default/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/1.png
--------------------------------------------------------------------------------
/test/fixtures/default/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/2.png
--------------------------------------------------------------------------------
/test/fixtures/default/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/3.png
--------------------------------------------------------------------------------
/test/fixtures/default/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/4.png
--------------------------------------------------------------------------------
/test/fixtures/default/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/5.jpg
--------------------------------------------------------------------------------
/test/fixtures/default/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/default/6.jpg
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/expected/beta.js:
--------------------------------------------------------------------------------
1 | define(["./sub/betaSub"],function(a){return{name:"beta",subName:a.name}})
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/sample/alpha.js:
--------------------------------------------------------------------------------
1 | define(function(require, exports) {
2 | exports.name = 'alpha';
3 | });
4 |
--------------------------------------------------------------------------------
/vendor/jpegtran-8d/jpegtran.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/vendor/jpegtran-8d/jpegtran.exe
--------------------------------------------------------------------------------
/test/fixtures/img/expected/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/1.png
--------------------------------------------------------------------------------
/test/fixtures/img/expected/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/2.png
--------------------------------------------------------------------------------
/test/fixtures/img/expected/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/3.png
--------------------------------------------------------------------------------
/test/fixtures/img/expected/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/4.png
--------------------------------------------------------------------------------
/test/fixtures/img/expected/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/5.jpg
--------------------------------------------------------------------------------
/test/fixtures/img/expected/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/img/expected/6.jpg
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/optipng.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/vendor/optipng-0.7.1-win32/optipng.exe
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/doc/authors.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/vendor/optipng-0.7.1-win32/doc/authors.txt
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | test/fixtures/h5bp
3 | .test
4 | npm-debug.log
5 | tasks/init/h5bp/root
6 | docs/css
7 | docs/index.html
8 | docs/api
9 |
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/doc/optipng.man.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/vendor/optipng-0.7.1-win32/doc/optipng.man.pdf
--------------------------------------------------------------------------------
/test/fixtures/init/expected/robots.txt:
--------------------------------------------------------------------------------
1 | # www.robotstxt.org/
2 | # https://developers.google.com/webmasters/control-crawl-index/
3 |
4 | User-agent: *
5 |
--------------------------------------------------------------------------------
/test/fixtures/rjs/sample/beta.js:
--------------------------------------------------------------------------------
1 | define(['./sub/betaSub'], function (betaSub) {
2 | return {
3 | name: 'beta',
4 | subName: betaSub.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/sample/beta.js:
--------------------------------------------------------------------------------
1 | define(['./sub/betaSub'], function (betaSub) {
2 | return {
3 | name: 'beta',
4 | subName: betaSub.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/apple-touch-icon-114x114-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mklabs/node-build-script/HEAD/test/fixtures/init/expected/apple-touch-icon-114x114-precomposed.png
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "test/h5bp"]
2 | path = test/h5bp
3 | url = git://github.com/h5bp/html5-boilerplate.git
4 | [submodule "docs/wiki"]
5 | path = docs/wiki
6 | url = git://github.com/h5bp/node-build-script.wiki.git
7 |
--------------------------------------------------------------------------------
/support/docs/pages.txt:
--------------------------------------------------------------------------------
1 | Home
2 | install
3 | overview
4 | configuration
5 | tasks
6 | clean
7 | concat
8 | connect
9 | css
10 | min
11 | mkdirs
12 | rev
13 | serve
14 | usemin
15 | dom
16 | link-plugin
17 | rev-plugin
18 | script-plugin
19 | test
20 |
--------------------------------------------------------------------------------
/test/features/template.feature:
--------------------------------------------------------------------------------
1 | Feature: <%= feature %>
2 | As a <%= role %>
3 | I want to <%= action %>
4 | So that <%= benefit %>
5 |
6 | Scenario: <%= scenario %>
7 | Given <%= context %>
8 | When <%= event %>
9 | Then <%= outcome %>
10 |
11 |
--------------------------------------------------------------------------------
/test/fixtures/rjs/expected/main.js:
--------------------------------------------------------------------------------
1 | define("alpha",["require","exports","module"],function(a,b){b.name="alpha"}),define("sub/betaSub",{name:"betaSubName"}),define("beta",["./sub/betaSub"],function(a){return{name:"beta",subName:a.name}}),require(["alpha","beta"],function(a,b){}),define("main",function(){})
--------------------------------------------------------------------------------
/test/features/docs.feature:
--------------------------------------------------------------------------------
1 | Feature: DOCS task
2 | As a build script user
3 | I want to be able to run the docs task
4 | So that I can see the docs task in action
5 |
6 | Scenario: docs task
7 | Given I run the "docs" task
8 | When the script ends
9 | Then it should not fail miserably
10 |
11 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # This project has been sunsetted.
2 |
3 | Currently we don't maintain this project anymore and would advice you to not use
4 | it anymore.
5 |
6 | Please check out [Yeoman](http://yeoman.io/) which helps you scaffolding your
7 | project.
8 |
9 | The old readme file is [still available](documentation.md) though.
10 |
--------------------------------------------------------------------------------
/test/features/rjs.feature:
--------------------------------------------------------------------------------
1 | Feature: RJS task
2 | As a build script user
3 | I want to be able to run the rjs task
4 | So that I can see the rjs task in action
5 |
6 | Scenario: rjs task
7 | Given I run the "rjs" task
8 | When the script ends
9 | Then "test/js" should be the same as "test/fixtures/rjs/expected/"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/img.feature:
--------------------------------------------------------------------------------
1 | Feature: IMG task
2 | As a build script user
3 | I want to be able to run the img task
4 | So that I can see the img task in action
5 |
6 | Scenario: img task
7 | Given I run the "img" task
8 | When the script ends
9 | Then ".test/img" should be the same as "test/fixtures/img/expected/"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/tar.feature:
--------------------------------------------------------------------------------
1 | Feature: TAR task
2 | As a build script user
3 | I want to be able to run the tar task
4 | So that I can see the tar task in action
5 |
6 | Scenario: tar task
7 | Given I run the "tar" task
8 | When the script ends
9 | Then ".test/tar" should be the same as "test/fixtures/tar/expected/"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/init.feature:
--------------------------------------------------------------------------------
1 | Feature: INIT task
2 | As a build script user
3 | I want to be able to run the init task
4 | So that I can see the init task in action
5 |
6 | Scenario: init task
7 | Given I run the "init" task
8 | When the script ends
9 | Then ".test/init" should be the same as "test/fixtures/init/expected/"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/css.feature:
--------------------------------------------------------------------------------
1 | Feature: CSS task
2 | As a build script user
3 | I want to be able to run the css task
4 | So that I can see the css task in action
5 |
6 | Scenario: css task
7 | Given I run the "css" task
8 | When the script ends
9 | Then ".test/css/style.css" should be the same as "test/fixtures/css/style.css"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/default.feature:
--------------------------------------------------------------------------------
1 | Feature: Default task
2 | As a build script user
3 | I want to be able to run the default task
4 | So that I can see the whole tasks in action
5 |
6 | Scenario: Default task
7 | Given I run the "default" task
8 | When the build script ends
9 | Then the outcome should be "test/fixtures/default"
10 |
11 |
--------------------------------------------------------------------------------
/test/features/html.feature:
--------------------------------------------------------------------------------
1 | Feature: HTML task
2 | As a build script user
3 | I want to be able to run the html task
4 | So that I can see the html task in action
5 |
6 | Scenario: html task
7 | Given I run the "html" task
8 | When the script ends
9 | Then "./test/index.html" should be the same as "test/fixtures/html/expected.html"
10 |
11 |
--------------------------------------------------------------------------------
/test/fixtures/css/grunt.js:
--------------------------------------------------------------------------------
1 |
2 | var path = require('path');
3 |
4 | module.exports = function(grunt) {
5 |
6 | //
7 | // Grunt configuration
8 | //
9 | grunt.config.init({
10 |
11 | css: {
12 | 'css/compressed.css': ['css/style.css']
13 | }
14 |
15 | });
16 |
17 | grunt.loadNpmTasks(path.join(__dirname, '..'));
18 |
19 | };
20 |
--------------------------------------------------------------------------------
/test/features/usemin.feature:
--------------------------------------------------------------------------------
1 | Feature: USEMIN task
2 | As a build script user
3 | I want to be able to run the usemin task
4 | So that I can see the usemin task in action
5 |
6 | Scenario: usemin task
7 | Given I run the "usemin" task
8 | When the script ends
9 | Then ".test/usemin.html" should be the same as "test/fixtures/usemin/index.html"
10 |
11 |
--------------------------------------------------------------------------------
/lib/plugins/index.js:
--------------------------------------------------------------------------------
1 |
2 | var fs = require('fs'),
3 | path = require('path');
4 |
5 | var plugins = module.exports;
6 |
7 | fs.readdirSync(path.join(__dirname)).forEach(function(file) {
8 | var plugin = file.replace(path.extname(file), '');
9 | if(plugin === 'index' || path.extname(file) !== '.js') return;
10 | plugins.__defineGetter__(plugin, function() {
11 | return require('./' + plugin);
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/h5bp.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | var h5bp = module.exports;
4 |
5 | // hoist up any plugins onto the plugin object as lazy-loaded getters.
6 | h5bp.plugins = require('./lib/plugins');
7 |
8 | //
9 | // custom package utilities, works in tandem with `grunt.utils`.
10 | //
11 | // Utils is there to package and provide a
12 | //
13 | // Will be merged into grunt.utils for further usage in tasks and helpers
14 | //
15 | h5bp.utils = require('./lib/utils');
16 |
--------------------------------------------------------------------------------
/support/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "mklabs",
3 | "name": "grunt-doc-generator",
4 | "description": "Internal tool for generating api docs",
5 | "version": "0.0.0",
6 | "engines": {
7 | "node": "0.6.x"
8 | },
9 | "dependencies": {
10 | "h5bp-docs": "http://nodeload.github.com/mklabs/h5bp-docs/tarball/next",
11 | "docco": "~0.3.0",
12 | "fstream": "~0.1.18"
13 | },
14 | "bin": "./generate.js"
15 | }
16 |
--------------------------------------------------------------------------------
/test/fixtures/css/app.css:
--------------------------------------------------------------------------------
1 |
2 | /* =============================================================================
3 | App specific CSS file.
4 |
5 | This is usually where the site/app's CSS specific rules are setup.
6 |
7 | ========================================================================== */
8 |
9 |
10 | @import url('ui/widget.css');
11 |
12 | body:before {
13 | content: ' ☺ H E L L O ☺ ';
14 | font: 10em Helvetica, sans-serif;
15 | color: hotPink;
16 | }
17 |
18 | .css-reved .img-6 { background: url('../img/6.jpg'); }
19 |
--------------------------------------------------------------------------------
/tasks/util.js:
--------------------------------------------------------------------------------
1 |
2 | var util = require('util');
3 |
4 | //
5 | // This file defines a few utilities helpers.
6 | //
7 | // - inspect: takes an object, util.inspet it (with colorized output,
8 | // http://nodejs.org/api/util.html#util_util_inspect_object_showhidden_depth_colors).
9 | //
10 |
11 | module.exports = function(grunt) {
12 | // Output some info on given object, using util.inspect
13 | grunt.registerHelper('inspect', function(o) {
14 | var lf = grunt.utils.linefeed;
15 | grunt.log.ok(util.inspect(o, false, 4, true));
16 | return grunt;
17 | });
18 | };
19 |
20 |
--------------------------------------------------------------------------------
/test/features/steps/default.js:
--------------------------------------------------------------------------------
1 |
2 | Given(/I run the '(\w+)' task/, function() {
3 | // runt the $1 task
4 | helpers.run('$1', done);
5 | });
6 |
7 | When(/the script ends/, function(done) {
8 | // not doing anything particularly usefull in this step but the hook is here
9 | // if we need to
10 | done();
11 | });
12 |
13 | Then(/'(.+)' should be the same as '(.+)'/, function() {
14 | helpers.assertFile('$1', '$2');
15 | done();
16 | });
17 |
18 | Then(/'(.+)' dir should be the same as '(.+)'/, function() {
19 | helpers.assertFile('$1', '$2');
20 | done();
21 | });
22 |
--------------------------------------------------------------------------------
/test/fixtures/rjs/expected/plugins.js:
--------------------------------------------------------------------------------
1 | window.log=function a(){log.history=log.history||[],log.history.push(arguments);if(this.console){var b=arguments,c;try{b.callee=a.caller}catch(d){}c=[].slice.call(b),typeof console.log=="object"?log.apply.call(console.log,console,c):console.log.apply(console,c)}},function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());)a[d]=a[d]||b}(function(){try{return console.log(),window.console}catch(a){return window.console={}}}())
--------------------------------------------------------------------------------
/test/fixtures/usemin/tmpl.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |

9 |

10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/fixtures/rjs-almond/expected/plugins.js:
--------------------------------------------------------------------------------
1 | window.log=function a(){log.history=log.history||[],log.history.push(arguments);if(this.console){var b=arguments,c;try{b.callee=a.caller}catch(d){}c=[].slice.call(b),typeof console.log=="object"?log.apply.call(console.log,console,c):console.log.apply(console,c)}},function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());)a[d]=a[d]||b}(function(){try{return console.log(),window.console}catch(a){return window.console={}}}())
--------------------------------------------------------------------------------
/test/fixtures/usemin/tmpl.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |

9 |

10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/fixtures/css/style.css:
--------------------------------------------------------------------------------
1 |
2 | /* =============================================================================
3 | CSS App imports.
4 |
5 | These imports are inlined and minified by the build script. If
6 | you don't intend to use a build script, do not use @import
7 | statements. Use a single style.css file with bootstrap's style first,
8 | then your specific CSS files.
9 |
10 | Following assumes an app.css to put specific CSS rules.
11 |
12 | ========================================================================== */
13 |
14 | @import url('h5bp.css');
15 | @import url('app.css');
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/fixtures/usemin/expected/tmpl.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |

9 |

10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/fixtures/usemin/expected/tmpl.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |

9 |

10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "name",
3 | "description": "The best project ever.",
4 | "version": "0.1.0",
5 | "homepage": "https://github.com/h5bp/node-build-script",
6 | "author": {},
7 | "repository": {
8 | "type": "git",
9 | "url": "git://github.com/h5bp/node-build-script.git"
10 | },
11 | "licenses": [
12 | {
13 | "type": "MIT",
14 | "url": "https://github.com/h5bp/node-build-script/blob/master/LICENSE-MIT"
15 | }
16 | ],
17 | "dependencies": {
18 | "node-build-script": "http://nodeload.github.com/h5bp/node-build-script/tarball/dev"
19 | },
20 | "keywords": []
21 | }
--------------------------------------------------------------------------------
/test/fixtures/init/expected/.gitignore:
--------------------------------------------------------------------------------
1 | # Numerous always-ignore extensions
2 | *.diff
3 | *.err
4 | *.orig
5 | *.log
6 | *.rej
7 | *.swo
8 | *.swp
9 | *.vi
10 | *~
11 | *.sass-cache
12 |
13 | # OS or Editor folders
14 | .DS_Store
15 | ._*
16 | Thumbs.db
17 | .cache
18 | .project
19 | .settings
20 | .tmproj
21 | nbproject
22 | *.sublime-project
23 | *.sublime-workspace
24 |
25 | # Dreamweaver added files
26 | _notes
27 | dwsync.xml
28 |
29 | # Komodo
30 | *.komodoproject
31 | .komodotools
32 |
33 | # Espresso
34 | *.esproj
35 | *.espressostorage
36 |
37 | # Rubinius
38 | *.rbc
39 |
40 | # Folders to ignore
41 | .hg
42 | .svn
43 | .CVS
44 | intermediate
45 | publish
46 | .idea
47 |
48 | # build script local files
49 | build/buildinfo.properties
50 | build/config/buildinfo.properties
51 |
--------------------------------------------------------------------------------
/test/tasks/minify.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var assert = require('assert'),
6 | helpers = require('../helpers');
7 |
8 | describe("build:minify task", function() {
9 |
10 | before(helpers.before);
11 |
12 | describe("As a build script user I want to run the build:minify task", function() {
13 | describe("build:minify task", function() {
14 | it("Given I run the 'build:minify' task", function(done) {
15 | helpers.run('build:minify', done);
16 | });
17 |
18 | describe("When the build script ends", function() {
19 | it("Then the outcome should be 'test/fixtures/default/build.minify.html'", function() {
20 | helpers.assertFile('.test/publish/index.html', 'test/fixtures/default/build.minify.html');
21 | });
22 | });
23 | });
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/test/tasks/default.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var assert = require('assert'),
6 | helpers = require('../helpers');
7 |
8 | describe("Default task", function() {
9 |
10 | before(helpers.before);
11 |
12 | describe("As a build script user I want to be able to run the default task So that I can see the whole tasks in action", function() {
13 | describe("Default task", function() {
14 | it("Given I run the 'default' task", function(done) {
15 | helpers.run('default', done);
16 | });
17 |
18 | describe("When the build script ends", function() {
19 | it("Then the outcome should be 'test/fixtures/default'", function() {
20 | helpers.assertFile('.test/publish/index.html', 'test/fixtures/default/expected.html');
21 | });
22 | });
23 | });
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/support/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | //
4 | // Consider adding this to your local .git/hooks/pre-commit. To
5 | // install (or update):
6 | //
7 | // cat scripts/pre-commit > .git/hooks/pre-commit
8 | // chmod +x .git/hooks/pre-commit
9 | //
10 | //
11 | // Does two thing before allowing the commit:
12 | //
13 | // * runs `grunt lint`
14 | // * runs `npm test`
15 | //
16 |
17 | var spawn = require('child_process').spawn;
18 |
19 | run('grunt lint').on('next', run.bind({}, 'npm test'));
20 |
21 | function run(args) {
22 | args = args.split(' ');
23 | var cmd = args.shift();
24 | var ch = spawn(cmd, args);
25 | ch.stdout.pipe(process.stdout);
26 | ch.stderr.pipe(process.stderr);
27 | ch.on('exit', function (code) {
28 | if(code) process.exit(code);
29 | var end = !ch.emit('next');
30 | if()
31 | });
32 | return ch;
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/tasks/init/templates/rjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "name",
3 | "description": "rjs default setup",
4 | "version": "0.1.0",
5 | "repository": "git://github.com/h5bp/node-build-script.git",
6 | "homepage": "https://github.com/h5bp/node-build-script",
7 | "licenses": [
8 | "MIT"
9 | ],
10 | "author_name": "",
11 | "author_email": "",
12 | "author_url": "",
13 | "force_update": "y/N",
14 | "js_safe_name": "name",
15 | "git_user": "h5bp",
16 | "setup": {
17 | "layout": "D"
18 | },
19 | "gruntfile": {
20 | "dom": true,
21 | "min_concat": false,
22 | "package_json": true,
23 | "staging": "intermediate",
24 | "output": "publish",
25 | "css_dir": "css",
26 | "js_dir": "js",
27 | "img_dir": "img",
28 | "require_js": "y",
29 | "test_task": "qunit",
30 | "file_name": "<%= pkg.name %>",
31 | "test_dir": "test",
32 | "jquery": true
33 | }
34 | }
--------------------------------------------------------------------------------
/tasks/init/templates/defaults.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "name",
3 | "description": "The best project ever.",
4 | "version": "0.1.0",
5 | "repository": "git://github.com/h5bp/node-build-script.git",
6 | "homepage": "https://github.com/h5bp/node-build-script",
7 | "licenses": [
8 | "MIT"
9 | ],
10 | "author_name": "",
11 | "author_email": "",
12 | "author_url": "",
13 | "force_update": "y/N",
14 | "js_safe_name": "name",
15 | "git_user": "h5bp",
16 | "setup": {
17 | "layout": "D"
18 | },
19 | "gruntfile": {
20 | "dom": true,
21 | "min_concat": true,
22 | "package_json": true,
23 | "staging": "intermediate",
24 | "output": "publish",
25 | "css_dir": "css",
26 | "js_dir": "js",
27 | "img_dir": "img",
28 | "require_js": "y/N",
29 | "test_task": "qunit",
30 | "file_name": "<%= pkg.name %>",
31 | "test_dir": "test",
32 | "jquery": true
33 | }
34 | }
--------------------------------------------------------------------------------
/test/fixtures/init/expected/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/tasks/init/h5bp/prompts.txt:
--------------------------------------------------------------------------------
1 |
2 | [?] Do you need to force an update on master repo? (y/N) | force_update
3 | [?] Which layout ? ([D]efault, [C]ustom, [S]illy) | layout
4 | » [D]efault: Standard html5-boilerplate layout
5 |
6 | » [C]ustom: Specific build of html5-boilerplate. A series of prompt allows
7 | explicit file rewrites for common files and directories.
8 |
9 | » [S]illy: A "silly" build will prompt for every file in the h5bp repository.
10 |
11 | [?] CSS directory (css/) | css/
12 | » You can change here the basic layout of the project you're about to
13 | create. The defaults values will create a standars h5bp project, but you
14 | might want to go for something different like:
15 |
16 | js/ → javascripts/
17 | css/ → stylesheets/
18 | img/ → images/
19 |
20 | [?] Image directory (img/) | img/
21 | [?] JavaScript directory (js/) | js/
22 |
23 |
--------------------------------------------------------------------------------
/tasks/init/h5bp/notes.txt:
--------------------------------------------------------------------------------
1 | First time the init task is run with `h5bp` template, the latest version
2 | of html5-boilerplate is downloaded locally.
3 |
4 | The resulting output depends on the few question grunt asks during the
5 | process. This includes some path rewrites (like renaming the
6 | `css/style.css` file to something else).
7 |
8 | Simply keep pressing enter for the default h5bp layout.
9 |
10 | There's four "step" of prompts:
11 |
12 | - project: Basic project configuration (name, description, version, ...)
13 | - layout: [D]efault, [C]ustom, [S]illy
14 | - files: Depends on layout value, series of prompts for specific
15 | file / directory renames
16 | - gruntfile: Gruntfile creation
17 |
18 | This template tries to guess file and directory paths, but you will most likely
19 | need to edit the generated grunt.js file before running grunt. If you run grunt
20 | after generating grunt.js, and grunt exits with errors, edit the grunt.js file!
21 |
22 |
--------------------------------------------------------------------------------
/test/tasks/test-docs.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var assert = require('assert'),
6 | helpers = require('../helpers');
7 |
8 | describe("DOCS task", function() {
9 |
10 | describe("As a build script user I want to be able to run the docs task So that I can see the docs task in action", function() {
11 |
12 | describe("docs task", function() {
13 |
14 | it("Given I run the 'docs' task", function(done) {
15 | // runt the docs task
16 | helpers.run('docs', done);
17 | });
18 |
19 | it("When the script ends", function(done) {
20 | // not doing anything particularly usefull in this step but the hook is here
21 | // if we need to
22 | done();
23 | });
24 |
25 | describe("Then it should not fail miserably", function() {
26 | it("(and you should see the documention in a web browser by now..)", function() {
27 | assert.ok(true);
28 | });
29 | });
30 |
31 | });
32 |
33 | });
34 |
35 | });
36 |
--------------------------------------------------------------------------------
/support/grunt-docs.js:
--------------------------------------------------------------------------------
1 |
2 | var path = require('path');
3 |
4 | //
5 | // This file defines a few development tasks (not part of the plugin
6 | // functionnality).
7 | //
8 | // - gendocs: doc generation for the project. Uses docco and a custom wrapper
9 | // to h5bp-docs to generate from project wiki (submodule). All the docs are all
10 | // compiled into one page (index.html). Docco is also used and generates from
11 | // files in `src/` into `api/`.
12 | //
13 |
14 | module.exports = function(grunt) {
15 |
16 | grunt.registerTask('gendocs', 'Generates docs/index.html from wiki pages', function() {
17 | var cb = this.async();
18 |
19 | var gendoc = grunt.utils.spawn({
20 | cmd: 'grunt', opts: { cwd: path.join(__dirname, 'docs') }
21 | }, function() {});
22 |
23 | gendoc.stdout.pipe(process.stdout);
24 | gendoc.stderr.pipe(process.stderr);
25 | gendoc.on('exit', function(code) {
26 | if(code) grunt.warn('Something bad happend', code);
27 | cb();
28 | });
29 | });
30 |
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/test/tasks/test-html.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var helpers = require('../helpers');
6 |
7 | describe("HTML task", function() {
8 |
9 | // prepares the build dir
10 | before(helpers.before);
11 |
12 | describe("As a build script user I want to be able to run the html task So that I can see the html task in action", function() {
13 |
14 | describe("html task", function() {
15 |
16 | it("Given I run the 'html' task", function(done) {
17 | // runt the html task
18 | helpers.run('html', done);
19 | });
20 |
21 | it("When the script ends", function(done) {
22 | // not doing anything particularly usefull in this step but the hook is here
23 | // if we need to
24 | done();
25 | });
26 |
27 | it("Then './test/index.html' should be the same as 'test/fixtures/html/index.html'", function(done) {
28 | helpers.assertFile('.test/index.html', 'test/fixtures/html/index.html');
29 | done();
30 | });
31 |
32 | });
33 |
34 | });
35 |
36 | });
37 |
--------------------------------------------------------------------------------
/support/grunt-inspect.js:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // This file defines a few development tasks (not part of the plugin
4 | // functionnality).
5 | //
6 | // - list-helpers: run grunt list-helpers to get a list of all available
7 | // helpers in this current grunt instance (built-in plus user defined ones)
8 | //
9 | // - list-task: same here but for tasks.
10 | //
11 |
12 | module.exports = function(grunt) {
13 |
14 | grunt.registerTask('list-helpers', 'List all grunt registered helpers', function(helper) {
15 | var ls = grunt.log.wordlist(Object.keys(grunt.task._helpers), grunt.utils.linefeed);
16 | if(!helper) return grunt.log.ok(ls);
17 | grunt.log.subhead(helper + ' source:').ok(grunt.task._helpers[helper]);
18 | });
19 |
20 | grunt.registerTask('list-task', 'List all grunt registered tasks', function(t) {
21 | var ls = grunt.log.wordlist(Object.keys(grunt.task._tasks), grunt.utils.linefeed);
22 | if(!t) return grunt.log.ok(ls);
23 | grunt.log.subhead(t + ' source:');
24 | grunt.helper('inspect', grunt.task._tasks[t]);
25 | });
26 |
27 | };
28 |
29 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) HTML5 Boilerplate
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/doc/license.txt:
--------------------------------------------------------------------------------
1 |
2 | Copyright (C) 2001-2012 Cosmin Truta and the Contributing Authors.
3 | For the purpose of copyright and licensing, the list of Contributing
4 | Authors is available in the accompanying AUTHORS file.
5 |
6 | This software is provided 'as-is', without any express or implied
7 | warranty. In no event will the author(s) be held liable for any damages
8 | arising from the use of this software.
9 |
10 | Permission is granted to anyone to use this software for any purpose,
11 | including commercial applications, and to alter it and redistribute it
12 | freely, subject to the following restrictions:
13 |
14 | 1. The origin of this software must not be misrepresented; you must not
15 | claim that you wrote the original software. If you use this software
16 | in a product, an acknowledgment in the product documentation would be
17 | appreciated but is not required.
18 |
19 | 2. Altered source versions must be plainly marked as such, and must not
20 | be misrepresented as being the original software.
21 |
22 | 3. This notice may not be removed or altered from any source distribution.
23 |
24 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/LICENSE-MIT:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Paul Irish, Divya Manian",
3 | "name": "node-build-script",
4 | "description": "HTML5 Boilerplate node build script - Professional front-end template. So much goodness baked in by default",
5 | "version": "0.2.3",
6 | "homepage": "http://h5bp.com",
7 | "bin": {
8 | "html5-boilerplate": "./bin/h5bp",
9 | "h5bp": "./bin/h5bp"
10 | },
11 | "main": "./h5bp",
12 | "dependencies": {
13 | "rimraf": "~2.0.1",
14 | "mkdirp": "~0.3.1",
15 | "ncp": "~0.2.6",
16 | "requirejs": "~1.0.8",
17 | "almond": "~0.1.1",
18 | "clean-css": "~0.3.2",
19 | "connect": "~1.8.6",
20 | "grunt": "~0.3.8",
21 | "socket.io": "~0.9.5",
22 | "request": "~2.9.202",
23 | "html-minifier": "~0.4.5",
24 | "which": "~1.0.5",
25 | "fstream": "~0.1.18",
26 | "fstream-ignore": "0.0.5"
27 | },
28 | "devDependencies": {
29 | "mocha": "~1.0.3",
30 | "mocha-gherkin": "http://github.com/mklabs/mocha-gherkin/tarball/master"
31 | },
32 | "scripts": {
33 | "pretest": "git submodule update --init",
34 | "test": "node node_modules/mocha/bin/mocha test/tasks/*.js --silent"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/tasks/docs.js:
--------------------------------------------------------------------------------
1 |
2 | var path = require('path'),
3 | exec = require('child_process').exec;
4 |
5 | var env = process.platform;
6 |
7 | module.exports = function(grunt) {
8 |
9 | grunt.registerTask('docs', 'grunt h5bp plugin documentation', function(target) {
10 | // path to the documentation page
11 | var docs = path.join(__dirname, '../docs/index.html');
12 |
13 | // in case browser to use is setup in config or via --browser flag
14 | var gruntBro = grunt.config('browser') || grunt.option('browser') || '';
15 |
16 | // async task
17 | var cb = this.async();
18 |
19 | // depending on env.. try to guess the correct browser
20 | var browser = gruntBro ? gruntBro :
21 | env === 'win32' ? 'explorer' :
22 | env === 'darwin' ? 'open' :
23 | 'google-chrome';
24 |
25 | /// XXX should which the browser, warn user if it fails and preven the
26 | // browser exec
27 |
28 | // spawn and forget, would probably ends up with no browser opening
29 | // but output to console webserver url.
30 | exec(browser + ' ' + docs, function(err) {
31 | if(err) {
32 | // XXX to be removed in grunt0.4.x
33 | grunt.log.error(err);
34 | return cb(false);
35 | }
36 | });
37 | });
38 |
39 | };
40 |
--------------------------------------------------------------------------------
/test/tasks/test-img.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var helpers = require('../helpers');
6 |
7 | describe("IMG task", function() {
8 |
9 | // mocha converter should expose hook for before, after, beforeEach and afterEach
10 | before(helpers.before);
11 |
12 | describe("As a build script user I want to be able to run the img task So that I can see the img task in action", function() {
13 |
14 | describe("img task", function() {
15 |
16 | it("Given I run the 'img' task", function(done) {
17 | // run the img task
18 | //
19 | // note: try commenting out this and execute done callback right away
20 | // to see mocha generate diff output on base64 encoded value in its
21 | // full glory
22 | helpers.run('img', done);
23 | });
24 |
25 | it("When the script ends", function(done) {
26 | // not doing particularly usefull in this step
27 | // but the hook is here is we need to
28 | done();
29 | });
30 |
31 | it("Then '.test/img' dir should be the same as 'test/fixtures/img/expected/'", function(done) {
32 | helpers.assertDir('.test/img', 'test/fixtures/img/expected/');
33 | done();
34 | });
35 |
36 | });
37 |
38 | });
39 |
40 | });
41 |
--------------------------------------------------------------------------------
/support/docs/readme.md:
--------------------------------------------------------------------------------
1 |
2 | node-build-script documentation site
3 | ====================================
4 |
5 | Site is build with [h5bp-docs][] and generated from the project wiki.
6 | Each page may be rendered as individual page, but the docs are all compiled
7 | into one page (index.html).
8 |
9 | [Docco][] is also used and generates from files in `src/` into `api/`.
10 |
11 | The site can be built with:
12 |
13 | ``` sh
14 | $ grunt docs
15 | # >> docs copy
16 | $ open index.html
17 | ```
18 |
19 | ```sh
20 | $ grunt wiki
21 | # >> docs:wiki copy
22 | open index.html
23 | ```
24 |
25 | ```sh
26 | $ grunt api
27 | # >> docs:api
28 | $ ls api/
29 | lib/ root/ tasks/
30 | ```
31 |
32 | Faster building & rebuilding
33 | ----------------------------
34 |
35 | For quicker rebuilding of the site, you can start up the preview server:
36 |
37 | ``` sh
38 | $ grunt docs --serve # live rebuilding of the site!
39 | $ open http://localhost:3000
40 | ```
41 |
42 | Update the docs
43 | ---------------
44 |
45 | The docs are managed through git submodules in `docs/` path. To update
46 | (or clone the first time it's run):
47 |
48 | ```sh
49 | $ git submodule update --init
50 | ```
51 |
52 | [h5bp-docs]: https://github.com/mklabs/h5bp-docs
53 | [Docco]: http://jashkenas.github.com/docco/
54 |
--------------------------------------------------------------------------------
/bin/h5bp:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | var fs = require('fs'),
3 | join = require('path').join,
4 | help = join(__dirname, 'help.txt');
5 |
6 | // grunt with the plugin registered
7 | var grunt = require('grunt').npmTasks(join(__dirname, '../'));
8 |
9 | // Get back a reference to the internal grunt cli object (Yes, it's hacky) We
10 | // need this to be able to read grunt command line parsed options and tasks to
11 | // run to hook our internal additional logic.
12 | //
13 | // Another (nicer) alternative is to redo the command line parsing with nopt,
14 | // but it'll add yet another dependency for a very little thing
15 | var cli = require('grunt/lib/grunt/cli');
16 |
17 | // command line options and remaining args
18 | var opts = cli.options,
19 | cmds = cli.tasks,
20 | route = cmds.join(' ').trim('');
21 |
22 | // custom help, on `h5bp help`
23 | if(/^help/.test(route)) {
24 | if(/^help$/.test(route)) return fs.createReadStream(help).pipe(process.stdout);
25 | cli.tasks = cmds.join(':');
26 | }
27 |
28 | // add the plugin version on `--version`
29 | if(opts.version) {
30 | console.log('h5bp v%s', require('../package.json').version);
31 | }
32 |
33 | // `h5bp init` -> `grunt init:h5bp`
34 | if(/^init$/.test(route)) {
35 | cli.tasks = 'init:h5bp';
36 | }
37 |
38 | // the grunt cli
39 | grunt.cli();
40 |
--------------------------------------------------------------------------------
/bin/help.txt:
--------------------------------------------------------------------------------
1 | Usage: h5bp [options] [task [task ...]]
2 |
3 | Available tasks the h5bp plugin provides (for a full list, type h5bp --help
4 |
5 | clean Wipe the previous build dirs
6 | copy Copies the whole staging(intermediate/) folder to output
7 | (publish/) one
8 | css Concats, replaces @imports and minifies the CSS files *
9 | docs grunt h5bp plugin documentation
10 | dom dom-based build system
11 | html Basic to aggresive html minification
12 | img Optimizes .png/.jpg images using optipng/jpegtran
13 | mkdirs Prepares the build dirs *
14 | rev Automate the hash renames of assets filename *
15 | server Start a custom static web server
16 | usemin Replaces references to non-minified scripts / stylesheets *
17 |
18 | Build targets: h5bp build:
19 |
20 | default concat css min img rev usemin manifest
21 | text concat css min rev usemin manifest
22 | buildkit concat css min img rev usemin manifest html:buildkit
23 | basics concat css min img rev usemin manifest html:basics
24 | minify concat css min img rev usemin manifest html:compress
25 |
26 | For more information on the h5bp plugin, see https://github.com/h5bp/node-build-script/wiki
27 |
28 | For more information on grunt, see https://github.com/cowboy/grunt
29 |
--------------------------------------------------------------------------------
/test/tasks/test-tar.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var fs = require('fs'),
6 | path = require('path'),
7 | helpers = require('../helpers');
8 |
9 | describe("TAR task", function() {
10 |
11 | // mocha converter should expose hook for before, after, beforeEach and afterEach
12 | // note: stop copy-pasting this everywhere, do it.
13 | before(helpers.before);
14 |
15 | describe("As a build script user I want to be able to run the tar task So that I can see the tar task in action", function() {
16 |
17 | describe("tar task", function() {
18 |
19 | it("Given I run the 'tar' task", function(done) {
20 | // runs the tar task
21 | // we gonna pack the whole '.test' dir in '.test/test.tar.gz'
22 | // curious to see how the task handle output within input..
23 | helpers.run('tar --input ./ --output ./test.tgz', done);
24 | });
25 |
26 | it("When the script ends", function(done) {
27 | // not doing particularly usefull in this step
28 | // but the hook is here is we need to
29 | done();
30 | });
31 |
32 | it("Then '.test/test.tgz' should be the same as 'test/fixtures/tar/test.tgz'", function(done) {
33 | helpers.assertLength('.test/test.tgz', 'test/fixtures/tar/test.tgz', done);
34 | });
35 |
36 | });
37 |
38 | });
39 |
40 | });
41 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/humans.txt:
--------------------------------------------------------------------------------
1 | /* the humans responsible & colophon */
2 | /* humanstxt.org */
3 |
4 |
5 | /* TEAM */
6 | :
7 | Site:
8 | Twitter:
9 | Location:
10 |
11 | /* THANKS */
12 | Names (& URL):
13 |
14 | /* SITE */
15 | Standards: HTML5, CSS3
16 | Components: Modernizr, jQuery
17 | Software:
18 |
19 |
20 |
21 | -o/-
22 | +oo//-
23 | :ooo+//:
24 | -ooooo///-
25 | /oooooo//:
26 | :ooooooo+//-
27 | -+oooooooo///-
28 | -://////////////+oooooooooo++////////////::
29 | :+ooooooooooooooooooooooooooooooooooooo+:::-
30 | -/+ooooooooooooooooooooooooooooooo+/::////:-
31 | -:+oooooooooooooooooooooooooooo/::///////:-
32 | --/+ooooooooooooooooooooo+::://////:-
33 | -:+ooooooooooooooooo+:://////:--
34 | /ooooooooooooooooo+//////:-
35 | -ooooooooooooooooooo////-
36 | /ooooooooo+oooooooooo//:
37 | :ooooooo+/::/+oooooooo+//-
38 | -oooooo/::///////+oooooo///-
39 | /ooo+::://////:---:/+oooo//:
40 | -o+/::///////:- -:/+o+//-
41 | :-:///////:- -:/://
42 | -////:- --//:
43 | -- -:
44 |
--------------------------------------------------------------------------------
/lib/support/reload.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | //
4 | // This is the client-side script that is "injected" automatically
5 | // with the connect (or reload) tasks.
6 | //
7 | // This is a first implementation. It may greatly be improved, the
8 | // grunt watch task has evolved and we might add some handy new
9 | // development utilities.
10 | //
11 | // We don't use jQuery for this, but one could totally change this (could we?
12 | // todo: add a way to overidde this file). It should work well on every (non
13 | // crappy) browsers. (eg. should implement querySelector).
14 | //
15 |
16 | var url = 'http://<%= hostname %>:<%= port %>',
17 | socket = io.connect(url);
18 |
19 | // watched files just changed, reload page.
20 | // also retrigger on reconnect event
21 | socket
22 | .on('changed', reload)
23 | .on('reconnect', reload)
24 | .on('error', function(errors) {
25 | var div = document.createElement('div'),
26 | errDiv = document.getElementById('h5bp-error'),
27 | first = document.body.querySelector('*');
28 |
29 | div.innerHTML = errors.map(function(err) {
30 | return err.msg;
31 | }).join('
');
32 |
33 | div.id = 'h5bp-error';
34 | div.style.color = '#b94a48';
35 | div.style.padding = '1em';
36 | div.style.backgroundColor = '#f2dede';
37 | div.style.borderColor = '#eed3d7';
38 |
39 | if(errDiv) errDiv.innerHTML = div.innerHTML;
40 | else document.body.insertBefore(div, first);
41 | });
42 |
43 | // Function.prototype.bind not always there
44 | function reload() { location.reload(); }
45 | })();
46 |
--------------------------------------------------------------------------------
/lib/utils/index.js:
--------------------------------------------------------------------------------
1 |
2 | var path = require('path');
3 |
4 | var utils = module.exports;
5 |
6 | //
7 | // flatiron/utile inspired.
8 | //
9 | // Set of common utilities, mainly defining wrapper to various utility modules
10 | // (like ncp, mkdir, rimraf) as lazy-loaded getters.
11 | //
12 |
13 | //
14 | // Wrapper to `require('mkdirp')`
15 | //
16 | utils.__defineGetter__('mkdirp', function () {
17 | return require('mkdirp');
18 | });
19 |
20 | //
21 | // Wrapper to `require('rimraf')`
22 | //
23 | utils.__defineGetter__('rimraf', function () {
24 | return require('rimraf');
25 | });
26 |
27 | //
28 | // Wrapper to `require('ncp').ncp`
29 | //
30 | utils.__defineGetter__('ncp', function () {
31 | return require('ncp').ncp;
32 | });
33 |
34 | //
35 | // Wrapper to `require('./fetch')`, internal tarball helper using
36 | // mikeal/request, zlib and isaacs/tar.
37 | //
38 | utils.__defineGetter__('fetch', function () {
39 | return require('./fetch');
40 | });
41 |
42 | // **extend** a given object with the util module definition, taking care
43 | // of not triggering the getters. Doing so with _.extend makes the module
44 | // to be required right away.
45 | utils.extend = function extend(o) {
46 | var props = Object.keys(utils);
47 | props.forEach(function(prop) {
48 | o.__defineGetter__(prop, function() {
49 | return utils[prop];
50 | });
51 | });
52 | return o;
53 | };
54 |
55 | //
56 | // **join** basic wrapper to `path.join`, dealing with `//` and converting back
57 | // **`\` windows like path to unix like one.
58 | //
59 | utils.join = function join() {
60 | var args = Array.prototype.slice.call(arguments);
61 | return path.join.apply(path, args).replace(/\\/g, '/');
62 | };
63 |
--------------------------------------------------------------------------------
/lib/utils/fetch.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs'),
2 | path = require('path'),
3 | zlib = require('zlib'),
4 | request = require('request'),
5 | tar = require('tar');
6 |
7 | // Check if we're behind some kind of proxy.
8 | var proxy = process.env.http_proxy || process.env.HTTP_PROXY ||
9 | process.env.https_proxy || process.env.HTTPS_PROXY || '';
10 |
11 | // heavily based on npm's util/untar.js file
12 | module.exports = function fetch(tarball, target, cb) {
13 | var r = request.defaults({ proxy: proxy }),
14 | now = +new Date;
15 |
16 | var log = this.log
17 | .subhead('Fetching ' + tarball)
18 | .writeln('This might take a few moment');
19 |
20 | // tarball untar opts
21 | var extractOpts = { type: 'Directory', path: target, strip: 1 };
22 |
23 | // remote request --> zlib.Unzip() --> untar into h5bp/root
24 | var req = r.get(tarball).on('error', cb);
25 |
26 | req.on('data', function() { log.write('.'); }).on('end', function() {
27 | log.ok().writeln();
28 | log.ok('Done in ' + (+new Date - now) / 1000 + 's.');
29 | });
30 |
31 | req
32 | // first gzip
33 | .pipe(zlib.Unzip())
34 | .on('error', function(err) {
35 | console.error('unzip error', err);
36 | cb(err);
37 | })
38 | // then tar extract into h5bp/root
39 | .pipe(tar.Extract(extractOpts))
40 | .on('entry', function(entry) {
41 | log.write('.');
42 | entry.props.uid = entry.uid = 501;
43 | entry.props.gid = entry.gid = 20;
44 | })
45 | .on('error', function(err) {
46 | console.error('untar error', err);
47 | cb(err);
48 | })
49 | .on('close', function() {
50 | log.writeln().ok('Done in ' + extractOpts.path).writeln();
51 | cb();
52 | });
53 | };
54 |
--------------------------------------------------------------------------------
/test/tasks/test-css.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var fs = require('fs'),
6 | path = require('path'),
7 | helpers = require('../helpers');
8 |
9 | describe("CSS task", function() {
10 |
11 | // prepares the build dir
12 | before(helpers.before);
13 |
14 | before(function(done) {
15 | // copy in some files, with @imports to test out the inline imports
16 | var files = fs.readdirSync(path.join(__dirname, '../fixtures/css'))
17 | .filter(function(f) {
18 | return !(/expected/).test(f) && path.extname(f) === '.css';
19 | })
20 | .map(function(f) {
21 | return path.join('css', f);
22 | });
23 |
24 | // gruntfile with our css config for test
25 | helpers.copyFile('test/fixtures/css/grunt.js', '.test/grunt.js', function(err) {
26 | if(err) return done(err);
27 | helpers.copy(files, '.test/css', done);
28 | });
29 |
30 | });
31 |
32 | describe("As a build script user I want to be able to run the css task So that I can see the css task in action", function() {
33 |
34 | describe("css task", function() {
35 |
36 | it("Given I run the 'css' task", function(done) {
37 | // runt the css task
38 | helpers.run('css', done);
39 | });
40 |
41 | it("When the script ends", function(done) {
42 | // not doing particularly usefull in this step
43 | // but the hook is here is we need to
44 | done();
45 | });
46 |
47 | it("Then './test/css/compressed.css' should be the same as 'test/fixtures/css/expected.css'", function(done) {
48 | helpers.assertFile('.test/css/compressed.css', 'test/fixtures/css/expected.css');
49 | done();
50 | });
51 |
52 | });
53 |
54 | });
55 |
56 | });
57 |
--------------------------------------------------------------------------------
/vendor/optipng-0.7.1-win32/doc/todo.txt:
--------------------------------------------------------------------------------
1 |
2 | OptiPNG - TO-DO list
3 | ====================
4 |
5 | - Compression improvements:
6 | Use zlib's deflateTune().
7 | Use 7zip's powerful deflation engine.
8 | (This is not possible with libpng, so a custom encoder is needed.)
9 |
10 | - Speed improvements:
11 | Avoid repeated filtering when trying a filter value more than once.
12 | (This is not possible with libpng, so a custom encoder is needed.)
13 |
14 | - Text chunk optimization:
15 | Smart selection between tEXt and zTXt. Similarly for iTXt.
16 |
17 | - More file recovery features.
18 |
19 | - Input from stdin; output to stdout.
20 |
21 | - Optimization of an entire directory, with and without subdirectory
22 | recursion:
23 | optipng dir/
24 | optipng -recurse dir/
25 |
26 | - Improved support for reading external image formats
27 | (e.g. compressed TIFF).
28 |
29 | - Support for conversion to a desired bit depth and color type:
30 | optipng -b16 -c6 ...
31 |
32 | - Support for handling metadata, e.g.:
33 | optipng -set tEXt=, # add or update chunk
34 | optipng -set sRGB=0 # add or update chunk
35 | optipng -set image.precision= # set the precision of all samples
36 | optipng -set image.alpha.precision= # set the precision of alpha samples
37 | optipng -reset image.alpha # make the image fully opaque
38 | optipng -strip hIST,sPLT # strip hIST and sPLT
39 | optipng -strip all -protect iCCP # strip all metadata except iCCP
40 |
41 | - Parallelization on multi-processor/multi-core machines.
42 |
43 | - A shared library (e.g. optipng.dll), to facilitate the development of
44 | PNG-optimizing GUI applications and plugins.
45 |
46 |
--------------------------------------------------------------------------------
/tasks/rev.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | var fs = require('fs'),
4 | path = require('path'),
5 | crypto = require('crypto');
6 |
7 |
8 | module.exports = function(grunt) {
9 | // rev task - reving is done in the `output/` directory
10 | grunt.registerMultiTask('rev', 'Automate the hash renames of assets filename', function() {
11 | grunt.helper('hash', this.data);
12 | });
13 |
14 | // **hash** helper takes care of files revving, by renaming any files
15 | // in the given `files` pattern(s), with passed in `options`.
16 | //
17 | // - files - String or Array of glob pattern
18 | // - options - (optional) An Hash object where:
19 | // - cwd - Base directory to work from, glob patterns are
20 | // prepended to this path.
21 | //
22 | grunt.registerHelper('hash', function(files, opts) {
23 | opts = opts || {};
24 |
25 | files = Array.isArray(files) ? files : [files];
26 | grunt.file.expand(files).forEach(function(f) {
27 | var md5 = grunt.helper('md5', f),
28 | renamed = [md5.slice(0, 8), path.basename(f)].join('.');
29 |
30 | grunt.verbose.ok().ok(md5);
31 | // create the new file
32 | fs.renameSync(f, path.resolve(path.dirname(f), renamed));
33 | grunt.log.write(f + ' ').ok(renamed);
34 | });
35 | });
36 |
37 |
38 | // **md5** helper is a basic wrapper around crypto.createHash, with
39 | // given `algorithm` and `encoding`. Both are optional and defaults to
40 | // `md5` and `hex` values.
41 | grunt.registerHelper('md5', function(filepath, algorithm, encoding) {
42 | algorithm = algorithm || 'md5';
43 | encoding = encoding || 'hex';
44 | var hash = crypto.createHash(algorithm);
45 | hash.update(grunt.file.read(filepath));
46 | grunt.log.verbose.write('Hashing ' + filepath + '...');
47 | return hash.digest(encoding);
48 | });
49 | };
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/tasks/rjs.js:
--------------------------------------------------------------------------------
1 | var path = require('path'),
2 | rjs = require('requirejs');
3 |
4 | module.exports = function(grunt) {
5 | grunt.task.registerTask('rjs', 'Optimizes javascript that actually is built with requirejs.', function () {
6 | this.requiresConfig(this.name);
7 | grunt.helper('rjs:optimize:js', grunt.config(this.name), this.async());
8 | });
9 |
10 | grunt.registerHelper('rjs:optimize:js', function(options, cb) {
11 | if(!cb) { cb = options; options = {}; }
12 | grunt.log.subhead('Options:');
13 | grunt.helper('inspect', options);
14 |
15 | var originals = options.modules.map(function(m) {
16 | return {
17 | name: m.name,
18 | body: grunt.file.read(path.join(options.baseUrl, options.appDir, m.name + '.js'))
19 | };
20 | });
21 |
22 | if (options.almond === true) {
23 | grunt.log.ok('Including almond.js');
24 | // resolve almond path
25 | if (typeof options.paths === 'undefined') {
26 | options.paths = {};
27 | }
28 | options.paths.almond = require.resolve('almond').replace('.js', '');
29 | // include almond to each module
30 | options.modules.forEach(function (module, idx) {
31 | grunt.verbose.ok('Adding almond to module: ' + module.name);
32 | // append almond to includes
33 | if (module.include) {
34 | module.include.push('almond');
35 | } else {
36 | module.include = ['almond'];
37 | }
38 | });
39 | }
40 |
41 | rjs.optimize(options, function() {
42 | originals.forEach(function(m) {
43 | var filepath = path.join(options.dir, m.name + '.js');
44 | grunt.log
45 | .writeln('rjs optimized module ' + m.name)
46 | .writeln('>> ' + filepath);
47 | grunt.helper('min_max_info', grunt.file.read(filepath), m.body);
48 | });
49 |
50 | cb();
51 | });
52 | });
53 |
54 | };
55 |
--------------------------------------------------------------------------------
/test/tasks/test-init.js:
--------------------------------------------------------------------------------
1 | //
2 | // Mocha generated tests
3 | //
4 |
5 | var path = require('path'),
6 | helpers = require('../helpers');
7 |
8 | describe("INIT task", function() {
9 |
10 | before(function(done) {
11 | helpers.setup({ nocopy: true }, done);
12 | });
13 |
14 | describe("As a build script user I want to be able to run the init task So that I can see this in action", function() {
15 |
16 |
17 | describe("init task default template", function() {
18 |
19 | it("Given I run the 'init' task with default template", function(done) {
20 | // runt the init task
21 | var grunt = helpers.run('init --template defaults', {
22 | bin: path.join(__dirname, '../../bin/h5bp')
23 | }, done);
24 |
25 | });
26 |
27 | it("When the script ends", function(done) {
28 | // not doing anything particularly usefull in this step but the hook is here
29 | // if we need to
30 | done();
31 | });
32 |
33 | it("Then '.test/' should be the same as 'test/fixtures/init/expected/'", function(done) {
34 | helpers.assertDir('.test/', 'test/fixtures/init/expected/');
35 | done();
36 | });
37 |
38 | });
39 |
40 | describe("init task rjs template", function() {
41 |
42 | it("Given I run the 'init' task with rjs template", function(done) {
43 | // runt the init task
44 | var grunt = helpers.run('init --template rjs --force', {
45 | bin: path.join(__dirname, '../../bin/h5bp')
46 | }, done);
47 |
48 | });
49 |
50 | describe("When the script ends", function(done) {
51 | it("Then '.test/gruntfile.js' should be the same as 'test/fixtures/init/rjs.gruntfile.js'", function(done) {
52 | helpers.assertFile('.test/grunt.js', 'test/fixtures/init/rjs.gruntfile.js');
53 | done();
54 | });
55 | });
56 |
57 | });
58 | });
59 |
60 | });
61 |
--------------------------------------------------------------------------------
/test/fixtures/init/expected/apple-touch-icon.png:
--------------------------------------------------------------------------------
1 | �PNG
2 |
3 |
IHDR 9 9 ��s� PLTE�Y,Fgp# ! %"#(% $"0JQ"!%"�W)"#'$# #! $!" $!!!%#!%)%�c1"&$Eem�d1�d2#'%2-&*+&�X))8:'/./HN�X)"�c7)6880(�d32LS�S6�c20IO�J*+77>X^`@0�jA-CH�W78.&[>/.=>�Q47/'�[,�a1,@E�U6�f8(44�d7+*%�^0+=@�Z-3MT\9(=V\�L*�c8-+&Z9(-BF&.,DclZ>. �\.$*(�e2�Z-[9(oE0'33'*&Ffo,;=�f4#)'�l?!"'$4LS&.+Dck#(&`@/3MS�F'wG0\?/�T2zH0l='�J(�M(�S14GJ,=?6KN�W3�O)�W*%,)Ddm;/&bA00?@)89�N,2-%�W,EfnE4)zA'.@B[8&-;;�L*�R(�K*�E'X=.�M+;SX/GM(56mD/�W3,?C�\.b:':QV.FK7LO/@C2CF70(A3*.<=B`g)54F2&1CF/ADQ5&�X2V<.'22�b1�b0-;=�R)�`/�a/�a01@B1FIW7&$*'$)'4-&&11�Y*�Y*%,+&.-1BD�\,�Y*�Z+�[,�\,�[+E5*�V)=2)�]-�Z+*;>w@'�^-�^.+;<')%�T)�pD�_.�I(�_.-::�[-4FI>]e7KO�`/3DG�N,�W3�g5�e3�X*&/.$,*B1&5.&*661KRoD/�W18OS