collection of cake files, mainly trying to learn this cool stuff
collection of cake files, mainly trying to learn this cool stuff
In the root of this repo, run
npm install
It'll get the dependencies as defined in the package.json
file (they're
quite a few, this may take a while)
[email protected] ./node_modules/mkdirp
[email protected] ./node_modules/colors
[email protected] ./node_modules/html-minifier
[email protected] ./node_modules/coffee-script
[email protected] ./node_modules/uglify-js
[email protected] ./node_modules/clean-css
└── [email protected]
[email protected] ./node_modules/vows
└── [email protected]
[email protected] ./node_modules/connect
├── [email protected]
└── [email protected]
[email protected] ./node_modules/zombie
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
[email protected] ./node_modules/prompt
├── [email protected]
├── [email protected]
└── [email protected]
[email protected] ./node_modules/fileset
├── [email protected]
└── [email protected]
Primary as a learning material, I thought that the h5bp build script could be a great fit to play with coffeescript and cake files
Also a great way to play with Cakefile and EventEmitter to deal with node asynchronicity
cd to h5bp and run cake
to get the following output
cake docs # Generates the source documentation of this cake script
cake build # Build with defaults configuration the main tasks: js, css and img optimiaztion
cake js # Combines and minifies JS
cake css # Combines and minifies CSS
cake img # Performs img optimization
cake createproject # a simple create project task
cake intro # Kindly inform the developer about the impending magic
cake check # Performs few validations upon the current repo, outputing errors if any
cake clean # Wipe the previous build
cake mkdirs # Create the directory intermediate structure
cake js.main.concat # Concatenates the JS files in dir.js
cake js.mylibs.concat # Concatenates the JS files in dir.js.mylibs
cake js.scripts.concat # Concatenating library file with main script file
cake js.all.minify # Minifies the *-concat.js files in intermediate/js
cake jshint # jshint task, run jshint on any non min.js file in dir.js
cake csslint # csslint task, run csslint on dir.css and ommit *.min.css one
cake css.concat # Concat the CSS files depending on the @imports in your file.root.stylesheet
cake img.optimize # Run optipng
cake usemin # Replaces references to non-minified scripts/styles
cake htmlclean # Peforms basic to aggresive minification
-o, --output directory for the createproject task
This is a quick and dirty implementation, but the following tasks may (or may not) work
npm test
it'll trigger a first clone/pull/build if needed, and run the vows/zombie test suite.
Check the tests/build.js file to see the basic asserts