http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/escodegen ---------------------------------------------------------------------- diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen new file mode 100755 index 0000000..a7c38aa --- /dev/null +++ b/node_modules/.bin/escodegen @@ -0,0 +1,77 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Yusuke Suzuki <[email protected]> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true */ + +var fs = require('fs'), + path = require('path'), + root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), + esprima = require('esprima'), + escodegen = require(root), + optionator = require('optionator')({ + prepend: 'Usage: escodegen [options] file...', + options: [ + { + option: 'config', + alias: 'c', + type: 'String', + description: 'configuration json for escodegen' + } + ] + }), + args = optionator.parse(process.argv), + files = args._, + options, + esprimaOptions = { + raw: true, + tokens: true, + range: true, + comment: true + }; + +if (files.length === 0) { + console.log(optionator.generateHelp()); + process.exit(1); +} + +if (args.config) { + try { + options = JSON.parse(fs.readFileSync(args.config, 'utf-8')); + } catch (err) { + console.error('Error parsing config: ', err); + } +} + +files.forEach(function (filename) { + var content = fs.readFileSync(filename, 'utf-8'), + syntax = esprima.parse(content, esprimaOptions); + + if (options.comment) { + escodegen.attachComments(syntax, syntax.comments, syntax.tokens); + } + + console.log(escodegen.generate(syntax, options)); +}); +/* vim: set sw=4 ts=4 et tw=80 : */
http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/esgenerate ---------------------------------------------------------------------- diff --git a/node_modules/.bin/esgenerate b/node_modules/.bin/esgenerate new file mode 100755 index 0000000..449abcc --- /dev/null +++ b/node_modules/.bin/esgenerate @@ -0,0 +1,64 @@ +#!/usr/bin/env node +/* + Copyright (C) 2012 Yusuke Suzuki <[email protected]> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true */ + +var fs = require('fs'), + path = require('path'), + root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), + escodegen = require(root), + optionator = require('optionator')({ + prepend: 'Usage: esgenerate [options] file.json ...', + options: [ + { + option: 'config', + alias: 'c', + type: 'String', + description: 'configuration json for escodegen' + } + ] + }), + args = optionator.parse(process.argv), + files = args._, + options; + +if (files.length === 0) { + console.log(optionator.generateHelp()); + process.exit(1); +} + +if (args.config) { + try { + options = JSON.parse(fs.readFileSync(args.config, 'utf-8')) + } catch (err) { + console.error('Error parsing config: ', err); + } +} + +files.forEach(function (filename) { + var content = fs.readFileSync(filename, 'utf-8'); + console.log(escodegen.generate(JSON.parse(content), options)); +}); +/* vim: set sw=4 ts=4 et tw=80 : */ http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/esparse ---------------------------------------------------------------------- diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 100755 index 0000000..98bdbf4 --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1,126 @@ +#!/usr/bin/env node +/* + Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } +}); + +if (typeof fname !== 'string') { + console.log('Error: no input file.'); + process.exit(1); +} + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +try { + content = fs.readFileSync(fname, 'utf-8'); + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/esvalidate ---------------------------------------------------------------------- diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 100755 index 0000000..f522dec --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1,199 @@ +#!/usr/bin/env node +/* + Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ +/*global phantom:true */ + +var fs, system, esprima, options, fnames, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } + } +} + +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit + }; + process.argv.unshift('phantomjs'); +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else { + fnames.push(entry); + } +}); + +if (fnames.length === 0) { + console.log('Error: no input file.'); + process.exit(1); +} + +if (options.format === 'junit') { + console.log('<?xml version="1.0" encoding="UTF-8"?>'); + console.log('<testsuites>'); +} + +count = 0; +fnames.forEach(function (fname) { + var content, timestamp, syntax, name; + try { + content = fs.readFileSync(fname, 'utf-8'); + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log('<testsuite name="' + fname + '" errors="0" ' + + ' failures="' + syntax.errors.length + '" ' + + ' tests="' + syntax.errors.length + '" ' + + ' time="' + Math.round((Date.now() - timestamp) / 1000) + + '">'); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' + + ' time="0">'); + console.log(' <error type="SyntaxError" message="' + error.message + '">' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + '</error>'); + console.log(' </testcase>'); + }); + + console.log('</testsuite>'); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' + + ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">'); + console.log(' <testcase name="' + e.message + '" ' + ' time="0">'); + console.log(' <error type="ParseError" message="' + e.message + '">' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')</error>'); + console.log(' </testcase>'); + console.log('</testsuite>'); + } else { + console.log('Error: ' + e.message); + } + } +}); + +if (options.format === 'junit') { + console.log('</testsuites>'); +} + +if (count > 0) { + process.exit(1); +} + +if (count === 0 && typeof phantom === 'object') { + process.exit(0); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/hexo ---------------------------------------------------------------------- diff --git a/node_modules/.bin/hexo b/node_modules/.bin/hexo new file mode 100755 index 0000000..7344e8d --- /dev/null +++ b/node_modules/.bin/hexo @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +'use strict'; + +require('hexo-cli')(); http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/js-yaml ---------------------------------------------------------------------- diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 100755 index 0000000..e79186b --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1,132 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +// stdlib +var fs = require('fs'); + + +// 3rd-party +var argparse = require('argparse'); + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument([ '-c', '--compact' ], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.addArgument([ '-j', '--to-json' ], { + help: argparse.Const.SUPPRESS, + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument([ '-t', '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + defaultValue: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + + var chunks = []; + + process.stdin.on('data', function (chunk) { + chunks.push(chunk); + }); + + process.stdin.on('end', function () { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + +readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if (error.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (err) { + if (err instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); + + process.exit(1); + } + } else { + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + } + + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); +}); http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/marked ---------------------------------------------------------------------- diff --git a/node_modules/.bin/marked b/node_modules/.bin/marked new file mode 100755 index 0000000..64254fc --- /dev/null +++ b/node_modules/.bin/marked @@ -0,0 +1,187 @@ +#!/usr/bin/env node + +/** + * Marked CLI + * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) + */ + +var fs = require('fs') + , util = require('util') + , marked = require('../'); + +/** + * Man Page + */ + +function help() { + var spawn = require('child_process').spawn; + + var options = { + cwd: process.cwd(), + env: process.env, + setsid: false, + customFds: [0, 1, 2] + }; + + spawn('man', + [__dirname + '/../man/marked.1'], + options); +} + +/** + * Main + */ + +function main(argv, callback) { + var files = [] + , options = {} + , input + , output + , arg + , tokens + , opt; + + function getarg() { + var arg = argv.shift(); + + if (arg.indexOf('--') === 0) { + // e.g. --opt + arg = arg.split('='); + if (arg.length > 1) { + // e.g. --opt=val + argv.unshift(arg.slice(1).join('=')); + } + arg = arg[0]; + } else if (arg[0] === '-') { + if (arg.length > 2) { + // e.g. -abc + argv = arg.substring(1).split('').map(function(ch) { + return '-' + ch; + }).concat(argv); + arg = argv.shift(); + } else { + // e.g. -a + } + } else { + // e.g. foo + } + + return arg; + } + + while (argv.length) { + arg = getarg(); + switch (arg) { + case '--test': + return require('../test').main(process.argv.slice()); + case '-o': + case '--output': + output = argv.shift(); + break; + case '-i': + case '--input': + input = argv.shift(); + break; + case '-t': + case '--tokens': + tokens = true; + break; + case '-h': + case '--help': + return help(); + default: + if (arg.indexOf('--') === 0) { + opt = camelize(arg.replace(/^--(no-)?/, '')); + if (!marked.defaults.hasOwnProperty(opt)) { + continue; + } + if (arg.indexOf('--no-') === 0) { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? null + : false; + } else { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? argv.shift() + : true; + } + } else { + files.push(arg); + } + break; + } + } + + function getData(callback) { + if (!input) { + if (files.length <= 2) { + return getStdin(callback); + } + input = files.pop(); + } + return fs.readFile(input, 'utf8', callback); + } + + return getData(function(err, data) { + if (err) return callback(err); + + data = tokens + ? JSON.stringify(marked.lexer(data, options), null, 2) + : marked(data, options); + + if (!output) { + process.stdout.write(data + '\n'); + return callback(); + } + + return fs.writeFile(output, data, callback); + }); +} + +/** + * Helpers + */ + +function getStdin(callback) { + var stdin = process.stdin + , buff = ''; + + stdin.setEncoding('utf8'); + + stdin.on('data', function(data) { + buff += data; + }); + + stdin.on('error', function(err) { + return callback(err); + }); + + stdin.on('end', function() { + return callback(null, buff); + }); + + try { + stdin.resume(); + } catch (e) { + callback(e); + } +} + +function camelize(text) { + return text.replace(/(\w)-(\w)/g, function(_, a, b) { + return a + b.toUpperCase(); + }); +} + +/** + * Expose / Entry Point + */ + +if (!module.parent) { + process.title = 'marked'; + main(process.argv.slice(), function(err, code) { + if (err) throw err; + return process.exit(code || 0); + }); +} else { + module.exports = main; +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/md2html ---------------------------------------------------------------------- diff --git a/node_modules/.bin/md2html b/node_modules/.bin/md2html new file mode 100755 index 0000000..f8ce1dd --- /dev/null +++ b/node_modules/.bin/md2html @@ -0,0 +1,52 @@ +#!/usr/bin/env node +(function () { + "use strict"; + + var fs = require("fs") + , markdown = require("markdown").markdown + , nopt = require("nopt") + , stream + , opts + , buffer = "" + ; + + opts = nopt( + { "dialect": [ "Gruber", "Maruku"] + , "help": Boolean + } + ); + + if (opts.help) { + var name = process.argv[1].split("/").pop() + console.warn( require("util").format( + "usage: %s [--dialect=DIALECT] FILE\n\nValid dialects are Gruber (the default) or Maruku", + name + ) ); + process.exit(0); + } + + var fullpath = opts.argv.remain[0]; + + if (fullpath && fullpath !== "-") { + stream = fs.createReadStream(fullpath); + } else { + stream = process.stdin; + } + stream.resume(); + stream.setEncoding("utf8"); + + stream.on("error", function(error) { + console.error(error.toString()); + process.exit(1); + }); + + stream.on("data", function(data) { + buffer += data; + }); + + stream.on("end", function() { + var html = markdown.toHTML(buffer, opts.dialect); + console.log(html); + }); + +}()) http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/mime ---------------------------------------------------------------------- diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 100755 index 0000000..20b1ffe --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var mime = require('./mime.js'); +var file = process.argv[2]; +var type = mime.lookup(file); + +process.stdout.write(type + '\n'); + http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/mkdirp ---------------------------------------------------------------------- diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 100755 index 0000000..d95de15 --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var mkdirp = require('../'); +var minimist = require('minimist'); +var fs = require('fs'); + +var argv = minimist(process.argv.slice(2), { + alias: { m: 'mode', h: 'help' }, + string: [ 'mode' ] +}); +if (argv.help) { + fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); + return; +} + +var paths = argv._.slice(); +var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; + +(function next () { + if (paths.length === 0) return; + var p = paths.shift(); + + if (mode === undefined) mkdirp(p, cb) + else mkdirp(p, mode, cb) + + function cb (err) { + if (err) { + console.error(err.message); + process.exit(1); + } + else next(); + } +})(); http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/ncp ---------------------------------------------------------------------- diff --git a/node_modules/.bin/ncp b/node_modules/.bin/ncp new file mode 100755 index 0000000..388eaba --- /dev/null +++ b/node_modules/.bin/ncp @@ -0,0 +1,48 @@ +#!/usr/bin/env node + + + + +var ncp = require('../lib/ncp'), + args = process.argv.slice(2), + source, dest; + +if (args.length < 2) { + console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]'); + process.exit(1); +} + +// parse arguments the hard way +function startsWith(str, prefix) { + return str.substr(0, prefix.length) == prefix; +} + +var options = {}; +args.forEach(function (arg) { + if (startsWith(arg, "--limit=")) { + options.limit = parseInt(arg.split('=', 2)[1], 10); + } + if (startsWith(arg, "--filter=")) { + options.filter = new RegExp(arg.split('=', 2)[1]); + } + if (startsWith(arg, "--stoponerr")) { + options.stopOnErr = true; + } +}); + +ncp.ncp(args[0], args[1], options, function (err) { + if (Array.isArray(err)) { + console.error('There were errors during the copy.'); + err.forEach(function (err) { + console.error(err.stack || err.message); + }); + process.exit(1); + } + else if (err) { + console.error('An error has occurred.'); + console.error(err.stack || err.message); + process.exit(1); + } +}); + + http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/nopt ---------------------------------------------------------------------- diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt new file mode 100755 index 0000000..30e9fdb --- /dev/null +++ b/node_modules/.bin/nopt @@ -0,0 +1,51 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/nunjucks-precompile ---------------------------------------------------------------------- diff --git a/node_modules/.bin/nunjucks-precompile b/node_modules/.bin/nunjucks-precompile new file mode 100755 index 0000000..37904b7 --- /dev/null +++ b/node_modules/.bin/nunjucks-precompile @@ -0,0 +1,70 @@ +#!/usr/bin/env node +var path = require('path'); +var precompile = require('../src/precompile').precompile; +var Environment = require('../src/environment').Environment; +var lib = require('../src/lib'); + +var yargs = require('yargs') + + .usage('$0 [-f|--force] [-a|--filters <filters>] [-n|--name <name>] [-i|--include <regex>] [-x|--exclude <regex>] [-w|--wrapper <wrapper>] <path>') + .wrap(80) + + .describe('help', 'Display this help message') + .boolean('help') + .alias('h', 'help') + .alias('?', 'help') + + .describe('force', 'Force compilation to continue on error') + .boolean('force') + .alias('f', 'force') + + .describe('filters', 'Give the compiler a comma-delimited list of asynchronous filters, required for correctly generating code') + .string('filters') + .alias('a', 'filters') + + .describe('name', 'Specify the template name when compiling a single file') + .string('name') + .alias('n', 'n') + + .describe('include', 'Include a file or folder which match the regex but would otherwise be excluded. You can use this flag multiple times') + .string('include' ) + .default('include', ['\\.html$', '\\.jinja$']) + .alias('i', 'include') + + .describe('exclude', 'Exclude a file or folder which match the regex but would otherwise be included. You can use this flag multiple times') + .string('exclude' ) + .default('exclude', []) + .alias('x', 'exclude') + + .describe('wrapper', 'Load a external plugin to change the output format of the precompiled templates (for example, "-w custom" will load a module named "nunjucks-custom")') + .string('wrapper') + .alias('w', 'wrapper') + + .demand(1); + +var argv = yargs.argv; + +if (argv.help) { + yargs.showHelp(); + process.exit(1); +} + +var env = new Environment([]); + +lib.each([].concat(argv.filters).join(',').split(','), function(name) { + env.addFilter(name.trim(), function() {}, true); +}); + +if(argv.wrapper) { + argv.wrapper = require('nunjucks-' + argv.wrapper).wrapper; +} + +console.log(precompile(argv._[0], { + env : env, + force : argv.force, + name : argv.name, + wrapper: argv.wrapper, + + include : [].concat(argv.include), + exclude : [].concat(argv.exclude) +})); http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/rimraf ---------------------------------------------------------------------- diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 100755 index 0000000..1bd5a0d --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1,40 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf <path> [<path> ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + rimraf(args[n], function (er) { + if (er) + throw er + go(n+1) + }) +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/sshpk-conv ---------------------------------------------------------------------- diff --git a/node_modules/.bin/sshpk-conv b/node_modules/.bin/sshpk-conv new file mode 100755 index 0000000..444045a --- /dev/null +++ b/node_modules/.bin/sshpk-conv @@ -0,0 +1,201 @@ +#!/usr/bin/env node +// -*- mode: js -*- +// vim: set filetype=javascript : +// Copyright 2015 Joyent, Inc. All rights reserved. + +var dashdash = require('dashdash'); +var sshpk = require('../lib/index'); +var fs = require('fs'); +var path = require('path'); +var tty = require('tty'); +var readline = require('readline'); +var getPassword = require('getpass').getPass; + +var options = [ + { + names: ['outformat', 't'], + type: 'string', + help: 'Output format' + }, + { + names: ['informat', 'T'], + type: 'string', + help: 'Input format' + }, + { + names: ['file', 'f'], + type: 'string', + help: 'Input file name (default stdin)' + }, + { + names: ['out', 'o'], + type: 'string', + help: 'Output file name (default stdout)' + }, + { + names: ['private', 'p'], + type: 'bool', + help: 'Produce a private key as output' + }, + { + names: ['derive', 'd'], + type: 'string', + help: 'Output a new key derived from this one, with given algo' + }, + { + names: ['identify', 'i'], + type: 'bool', + help: 'Print key metadata instead of converting' + }, + { + names: ['comment', 'c'], + type: 'string', + help: 'Set key comment, if output format supports' + }, + { + names: ['help', 'h'], + type: 'bool', + help: 'Shows this help text' + } +]; + +if (require.main === module) { + var parser = dashdash.createParser({ + options: options + }); + + try { + var opts = parser.parse(process.argv); + } catch (e) { + console.error('sshpk-conv: error: %s', e.message); + process.exit(1); + } + + if (opts.help || opts._args.length > 1) { + var help = parser.help({}).trimRight(); + console.error('sshpk-conv: converts between SSH key formats\n'); + console.error(help); + console.error('\navailable formats:'); + console.error(' - pem, pkcs1 eg id_rsa'); + console.error(' - ssh eg id_rsa.pub'); + console.error(' - pkcs8 format you want for openssl'); + console.error(' - openssh like output of ssh-keygen -o'); + console.error(' - rfc4253 raw OpenSSH wire format'); + process.exit(1); + } + + /* + * Key derivation can only be done on private keys, so use of the -d + * option necessarily implies -p. + */ + if (opts.derive) + opts.private = true; + + var inFile = process.stdin; + var inFileName = 'stdin'; + + var inFilePath; + if (opts.file) { + inFilePath = opts.file; + } else if (opts._args.length === 1) { + inFilePath = opts._args[0]; + } + + if (inFilePath) + inFileName = path.basename(inFilePath); + + try { + if (inFilePath) { + fs.accessSync(inFilePath, fs.R_OK); + inFile = fs.createReadStream(inFilePath); + } + } catch (e) { + console.error('sshpk-conv: error opening input file' + + ': ' + e.name + ': ' + e.message); + process.exit(1); + } + + var outFile = process.stdout; + + try { + if (opts.out && !opts.identify) { + fs.accessSync(path.dirname(opts.out), fs.W_OK); + outFile = fs.createWriteStream(opts.out); + } + } catch (e) { + console.error('sshpk-conv: error opening output file' + + ': ' + e.name + ': ' + e.message); + process.exit(1); + } + + var bufs = []; + inFile.on('readable', function () { + var data; + while ((data = inFile.read())) + bufs.push(data); + }); + var parseOpts = {}; + parseOpts.filename = inFileName; + inFile.on('end', function processKey() { + var buf = Buffer.concat(bufs); + var fmt = 'auto'; + if (opts.informat) + fmt = opts.informat; + var f = sshpk.parseKey; + if (opts.private) + f = sshpk.parsePrivateKey; + try { + var key = f(buf, fmt, parseOpts); + } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + if (err) { + console.log('sshpk-conv: ' + + err.name + ': ' + + err.message); + process.exit(1); + } + parseOpts.passphrase = pw; + processKey(); + }); + return; + } + console.error('sshpk-conv: ' + + e.name + ': ' + e.message); + process.exit(1); + } + + if (opts.derive) + key = key.derive(opts.derive); + + if (opts.comment) + key.comment = opts.comment; + + if (!opts.identify) { + fmt = undefined; + if (opts.outformat) + fmt = opts.outformat; + outFile.write(key.toBuffer(fmt)); + if (fmt === 'ssh' || + (!opts.private && fmt === undefined)) + outFile.write('\n'); + outFile.once('drain', function () { + process.exit(0); + }); + } else { + var kind = 'public'; + if (sshpk.PrivateKey.isPrivateKey(key)) + kind = 'private'; + console.log('%s: a %d bit %s %s key', inFileName, + key.size, key.type.toUpperCase(), kind); + if (key.type === 'ecdsa') + console.log('ECDSA curve: %s', key.curve); + if (key.comment) + console.log('Comment: %s', key.comment); + console.log('Fingerprint:'); + console.log(' ' + key.fingerprint().toString()); + console.log(' ' + key.fingerprint('md5').toString()); + process.exit(0); + } + }); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/sshpk-sign ---------------------------------------------------------------------- diff --git a/node_modules/.bin/sshpk-sign b/node_modules/.bin/sshpk-sign new file mode 100755 index 0000000..673fc98 --- /dev/null +++ b/node_modules/.bin/sshpk-sign @@ -0,0 +1,191 @@ +#!/usr/bin/env node +// -*- mode: js -*- +// vim: set filetype=javascript : +// Copyright 2015 Joyent, Inc. All rights reserved. + +var dashdash = require('dashdash'); +var sshpk = require('../lib/index'); +var fs = require('fs'); +var path = require('path'); +var getPassword = require('getpass').getPass; + +var options = [ + { + names: ['hash', 'H'], + type: 'string', + help: 'Hash algorithm (sha1, sha256, sha384, sha512)' + }, + { + names: ['verbose', 'v'], + type: 'bool', + help: 'Display verbose info about key and hash used' + }, + { + names: ['identity', 'i'], + type: 'string', + help: 'Path to key to use' + }, + { + names: ['file', 'f'], + type: 'string', + help: 'Input filename' + }, + { + names: ['out', 'o'], + type: 'string', + help: 'Output filename' + }, + { + names: ['format', 't'], + type: 'string', + help: 'Signature format (asn1, ssh, raw)' + }, + { + names: ['binary', 'b'], + type: 'bool', + help: 'Output raw binary instead of base64' + }, + { + names: ['help', 'h'], + type: 'bool', + help: 'Shows this help text' + } +]; + +var parseOpts = {}; + +if (require.main === module) { + var parser = dashdash.createParser({ + options: options + }); + + try { + var opts = parser.parse(process.argv); + } catch (e) { + console.error('sshpk-sign: error: %s', e.message); + process.exit(1); + } + + if (opts.help || opts._args.length > 1) { + var help = parser.help({}).trimRight(); + console.error('sshpk-sign: sign data using an SSH key\n'); + console.error(help); + process.exit(1); + } + + if (!opts.identity) { + var help = parser.help({}).trimRight(); + console.error('sshpk-sign: the -i or --identity option ' + + 'is required\n'); + console.error(help); + process.exit(1); + } + + var keyData = fs.readFileSync(opts.identity); + parseOpts.filename = opts.identity; + + run(); +} + +function run() { + var key; + try { + key = sshpk.parsePrivateKey(keyData, 'auto', parseOpts); + } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + parseOpts.passphrase = pw; + run(); + }); + return; + } + console.error('sshpk-sign: error loading private key "' + + opts.identity + '": ' + e.name + ': ' + e.message); + process.exit(1); + } + + var hash = opts.hash || key.defaultHashAlgorithm(); + + var signer; + try { + signer = key.createSign(hash); + } catch (e) { + console.error('sshpk-sign: error creating signer: ' + + e.name + ': ' + e.message); + process.exit(1); + } + + if (opts.verbose) { + console.error('sshpk-sign: using %s-%s with a %d bit key', + key.type, hash, key.size); + } + + var inFile = process.stdin; + var inFileName = 'stdin'; + + var inFilePath; + if (opts.file) { + inFilePath = opts.file; + } else if (opts._args.length === 1) { + inFilePath = opts._args[0]; + } + + if (inFilePath) + inFileName = path.basename(inFilePath); + + try { + if (inFilePath) { + fs.accessSync(inFilePath, fs.R_OK); + inFile = fs.createReadStream(inFilePath); + } + } catch (e) { + console.error('sshpk-sign: error opening input file' + + ': ' + e.name + ': ' + e.message); + process.exit(1); + } + + var outFile = process.stdout; + + try { + if (opts.out && !opts.identify) { + fs.accessSync(path.dirname(opts.out), fs.W_OK); + outFile = fs.createWriteStream(opts.out); + } + } catch (e) { + console.error('sshpk-sign: error opening output file' + + ': ' + e.name + ': ' + e.message); + process.exit(1); + } + + inFile.pipe(signer); + inFile.on('end', function () { + var sig; + try { + sig = signer.sign(); + } catch (e) { + console.error('sshpk-sign: error signing data: ' + + e.name + ': ' + e.message); + process.exit(1); + } + + var fmt = opts.format || 'asn1'; + var output; + try { + output = sig.toBuffer(fmt); + if (!opts.binary) + output = output.toString('base64'); + } catch (e) { + console.error('sshpk-sign: error converting signature' + + ' to ' + fmt + ' format: ' + e.name + ': ' + + e.message); + process.exit(1); + } + + outFile.write(output); + if (!opts.binary) + outFile.write('\n'); + outFile.once('drain', function () { + process.exit(0); + }); + }); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/sshpk-verify ---------------------------------------------------------------------- diff --git a/node_modules/.bin/sshpk-verify b/node_modules/.bin/sshpk-verify new file mode 100755 index 0000000..a1669f4 --- /dev/null +++ b/node_modules/.bin/sshpk-verify @@ -0,0 +1,166 @@ +#!/usr/bin/env node +// -*- mode: js -*- +// vim: set filetype=javascript : +// Copyright 2015 Joyent, Inc. All rights reserved. + +var dashdash = require('dashdash'); +var sshpk = require('../lib/index'); +var fs = require('fs'); +var path = require('path'); + +var options = [ + { + names: ['hash', 'H'], + type: 'string', + help: 'Hash algorithm (sha1, sha256, sha384, sha512)' + }, + { + names: ['verbose', 'v'], + type: 'bool', + help: 'Display verbose info about key and hash used' + }, + { + names: ['identity', 'i'], + type: 'string', + help: 'Path to (public) key to use' + }, + { + names: ['file', 'f'], + type: 'string', + help: 'Input filename' + }, + { + names: ['format', 't'], + type: 'string', + help: 'Signature format (asn1, ssh, raw)' + }, + { + names: ['signature', 's'], + type: 'string', + help: 'base64-encoded signature data' + }, + { + names: ['help', 'h'], + type: 'bool', + help: 'Shows this help text' + } +]; + +if (require.main === module) { + var parser = dashdash.createParser({ + options: options + }); + + try { + var opts = parser.parse(process.argv); + } catch (e) { + console.error('sshpk-verify: error: %s', e.message); + process.exit(3); + } + + if (opts.help || opts._args.length > 1) { + var help = parser.help({}).trimRight(); + console.error('sshpk-verify: sign data using an SSH key\n'); + console.error(help); + process.exit(3); + } + + if (!opts.identity) { + var help = parser.help({}).trimRight(); + console.error('sshpk-verify: the -i or --identity option ' + + 'is required\n'); + console.error(help); + process.exit(3); + } + + if (!opts.signature) { + var help = parser.help({}).trimRight(); + console.error('sshpk-verify: the -s or --signature option ' + + 'is required\n'); + console.error(help); + process.exit(3); + } + + var keyData = fs.readFileSync(opts.identity); + + var key; + try { + key = sshpk.parseKey(keyData); + } catch (e) { + console.error('sshpk-verify: error loading key "' + + opts.identity + '": ' + e.name + ': ' + e.message); + process.exit(2); + } + + var fmt = opts.format || 'asn1'; + var sigData = new Buffer(opts.signature, 'base64'); + + var sig; + try { + sig = sshpk.parseSignature(sigData, key.type, fmt); + } catch (e) { + console.error('sshpk-verify: error parsing signature: ' + + e.name + ': ' + e.message); + process.exit(2); + } + + var hash = opts.hash || key.defaultHashAlgorithm(); + + var verifier; + try { + verifier = key.createVerify(hash); + } catch (e) { + console.error('sshpk-verify: error creating verifier: ' + + e.name + ': ' + e.message); + process.exit(2); + } + + if (opts.verbose) { + console.error('sshpk-verify: using %s-%s with a %d bit key', + key.type, hash, key.size); + } + + var inFile = process.stdin; + var inFileName = 'stdin'; + + var inFilePath; + if (opts.file) { + inFilePath = opts.file; + } else if (opts._args.length === 1) { + inFilePath = opts._args[0]; + } + + if (inFilePath) + inFileName = path.basename(inFilePath); + + try { + if (inFilePath) { + fs.accessSync(inFilePath, fs.R_OK); + inFile = fs.createReadStream(inFilePath); + } + } catch (e) { + console.error('sshpk-verify: error opening input file' + + ': ' + e.name + ': ' + e.message); + process.exit(2); + } + + inFile.pipe(verifier); + inFile.on('end', function () { + var ret; + try { + ret = verifier.verify(sig); + } catch (e) { + console.error('sshpk-verify: error verifying data: ' + + e.name + ': ' + e.message); + process.exit(1); + } + + if (ret) { + console.error('OK'); + process.exit(0); + } + + console.error('NOT OK'); + process.exit(1); + }); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/strip-indent ---------------------------------------------------------------------- diff --git a/node_modules/.bin/strip-indent b/node_modules/.bin/strip-indent new file mode 100755 index 0000000..bcd5f8d --- /dev/null +++ b/node_modules/.bin/strip-indent @@ -0,0 +1,49 @@ +#!/usr/bin/env node +'use strict'; +var fs = require('fs'); +var stdin = require('get-stdin'); +var pkg = require('./package.json'); +var stripIndent = require('./'); +var argv = process.argv.slice(2); +var input = argv[0]; + +function help() { + console.log([ + '', + ' ' + pkg.description, + '', + ' Usage', + ' strip-indent <file>', + ' echo <string> | strip-indent', + '', + ' Example', + ' echo \'\\tunicorn\\n\\t\\tcake\' | strip-indent', + ' unicorn', + ' \tcake' + ].join('\n')); +} + +function init(data) { + console.log(stripIndent(data)); +} + +if (argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +if (process.stdin.isTTY) { + if (!input) { + help(); + return; + } + + init(fs.readFileSync(input, 'utf8')); +} else { + stdin(init); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/stylus ---------------------------------------------------------------------- diff --git a/node_modules/.bin/stylus b/node_modules/.bin/stylus new file mode 100755 index 0000000..775ff76 --- /dev/null +++ b/node_modules/.bin/stylus @@ -0,0 +1,810 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var fs = require('fs') + , stylus = require('../lib/stylus') + , basename = require('path').basename + , dirname = require('path').dirname + , extname = require('path').extname + , resolve = require('path').resolve + , join = require('path').join + , isWindows = process.platform === 'win32'; + +/** + * Arguments. + */ + +var args = process.argv.slice(2); + +/** + * Compare flag. + */ + +var compare = false; + +/** + * Compress flag. + */ + +var compress = false; + +/** + * CSS conversion flag. + */ + +var convertCSS = false; + +/** + * Line numbers flag. + */ + +var linenos = false; + +/** + * CSS class prefix. + */ +var prefix = ''; + +/** + * Print to stdout flag. + */ +var print = false; + +/** + * Firebug flag + */ + +var firebug = false; + +/** + * Sourcemap flag + */ + +var sourcemap = false; + +/** + * Files to processes. + */ + +var files = []; + +/** + * Import paths. + */ + +var paths = []; + +/** + * Destination directory. + */ + +var dest; + +/** + * Watcher hash. + */ + +var watchers; + +/** + * Enable REPL. + */ + +var interactive; + +/** + * Plugins. + */ + +var plugins = []; + +/** + * Optional url() function. + */ + +var urlFunction = false; + +/** + * Include CSS on import. + */ + +var includeCSS = false; + +/** + * Set file imports. + */ + +var imports = []; + +/** + * Resolve relative urls + */ + +var resolveURL = false; + +/** + * Disable cache. + */ + +var disableCache = false; + +/** + * Display dependencies flag. + */ + +var deps = false; + +/** + * Hoist at-rules. + */ + +var hoist = false; + +/** + * Usage docs. + */ + +var usage = [ + '' + , ' Usage: stylus [options] [command] [< in [> out]]' + , ' [file|dir ...]' + , '' + , ' Commands:' + , '' + , ' help [<type>:]<prop> Opens help info at MDN for <prop> in' + , ' your default browser. Optionally' + , ' searches other resources of <type>:' + , ' safari opera w3c ms caniuse quirksmode' + , '' + , ' Options:' + , '' + , ' -i, --interactive Start interactive REPL' + , ' -u, --use <path> Utilize the Stylus plugin at <path>' + , ' -U, --inline Utilize image inlining via data URI support' + , ' -w, --watch Watch file(s) for changes and re-compile' + , ' -o, --out <dir> Output to <dir> when passing files' + , ' -C, --css <src> [dest] Convert CSS input to Stylus' + , ' -I, --include <path> Add <path> to lookup paths' + , ' -c, --compress Compress CSS output' + , ' -d, --compare Display input along with output' + , ' -f, --firebug Emits debug infos in the generated CSS that' + , ' can be used by the FireStylus Firebug plugin' + , ' -l, --line-numbers Emits comments in the generated CSS' + , ' indicating the corresponding Stylus line' + , ' -m, --sourcemap Generates a sourcemap in sourcemaps v3 format' + , ' --sourcemap-inline Inlines sourcemap with full source text in base64 format' + , ' --sourcemap-root <url> "sourceRoot" property of the generated sourcemap' + , ' --sourcemap-base <path> Base <path> from which sourcemap and all sources are relative' + , ' -P, --prefix [prefix] prefix all css classes' + , ' -p, --print Print out the compiled CSS' + , ' --import <file> Import stylus <file>' + , ' --include-css Include regular CSS on @import' + , ' -D, --deps Display dependencies of the compiled file' + , ' --disable-cache Disable caching' + , ' --hoist-atrules Move @import and @charset to the top' + , ' -r, --resolve-url Resolve relative urls inside imports' + , ' --resolve-url-nocheck Like --resolve-url but without file existence check' + , ' -V, --version Display the version of Stylus' + , ' -h, --help Display help information' + , '' +].join('\n'); + +/** + * Handle arguments. + */ + +var arg; +while (args.length) { + arg = args.shift(); + switch (arg) { + case '-h': + case '--help': + console.error(usage); + process.exit(0); + case '-d': + case '--compare': + compare = true; + break; + case '-c': + case '--compress': + compress = true; + break; + case '-C': + case '--css': + convertCSS = true; + break; + case '-f': + case '--firebug': + firebug = true; + break; + case '-l': + case '--line-numbers': + linenos = true; + break; + case '-m': + case '--sourcemap': + sourcemap = {}; + break; + case '--sourcemap-inline': + sourcemap = sourcemap || {}; + sourcemap.inline = true; + break; + case '--sourcemap-root': + var url = args.shift(); + if (!url) throw new Error('--sourcemap-root <url> required'); + sourcemap = sourcemap || {}; + sourcemap.sourceRoot = url; + break; + case '--sourcemap-base': + var path = args.shift(); + if (!path) throw new Error('--sourcemap-base <path> required'); + sourcemap = sourcemap || {}; + sourcemap.basePath = path; + break; + case '-P': + case '--prefix': + prefix = args.shift(); + if (!prefix) throw new Error('--prefix <prefix> required'); + break; + case '-p': + case '--print': + print = true; + break; + case '-V': + case '--version': + console.log(stylus.version); + process.exit(0); + break; + case '-o': + case '--out': + dest = args.shift(); + if (!dest) throw new Error('--out <dir> required'); + break; + case 'help': + var name = args.shift() + , browser = name.split(':'); + if (browser.length > 1) { + name = [].slice.call(browser, 1).join(':'); + browser = browser[0]; + } else { + name = browser[0]; + browser = ''; + } + if (!name) throw new Error('help <property> required'); + help(name); + break; + case '--include-css': + includeCSS = true; + break; + case '--disable-cache': + disableCache = true; + break; + case '--hoist-atrules': + hoist = true; + break; + case '-i': + case '--repl': + case '--interactive': + interactive = true; + break; + case '-I': + case '--include': + var path = args.shift(); + if (!path) throw new Error('--include <path> required'); + paths.push(path); + break; + case '-w': + case '--watch': + watchers = {}; + break; + case '-U': + case '--inline': + args.unshift('--use', 'url'); + break; + case '-u': + case '--use': + var options; + var path = args.shift(); + if (!path) throw new Error('--use <path> required'); + + // options + if ('--with' == args[0]) { + args.shift(); + options = args.shift(); + if (!options) throw new Error('--with <options> required'); + options = eval('(' + options + ')'); + } + + // url support + if ('url' == path) { + urlFunction = options || {}; + } else { + paths.push(dirname(path)); + plugins.push({ path: path, options: options }); + } + break; + case '--import': + var file = args.shift(); + if (!file) throw new Error('--import <file> required'); + imports.push(file); + break; + case '-r': + case '--resolve-url': + resolveURL = {}; + break; + case '--resolve-url-nocheck': + resolveURL = { nocheck: true }; + break; + case '-D': + case '--deps': + deps = true; + break; + default: + files.push(arg); + } +} + +// if --watch is used, assume we are +// not working with stdio + +if (watchers && !files.length) { + files = fs.readdirSync(process.cwd()) + .filter(function(file){ + return file.match(/\.styl$/); + }); +} + +// --sourcemap flag is not working with stdio +if (sourcemap && !files.length) sourcemap = false; + +/** + * Open the default browser to the CSS property `name`. + * + * @param {String} name + */ + +function help(name) { + var url + , exec = require('child_process').exec + , command; + + name = encodeURIComponent(name); + + switch (browser) { + case 'safari': + case 'webkit': + url = 'https://developer.apple.com/library/safari/search/?q=' + name; + break; + case 'opera': + url = 'http://dev.opera.com/search/?term=' + name; + break; + case 'w3c': + url = 'http://www.google.com/search?q=site%3Awww.w3.org%2FTR+' + name; + break; + case 'ms': + url = 'http://social.msdn.microsoft.com/search/en-US/ie?query=' + name + '&refinement=59%2c61'; + break; + case 'caniuse': + url = 'http://caniuse.com/#search=' + name; + break; + case 'quirksmode': + url = 'http://www.google.com/search?q=site%3Awww.quirksmode.org+' + name; + break; + default: + url = 'https://developer.mozilla.org/en/CSS/' + name; + } + + switch (process.platform) { + case 'linux': command = 'x-www-browser'; break; + default: command = 'open'; + } + + exec(command + ' "' + url + '"', function(){ + process.exit(0); + }); +} + +// Compilation options + +if (files.length > 1 && extname(dest) === '.css') { + dest = dirname(dest); +} + +var options = { + filename: 'stdin' + , compress: compress + , firebug: firebug + , linenos: linenos + , sourcemap: sourcemap + , paths: [process.cwd()].concat(paths) + , prefix: prefix + , dest: dest + , 'hoist atrules': hoist +}; + +// Buffer stdin + +var str = ''; + +// Convert CSS to Stylus + +if (convertCSS) { + switch (files.length) { + case 2: + compileCSSFile(files[0], files[1]); + break; + case 1: + var file = files[0]; + compileCSSFile(file, join(dirname(file), basename(file, extname(file))) + '.styl'); + break; + default: + var stdin = process.openStdin(); + stdin.setEncoding('utf8'); + stdin.on('data', function(chunk){ str += chunk; }); + stdin.on('end', function(){ + var out = stylus.convertCSS(str); + console.log(out); + }); + } +} else if (interactive) { + repl(); +} else if (deps) { + // if --deps is used, just display list of the dependencies + // not working with stdio and dirs + displayDeps(); +} else { + if (files.length) { + compileFiles(files); + } else { + compileStdio(); + } +} + +/** + * Start Stylus REPL. + */ + +function repl() { + var options = { cache: false, filename: 'stdin', imports: [join(__dirname, '..', 'lib', 'functions')] } + , parser = new stylus.Parser('', options) + , evaluator = new stylus.Evaluator(parser.parse(), options) + , rl = require('readline') + , repl = rl.createInterface(process.stdin, process.stdout, autocomplete) + , global = evaluator.global.scope; + + // expose BIFs + evaluator.evaluate(); + + // readline + repl.setPrompt('> '); + repl.prompt(); + + // HACK: flat-list auto-complete + function autocomplete(line){ + var out = process.stdout + , keys = Object.keys(global.locals) + , len = keys.length + , words = line.split(/\s+/) + , word = words.pop() + , names = [] + , name + , node + , key; + + // find words that match + for (var i = 0; i < len; ++i) { + key = keys[i]; + if (0 == key.indexOf(word)) { + node = global.lookup(key); + switch (node.nodeName) { + case 'function': + names.push(node.toString()); + break; + default: + names.push(key); + } + } + } + + return [names, line]; + }; + + repl.on('line', function(line){ + if (!line.trim().length) return repl.prompt(); + parser = new stylus.Parser(line, options); + parser.state.push('expression'); + evaluator.return = true; + try { + var expr = parser.parse(); + evaluator.root = expr; + var ret = evaluator.evaluate(); + var node; + while (node = ret.nodes.pop()) { + if (!node.suppress) { + var str = node.toString(); + if ('(' == str[0]) str = str.replace(/^\(|\)$/g, ''); + console.log('\033[90m=> \033[0m' + highlight(str)); + break; + } + } + repl.prompt(); + } catch (err) { + console.error('\033[31merror: %s\033[0m', err.message || err.stack); + repl.prompt(); + } + }); + + repl.on('SIGINT', function(){ + console.log(); + process.exit(0); + }); +} + +/** + * Highlight the given string of Stylus. + */ + +function highlight(str) { + return str + .replace(/(#)?(\d+(\.\d+)?)/g, function($0, $1, $2){ + return $1 ? $0 : '\033[36m' + $2 + '\033[0m'; + }) + .replace(/(#[\da-fA-F]+)/g, '\033[33m$1\033[0m') + .replace(/('.*?'|".*?")/g, '\033[32m$1\033[0m'); +} + +/** + * Convert a CSS file to a Styl file + */ + +function compileCSSFile(file, fileOut) { + fs.stat(file, function(err, stat){ + if (err) throw err; + if (stat.isFile()) { + fs.readFile(file, 'utf8', function(err, str){ + if (err) throw err; + var styl = stylus.convertCSS(str); + fs.writeFile(fileOut, styl, function(err){ + if (err) throw err; + }); + }); + } + }); +} + +/** + * Compile with stdio. + */ + +function compileStdio() { + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function(chunk){ str += chunk; }); + process.stdin.on('end', function(){ + // Compile to css + var style = stylus(str, options); + if (includeCSS) style.set('include css', true); + if (disableCache) style.set('cache', false); + usePlugins(style); + importFiles(style); + style.render(function(err, css){ + if (err) throw err; + if (compare) { + console.log('\n\x1b[1mInput:\x1b[0m'); + console.log(str); + console.log('\n\x1b[1mOutput:\x1b[0m'); + } + console.log(css); + if (compare) console.log(); + }); + }).resume(); +} + +/** + * Compile the given files. + */ + +function compileFiles(files) { + files.forEach(compileFile); +} + +/** + * Display dependencies of the compiled files. + */ + +function displayDeps() { + files.forEach(function(file){ + // ensure file exists + fs.stat(file, function(err, stat){ + if (err) throw err; + fs.readFile(file, 'utf8', function(err, str){ + if (err) throw err; + options.filename = file; + var style = stylus(str, options); + + usePlugins(style); + importFiles(style); + console.log(style.deps().join('\n')); + }); + }); + }); +} + +/** + * Compile the given file. + */ + +function compileFile(file) { + // ensure file exists + fs.stat(file, function(err, stat){ + if (err) throw err; + // file + if (stat.isFile()) { + fs.readFile(file, 'utf8', function(err, str){ + if (err) throw err; + options.filename = file; + options._imports = []; + var style = stylus(str, options); + if (includeCSS) style.set('include css', true); + if (disableCache) style.set('cache', false); + if (sourcemap) style.set('sourcemap', sourcemap); + + usePlugins(style); + importFiles(style); + style.render(function(err, css){ + watchImports(file, options._imports); + if (err) { + if (watchers) { + console.error(err.stack || err.message); + } else { + throw err; + } + } else { + writeFile(file, css); + // write sourcemap + if (sourcemap && !sourcemap.inline) { + writeSourcemap(file, style.sourcemap); + } + } + }); + }); + // directory + } else if (stat.isDirectory()) { + fs.readdir(file, function(err, files){ + if (err) throw err; + files.filter(function(path){ + return path.match(/\.styl$/); + }).map(function(path){ + return join(file, path); + }).forEach(compileFile); + }); + } + }); +} + +/** + * Write the given CSS output. + */ + +function createPath(file, sourceMap) { + var out; + if (files.length === 1 && extname(dest) === '.css') { + return [dest, sourceMap ? '.map' : ''].join(''); + } + // --out support + out = [basename(file, extname(file)), sourceMap ? '.css.map' : '.css'].join(''); + return dest + ? join(dest, out) + : join(dirname(file), out); +} + +function writeFile(file, css) { + // --print support + if (print) return process.stdout.write(css); + var path = createPath(file); + fs.writeFile(path, css, function(err){ + if (err) throw err; + console.log(' \033[90mcompiled\033[0m %s', path); + // --watch support + watch(file, file); + }); +} + +/** +* Write the given sourcemap. +*/ + +function writeSourcemap(file, sourcemap) { + var path = createPath(file, true); + fs.writeFile(path, JSON.stringify(sourcemap), function(err){ + if (err) throw err; + // don't output log message if --print is present + if (!print) console.log(' \033[90mgenerated\033[0m %s', path); + }); +} + +/** + * Watch the given `file` and recompiling `rootFile` when modified. + */ + +function watch(file, rootFile) { + // not watching + if (!watchers) return; + + // already watched + if (watchers[file]) { + watchers[file][rootFile] = true; + return; + } + + // watch the file itself + watchers[file] = {}; + watchers[file][rootFile] = true; + if (print) { + console.error('Stylus CLI Error: Watch and print cannot be used together'); + process.exit(1); + } + console.log(' \033[90mwatching\033[0m %s', file); + // if is windows use fs.watch api instead + // TODO: remove watchFile when fs.watch() works on osx etc + if (isWindows) { + fs.watch(file, function(event) { + if (event === 'change') compile(); + }); + } else { + fs.watchFile(file, { interval: 300 }, function(curr, prev) { + if (curr.mtime > prev.mtime) compile(); + }); + } + + function compile() { + for (var rootFile in watchers[file]) { + compileFile(rootFile); + } + } +} + +/** + * Watch `imports`, re-compiling `file` when they change. + */ + +function watchImports(file, imports) { + imports.forEach(function(imported){ + if (!imported.path) return; + watch(imported.path, file); + }); +} + +/** + * Utilize plugins. + */ + +function usePlugins(style) { + plugins.forEach(function(plugin){ + var path = plugin.path; + var options = plugin.options; + fn = require(/^\.+\//.test(path) ? resolve(path) : path); + if ('function' != typeof fn) { + throw new Error('plugin ' + path + ' does not export a function'); + } + style.use(fn(options)); + }); + + if (urlFunction) { + style.define('url', stylus.url(urlFunction)); + } else if (resolveURL) { + style.define('url', stylus.resolver(resolveURL)); + } +} + +/** + * Imports the indicated files. + */ + +function importFiles(style) { + imports.forEach(function(file) { + style.import(file); + }); +} http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/swig ---------------------------------------------------------------------- diff --git a/node_modules/.bin/swig b/node_modules/.bin/swig new file mode 100755 index 0000000..3240f66 --- /dev/null +++ b/node_modules/.bin/swig @@ -0,0 +1,161 @@ +#!/usr/bin/env node +/*jslint es5: true */ + +var swig = require('../index'), + optimist = require('optimist'), + fs = require('fs'), + path = require('path'), + filters = require('../lib/filters'), + utils = require('../lib/utils'), + uglify = require('uglify-js'); + +var command, + argv = optimist + .usage('\n Usage:\n' + + ' $0 compile [files] [options]\n' + + ' $0 run [files] [options]\n' + + ' $0 render [files] [options]\n' + ) + .describe({ + v: 'Show the Swig version number.', + o: 'Output location.', + h: 'Show this help screen.', + j: 'Variable context as a JSON file.', + c: 'Variable context as a CommonJS-style file. Used only if option `j` is not provided.', + m: 'Minify compiled functions with uglify-js', + 'filters': 'Custom filters as a CommonJS-style file', + 'tags': 'Custom tags as a CommonJS-style file', + 'options': 'Customize Swig\'s Options from a CommonJS-style file', + 'wrap-start': 'Template wrapper beginning for "compile".', + 'wrap-end': 'Template wrapper end for "compile".', + 'method-name': 'Method name to set template to and run from.' + }) + .alias('v', 'version') + .alias('o', 'output') + .default('o', 'stdout') + .alias('h', 'help') + .alias('j', 'json') + .alias('c', 'context') + .alias('m', 'minify') + .default('wrap-start', 'var tpl = ') + .default('wrap-end', ';') + .default('method-name', 'tpl') + .check(function (argv) { + if (argv.v) { + return; + } + + if (!argv._.length) { + throw new Error(''); + } + + command = argv._.shift(); + if (command !== 'compile' && command !== 'render' && command !== 'run') { + throw new Error('Unrecognized command "' + command + '". Use -h for help.'); + } + + if (argv['method-name'] !== 'tpl' && argv['wrap-start'] !== 'var tpl =') { + throw new Error('Cannot use arguments "--method-name" and "--wrap-start" together.'); + } + + if (argv['method-name'] !== 'tpl') { + argv['wrap-start'] = 'var ' + argv['method-name'] + ' = '; + } + }) + .argv, + ctx = {}, + out = function (file, str) { + console.log(str); + }, + efn = function () {}, + anonymous, + files, + fn; + +// What version? +if (argv.v) { + console.log(require('../package').version); + process.exit(0); +} + +// Pull in any context data provided +if (argv.j) { + ctx = JSON.parse(fs.readFileSync(argv.j, 'utf8')); +} else if (argv.c) { + ctx = require(argv.c); +} + +if (argv.o !== 'stdout') { + argv.o += '/'; + argv.o = path.normalize(argv.o); + + try { + fs.mkdirSync(argv.o); + } catch (e) { + if (e.errno !== 47) { + throw e; + } + } + + out = function (file, str) { + file = path.basename(file); + fs.writeFileSync(argv.o + file, str, { flags: 'w' }); + console.log('Wrote', argv.o + file); + }; +} + +// Set any custom filters +if (argv.filters) { + utils.each(require(path.resolve(argv.filters)), function (filter, name) { + swig.setFilter(name, filter); + }); +} + +// Set any custom tags +if (argv.tags) { + utils.each(require(path.resolve(argv.tags)), function (tag, name) { + swig.setTag(name, tag.parse, tag.compile, tag.ends, tag.block); + }); +} + +// Specify swig default options +if (argv.options) { + swig.setDefaults(require(argv.options)); +} + +switch (command) { +case 'compile': + fn = function (file, str) { + var r = swig.precompile(str, { filename: file, locals: ctx }).tpl.toString().replace('anonymous', ''); + + r = argv['wrap-start'] + r + argv['wrap-end']; + + if (argv.m) { + r = uglify.minify(r, { fromString: true }).code; + } + + out(file, r); + }; + break; + +case 'run': + fn = function (file, str) { + (function () { + eval(str); + var __tpl = eval(argv['method-name']); + out(file, __tpl(swig, ctx, filters, utils, efn)); + }()); + }; + break; + +case 'render': + fn = function (file, str) { + out(file, swig.render(str, { filename: file, locals: ctx })); + }; + break; +} + +argv._.forEach(function (file) { + var str = fs.readFileSync(file, 'utf8'); + fn(file, str); +}); http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/4f8fa326/node_modules/.bin/to-title-case ---------------------------------------------------------------------- diff --git a/node_modules/.bin/to-title-case b/node_modules/.bin/to-title-case new file mode 100755 index 0000000..af25a98 --- /dev/null +++ b/node_modules/.bin/to-title-case @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var toTitleCase = require('./to-title-case') + +process.argv.slice(2).forEach(function (a) { + console.log(toTitleCase(a)) +}) +
