1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

update minify

This commit is contained in:
s2
2020-02-07 22:55:28 +01:00
parent 439b2733a6
commit 9dc253a6be
77 changed files with 6154 additions and 24560 deletions

37
node_modules/commander/CHANGELOG.md generated vendored
View File

@@ -1,3 +1,40 @@
2.20.3 / 2019-10-11
==================
* Support Node.js 0.10 (Revert #1059)
* Ran "npm unpublish commander@2.20.2". There is no 2.20.2.
2.20.1 / 2019-09-29
==================
* Improve executable subcommand tracking
* Update dev dependencies
2.20.0 / 2019-04-02
==================
* fix: resolve symbolic links completely when hunting for subcommands (#935)
* Update index.d.ts (#930)
* Update Readme.md (#924)
* Remove --save option as it isn't required anymore (#918)
* Add link to the license file (#900)
* Added example of receiving args from options (#858)
* Added missing semicolon (#882)
* Add extension to .eslintrc (#876)
2.19.0 / 2018-10-02
==================
* Removed newline after Options and Commands headers (#864)
* Bugfix - Error output (#862)
* Fix to change default value to string (#856)
2.18.0 / 2018-09-07
==================
* Standardize help output (#853)
* chmod 644 travis.yml (#851)
* add support for execute typescript subcommand via ts-node (#849)
2.17.1 / 2018-08-07
==================

69
node_modules/commander/Readme.md generated vendored
View File

@@ -13,7 +13,7 @@
## Installation
$ npm install commander --save
$ npm install commander
## Option parsing
@@ -45,7 +45,7 @@ console.log(' - %s cheese', program.cheese);
Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false.
Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false.
```js
#!/usr/bin/env node
@@ -65,6 +65,17 @@ if (program.sauce) console.log(' with sauce');
else console.log(' without sauce');
```
To get string arguments from options you will need to use angle brackets <> for required inputs or square brackets [] for optional inputs.
e.g. ```.option('-m --myarg [myVar]', 'my super cool description')```
Then to access the input if it was passed in.
e.g. ```var myInput = program.myarg```
**NOTE**: If you pass a argument without using brackets the example above will return true and not the value passed in.
## Version option
Calling the `version` implicitly adds the `-V` and `--version` options to the command.
@@ -153,7 +164,7 @@ program
.option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
.option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
.parse(process.argv);
console.log(' size: %j', program.size);
console.log(' drink: %j', program.drink);
```
@@ -248,22 +259,19 @@ You can enable `--harmony` option in two ways:
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
```
$ ./examples/pizza --help
$ ./examples/pizza --help
Usage: pizza [options]
Usage: pizza [options]
An application for pizzas ordering
Options:
-h, --help output usage information
-V, --version output the version number
-p, --peppers Add peppers
-P, --pineapple Add pineapple
-b, --bbq Add bbq sauce
-c, --cheese <type> Add the specified type of cheese [marble]
-C, --no-cheese You do not want any cheese
An application for pizzas ordering
Options:
-h, --help output usage information
-V, --version output the version number
-p, --peppers Add peppers
-P, --pineapple Add pineapple
-b, --bbq Add bbq sauce
-c, --cheese <type> Add the specified type of cheese [marble]
-C, --no-cheese You do not want any cheese
```
## Custom help
@@ -271,7 +279,7 @@ You can enable `--harmony` option in two ways:
You can display arbitrary `-h, --help` information
by listening for "--help". Commander will automatically
exit once you are done so that the remainder of your program
does not execute causing undesired behaviours, for example
does not execute causing undesired behaviors, for example
in the following executable "stuff" will not output when
`--help` is used.
@@ -294,11 +302,10 @@ program
// node's emit() is immediate
program.on('--help', function(){
console.log(' Examples:');
console.log('');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
console.log('');
console.log('')
console.log('Examples:');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
});
program.parse(process.argv);
@@ -309,11 +316,9 @@ console.log('stuff');
Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
```
Usage: custom-help [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --foo enable some foo
@@ -321,10 +326,8 @@ Options:
-B, --baz enable some baz
Examples:
$ custom-help --help
$ custom-help -h
```
## .outputHelp(cb)
@@ -402,11 +405,11 @@ program
.action(function(cmd, options){
console.log('exec "%s" using %s mode', cmd, options.exec_mode);
}).on('--help', function() {
console.log(' Examples:');
console.log();
console.log(' $ deploy exec sequential');
console.log(' $ deploy exec async');
console.log();
console.log('');
console.log('Examples:');
console.log('');
console.log(' $ deploy exec sequential');
console.log(' $ deploy exec async');
});
program
@@ -422,4 +425,4 @@ More Demos can be found in the [examples](https://github.com/tj/commander.js/tre
## License
MIT
[MIT](https://github.com/tj/commander.js/blob/master/LICENSE)

66
node_modules/commander/index.js generated vendored
View File

@@ -484,7 +484,7 @@ Command.prototype.parse = function(argv) {
})[0];
}
if (this._execs[name] && typeof this._execs[name] !== 'function') {
if (this._execs[name] === true) {
return this.executeSubCommand(argv, args, parsed.unknown);
} else if (aliasCommand) {
// is alias of a subCommand
@@ -523,27 +523,27 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) {
// executable
var f = argv[1];
// name of the subcommand, link `pm-install`
var bin = basename(f, '.js') + '-' + args[0];
var bin = basename(f, path.extname(f)) + '-' + args[0];
// In case of globally installed, get the base dir where executable
// subcommand file should be located at
var baseDir,
link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
var baseDir;
// when symbolink is relative path
if (link !== f && link.charAt(0) !== '/') {
link = path.join(dirname(f), link);
}
baseDir = dirname(link);
var resolvedLink = fs.realpathSync(f);
baseDir = dirname(resolvedLink);
// prefer local `./<bin>` to bin in the $PATH
var localBin = path.join(baseDir, bin);
// whether bin file is a js script with explicit `.js` extension
// whether bin file is a js script with explicit `.js` or `.ts` extension
var isExplicitJS = false;
if (exists(localBin + '.js')) {
bin = localBin + '.js';
isExplicitJS = true;
} else if (exists(localBin + '.ts')) {
bin = localBin + '.ts';
isExplicitJS = true;
} else if (exists(localBin)) {
bin = localBin;
}
@@ -577,9 +577,9 @@ Command.prototype.executeSubCommand = function(argv, args, unknown) {
proc.on('close', process.exit.bind(process));
proc.on('error', function(err) {
if (err.code === 'ENOENT') {
console.error('\n %s(1) does not exist, try --help\n', bin);
console.error('error: %s(1) does not exist, try --help', bin);
} else if (err.code === 'EACCES') {
console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
console.error('error: %s(1) not executable. try chmod or run with root', bin);
}
process.exit(1);
});
@@ -661,7 +661,7 @@ Command.prototype.parseArgs = function(args, unknown) {
this.unknownOption(unknown[0]);
}
if (this.commands.length === 0 &&
this._args.filter(function(a) { return a.required }).length === 0) {
this._args.filter(function(a) { return a.required; }).length === 0) {
this.emit('command:*');
}
}
@@ -789,9 +789,7 @@ Command.prototype.opts = function() {
*/
Command.prototype.missingArgument = function(name) {
console.error();
console.error(" error: missing required argument `%s'", name);
console.error();
console.error("error: missing required argument `%s'", name);
process.exit(1);
};
@@ -804,13 +802,11 @@ Command.prototype.missingArgument = function(name) {
*/
Command.prototype.optionMissingArgument = function(option, flag) {
console.error();
if (flag) {
console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
console.error("error: option `%s' argument missing, got `%s'", option.flags, flag);
} else {
console.error(" error: option `%s' argument missing", option.flags);
console.error("error: option `%s' argument missing", option.flags);
}
console.error();
process.exit(1);
};
@@ -823,9 +819,7 @@ Command.prototype.optionMissingArgument = function(option, flag) {
Command.prototype.unknownOption = function(flag) {
if (this._allowUnknownOption) return;
console.error();
console.error(" error: unknown option `%s'", flag);
console.error();
console.error("error: unknown option `%s'", flag);
process.exit(1);
};
@@ -837,9 +831,7 @@ Command.prototype.unknownOption = function(flag) {
*/
Command.prototype.variadicArgNotLast = function(name) {
console.error();
console.error(" error: variadic arguments must be last `%s'", name);
console.error();
console.error("error: variadic arguments must be last `%s'", name);
process.exit(1);
};
@@ -1050,7 +1042,7 @@ Command.prototype.optionHelp = function() {
// Append the help information
return this.options.map(function(option) {
return pad(option.flags, width) + ' ' + option.description +
((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : '');
((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : '');
}).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
.join('\n');
};
@@ -1069,12 +1061,11 @@ Command.prototype.commandHelp = function() {
var width = this.padWidth();
return [
' Commands:',
'',
'Commands:',
commands.map(function(cmd) {
var desc = cmd[1] ? ' ' + cmd[1] : '';
return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
}).join('\n').replace(/^/gm, ' '),
}).join('\n').replace(/^/gm, ' '),
''
].join('\n');
};
@@ -1090,17 +1081,17 @@ Command.prototype.helpInformation = function() {
var desc = [];
if (this._description) {
desc = [
' ' + this._description,
this._description,
''
];
var argsDescription = this._argsDescription;
if (argsDescription && this._args.length) {
var width = this.padWidth();
desc.push(' Arguments:');
desc.push('Arguments:');
desc.push('');
this._args.forEach(function(arg) {
desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
});
desc.push('');
}
@@ -1111,8 +1102,7 @@ Command.prototype.helpInformation = function() {
cmdName = cmdName + '|' + this._alias;
}
var usage = [
'',
' Usage: ' + cmdName + ' ' + this.usage(),
'Usage: ' + cmdName + ' ' + this.usage(),
''
];
@@ -1121,9 +1111,8 @@ Command.prototype.helpInformation = function() {
if (commandHelp) cmds = [commandHelp];
var options = [
' Options:',
'',
'' + this.optionHelp().replace(/^/gm, ' '),
'Options:',
'' + this.optionHelp().replace(/^/gm, ' '),
''
];
@@ -1131,7 +1120,6 @@ Command.prototype.helpInformation = function() {
.concat(desc)
.concat(options)
.concat(cmds)
.concat([''])
.join('\n');
};

37
node_modules/commander/package.json generated vendored
View File

@@ -1,27 +1,29 @@
{
"_from": "commander@2.17.x",
"_id": "commander@2.17.1",
"_from": "commander@^2.19.0",
"_id": "commander@2.20.3",
"_inBundle": false,
"_integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
"_integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"_location": "/commander",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "commander@2.17.x",
"raw": "commander@^2.19.0",
"name": "commander",
"escapedName": "commander",
"rawSpec": "2.17.x",
"rawSpec": "^2.19.0",
"saveSpec": null,
"fetchSpec": "2.17.x"
"fetchSpec": "^2.19.0"
},
"_requiredBy": [
"/html-minifier"
"/html-minifier",
"/terser",
"/uglify-js"
],
"_resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"_shasum": "bd77ab7de6de94205ceacc72f1716d29f20a77bf",
"_spec": "commander@2.17.x",
"_where": "F:\\projects\\p\\minifyfromhtml\\node_modules\\html-minifier",
"_resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"_shasum": "fd485e84c03eb4881c20722ba48035e8531aeb33",
"_spec": "commander@^2.19.0",
"_where": "/home/s2/Code/minifyfromhtml/node_modules/html-minifier",
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca"
@@ -34,12 +36,13 @@
"deprecated": false,
"description": "the complete solution for node.js command-line programs",
"devDependencies": {
"@types/node": "^10.5.7",
"eslint": "^5.3.0",
"@types/node": "^12.7.8",
"eslint": "^6.4.0",
"should": "^13.2.3",
"sinon": "^6.1.4",
"standard": "^11.0.1",
"typescript": "^2.9.2"
"sinon": "^7.5.0",
"standard": "^14.3.1",
"ts-node": "^8.4.1",
"typescript": "^3.6.3"
},
"files": [
"index.js",
@@ -65,5 +68,5 @@
"test-typings": "tsc -p tsconfig.json"
},
"typings": "typings/index.d.ts",
"version": "2.17.1"
"version": "2.20.3"
}

View File

@@ -226,9 +226,10 @@ declare namespace local {
* Set the description to `str`.
*
* @param {string} str
* @param {{[argName: string]: string}} argsDescription
* @return {(Command | string)}
*/
description(str: string): Command;
description(str: string, argsDescription?: {[argName: string]: string}): Command;
description(): string;
/**