refactor: init cypress-cucumber-preprocessor install.
This commit is contained in:
117
node_modules/browserify/bin/advanced.txt
generated
vendored
Normal file
117
node_modules/browserify/bin/advanced.txt
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
Advanced Options:
|
||||
|
||||
--insert-globals, --ig, --fast [default: false]
|
||||
|
||||
Skip detection and always insert definitions for process, global,
|
||||
__filename, and __dirname.
|
||||
|
||||
benefit: faster builds
|
||||
cost: extra bytes
|
||||
|
||||
--insert-global-vars, --igv
|
||||
|
||||
Comma-separated list of global variables to detect and define.
|
||||
Default: __filename,__dirname,process,Buffer,global
|
||||
|
||||
--detect-globals, --dg [default: true]
|
||||
|
||||
Detect the presence of process, global, __filename, and __dirname and define
|
||||
these values when present.
|
||||
|
||||
benefit: npm modules more likely to work
|
||||
cost: slower builds
|
||||
|
||||
--ignore-missing, --im [default: false]
|
||||
|
||||
Ignore `require()` statements that don't resolve to anything.
|
||||
|
||||
--noparse=FILE
|
||||
|
||||
Don't parse FILE at all. This will make bundling much, much faster for giant
|
||||
libs like jquery or threejs.
|
||||
|
||||
--no-builtins
|
||||
|
||||
Turn off builtins. This is handy when you want to run a bundle in node which
|
||||
provides the core builtins.
|
||||
|
||||
--no-commondir
|
||||
|
||||
Turn off setting a commondir. This is useful if you want to preserve the
|
||||
original paths that a bundle was generated with.
|
||||
|
||||
--no-bundle-external
|
||||
|
||||
Turn off bundling of all external modules. This is useful if you only want
|
||||
to bundle your local files.
|
||||
|
||||
--bare
|
||||
|
||||
Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars
|
||||
to just "__filename,__dirname". This is handy if you want to run bundles in
|
||||
node.
|
||||
|
||||
--no-browser-field, --no-bf
|
||||
|
||||
Turn off package.json browser field resolution. This is also handy if you
|
||||
need to run a bundle in node.
|
||||
|
||||
--transform-key
|
||||
|
||||
Instead of the default package.json#browserify#transform field to list
|
||||
all transforms to apply when running browserify, a custom field, like, e.g.
|
||||
package.json#browserify#production or package.json#browserify#staging
|
||||
can be used, by for example running:
|
||||
* `browserify index.js --transform-key=production > bundle.js`
|
||||
* `browserify index.js --transform-key=staging > bundle.js`
|
||||
|
||||
--node
|
||||
|
||||
Alias for --bare and --no-browser-field.
|
||||
|
||||
--full-paths
|
||||
|
||||
Turn off converting module ids into numerical indexes. This is useful for
|
||||
preserving the original paths that a bundle was generated with.
|
||||
|
||||
--deps
|
||||
|
||||
Instead of standard bundle output, print the dependency array generated by
|
||||
module-deps.
|
||||
|
||||
--no-dedupe
|
||||
|
||||
Turn off deduping.
|
||||
|
||||
--list
|
||||
|
||||
Print each file in the dependency graph. Useful for makefiles.
|
||||
|
||||
--extension=EXTENSION
|
||||
|
||||
Consider files with specified EXTENSION as modules, this option can used
|
||||
multiple times.
|
||||
|
||||
--global-transform=MODULE, -g MODULE
|
||||
|
||||
Use a transform module on all files after any ordinary transforms have run.
|
||||
|
||||
--plugin=MODULE, -p MODULE
|
||||
|
||||
Register MODULE as a plugin.
|
||||
|
||||
--preserve-symlinks
|
||||
|
||||
Preserves symlinks when resolving modules.
|
||||
|
||||
Passing arguments to transforms and plugins:
|
||||
|
||||
For -t, -g, and -p, you may use subarg syntax to pass options to the
|
||||
transforms or plugin function as the second parameter. For example:
|
||||
|
||||
-t [ foo -x 3 --beep ]
|
||||
|
||||
will call the `foo` transform for each applicable file by calling:
|
||||
|
||||
foo(file, { x: 3, beep: true })
|
||||
|
260
node_modules/browserify/bin/args.js
generated
vendored
Normal file
260
node_modules/browserify/bin/args.js
generated
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
var browserify = require('../');
|
||||
var path = require('path');
|
||||
var spawn = require('child_process').spawn;
|
||||
var parseShell = require('shell-quote').parse;
|
||||
var insertGlobals = require('insert-module-globals');
|
||||
var duplexer = require('duplexer2');
|
||||
var subarg = require('subarg');
|
||||
var glob = require('glob');
|
||||
var Readable = require('readable-stream').Readable;
|
||||
var xtend = require('xtend');
|
||||
|
||||
module.exports = function (args, opts) {
|
||||
var argv = subarg(args, {
|
||||
'boolean': [
|
||||
'deps', 'pack', 'ig', 'dg', 'im', 'd', 'list', 'builtins',
|
||||
'commondir', 'bare', 'full-paths', 'bundle-external', 'bf',
|
||||
'node', 'preserve-symlinks'
|
||||
],
|
||||
string: [ 's', 'r', 'u', 'x', 't', 'i', 'o', 'e', 'c', 'it' ],
|
||||
alias: {
|
||||
ig: [ 'insert-globals', 'fast' ],
|
||||
dg: [ 'detect-globals', 'detectGlobals', 'dg' ],
|
||||
bf: [ 'browser-field', 'browserField' ],
|
||||
im: 'ignore-missing',
|
||||
it: 'ignore-transform',
|
||||
igv: 'insert-global-vars',
|
||||
d: 'debug',
|
||||
s: 'standalone',
|
||||
noParse: [ 'noparse' ],
|
||||
'full-paths': [ 'fullpaths', 'fullPaths' ],
|
||||
r: 'require',
|
||||
u: 'exclude',
|
||||
x: 'external',
|
||||
t: 'transform',
|
||||
i: 'ignore',
|
||||
o: 'outfile',
|
||||
e: 'entry',
|
||||
c: 'command',
|
||||
bare: 'bear'
|
||||
},
|
||||
'default': {
|
||||
ig: false,
|
||||
im: false,
|
||||
dg: true,
|
||||
d: false,
|
||||
builtins: true,
|
||||
commondir: true,
|
||||
'bundle-external': true,
|
||||
bf: true,
|
||||
dedupe: true,
|
||||
node: false
|
||||
}
|
||||
});
|
||||
|
||||
var entries = argv._.concat(argv.entry)
|
||||
.filter(Boolean).map(function (entry) {
|
||||
if (entry === '-') {
|
||||
var s = process.stdin;
|
||||
if (typeof s.read === 'function') return s;
|
||||
// only needed for 0.8, remove at some point later:
|
||||
var rs = Readable().wrap(s);
|
||||
s.resume();
|
||||
return rs;
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
|
||||
if (argv.igv) {
|
||||
var insertGlobalVars = {};
|
||||
var wantedGlobalVars = argv.igv.split(',');
|
||||
Object.keys(insertGlobals.vars).forEach(function (x) {
|
||||
if (wantedGlobalVars.indexOf(x) === -1) {
|
||||
insertGlobalVars[x] = undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var ignoreTransform = argv['ignore-transform'] || argv.it;
|
||||
var b = browserify(xtend({
|
||||
node: argv.node,
|
||||
bare: argv.bare,
|
||||
noParse: Array.isArray(argv.noParse) ? argv.noParse : [argv.noParse],
|
||||
extensions: [].concat(argv.extension).filter(Boolean).map(function (extension) {
|
||||
if (extension.charAt(0) != '.') {
|
||||
return '.' + extension;
|
||||
} else {
|
||||
return extension
|
||||
}
|
||||
}),
|
||||
ignoreTransform: [].concat(ignoreTransform).filter(Boolean),
|
||||
entries: entries,
|
||||
fullPaths: argv['full-paths'],
|
||||
builtins: argv.builtins === false ? false : undefined,
|
||||
commondir: argv.commondir === false ? false : undefined,
|
||||
bundleExternal: argv['bundle-external'],
|
||||
basedir: argv.basedir,
|
||||
browserField: argv.browserField,
|
||||
transformKey: argv['transform-key'] ? ['browserify', argv['transform-key']] : undefined,
|
||||
dedupe: argv['dedupe'],
|
||||
preserveSymlinks: argv['preserve-symlinks'],
|
||||
|
||||
detectGlobals: argv.detectGlobals,
|
||||
insertGlobals: argv['insert-globals'] || argv.ig,
|
||||
insertGlobalVars: insertGlobalVars,
|
||||
ignoreMissing: argv['ignore-missing'] || argv.im,
|
||||
debug: argv['debug'] || argv.d,
|
||||
standalone: argv['standalone'] || argv.s
|
||||
}, opts));
|
||||
function error (msg) {
|
||||
var e = new Error(msg);
|
||||
process.nextTick(function () { b.emit('error', e) });
|
||||
}
|
||||
b.argv = argv;
|
||||
[].concat(argv.p).concat(argv.plugin).filter(Boolean)
|
||||
.forEach(function (p) {
|
||||
var pf = p, pOpts = {};
|
||||
if (typeof p === 'object') {
|
||||
pf = p._.shift(), pOpts = p;
|
||||
}
|
||||
b.plugin(pf, pOpts);
|
||||
})
|
||||
;
|
||||
|
||||
[].concat(argv.ignore).filter(Boolean)
|
||||
.forEach(function (i) {
|
||||
b._pending ++;
|
||||
glob(i, function (err, files) {
|
||||
if (err) return b.emit('error', err);
|
||||
if (files.length === 0) {
|
||||
b.ignore(i);
|
||||
}
|
||||
else {
|
||||
files.forEach(function (file) { b.ignore(file) });
|
||||
}
|
||||
if (--b._pending === 0) b.emit('_ready');
|
||||
});
|
||||
})
|
||||
;
|
||||
|
||||
[].concat(argv.exclude).filter(Boolean)
|
||||
.forEach(function (u) {
|
||||
b.exclude(u);
|
||||
|
||||
b._pending ++;
|
||||
glob(u, function (err, files) {
|
||||
if (err) return b.emit('error', err);
|
||||
files.forEach(function (file) { b.exclude(file) });
|
||||
if (--b._pending === 0) b.emit('_ready');
|
||||
});
|
||||
})
|
||||
;
|
||||
|
||||
[].concat(argv.require).filter(Boolean)
|
||||
.forEach(function (r) {
|
||||
var xs = splitOnColon(r);
|
||||
b.require(xs[0], { expose: xs.length === 1 ? xs[0] : xs[1] })
|
||||
})
|
||||
;
|
||||
|
||||
// resolve any external files and add them to the bundle as externals
|
||||
[].concat(argv.external).filter(Boolean)
|
||||
.forEach(function (x) {
|
||||
var xs = splitOnColon(x);
|
||||
if (xs.length === 2) {
|
||||
add(xs[0], { expose: xs[1] });
|
||||
}
|
||||
else if (/\*/.test(x)) {
|
||||
b.external(x);
|
||||
glob(x, function (err, files) {
|
||||
files.forEach(function (file) {
|
||||
add(file, {});
|
||||
});
|
||||
});
|
||||
}
|
||||
else add(x, {});
|
||||
|
||||
function add (x, opts) {
|
||||
if (/^[\/.]/.test(x)) b.external(path.resolve(x), opts)
|
||||
else b.external(x, opts)
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
[].concat(argv.transform)
|
||||
.filter(Boolean)
|
||||
.forEach(function (t) { addTransform(t) })
|
||||
;
|
||||
|
||||
[].concat(argv.g).concat(argv['global-transform'])
|
||||
.filter(Boolean)
|
||||
.forEach(function (t) {
|
||||
addTransform(t, { global: true });
|
||||
})
|
||||
;
|
||||
|
||||
function addTransform (t, opts) {
|
||||
if (typeof t === 'string' || typeof t === 'function') {
|
||||
b.transform(opts, t);
|
||||
}
|
||||
else if (t && typeof t === 'object') {
|
||||
if (!t._[0] || typeof t._[0] !== 'string') {
|
||||
return error(
|
||||
'expected first parameter to be a transform string'
|
||||
);
|
||||
}
|
||||
if (opts) Object.keys(opts).forEach(function (key) {
|
||||
t[key] = opts[key];
|
||||
});
|
||||
b.transform(t, t._.shift());
|
||||
}
|
||||
else error('unexpected transform of type ' + typeof t);
|
||||
}
|
||||
|
||||
[].concat(argv.command).filter(Boolean)
|
||||
.forEach(function (c) {
|
||||
var cmd = parseShell(c);
|
||||
b.transform(function (file) {
|
||||
var env = Object.keys(process.env).reduce(function (acc, key) {
|
||||
acc[key] = process.env[key];
|
||||
return acc;
|
||||
}, {});
|
||||
env.FILENAME = file;
|
||||
var ps = spawn(cmd[0], cmd.slice(1), { env: env });
|
||||
var error = '';
|
||||
ps.stderr.on('data', function (buf) { error += buf });
|
||||
|
||||
ps.on('exit', function (code) {
|
||||
if (code === 0) return;
|
||||
console.error([
|
||||
'error running source transform command: ' + c,
|
||||
error.split('\n').join('\n '),
|
||||
''
|
||||
].join('\n'));
|
||||
process.exit(1);
|
||||
});
|
||||
return duplexer(ps.stdin, ps.stdout);
|
||||
});
|
||||
})
|
||||
;
|
||||
|
||||
if (argv.standalone === '') {
|
||||
error('--standalone requires an export name argument');
|
||||
return b;
|
||||
}
|
||||
|
||||
return b;
|
||||
};
|
||||
|
||||
function splitOnColon (f) {
|
||||
var pos = f.lastIndexOf(':');
|
||||
if (pos == -1) {
|
||||
return [f]; // No colon
|
||||
} else {
|
||||
if ((/[a-zA-Z]:[\\/]/.test(f)) && (pos == 1)){
|
||||
return [f]; // Windows path and colon is part of drive name
|
||||
} else {
|
||||
return [f.substr(0, pos), f.substr(pos + 1)];
|
||||
}
|
||||
}
|
||||
}
|
91
node_modules/browserify/bin/cmd.js
generated
vendored
Executable file
91
node_modules/browserify/bin/cmd.js
generated
vendored
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env node
|
||||
var fs = require('fs');
|
||||
var JSONStream = require('JSONStream');
|
||||
var through = require('through2');
|
||||
var mkdirp = require('mkdirp');
|
||||
var path = require('path');
|
||||
|
||||
var b = require('./args')(process.argv.slice(2));
|
||||
process.stdout.on('error', process.exit);
|
||||
|
||||
if ((b.argv._[0] === 'help' && b.argv._[1]) === 'advanced'
|
||||
|| (b.argv.h || b.argv.help) === 'advanced') {
|
||||
return fs.createReadStream(__dirname + '/advanced.txt')
|
||||
.pipe(process.stdout)
|
||||
.on('close', function () { process.exit(1) })
|
||||
;
|
||||
}
|
||||
if (b.argv._[0] === 'help' || b.argv.h || b.argv.help
|
||||
|| (process.argv.length <= 2 && process.stdin.isTTY)) {
|
||||
return fs.createReadStream(__dirname + '/usage.txt')
|
||||
.pipe(process.stdout)
|
||||
.on('close', function () { process.exit(1) })
|
||||
;
|
||||
}
|
||||
if (b.argv.version) {
|
||||
return console.log(require('../package.json').version);
|
||||
}
|
||||
|
||||
b.on('error', errorExit);
|
||||
|
||||
if (b.argv.pack) {
|
||||
process.stdin.pipe(b.pack()).pipe(process.stdout);
|
||||
process.stdin.resume();
|
||||
return;
|
||||
}
|
||||
|
||||
if (b.argv.deps) {
|
||||
var stringify = JSONStream.stringify();
|
||||
stringify.pipe(process.stdout);
|
||||
b.pipeline.get('deps').push(through.obj(
|
||||
function (row, enc, next) { stringify.write(row); next() },
|
||||
function () { stringify.end() }
|
||||
));
|
||||
return b.bundle();
|
||||
}
|
||||
|
||||
if (b.argv.list) {
|
||||
b.pipeline.get('deps').push(through.obj(
|
||||
function (row, enc, next) {
|
||||
console.log(row.file || row.id);
|
||||
next()
|
||||
}
|
||||
));
|
||||
return b.bundle();
|
||||
}
|
||||
|
||||
var bundle = b.bundle();
|
||||
bundle.on('error', errorExit);
|
||||
bundle.on('end', successExit);
|
||||
|
||||
var tmpfile;
|
||||
var outfile = b.argv.o || b.argv.outfile;
|
||||
if (outfile) {
|
||||
mkdirp.sync(path.dirname(outfile));
|
||||
|
||||
// we'll output to a temp file within same filesystem, then atomically overwrite outfile once successful
|
||||
tmpfile = outfile + ".tmp-browserify-" + Math.random().toFixed(20).slice(2)
|
||||
bundle.pipe(fs.createWriteStream(tmpfile));
|
||||
}
|
||||
else {
|
||||
bundle.pipe(process.stdout);
|
||||
}
|
||||
|
||||
function errorExit(err) {
|
||||
if (tmpfile) fs.unlink(tmpfile, function (err) {
|
||||
if (err) /* no-op, we're already exiting unhappily… */;
|
||||
});
|
||||
if (err.stack) {
|
||||
console.error(err.stack);
|
||||
}
|
||||
else {
|
||||
console.error(String(err));
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function successExit() {
|
||||
if (tmpfile && outfile) fs.rename(tmpfile, outfile, function (err) {
|
||||
if (err) errorExit(err);
|
||||
});
|
||||
}
|
34
node_modules/browserify/bin/usage.txt
generated
vendored
Normal file
34
node_modules/browserify/bin/usage.txt
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Usage: browserify [entry files] {OPTIONS}
|
||||
|
||||
Standard Options:
|
||||
|
||||
--outfile, -o Write the browserify bundle to this file.
|
||||
If unspecified, browserify prints to stdout.
|
||||
|
||||
--require, -r A module name or file to bundle.require()
|
||||
Optionally use a colon separator to set the target.
|
||||
|
||||
--entry, -e An entry point of your app
|
||||
|
||||
--ignore, -i Replace a file with an empty stub. Files can be globs.
|
||||
|
||||
--exclude, -u Omit a file from the output bundle. Files can be globs.
|
||||
|
||||
--external, -x Reference a file from another bundle. Files can be globs.
|
||||
|
||||
--transform, -t Use a transform module on top-level files.
|
||||
|
||||
--command, -c Use a transform command on top-level files.
|
||||
|
||||
--standalone -s Generate a UMD bundle for the supplied export name.
|
||||
This bundle works with other module systems and sets the name
|
||||
given as a window global if no module system is found.
|
||||
|
||||
--debug -d Enable source maps that allow you to debug your files
|
||||
separately.
|
||||
|
||||
--help, -h Show this message
|
||||
|
||||
For advanced options, type `browserify --help advanced`.
|
||||
|
||||
Specify a parameter.
|
Reference in New Issue
Block a user