yargs 16.0.4-candidate.0 → 16.1.0
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/CHANGELOG.md +16 -0
- package/README.md +25 -6
- package/browser.mjs +4 -4
- package/build/index.cjs +348 -231
- package/build/lib/argsert.js +9 -5
- package/build/lib/command.js +44 -35
- package/build/lib/completion.js +27 -14
- package/build/lib/middleware.js +5 -3
- package/build/lib/parse-command.js +3 -3
- package/build/lib/usage.js +81 -47
- package/build/lib/utils/apply-extends.js +8 -7
- package/build/lib/utils/is-promise.js +2 -2
- package/build/lib/utils/obj-filter.js +1 -1
- package/build/lib/utils/set-blocking.js +4 -2
- package/build/lib/utils/which-module.js +1 -1
- package/build/lib/validation.js +37 -31
- package/build/lib/yargs-factory.js +126 -83
- package/helpers.mjs +7 -11
- package/index.cjs +17 -17
- package/index.mjs +5 -5
- package/lib/platform-shims/browser.mjs +38 -37
- package/package.json +31 -25
- package/yargs +2 -1
package/package.json
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yargs",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "yargs the modern, pirate-themed, successor to optimist.",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"exports": {
|
|
7
|
-
".":
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
".": [
|
|
8
|
+
{
|
|
9
|
+
"import": "./index.mjs",
|
|
10
|
+
"require": "./index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./index.cjs"
|
|
13
|
+
],
|
|
11
14
|
"./helpers": {
|
|
12
|
-
"import": "./helpers.mjs"
|
|
13
|
-
},
|
|
14
|
-
"./yargs": {
|
|
15
|
+
"import": "./helpers.mjs",
|
|
15
16
|
"require": "./yargs"
|
|
16
|
-
}
|
|
17
|
+
},
|
|
18
|
+
"./yargs": [
|
|
19
|
+
{
|
|
20
|
+
"require": "./yargs"
|
|
21
|
+
},
|
|
22
|
+
"./yargs"
|
|
23
|
+
]
|
|
17
24
|
},
|
|
18
25
|
"type": "module",
|
|
19
|
-
"module": "./
|
|
26
|
+
"module": "./index.mjs",
|
|
20
27
|
"contributors": [
|
|
21
28
|
{
|
|
22
29
|
"name": "Yargs Contributors",
|
|
@@ -36,20 +43,18 @@
|
|
|
36
43
|
"!*.d.ts"
|
|
37
44
|
],
|
|
38
45
|
"dependencies": {
|
|
39
|
-
"cliui": "^7.0.
|
|
40
|
-
"escalade": "^3.
|
|
46
|
+
"cliui": "^7.0.2",
|
|
47
|
+
"escalade": "^3.1.1",
|
|
41
48
|
"get-caller-file": "^2.0.5",
|
|
42
49
|
"require-directory": "^2.1.1",
|
|
43
50
|
"string-width": "^4.2.0",
|
|
44
|
-
"y18n": "^5.0.
|
|
45
|
-
"yargs-parser": "^20.2.
|
|
51
|
+
"y18n": "^5.0.2",
|
|
52
|
+
"yargs-parser": "^20.2.2"
|
|
46
53
|
},
|
|
47
54
|
"devDependencies": {
|
|
48
55
|
"@types/chai": "^4.2.11",
|
|
49
56
|
"@types/mocha": "^8.0.0",
|
|
50
|
-
"@types/node": "^14.
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "^3.0.0",
|
|
52
|
-
"@typescript-eslint/parser": "^3.0.0",
|
|
57
|
+
"@types/node": "^14.11.2",
|
|
53
58
|
"@wessberg/rollup-plugin-ts": "^1.3.2",
|
|
54
59
|
"c8": "^7.0.0",
|
|
55
60
|
"chai": "^4.2.0",
|
|
@@ -58,10 +63,7 @@
|
|
|
58
63
|
"cpr": "^3.0.1",
|
|
59
64
|
"cross-env": "^7.0.2",
|
|
60
65
|
"cross-spawn": "^7.0.0",
|
|
61
|
-
"
|
|
62
|
-
"eslint-plugin-import": "^2.20.1",
|
|
63
|
-
"eslint-plugin-node": "^11.0.0",
|
|
64
|
-
"gts": "^2.0.0-alpha.4",
|
|
66
|
+
"gts": "^3.0.0",
|
|
65
67
|
"hashish": "0.0.4",
|
|
66
68
|
"mocha": "^8.0.0",
|
|
67
69
|
"rimraf": "^3.0.2",
|
|
@@ -73,8 +75,8 @@
|
|
|
73
75
|
"yargs-test-extends": "^1.0.1"
|
|
74
76
|
},
|
|
75
77
|
"scripts": {
|
|
76
|
-
"
|
|
77
|
-
"fix": "standardx --fix '
|
|
78
|
+
"fix": "gts fix && npm run fix:js",
|
|
79
|
+
"fix:js": "standardx --fix '**/*.mjs' && standardx --fix '**/*.cjs' && standardx --fix './*.mjs' && standardx --fix './*.cjs'",
|
|
78
80
|
"posttest": "npm run check",
|
|
79
81
|
"test": "c8 mocha ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
|
|
80
82
|
"test:esm": "c8 mocha ./test/esm/*.mjs --check-leaks",
|
|
@@ -84,7 +86,10 @@
|
|
|
84
86
|
"compile": "rimraf build && tsc",
|
|
85
87
|
"postcompile": "npm run build:cjs",
|
|
86
88
|
"build:cjs": "rollup -c rollup.config.cjs",
|
|
87
|
-
"postbuild:cjs": "rimraf ./build/index.cjs.d.ts"
|
|
89
|
+
"postbuild:cjs": "rimraf ./build/index.cjs.d.ts",
|
|
90
|
+
"check": "gts lint && npm run check:js",
|
|
91
|
+
"check:js": "standardx '**/*.mjs' && standardx '**/*.cjs' && standardx './*.mjs' && standardx './*.cjs'",
|
|
92
|
+
"clean": "gts clean"
|
|
88
93
|
},
|
|
89
94
|
"repository": {
|
|
90
95
|
"type": "git",
|
|
@@ -94,7 +99,8 @@
|
|
|
94
99
|
"standardx": {
|
|
95
100
|
"ignore": [
|
|
96
101
|
"build",
|
|
97
|
-
"**/example/**"
|
|
102
|
+
"**/example/**",
|
|
103
|
+
"**/platform-shims/esm.mjs"
|
|
98
104
|
]
|
|
99
105
|
},
|
|
100
106
|
"keywords": [
|
package/yargs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// TODO: consolidate on using a helpers file at some point in the future, which
|
|
2
2
|
// is the approach currently used to export Parser and applyExtends for ESM:
|
|
3
|
-
const {applyExtends, cjsPlatformShim, Parser, Yargs} = require('./build/index.cjs')
|
|
3
|
+
const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
|
|
4
4
|
Yargs.applyExtends = (config, cwd, mergeExtends) => {
|
|
5
5
|
return applyExtends(config, cwd, mergeExtends, cjsPlatformShim)
|
|
6
6
|
}
|
|
7
|
+
Yargs.hideBin = processArgv.hideBin
|
|
7
8
|
Yargs.Parser = Parser
|
|
8
9
|
module.exports = Yargs
|