Update api reference docs from review comments. Uses latest brodocs release.
This commit is contained in:
+51
-26
@@ -1,10 +1,11 @@
|
||||
var fs = require('fs')
|
||||
, buildOpts = {
|
||||
printStdout: true
|
||||
, printStderr: true
|
||||
};
|
||||
var execSync = require('child_process').execSync;
|
||||
var exec = function (cmd) {
|
||||
execSync(cmd, {stdio: 'inherit'});
|
||||
};
|
||||
|
||||
task('build', ['browserify', 'minify'], function () {
|
||||
/* global jake, task, desc, publishTask */
|
||||
|
||||
task('build', ['lint', 'clean', 'browserify', 'minify'], function () {
|
||||
console.log('Build completed.');
|
||||
});
|
||||
|
||||
@@ -12,33 +13,57 @@ 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.');
|
||||
});
|
||||
|
||||
task('browserify', {async: true}, function () {
|
||||
jake.exec('./node_modules/browserify/bin/cmd.js --standalone ejs lib/ejs.js > ejs.js',
|
||||
buildOpts, function () {
|
||||
console.log('Browserification completed.');
|
||||
setTimeout(complete, 0);
|
||||
});
|
||||
desc('Lints the source code');
|
||||
task('lint', function () {
|
||||
exec('./node_modules/.bin/eslint \"**/*.js\" Jakefile');
|
||||
console.log('Linting completed.');
|
||||
});
|
||||
|
||||
task('minify', {async: true}, function () {
|
||||
jake.exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js',
|
||||
buildOpts, function () {
|
||||
console.log('Minification completed.');
|
||||
setTimeout(complete, 0);
|
||||
});
|
||||
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.');
|
||||
});
|
||||
|
||||
task('doc', function (dev) {
|
||||
jake.rmRf('out');
|
||||
var p = dev ? '-p' : '';
|
||||
exec('./node_modules/.bin/jsdoc ' + p + ' -c jsdoc.json lib/* docs/jsdoc/*');
|
||||
console.log('Documentation generated.');
|
||||
});
|
||||
|
||||
task('docPublish', ['doc'], function () {
|
||||
console.log('Pushing docs to gh-pages...');
|
||||
exec('./node_modules/.bin/git-directory-deploy --directory out/');
|
||||
console.log('Docs published to gh-pages.');
|
||||
});
|
||||
|
||||
task('test', ['lint'], function () {
|
||||
exec('./node_modules/.bin/mocha');
|
||||
});
|
||||
|
||||
publishTask('ejs', ['build'], function () {
|
||||
this.packageFiles.include([
|
||||
'Jakefile'
|
||||
, 'README.md'
|
||||
, 'LICENSE'
|
||||
, 'package.json'
|
||||
, 'ejs.js'
|
||||
, 'ejs.min.js'
|
||||
, 'lib/**'
|
||||
, 'test/**'
|
||||
'Jakefile',
|
||||
'README.md',
|
||||
'LICENSE',
|
||||
'package.json',
|
||||
'ejs.js',
|
||||
'ejs.min.js',
|
||||
'lib/**',
|
||||
'test/**'
|
||||
]);
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user