Skip to content

Commit 3744cb1

Browse files
committed
Upgrade yargs to v17
1 parent 3aec894 commit 3744cb1

4 files changed

Lines changed: 53 additions & 12 deletions

File tree

deploy/docker/create-docker-context.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const {
2121
// --- cache dependencies data from package.json
2222
const packageDependencyDataCache = {};
2323
const argv = yargs
24+
.version(false) // Because version is a default yargs thing we need to specifically override its normal parsing.
2425
.options({
2526
build: {
2627
description: "Pipe the Docker context straight to Docker.",
@@ -51,6 +52,8 @@ const argv = yargs
5152
type: "string",
5253
array: true,
5354
default: process.env.MAGDA_DOCKER_VERSION
55+
? [process.env.MAGDA_DOCKER_VERSION]
56+
: []
5457
},
5558
output: {
5659
description:
@@ -85,9 +88,6 @@ const argv = yargs
8588
type: "string"
8689
}
8790
})
88-
// Because 'version is a default yargs thing we need to specifically override its normal parsing.
89-
.version(false)
90-
.array("version")
9191
.help().argv;
9292

9393
if (!argv.build && !argv.output) {

deploy/docker/docker-util.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
exports.getVersions = function getVersions(local, version) {
2-
return (
3-
version || [
4-
!local && process.env.npm_package_version
5-
? process.env.npm_package_version
6-
: "latest"
7-
]
8-
);
2+
return version.length > 0
3+
? version
4+
: [
5+
!local && process.env.npm_package_version
6+
? process.env.npm_package_version
7+
: "latest"
8+
];
99
};
1010

1111
exports.getName = function getName(name) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"webpack": "~4.47.0",
9191
"webpack-cli": "^3.3.11",
9292
"webpack-dev-server": "^3.1.14",
93-
"yargs": "^13.3.2"
93+
"yargs": "^17.7.2"
9494
},
9595
"scripts": {
9696
"prepare": "husky install",

yarn.lock

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,6 +3563,15 @@ cliui@^6.0.0:
35633563
strip-ansi "^6.0.0"
35643564
wrap-ansi "^6.2.0"
35653565

3566+
cliui@^8.0.1:
3567+
version "8.0.1"
3568+
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
3569+
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
3570+
dependencies:
3571+
string-width "^4.2.0"
3572+
strip-ansi "^6.0.1"
3573+
wrap-ansi "^7.0.0"
3574+
35663575
clone-buffer@^1.0.0:
35673576
version "1.0.0"
35683577
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
@@ -5821,7 +5830,7 @@ get-caller-file@^1.0.1:
58215830
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
58225831
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
58235832

5824-
get-caller-file@^2.0.1:
5833+
get-caller-file@^2.0.1, get-caller-file@^2.0.5:
58255834
version "2.0.5"
58265835
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
58275836
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
@@ -12175,6 +12184,15 @@ wrap-ansi@^6.2.0:
1217512184
string-width "^4.1.0"
1217612185
strip-ansi "^6.0.0"
1217712186

12187+
wrap-ansi@^7.0.0:
12188+
version "7.0.0"
12189+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
12190+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
12191+
dependencies:
12192+
ansi-styles "^4.0.0"
12193+
string-width "^4.1.0"
12194+
strip-ansi "^6.0.0"
12195+
1217812196
wrappy@1:
1217912197
version "1.0.2"
1218012198
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -12220,6 +12238,11 @@ y18n@^4.0.0:
1222012238
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf"
1222112239
integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
1222212240

12241+
y18n@^5.0.5:
12242+
version "5.0.8"
12243+
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
12244+
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
12245+
1222312246
yallist@^2.1.2:
1222412247
version "2.1.2"
1222512248
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
@@ -12256,6 +12279,11 @@ yargs-parser@^18.1.2:
1225612279
camelcase "^5.0.0"
1225712280
decamelize "^1.2.0"
1225812281

12282+
yargs-parser@^21.1.1:
12283+
version "21.1.1"
12284+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
12285+
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
12286+
1225912287
yargs-parser@^5.0.1:
1226012288
version "5.0.1"
1226112289
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.1.tgz#7ede329c1d8cdbbe209bd25cdb990e9b1ebbb394"
@@ -12297,6 +12325,19 @@ yargs@^15.3.1:
1229712325
y18n "^4.0.0"
1229812326
yargs-parser "^18.1.2"
1229912327

12328+
yargs@^17.7.2:
12329+
version "17.7.2"
12330+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
12331+
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==
12332+
dependencies:
12333+
cliui "^8.0.1"
12334+
escalade "^3.1.1"
12335+
get-caller-file "^2.0.5"
12336+
require-directory "^2.1.1"
12337+
string-width "^4.2.3"
12338+
y18n "^5.0.5"
12339+
yargs-parser "^21.1.1"
12340+
1230012341
yargs@^7.1.0:
1230112342
version "7.1.2"
1230212343
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.2.tgz#63a0a5d42143879fdbb30370741374e0641d55db"

0 commit comments

Comments
 (0)