yargs 18.0.0-candidate.7 → 18.0.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/build/lib/command.js +5 -4
- package/package.json +2 -2
package/build/lib/command.js
CHANGED
|
@@ -58,16 +58,17 @@ export class CommandInstance {
|
|
|
58
58
|
if (supportedExtension) {
|
|
59
59
|
const joined = this.shim.path.join(fullDirPath, file);
|
|
60
60
|
const module = req(joined);
|
|
61
|
-
const
|
|
61
|
+
const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module }));
|
|
62
|
+
const visited = visit(extendableModule, joined, file);
|
|
62
63
|
if (visited) {
|
|
63
64
|
if (this.requireCache.has(joined))
|
|
64
65
|
continue;
|
|
65
66
|
else
|
|
66
67
|
this.requireCache.add(joined);
|
|
67
|
-
if (!
|
|
68
|
-
|
|
68
|
+
if (!extendableModule.command) {
|
|
69
|
+
extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined));
|
|
69
70
|
}
|
|
70
|
-
this.addHandler(
|
|
71
|
+
this.addHandler(extendableModule);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yargs",
|
|
3
|
-
"version": "18.0.0
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "yargs the modern, pirate-themed, successor to optimist.",
|
|
5
5
|
"main": "./index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"get-caller-file": "^2.0.5",
|
|
41
41
|
"string-width": "^7.2.0",
|
|
42
42
|
"y18n": "^5.0.5",
|
|
43
|
-
"yargs-parser": "^
|
|
43
|
+
"yargs-parser": "^22.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/eslint-parser": "^7.26.10",
|