mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
Force yargs 16/17 to resolve to yargs 18 (#17988)
* Force yargs 16 to resolve to yargs 17 * Force yargs 17 to resolve to yargs 18 + backwards compat patch
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
diff --git a/index.mjs b/index.mjs
|
||||
index d65a6f446f48bcce71674425d25f31a867fee6e5..b306dc2a33832664088cf60164f26ad20aa42229 100644
|
||||
--- a/index.mjs
|
||||
+++ b/index.mjs
|
||||
@@ -8,3 +8,31 @@ const Yargs = YargsFactory(esmPlatformShim);
|
||||
export default Yargs;
|
||||
|
||||
export {Yargs as 'module.exports'};
|
||||
+
|
||||
+/*================================================================*\
|
||||
+| Inspided by yarg@17's build/index.cjs |
|
||||
+\*================================================================*/
|
||||
+
|
||||
+import { hideBin } from './helpers/helpers.mjs';
|
||||
+
|
||||
+const processArgv = Yargs(hideBin(process.argv));
|
||||
+
|
||||
+defineGetter(Yargs, 'argv', () => processArgv.argv);
|
||||
+defineGetter(Yargs, '$0', () => processArgv.$0);
|
||||
+defineGetter(Yargs, 'parsed', () => processArgv.parsed);
|
||||
+[
|
||||
+ ...Object.keys(processArgv),
|
||||
+ ...Object.getOwnPropertyNames(processArgv.constructor.prototype),
|
||||
+].forEach(key => {
|
||||
+ if (!Object.hasOwn(Yargs, key) && typeof processArgv[key] === 'function') {
|
||||
+ Yargs[key] = processArgv[key].bind(processArgv);
|
||||
+ }
|
||||
+});
|
||||
+
|
||||
+function defineGetter(obj, key, getter) {
|
||||
+ Object.defineProperty(obj, key, {
|
||||
+ configurable: true,
|
||||
+ enumerable: true,
|
||||
+ get: getter,
|
||||
+ });
|
||||
+}
|
||||
+3
-1
@@ -112,7 +112,9 @@
|
||||
"@babel/plugin-syntax-unicode-sets-regex/@babel/helper-create-regexp-features-plugin": "workspace:*",
|
||||
"interpret@npm:^2.2.0": "patch:interpret@npm%3A3.1.1#~/.yarn/patches/interpret-npm-3.1.1-715bac2bd7.patch",
|
||||
"interpret@npm:^1.0.0": "patch:interpret@npm%3A3.1.1#~/.yarn/patches/interpret-npm-3.1.1-715bac2bd7.patch",
|
||||
"interpret@npm:^3.1.1": "patch:interpret@npm%3A3.1.1#~/.yarn/patches/interpret-npm-3.1.1-715bac2bd7.patch"
|
||||
"interpret@npm:^3.1.1": "patch:interpret@npm%3A3.1.1#~/.yarn/patches/interpret-npm-3.1.1-715bac2bd7.patch",
|
||||
"yargs@npm:^16.2.0": "patch:yargs@npm%3A18.0.0#~/.yarn/patches/yargs-npm-18.0.0-ec82bf7b61.patch",
|
||||
"yargs@npm:^17.7.2": "patch:yargs@npm%3A18.0.0#~/.yarn/patches/yargs-npm-18.0.0-ec82bf7b61.patch"
|
||||
},
|
||||
"engines": {
|
||||
"yarn": ">=1.4.0"
|
||||
|
||||
@@ -8540,25 +8540,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cliui@npm:^7.0.2":
|
||||
version: 7.0.4
|
||||
resolution: "cliui@npm:7.0.4"
|
||||
"cliui@npm:^9.0.1":
|
||||
version: 9.0.1
|
||||
resolution: "cliui@npm:9.0.1"
|
||||
dependencies:
|
||||
string-width: "npm:^4.2.0"
|
||||
strip-ansi: "npm:^6.0.0"
|
||||
wrap-ansi: "npm:^7.0.0"
|
||||
checksum: 10/db858c49af9d59a32d603987e6fddaca2ce716cd4602ba5a2bb3a5af1351eebe82aba8dff3ef3e1b331f7fa9d40ca66e67bdf8e7c327ce0ea959747ead65c0ef
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cliui@npm:^8.0.1":
|
||||
version: 8.0.1
|
||||
resolution: "cliui@npm:8.0.1"
|
||||
dependencies:
|
||||
string-width: "npm:^4.2.0"
|
||||
strip-ansi: "npm:^6.0.1"
|
||||
wrap-ansi: "npm:^7.0.0"
|
||||
checksum: 10/eaa5561aeb3135c2cddf7a3b3f562fc4238ff3b3fc666869ef2adf264be0f372136702f16add9299087fb1907c2e4ec5dbfe83bd24bce815c70a80c6c1a2e950
|
||||
string-width: "npm:^7.2.0"
|
||||
strip-ansi: "npm:^7.1.0"
|
||||
wrap-ansi: "npm:^9.0.0"
|
||||
checksum: 10/df43d8d1c6e3254cbb64b1905310d5f6672c595496a3cbe76946c6d24777136886470686f2772ac9edfe547a74bb70e8017530b3554715aee119efd7752fc0d9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -16578,7 +16567,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3":
|
||||
"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.3":
|
||||
version: 4.2.3
|
||||
resolution: "string-width@npm:4.2.3"
|
||||
dependencies:
|
||||
@@ -16621,7 +16610,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"string-width@npm:^7.0.0":
|
||||
"string-width@npm:^7.0.0, string-width@npm:^7.2.0":
|
||||
version: 7.2.0
|
||||
resolution: "string-width@npm:7.2.0"
|
||||
dependencies:
|
||||
@@ -18380,7 +18369,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0":
|
||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||
version: 7.0.0
|
||||
resolution: "wrap-ansi@npm:7.0.0"
|
||||
dependencies:
|
||||
@@ -18555,7 +18544,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9":
|
||||
"yargs-parser@npm:^20.2.9":
|
||||
version: 20.2.9
|
||||
resolution: "yargs-parser@npm:20.2.9"
|
||||
checksum: 10/0188f430a0f496551d09df6719a9132a3469e47fe2747208b1dd0ab2bb0c512a95d0b081628bbca5400fb20dbf2fabe63d22badb346cecadffdd948b049f3fcc
|
||||
@@ -18569,6 +18558,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs-parser@npm:^22.0.0":
|
||||
version: 22.0.0
|
||||
resolution: "yargs-parser@npm:22.0.0"
|
||||
checksum: 10/f13c42bad6ebed1a587a72f2db5694f5fa772bcaf409a701691d13cf74eb5adfcf61a2611de08807e319b829d3e5e6e1578b16ebe174cae8e8be3bf7b8e7a19e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs-parser@npm:^7.0.0":
|
||||
version: 7.0.0
|
||||
resolution: "yargs-parser@npm:7.0.0"
|
||||
@@ -18590,33 +18586,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs@npm:^16.2.0":
|
||||
version: 16.2.0
|
||||
resolution: "yargs@npm:16.2.0"
|
||||
"yargs@npm:18.0.0":
|
||||
version: 18.0.0
|
||||
resolution: "yargs@npm:18.0.0"
|
||||
dependencies:
|
||||
cliui: "npm:^7.0.2"
|
||||
cliui: "npm:^9.0.1"
|
||||
escalade: "npm:^3.1.1"
|
||||
get-caller-file: "npm:^2.0.5"
|
||||
require-directory: "npm:^2.1.1"
|
||||
string-width: "npm:^4.2.0"
|
||||
string-width: "npm:^7.2.0"
|
||||
y18n: "npm:^5.0.5"
|
||||
yargs-parser: "npm:^20.2.2"
|
||||
checksum: 10/807fa21211d2117135d557f95fcd3c3d390530cda2eca0c840f1d95f0f40209dcfeb5ec18c785a1f3425896e623e3b2681e8bb7b6600060eda1c3f4804e7957e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs@npm:^17.7.2":
|
||||
version: 17.7.2
|
||||
resolution: "yargs@npm:17.7.2"
|
||||
dependencies:
|
||||
cliui: "npm:^8.0.1"
|
||||
escalade: "npm:^3.1.1"
|
||||
get-caller-file: "npm:^2.0.5"
|
||||
require-directory: "npm:^2.1.1"
|
||||
string-width: "npm:^4.2.3"
|
||||
y18n: "npm:^5.0.5"
|
||||
yargs-parser: "npm:^21.1.1"
|
||||
checksum: 10/abb3e37678d6e38ea85485ed86ebe0d1e3464c640d7d9069805ea0da12f69d5a32df8e5625e370f9c96dd1c2dc088ab2d0a4dd32af18222ef3c4224a19471576
|
||||
yargs-parser: "npm:^22.0.0"
|
||||
checksum: 10/5af36234871390386b31cac99f00e79fcbc2ead858a61b30a8ca381c5fde5df8af0b407c36b000d3f774bcbe4aec5833f2f1c915f6ddc49ce97b78176b651801
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -18653,6 +18633,20 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yargs@patch:yargs@npm%3A18.0.0#~/.yarn/patches/yargs-npm-18.0.0-ec82bf7b61.patch":
|
||||
version: 18.0.0
|
||||
resolution: "yargs@patch:yargs@npm%3A18.0.0#~/.yarn/patches/yargs-npm-18.0.0-ec82bf7b61.patch::version=18.0.0&hash=a19fec"
|
||||
dependencies:
|
||||
cliui: "npm:^9.0.1"
|
||||
escalade: "npm:^3.1.1"
|
||||
get-caller-file: "npm:^2.0.5"
|
||||
string-width: "npm:^7.2.0"
|
||||
y18n: "npm:^5.0.5"
|
||||
yargs-parser: "npm:^22.0.0"
|
||||
checksum: 10/740f44dee4dfef0f3d851fa837f17f37f03330b9ad79b3b8897c1ad09293b6f463e9627307850c6df7a5acfeeffe7d6172c5467da4aadb25f5c31cd4ddd1e0a7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yocto-queue@npm:^0.1.0":
|
||||
version: 0.1.0
|
||||
resolution: "yocto-queue@npm:0.1.0"
|
||||
|
||||
Reference in New Issue
Block a user