a simple collection of common javascript build tasks for grunt.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-barkeep
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-barkeep');
grunt-barkeep is bundled with the following additonal tasks:
Generate docco documentation from JavaScript files. This is a multi task. It requires the docco
binary to be installed on the system.
Example:
grunt.initConfig({
docco: {
files: ['lib/**/*.js']
}
});
Build a dependency tree of source files for the concat
and min
grunt tasks using snockets. Snockets is a JavaScript dependency parser similar to Ruby's sprockets. This is a multi task.
barkeep, using snockets, can also concatenate coffeescript files.
Example:
grunt.initConfig({
meta: {
buildDirectory: 'dist',
header: '/* Copyright 2012, Flite Inc. */',
footer: '/* End of source */',
},
snockets: {
core: {
src: ['public/javascript/main-rollup.js'],
options: {
concat: {
header: '<banner:meta.header>',
destExtension: "debug.js",
destDir: "<config:meta.buildDirectory>",
footer: '<banner:meta.footer>'
},
min: {
destExtension: "js",
destDir: "<config:meta.buildDirectory>"
}
}
}
}
});
An experimental task that determines what files to upload or delete from an Amazon S3 buckets when mirroring a local directory. It is meant to be run before the s3
task in the grunt-s3 project.
Sends file size data to ducksboard for reporting purposes. Useful for tracking the size of your JavaScript web applications over time. This is a multi task.
Example:
grunt.initConfig({
meta: {
ducksboard_api_key: process.env.DUCKSBOARD_API_KEY
},
ducksboard: {
everything_gzip: {
src: ['public/rollup.js'],
endpoint: 'everything',
gzip: true
},
everything_no_gzip: {
src: ['public/rollup.js'],
endpoint: 'everything-no-gzip'
}
}
});
Delete the files and/or directories of your choice. This is a multi task.
Example:
grunt.initConfig({
clean: {
files: ['build/**/*.js']
}
});
See grunt.js in the barkeep directory.
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
(Nothing yet)
Copyright (c) 2012 Flite, Inc.
Licensed under the MIT license.