summaryrefslogtreecommitdiff
path: root/node_modules/ejs/jakefile.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ejs/jakefile.js')
-rw-r--r--node_modules/ejs/jakefile.js81
1 files changed, 81 insertions, 0 deletions
diff --git a/node_modules/ejs/jakefile.js b/node_modules/ejs/jakefile.js
new file mode 100644
index 0000000..3953160
--- /dev/null
+++ b/node_modules/ejs/jakefile.js
@@ -0,0 +1,81 @@
+var fs = require('fs');
+var execSync = require('child_process').execSync;
+var exec = function (cmd) {
+ execSync(cmd, {stdio: 'inherit'});
+};
+
+/* global jake, task, desc, publishTask */
+
+task('build', ['lint', 'clean', 'browserify', 'minify'], function () {
+ console.log('Build completed.');
+});
+
+desc('Cleans browerified/minified files and package files');
+task('clean', ['clobber'], function () {
+ jake.rmRf('./ejs.js');
+ jake.rmRf('./ejs.min.js');
+ console.log('Cleaned up compiled files.');
+});
+
+desc('Lints the source code');
+task('lint', ['clean'], function () {
+ exec('./node_modules/.bin/eslint "**/*.js"');
+ console.log('Linting completed.');
+});
+
+task('browserify', function () {
+ exec('./node_modules/browserify/bin/cmd.js --standalone ejs lib/ejs.js > ejs.js');
+ console.log('Browserification completed.');
+});
+
+task('minify', function () {
+ exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js');
+ console.log('Minification completed.');
+});
+
+desc('Generates the EJS API docs for the public API');
+task('doc', function () {
+ jake.rmRf('out');
+ exec('./node_modules/.bin/jsdoc --verbose -c jsdoc.json lib/* docs/jsdoc/*');
+ console.log('Documentation generated in ./out.');
+});
+
+desc('Generates the EJS API docs for the public and private API');
+task('devdoc', function () {
+ jake.rmRf('out');
+ exec('./node_modules/.bin/jsdoc --verbose -p -c jsdoc.json lib/* docs/jsdoc/*');
+ console.log('Documentation generated in ./out.');
+});
+
+desc('Publishes the EJS API docs');
+task('docPublish', ['doc'], function () {
+ fs.writeFileSync('out/CNAME', 'api.ejs.co');
+ console.log('Pushing docs to gh-pages...');
+ exec('./node_modules/.bin/git-directory-deploy --directory out/');
+ console.log('Docs published to gh-pages.');
+});
+
+desc('Runs the EJS test suite');
+task('test', ['lint'], function () {
+ exec('./node_modules/.bin/mocha');
+});
+
+publishTask('ejs', ['build'], function () {
+ this.packageFiles.include([
+ 'jakefile.js',
+ 'README.md',
+ 'LICENSE',
+ 'package.json',
+ 'ejs.js',
+ 'ejs.min.js',
+ 'lib/**',
+ 'bin/**',
+ 'usage.txt'
+ ]);
+});
+
+jake.Task.publish.on('complete', function () {
+ console.log('Updating hosted docs...');
+ console.log('If this fails, run jake docPublish to re-try.');
+ jake.Task.docPublish.invoke();
+});