projen 0.71.38 → 0.71.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps-py.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-py.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/cdk8s-deps-py.js +1 -1
- package/lib/cdk8s/cdk8s-deps.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/cli/cmds/new.js +27 -19
- package/lib/cli/index.js +2 -2
- package/lib/cli/util.d.ts +3 -0
- package/lib/cli/util.js +9 -2
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose/docker-compose-service.js +1 -1
- package/lib/docker-compose/docker-compose.js +1 -1
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/actions-provider.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflow-actions.js +1 -1
- package/lib/github/workflow-jobs.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +4 -4
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +2 -2
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/json-patch.js +1 -1
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +2 -2
- package/lib/projenrc.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest-sample.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/renovatebot.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc-ts.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +3 -3
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/extensions.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/settings.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/cliui/CHANGELOG.md +18 -0
- package/node_modules/cliui/build/index.d.cts +43 -0
- package/node_modules/cliui/package.json +6 -6
- package/node_modules/yargs/README.md +8 -6
- package/node_modules/yargs/browser.d.ts +5 -0
- package/node_modules/yargs/browser.mjs +2 -2
- package/node_modules/yargs/build/index.cjs +1 -2920
- package/node_modules/yargs/build/lib/command.js +277 -210
- package/node_modules/yargs/build/lib/completion-templates.js +5 -4
- package/node_modules/yargs/build/lib/completion.js +201 -86
- package/node_modules/yargs/build/lib/middleware.js +51 -16
- package/node_modules/yargs/build/lib/usage.js +88 -52
- package/node_modules/yargs/build/lib/utils/levenshtein.js +9 -1
- package/node_modules/yargs/build/lib/utils/maybe-async-result.js +17 -0
- package/node_modules/yargs/build/lib/validation.js +51 -54
- package/node_modules/yargs/build/lib/yargs-factory.js +1253 -884
- package/node_modules/yargs/build/lib/yerror.js +3 -1
- package/node_modules/yargs/index.cjs +22 -8
- package/node_modules/yargs/index.mjs +2 -2
- package/node_modules/yargs/lib/platform-shims/browser.mjs +3 -0
- package/node_modules/yargs/lib/platform-shims/esm.mjs +9 -3
- package/node_modules/yargs/locales/cs.json +51 -0
- package/node_modules/yargs/locales/en.json +4 -0
- package/node_modules/yargs/locales/fi.json +1 -1
- package/node_modules/yargs/locales/ko.json +25 -25
- package/node_modules/yargs/locales/ru.json +6 -1
- package/node_modules/yargs/locales/uk_UA.json +51 -0
- package/node_modules/yargs/locales/uz.json +52 -0
- package/node_modules/yargs/locales/zh_TW.json +50 -46
- package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/CHANGELOG.md +45 -0
- package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/index.cjs +25 -17
- package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/index.js +8 -5
- package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/yargs-parser.js +20 -12
- package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/package.json +14 -9
- package/node_modules/yargs/package.json +25 -24
- package/node_modules/yargs/yargs.mjs +10 -0
- package/package.json +2 -2
- package/node_modules/yargs/CHANGELOG.md +0 -88
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/LICENSE.txt +0 -0
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/README.md +0 -0
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/browser.js +0 -0
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/string-utils.js +0 -0
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/tokenize-arg-string.js +0 -0
- /package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/yargs-parser-types.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var util = require('util');
|
|
4
|
-
var fs = require('fs');
|
|
5
4
|
var path = require('path');
|
|
5
|
+
var fs = require('fs');
|
|
6
6
|
|
|
7
7
|
function camelCase(str) {
|
|
8
8
|
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
|
@@ -125,6 +125,7 @@ class YargsParser {
|
|
|
125
125
|
key: undefined
|
|
126
126
|
}, options);
|
|
127
127
|
const args = tokenizeArgString(argsInput);
|
|
128
|
+
const inputIsString = typeof argsInput === 'string';
|
|
128
129
|
const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
|
|
129
130
|
const configuration = Object.assign({
|
|
130
131
|
'boolean-negation': true,
|
|
@@ -255,10 +256,10 @@ class YargsParser {
|
|
|
255
256
|
let m;
|
|
256
257
|
let next;
|
|
257
258
|
let value;
|
|
258
|
-
if (arg !== '--' && isUnknownOptionAsArg(arg)) {
|
|
259
|
+
if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
|
|
259
260
|
pushPositional(arg);
|
|
260
261
|
}
|
|
261
|
-
else if (truncatedArg.match(
|
|
262
|
+
else if (truncatedArg.match(/^---+(=|$)/)) {
|
|
262
263
|
pushPositional(arg);
|
|
263
264
|
continue;
|
|
264
265
|
}
|
|
@@ -272,7 +273,7 @@ class YargsParser {
|
|
|
272
273
|
i = eatNargs(i, m[1], args, m[2]);
|
|
273
274
|
}
|
|
274
275
|
else {
|
|
275
|
-
setArg(m[1], m[2]);
|
|
276
|
+
setArg(m[1], m[2], true);
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
}
|
|
@@ -509,7 +510,7 @@ class YargsParser {
|
|
|
509
510
|
}
|
|
510
511
|
else {
|
|
511
512
|
if (!isUndefined(argAfterEqualSign)) {
|
|
512
|
-
argsToSet.push(processValue(key, argAfterEqualSign));
|
|
513
|
+
argsToSet.push(processValue(key, argAfterEqualSign, true));
|
|
513
514
|
}
|
|
514
515
|
for (let ii = i + 1; ii < args.length; ii++) {
|
|
515
516
|
if ((!configuration['greedy-arrays'] && argsToSet.length > 0) ||
|
|
@@ -519,7 +520,7 @@ class YargsParser {
|
|
|
519
520
|
if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
|
|
520
521
|
break;
|
|
521
522
|
i = ii;
|
|
522
|
-
argsToSet.push(processValue(key, next));
|
|
523
|
+
argsToSet.push(processValue(key, next, inputIsString));
|
|
523
524
|
}
|
|
524
525
|
}
|
|
525
526
|
if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) ||
|
|
@@ -529,14 +530,14 @@ class YargsParser {
|
|
|
529
530
|
setArg(key, argsToSet);
|
|
530
531
|
return i;
|
|
531
532
|
}
|
|
532
|
-
function setArg(key, val) {
|
|
533
|
+
function setArg(key, val, shouldStripQuotes = inputIsString) {
|
|
533
534
|
if (/-/.test(key) && configuration['camel-case-expansion']) {
|
|
534
535
|
const alias = key.split('.').map(function (prop) {
|
|
535
536
|
return camelCase(prop);
|
|
536
537
|
}).join('.');
|
|
537
538
|
addNewAlias(key, alias);
|
|
538
539
|
}
|
|
539
|
-
const value = processValue(key, val);
|
|
540
|
+
const value = processValue(key, val, shouldStripQuotes);
|
|
540
541
|
const splitKey = key.split('.');
|
|
541
542
|
setKey(argv, splitKey, value);
|
|
542
543
|
if (flags.aliases[key]) {
|
|
@@ -580,11 +581,9 @@ class YargsParser {
|
|
|
580
581
|
addNewAlias(alias, key);
|
|
581
582
|
}
|
|
582
583
|
}
|
|
583
|
-
function processValue(key, val) {
|
|
584
|
-
if (
|
|
585
|
-
|
|
586
|
-
val[val.length - 1] === val[0]) {
|
|
587
|
-
val = val.substring(1, val.length - 1);
|
|
584
|
+
function processValue(key, val, shouldStripQuotes) {
|
|
585
|
+
if (shouldStripQuotes) {
|
|
586
|
+
val = stripQuotes(val);
|
|
588
587
|
}
|
|
589
588
|
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
|
|
590
589
|
if (typeof val === 'string')
|
|
@@ -997,12 +996,21 @@ function sanitizeKey(key) {
|
|
|
997
996
|
return '___proto___';
|
|
998
997
|
return key;
|
|
999
998
|
}
|
|
999
|
+
function stripQuotes(val) {
|
|
1000
|
+
return (typeof val === 'string' &&
|
|
1001
|
+
(val[0] === "'" || val[0] === '"') &&
|
|
1002
|
+
val[val.length - 1] === val[0])
|
|
1003
|
+
? val.substring(1, val.length - 1)
|
|
1004
|
+
: val;
|
|
1005
|
+
}
|
|
1000
1006
|
|
|
1007
|
+
var _a, _b, _c;
|
|
1001
1008
|
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
|
|
1002
1009
|
? Number(process.env.YARGS_MIN_NODE_VERSION)
|
|
1003
|
-
:
|
|
1004
|
-
|
|
1005
|
-
|
|
1010
|
+
: 12;
|
|
1011
|
+
const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
|
|
1012
|
+
if (nodeVersion) {
|
|
1013
|
+
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
|
1006
1014
|
if (major < minNodeVersion) {
|
|
1007
1015
|
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
1008
1016
|
}
|
|
@@ -1021,7 +1029,7 @@ const parser = new YargsParser({
|
|
|
1021
1029
|
return require(path);
|
|
1022
1030
|
}
|
|
1023
1031
|
else if (path.match(/\.json$/)) {
|
|
1024
|
-
return fs.readFileSync(path, 'utf8');
|
|
1032
|
+
return JSON.parse(fs.readFileSync(path, 'utf8'));
|
|
1025
1033
|
}
|
|
1026
1034
|
else {
|
|
1027
1035
|
throw Error('only .json config files are supported in ESM');
|
|
@@ -6,18 +6,20 @@
|
|
|
6
6
|
* Copyright (c) 2016, Contributors
|
|
7
7
|
* SPDX-License-Identifier: ISC
|
|
8
8
|
*/
|
|
9
|
+
var _a, _b, _c;
|
|
9
10
|
import { format } from 'util';
|
|
10
|
-
import { readFileSync } from 'fs';
|
|
11
11
|
import { normalize, resolve } from 'path';
|
|
12
12
|
import { camelCase, decamelize, looksLikeNumber } from './string-utils.js';
|
|
13
13
|
import { YargsParser } from './yargs-parser.js';
|
|
14
|
+
import { readFileSync } from 'fs';
|
|
14
15
|
// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
|
|
15
16
|
// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
|
|
16
17
|
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
|
|
17
18
|
? Number(process.env.YARGS_MIN_NODE_VERSION)
|
|
18
|
-
:
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
: 12;
|
|
20
|
+
const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
|
|
21
|
+
if (nodeVersion) {
|
|
22
|
+
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
|
21
23
|
if (major < minNodeVersion) {
|
|
22
24
|
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
23
25
|
}
|
|
@@ -39,7 +41,8 @@ const parser = new YargsParser({
|
|
|
39
41
|
return require(path);
|
|
40
42
|
}
|
|
41
43
|
else if (path.match(/\.json$/)) {
|
|
42
|
-
|
|
44
|
+
// Addresses: https://github.com/yargs/yargs/issues/2040
|
|
45
|
+
return JSON.parse(readFileSync(path, 'utf8'));
|
|
43
46
|
}
|
|
44
47
|
else {
|
|
45
48
|
throw Error('only .json config files are supported in ESM');
|
package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/yargs-parser.js
RENAMED
|
@@ -33,6 +33,9 @@ export class YargsParser {
|
|
|
33
33
|
// allow a string argument to be passed in rather
|
|
34
34
|
// than an argv array.
|
|
35
35
|
const args = tokenizeArgString(argsInput);
|
|
36
|
+
// tokenizeArgString adds extra quotes to args if argsInput is a string
|
|
37
|
+
// only strip those extra quotes in processValue if argsInput is a string
|
|
38
|
+
const inputIsString = typeof argsInput === 'string';
|
|
36
39
|
// aliases might have transitive relationships, normalize this.
|
|
37
40
|
const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
|
|
38
41
|
const configuration = Object.assign({
|
|
@@ -175,11 +178,11 @@ export class YargsParser {
|
|
|
175
178
|
let next;
|
|
176
179
|
let value;
|
|
177
180
|
// any unknown option (except for end-of-options, "--")
|
|
178
|
-
if (arg !== '--' && isUnknownOptionAsArg(arg)) {
|
|
181
|
+
if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
|
|
179
182
|
pushPositional(arg);
|
|
180
183
|
// ---, ---=, ----, etc,
|
|
181
184
|
}
|
|
182
|
-
else if (truncatedArg.match(
|
|
185
|
+
else if (truncatedArg.match(/^---+(=|$)/)) {
|
|
183
186
|
// options without key name are invalid.
|
|
184
187
|
pushPositional(arg);
|
|
185
188
|
continue;
|
|
@@ -200,7 +203,7 @@ export class YargsParser {
|
|
|
200
203
|
i = eatNargs(i, m[1], args, m[2]);
|
|
201
204
|
}
|
|
202
205
|
else {
|
|
203
|
-
setArg(m[1], m[2]);
|
|
206
|
+
setArg(m[1], m[2], true);
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
}
|
|
@@ -474,7 +477,7 @@ export class YargsParser {
|
|
|
474
477
|
else {
|
|
475
478
|
// value in --option=value is eaten as is
|
|
476
479
|
if (!isUndefined(argAfterEqualSign)) {
|
|
477
|
-
argsToSet.push(processValue(key, argAfterEqualSign));
|
|
480
|
+
argsToSet.push(processValue(key, argAfterEqualSign, true));
|
|
478
481
|
}
|
|
479
482
|
for (let ii = i + 1; ii < args.length; ii++) {
|
|
480
483
|
if ((!configuration['greedy-arrays'] && argsToSet.length > 0) ||
|
|
@@ -484,7 +487,7 @@ export class YargsParser {
|
|
|
484
487
|
if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
|
|
485
488
|
break;
|
|
486
489
|
i = ii;
|
|
487
|
-
argsToSet.push(processValue(key, next));
|
|
490
|
+
argsToSet.push(processValue(key, next, inputIsString));
|
|
488
491
|
}
|
|
489
492
|
}
|
|
490
493
|
// If both array and nargs are configured, create an error if less than
|
|
@@ -497,14 +500,14 @@ export class YargsParser {
|
|
|
497
500
|
setArg(key, argsToSet);
|
|
498
501
|
return i;
|
|
499
502
|
}
|
|
500
|
-
function setArg(key, val) {
|
|
503
|
+
function setArg(key, val, shouldStripQuotes = inputIsString) {
|
|
501
504
|
if (/-/.test(key) && configuration['camel-case-expansion']) {
|
|
502
505
|
const alias = key.split('.').map(function (prop) {
|
|
503
506
|
return camelCase(prop);
|
|
504
507
|
}).join('.');
|
|
505
508
|
addNewAlias(key, alias);
|
|
506
509
|
}
|
|
507
|
-
const value = processValue(key, val);
|
|
510
|
+
const value = processValue(key, val, shouldStripQuotes);
|
|
508
511
|
const splitKey = key.split('.');
|
|
509
512
|
setKey(argv, splitKey, value);
|
|
510
513
|
// handle populating aliases of the full key
|
|
@@ -555,12 +558,10 @@ export class YargsParser {
|
|
|
555
558
|
addNewAlias(alias, key);
|
|
556
559
|
}
|
|
557
560
|
}
|
|
558
|
-
function processValue(key, val) {
|
|
561
|
+
function processValue(key, val, shouldStripQuotes) {
|
|
559
562
|
// strings may be quoted, clean this up as we assign values.
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
val[val.length - 1] === val[0]) {
|
|
563
|
-
val = val.substring(1, val.length - 1);
|
|
563
|
+
if (shouldStripQuotes) {
|
|
564
|
+
val = stripQuotes(val);
|
|
564
565
|
}
|
|
565
566
|
// handle parsing boolean arguments --foo=true --bar false.
|
|
566
567
|
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
|
|
@@ -1035,3 +1036,10 @@ function sanitizeKey(key) {
|
|
|
1035
1036
|
return '___proto___';
|
|
1036
1037
|
return key;
|
|
1037
1038
|
}
|
|
1039
|
+
function stripQuotes(val) {
|
|
1040
|
+
return (typeof val === 'string' &&
|
|
1041
|
+
(val[0] === "'" || val[0] === '"') &&
|
|
1042
|
+
val[val.length - 1] === val[0])
|
|
1043
|
+
? val.substring(1, val.length - 1)
|
|
1044
|
+
: val;
|
|
1045
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yargs-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.1.1",
|
|
4
4
|
"description": "the mighty option parser used by yargs",
|
|
5
5
|
"main": "build/index.cjs",
|
|
6
6
|
"exports": {
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"require": "./build/index.cjs"
|
|
11
11
|
},
|
|
12
12
|
"./build/index.cjs"
|
|
13
|
+
],
|
|
14
|
+
"./browser": [
|
|
15
|
+
"./browser.js"
|
|
13
16
|
]
|
|
14
17
|
},
|
|
15
18
|
"type": "module",
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
|
|
20
23
|
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
|
|
21
24
|
"test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
|
|
25
|
+
"test:esm": "c8 --reporter=text --reporter=html mocha test/*.mjs",
|
|
22
26
|
"test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'",
|
|
23
27
|
"pretest:typescript": "npm run pretest",
|
|
24
28
|
"test:typescript": "c8 mocha ./build/test/typescript/*.js",
|
|
@@ -48,11 +52,10 @@
|
|
|
48
52
|
"license": "ISC",
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@types/chai": "^4.2.11",
|
|
51
|
-
"@types/mocha": "^
|
|
52
|
-
"@types/node": "^
|
|
55
|
+
"@types/mocha": "^9.0.0",
|
|
56
|
+
"@types/node": "^16.11.4",
|
|
53
57
|
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
|
54
58
|
"@typescript-eslint/parser": "^3.10.1",
|
|
55
|
-
"@wessberg/rollup-plugin-ts": "^1.2.28",
|
|
56
59
|
"c8": "^7.3.0",
|
|
57
60
|
"chai": "^4.2.0",
|
|
58
61
|
"cross-env": "^7.0.2",
|
|
@@ -60,12 +63,13 @@
|
|
|
60
63
|
"eslint-plugin-import": "^2.20.1",
|
|
61
64
|
"eslint-plugin-node": "^11.0.0",
|
|
62
65
|
"gts": "^3.0.0",
|
|
63
|
-
"mocha": "^
|
|
64
|
-
"puppeteer": "^
|
|
66
|
+
"mocha": "^10.0.0",
|
|
67
|
+
"puppeteer": "^16.0.0",
|
|
65
68
|
"rimraf": "^3.0.2",
|
|
66
69
|
"rollup": "^2.22.1",
|
|
67
70
|
"rollup-plugin-cleanup": "^3.1.1",
|
|
68
|
-
"
|
|
71
|
+
"rollup-plugin-ts": "^3.0.2",
|
|
72
|
+
"serve": "^14.0.0",
|
|
69
73
|
"standardx": "^7.0.0",
|
|
70
74
|
"start-server-and-test": "^1.11.2",
|
|
71
75
|
"ts-transform-default-export": "^1.0.2",
|
|
@@ -74,10 +78,11 @@
|
|
|
74
78
|
"files": [
|
|
75
79
|
"browser.js",
|
|
76
80
|
"build",
|
|
77
|
-
"!*.d.ts"
|
|
81
|
+
"!*.d.ts",
|
|
82
|
+
"!*.d.cts"
|
|
78
83
|
],
|
|
79
84
|
"engines": {
|
|
80
|
-
"node": ">=
|
|
85
|
+
"node": ">=12"
|
|
81
86
|
},
|
|
82
87
|
"standardx": {
|
|
83
88
|
"ignore": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yargs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.7.2",
|
|
4
4
|
"description": "yargs the modern, pirate-themed, successor to optimist.",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"exports": {
|
|
@@ -16,8 +16,13 @@
|
|
|
16
16
|
"import": "./helpers/helpers.mjs",
|
|
17
17
|
"require": "./helpers/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./browser": {
|
|
20
|
+
"import": "./browser.mjs",
|
|
21
|
+
"types": "./browser.d.ts"
|
|
22
|
+
},
|
|
19
23
|
"./yargs": [
|
|
20
24
|
{
|
|
25
|
+
"import": "./yargs.mjs",
|
|
21
26
|
"require": "./yargs"
|
|
22
27
|
},
|
|
23
28
|
"./yargs"
|
|
@@ -33,55 +38,59 @@
|
|
|
33
38
|
],
|
|
34
39
|
"files": [
|
|
35
40
|
"browser.mjs",
|
|
41
|
+
"browser.d.ts",
|
|
36
42
|
"index.cjs",
|
|
37
43
|
"helpers/*.js",
|
|
38
44
|
"helpers/*",
|
|
39
45
|
"index.mjs",
|
|
40
46
|
"yargs",
|
|
47
|
+
"yargs.mjs",
|
|
41
48
|
"build",
|
|
42
49
|
"locales",
|
|
43
50
|
"LICENSE",
|
|
44
51
|
"lib/platform-shims/*.mjs",
|
|
45
|
-
"!*.d.ts"
|
|
52
|
+
"!*.d.ts",
|
|
53
|
+
"!**/*.d.ts"
|
|
46
54
|
],
|
|
47
55
|
"dependencies": {
|
|
48
|
-
"cliui": "^
|
|
56
|
+
"cliui": "^8.0.1",
|
|
49
57
|
"escalade": "^3.1.1",
|
|
50
58
|
"get-caller-file": "^2.0.5",
|
|
51
59
|
"require-directory": "^2.1.1",
|
|
52
|
-
"string-width": "^4.2.
|
|
60
|
+
"string-width": "^4.2.3",
|
|
53
61
|
"y18n": "^5.0.5",
|
|
54
|
-
"yargs-parser": "^
|
|
62
|
+
"yargs-parser": "^21.1.1"
|
|
55
63
|
},
|
|
56
64
|
"devDependencies": {
|
|
57
65
|
"@types/chai": "^4.2.11",
|
|
58
|
-
"@types/mocha": "^
|
|
59
|
-
"@types/node": "^
|
|
60
|
-
"
|
|
61
|
-
"c8": "^7.0.0",
|
|
66
|
+
"@types/mocha": "^9.0.0",
|
|
67
|
+
"@types/node": "^18.0.0",
|
|
68
|
+
"c8": "^7.7.0",
|
|
62
69
|
"chai": "^4.2.0",
|
|
63
70
|
"chalk": "^4.0.0",
|
|
64
71
|
"coveralls": "^3.0.9",
|
|
65
72
|
"cpr": "^3.0.1",
|
|
66
73
|
"cross-env": "^7.0.2",
|
|
67
74
|
"cross-spawn": "^7.0.0",
|
|
75
|
+
"eslint": "^7.23.0",
|
|
68
76
|
"gts": "^3.0.0",
|
|
69
77
|
"hashish": "0.0.4",
|
|
70
|
-
"mocha": "^
|
|
78
|
+
"mocha": "^9.0.0",
|
|
71
79
|
"rimraf": "^3.0.2",
|
|
72
80
|
"rollup": "^2.23.0",
|
|
73
81
|
"rollup-plugin-cleanup": "^3.1.1",
|
|
74
|
-
"
|
|
82
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
83
|
+
"rollup-plugin-ts": "^2.0.4",
|
|
75
84
|
"typescript": "^4.0.2",
|
|
76
85
|
"which": "^2.0.0",
|
|
77
86
|
"yargs-test-extends": "^1.0.1"
|
|
78
87
|
},
|
|
79
88
|
"scripts": {
|
|
80
89
|
"fix": "gts fix && npm run fix:js",
|
|
81
|
-
"fix:js": "
|
|
90
|
+
"fix:js": "eslint . --ext cjs --ext mjs --ext js --fix",
|
|
82
91
|
"posttest": "npm run check",
|
|
83
|
-
"test": "c8 mocha ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
|
|
84
|
-
"test:esm": "c8 mocha ./test/esm/*.mjs --check-leaks",
|
|
92
|
+
"test": "c8 mocha --enable-source-maps ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
|
|
93
|
+
"test:esm": "c8 mocha --enable-source-maps ./test/esm/*.mjs --check-leaks",
|
|
85
94
|
"coverage": "c8 report --check-coverage",
|
|
86
95
|
"prepare": "npm run compile",
|
|
87
96
|
"pretest": "npm run compile -- -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
|
|
@@ -90,7 +99,7 @@
|
|
|
90
99
|
"build:cjs": "rollup -c rollup.config.cjs",
|
|
91
100
|
"postbuild:cjs": "rimraf ./build/index.cjs.d.ts",
|
|
92
101
|
"check": "gts lint && npm run check:js",
|
|
93
|
-
"check:js": "
|
|
102
|
+
"check:js": "eslint . --ext cjs --ext mjs --ext js",
|
|
94
103
|
"clean": "gts clean"
|
|
95
104
|
},
|
|
96
105
|
"repository": {
|
|
@@ -98,14 +107,6 @@
|
|
|
98
107
|
"url": "https://github.com/yargs/yargs.git"
|
|
99
108
|
},
|
|
100
109
|
"homepage": "https://yargs.js.org/",
|
|
101
|
-
"standardx": {
|
|
102
|
-
"ignore": [
|
|
103
|
-
"build",
|
|
104
|
-
"helpers",
|
|
105
|
-
"**/example/**",
|
|
106
|
-
"**/platform-shims/esm.mjs"
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
110
|
"keywords": [
|
|
110
111
|
"argument",
|
|
111
112
|
"args",
|
|
@@ -117,6 +118,6 @@
|
|
|
117
118
|
],
|
|
118
119
|
"license": "MIT",
|
|
119
120
|
"engines": {
|
|
120
|
-
"node": ">=
|
|
121
|
+
"node": ">=12"
|
|
121
122
|
}
|
|
122
123
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// TODO: consolidate on using a helpers file at some point in the future, which
|
|
2
|
+
// is the approach currently used to export Parser and applyExtends for ESM:
|
|
3
|
+
import pkg from './build/index.cjs';
|
|
4
|
+
const {applyExtends, cjsPlatformShim, Parser, processArgv, Yargs} = pkg;
|
|
5
|
+
Yargs.applyExtends = (config, cwd, mergeExtends) => {
|
|
6
|
+
return applyExtends(config, cwd, mergeExtends, cjsPlatformShim);
|
|
7
|
+
};
|
|
8
|
+
Yargs.hideBin = processArgv.hideBin;
|
|
9
|
+
Yargs.Parser = Parser;
|
|
10
|
+
export default Yargs;
|
package/package.json
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"shx": "^0.3.4",
|
|
91
91
|
"xmlbuilder2": "^2.4.1",
|
|
92
92
|
"yaml": "^2.2.2",
|
|
93
|
-
"yargs": "^
|
|
93
|
+
"yargs": "^17.7.2"
|
|
94
94
|
},
|
|
95
95
|
"bundledDependencies": [
|
|
96
96
|
"@iarna/toml",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
},
|
|
121
121
|
"main": "lib/index.js",
|
|
122
122
|
"license": "Apache-2.0",
|
|
123
|
-
"version": "0.71.
|
|
123
|
+
"version": "0.71.39",
|
|
124
124
|
"jest": {
|
|
125
125
|
"maxWorkers": "50%",
|
|
126
126
|
"testMatch": [
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
## [16.2.0](https://www.github.com/yargs/yargs/compare/v16.1.1...v16.2.0) (2020-12-05)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* command() now accepts an array of modules ([f415388](https://www.github.com/yargs/yargs/commit/f415388cc454d02786c65c50dd6c7a0cf9d8b842))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Bug Fixes
|
|
14
|
-
|
|
15
|
-
* add package.json to module exports ([#1818](https://www.github.com/yargs/yargs/issues/1818)) ([d783a49](https://www.github.com/yargs/yargs/commit/d783a49a7f21c9bbd4eec2990268f3244c4d5662)), closes [#1817](https://www.github.com/yargs/yargs/issues/1817)
|
|
16
|
-
|
|
17
|
-
### [16.1.1](https://www.github.com/yargs/yargs/compare/v16.1.0...v16.1.1) (2020-11-15)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* expose helpers for legacy versions of Node.js ([#1801](https://www.github.com/yargs/yargs/issues/1801)) ([107deaa](https://www.github.com/yargs/yargs/commit/107deaa4f68b7bc3f2386041e1f4fe0272b29c0a))
|
|
23
|
-
* **deno:** get yargs working on deno@1.5.x ([#1799](https://www.github.com/yargs/yargs/issues/1799)) ([cb01c98](https://www.github.com/yargs/yargs/commit/cb01c98c44e30f55c2dc9434caef524ae433d9a4))
|
|
24
|
-
|
|
25
|
-
## [16.1.0](https://www.github.com/yargs/yargs/compare/v16.0.3...v16.1.0) (2020-10-15)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Features
|
|
29
|
-
|
|
30
|
-
* expose hideBin helper for CJS ([#1768](https://www.github.com/yargs/yargs/issues/1768)) ([63e1173](https://www.github.com/yargs/yargs/commit/63e1173bb47dc651c151973a16ef659082a9ae66))
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* **deno:** update types for deno ^1.4.0 ([#1772](https://www.github.com/yargs/yargs/issues/1772)) ([0801752](https://www.github.com/yargs/yargs/commit/080175207d281be63edf90adfe4f0568700b0bf5))
|
|
36
|
-
* **exports:** node 13.0-13.6 require a string fallback ([#1776](https://www.github.com/yargs/yargs/issues/1776)) ([b45c43a](https://www.github.com/yargs/yargs/commit/b45c43a5f64b565c3794f9792150eaeec4e00b69))
|
|
37
|
-
* **modules:** module path was incorrect ([#1759](https://www.github.com/yargs/yargs/issues/1759)) ([95a4a0a](https://www.github.com/yargs/yargs/commit/95a4a0ac573cfe158e6e4bc8c8682ebd1644a198))
|
|
38
|
-
* **positional:** positional strings no longer drop decimals ([#1761](https://www.github.com/yargs/yargs/issues/1761)) ([e1a300f](https://www.github.com/yargs/yargs/commit/e1a300f1293ad821c900284616337f080b207980))
|
|
39
|
-
* make positionals in -- count towards validation ([#1752](https://www.github.com/yargs/yargs/issues/1752)) ([eb2b29d](https://www.github.com/yargs/yargs/commit/eb2b29d34f1a41e0fd6c4e841960e5bfc329dc3c))
|
|
40
|
-
|
|
41
|
-
### [16.0.3](https://www.github.com/yargs/yargs/compare/v16.0.2...v16.0.3) (2020-09-10)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### Bug Fixes
|
|
45
|
-
|
|
46
|
-
* move yargs.cjs to yargs to fix Node 10 imports ([#1747](https://www.github.com/yargs/yargs/issues/1747)) ([5bfb85b](https://www.github.com/yargs/yargs/commit/5bfb85b33b85db8a44b5f7a700a8e4dbaf022df0))
|
|
47
|
-
|
|
48
|
-
### [16.0.2](https://www.github.com/yargs/yargs/compare/v16.0.1...v16.0.2) (2020-09-09)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Bug Fixes
|
|
52
|
-
|
|
53
|
-
* **typescript:** yargs-parser was breaking @types/yargs ([#1745](https://www.github.com/yargs/yargs/issues/1745)) ([2253284](https://www.github.com/yargs/yargs/commit/2253284b233cceabd8db677b81c5bf1755eef230))
|
|
54
|
-
|
|
55
|
-
### [16.0.1](https://www.github.com/yargs/yargs/compare/v16.0.0...v16.0.1) (2020-09-09)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### Bug Fixes
|
|
59
|
-
|
|
60
|
-
* code was not passed to process.exit ([#1742](https://www.github.com/yargs/yargs/issues/1742)) ([d1a9930](https://www.github.com/yargs/yargs/commit/d1a993035a2f76c138460052cf19425f9684b637))
|
|
61
|
-
|
|
62
|
-
## [16.0.0](https://www.github.com/yargs/yargs/compare/v15.4.2...v16.0.0) (2020-09-09)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### ⚠ BREAKING CHANGES
|
|
66
|
-
|
|
67
|
-
* tweaks to ESM/Deno API surface: now exports yargs function by default; getProcessArgvWithoutBin becomes hideBin; types now exported for Deno.
|
|
68
|
-
* find-up replaced with escalade; export map added (limits importable files in Node >= 12); yarser-parser@19.x.x (new decamelize/camelcase implementation).
|
|
69
|
-
* **usage:** single character aliases are now shown first in help output
|
|
70
|
-
* rebase helper is no longer provided on yargs instance.
|
|
71
|
-
* drop support for EOL Node 8 (#1686)
|
|
72
|
-
|
|
73
|
-
### Features
|
|
74
|
-
|
|
75
|
-
* adds strictOptions() ([#1738](https://www.github.com/yargs/yargs/issues/1738)) ([b215fba](https://www.github.com/yargs/yargs/commit/b215fba0ed6e124e5aad6cf22c8d5875661c63a3))
|
|
76
|
-
* **helpers:** rebase, Parser, applyExtends now blessed helpers ([#1733](https://www.github.com/yargs/yargs/issues/1733)) ([c7debe8](https://www.github.com/yargs/yargs/commit/c7debe8eb1e5bc6ea20b5ed68026c56e5ebec9e1))
|
|
77
|
-
* adds support for ESM and Deno ([#1708](https://www.github.com/yargs/yargs/issues/1708)) ([ac6d5d1](https://www.github.com/yargs/yargs/commit/ac6d5d105a75711fe703f6a39dad5181b383d6c6))
|
|
78
|
-
* drop support for EOL Node 8 ([#1686](https://www.github.com/yargs/yargs/issues/1686)) ([863937f](https://www.github.com/yargs/yargs/commit/863937f23c3102f804cdea78ee3097e28c7c289f))
|
|
79
|
-
* i18n for ESM and Deno ([#1735](https://www.github.com/yargs/yargs/issues/1735)) ([c71783a](https://www.github.com/yargs/yargs/commit/c71783a5a898a0c0e92ac501c939a3ec411ac0c1))
|
|
80
|
-
* tweaks to API surface based on user feedback ([#1726](https://www.github.com/yargs/yargs/issues/1726)) ([4151fee](https://www.github.com/yargs/yargs/commit/4151fee4c33a97d26bc40de7e623e5b0eb87e9bb))
|
|
81
|
-
* **usage:** single char aliases first in help ([#1574](https://www.github.com/yargs/yargs/issues/1574)) ([a552990](https://www.github.com/yargs/yargs/commit/a552990c120646c2d85a5c9b628e1ce92a68e797))
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
### Bug Fixes
|
|
85
|
-
|
|
86
|
-
* **yargs:** add missing command(module) signature ([#1707](https://www.github.com/yargs/yargs/issues/1707)) ([0f81024](https://www.github.com/yargs/yargs/commit/0f810245494ccf13a35b7786d021b30fc95ecad5)), closes [#1704](https://www.github.com/yargs/yargs/issues/1704)
|
|
87
|
-
|
|
88
|
-
[Older CHANGELOG Entries](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/node_modules/{yargs-parser → yargs/node_modules/yargs-parser}/build/lib/string-utils.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|