commander 7.1.0 → 7.2.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 +17 -2
- package/Readme.md +2 -2
- package/index.js +1 -1
- package/package-support.json +16 -0
- package/package.json +16 -6
- package/typings/index.d.ts +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
8
8
|
<!-- markdownlint-disable MD024 -->
|
|
9
9
|
<!-- markdownlint-disable MD004 -->
|
|
10
10
|
|
|
11
|
+
## [7.2.0] (2021-03-26)
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- TypeScript typing for `parent` property on `Command` ([#1475])
|
|
16
|
+
- TypeScript typing for `.attributeName()` on `Option` ([#1483])
|
|
17
|
+
- support information in package ([#1477])
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- improvements to error messages, README, and tests
|
|
22
|
+
- update dependencies
|
|
23
|
+
|
|
11
24
|
## [7.1.0] (2021-02-15)
|
|
12
25
|
|
|
13
26
|
### Added
|
|
@@ -402,10 +415,12 @@ to expand `-fb` to `-f -b` rather than `-f b`.
|
|
|
402
415
|
[#1453]: https://github.com/tj/commander.js/pull/1453
|
|
403
416
|
[#1454]: https://github.com/tj/commander.js/pull/1454
|
|
404
417
|
[#1464]: https://github.com/tj/commander.js/pull/1464
|
|
405
|
-
|
|
406
|
-
|
|
418
|
+
[#1475]: https://github.com/tj/commander.js/pull/1475
|
|
419
|
+
[#1477]: https://github.com/tj/commander.js/pull/1477
|
|
420
|
+
[#1483]: https://github.com/tj/commander.js/pull/1483
|
|
407
421
|
|
|
408
422
|
[Unreleased]: https://github.com/tj/commander.js/compare/master...develop
|
|
423
|
+
[7.2.0]: https://github.com/tj/commander.js/compare/v7.1.0...v7.2.0
|
|
409
424
|
[7.1.0]: https://github.com/tj/commander.js/compare/v7.0.0...v7.1.0
|
|
410
425
|
[7.0.0]: https://github.com/tj/commander.js/compare/v6.2.1...v7.0.0
|
|
411
426
|
[7.0.0-2]: https://github.com/tj/commander.js/compare/v7.0.0-1...v7.0.0-2
|
package/Readme.md
CHANGED
|
@@ -711,7 +711,7 @@ an option for a different purpose in subcommands.
|
|
|
711
711
|
|
|
712
712
|
Example file: [positional-options.js](./examples/positional-options.js)
|
|
713
713
|
|
|
714
|
-
With positional options, the `-b` is a program option in the first line and a subcommand option in the second:
|
|
714
|
+
With positional options, the `-b` is a program option in the first line and a subcommand option in the second line:
|
|
715
715
|
|
|
716
716
|
```sh
|
|
717
717
|
program -b subcommand
|
|
@@ -725,7 +725,7 @@ To use pass through options in a subcommand, the program needs to enable positio
|
|
|
725
725
|
|
|
726
726
|
Example file: [pass-through-options.js](./examples/pass-through-options.js)
|
|
727
727
|
|
|
728
|
-
With pass through options, the `--port=80` is a program option in the line and passed through as a command-argument in the second:
|
|
728
|
+
With pass through options, the `--port=80` is a program option in the first line and passed through as a command-argument in the second line:
|
|
729
729
|
|
|
730
730
|
```sh
|
|
731
731
|
program --port=80 arg
|
package/index.js
CHANGED
|
@@ -1172,7 +1172,7 @@ class Command extends EventEmitter {
|
|
|
1172
1172
|
passThroughOptions(passThrough = true) {
|
|
1173
1173
|
this._passThroughOptions = !!passThrough;
|
|
1174
1174
|
if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {
|
|
1175
|
-
throw new Error('passThroughOptions can not be used without turning on
|
|
1175
|
+
throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');
|
|
1176
1176
|
}
|
|
1177
1177
|
return this;
|
|
1178
1178
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commander",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "the complete solution for node.js command-line programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commander",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint index.js esm.mjs \"tests/**/*.js\"",
|
|
23
|
-
"typescript-lint": "eslint typings/*.ts",
|
|
23
|
+
"typescript-lint": "eslint typings/*.ts tests/*.ts",
|
|
24
24
|
"test": "jest && npm run test-typings",
|
|
25
|
-
"test-esm": "node --experimental-modules ./tests/esm-test.mjs",
|
|
25
|
+
"test-esm": "node --experimental-modules ./tests/esm-imports-test.mjs",
|
|
26
26
|
"test-typings": "tsd",
|
|
27
27
|
"typescript-checkJS": "tsc --allowJS --checkJS index.js --noEmit",
|
|
28
28
|
"test-all": "npm run test && npm run lint && npm run typescript-lint && npm run typescript-checkJS && npm run test-esm"
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"index.js",
|
|
33
33
|
"esm.mjs",
|
|
34
|
-
"typings/index.d.ts"
|
|
34
|
+
"typings/index.d.ts",
|
|
35
|
+
"package-support.json"
|
|
35
36
|
],
|
|
36
37
|
"type": "commonjs",
|
|
37
38
|
"dependencies": {},
|
|
@@ -45,14 +46,23 @@
|
|
|
45
46
|
"eslint-plugin-jest": "^24.1.3",
|
|
46
47
|
"jest": "^26.6.3",
|
|
47
48
|
"standard": "^16.0.3",
|
|
49
|
+
"ts-jest": "^26.5.1",
|
|
48
50
|
"tsd": "^0.14.0",
|
|
49
51
|
"typescript": "^4.1.2"
|
|
50
52
|
},
|
|
51
53
|
"types": "typings/index.d.ts",
|
|
52
54
|
"jest": {
|
|
53
|
-
"
|
|
55
|
+
"testEnvironment": "node",
|
|
56
|
+
"collectCoverage": true,
|
|
57
|
+
"transform": {
|
|
58
|
+
"^.+\\.tsx?$": "ts-jest"
|
|
59
|
+
},
|
|
60
|
+
"testPathIgnorePatterns": [
|
|
61
|
+
"/node_modules/"
|
|
62
|
+
]
|
|
54
63
|
},
|
|
55
64
|
"engines": {
|
|
56
65
|
"node": ">= 10"
|
|
57
|
-
}
|
|
66
|
+
},
|
|
67
|
+
"support": true
|
|
58
68
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -78,6 +78,12 @@ declare namespace commander {
|
|
|
78
78
|
* Return option name.
|
|
79
79
|
*/
|
|
80
80
|
name(): string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Return option name, in a camelcase format that can be used
|
|
84
|
+
* as a object attribute key.
|
|
85
|
+
*/
|
|
86
|
+
attributeName(): string;
|
|
81
87
|
}
|
|
82
88
|
type OptionConstructor = new (flags: string, description?: string) => Option;
|
|
83
89
|
|
|
@@ -156,8 +162,8 @@ declare namespace commander {
|
|
|
156
162
|
|
|
157
163
|
interface Command {
|
|
158
164
|
args: string[];
|
|
159
|
-
|
|
160
165
|
commands: Command[];
|
|
166
|
+
parent: Command | null;
|
|
161
167
|
|
|
162
168
|
/**
|
|
163
169
|
* Set the program version to `str`.
|