@npmcli/config 10.3.1 → 10.4.1
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.
|
@@ -398,14 +398,14 @@ const definitions = {
|
|
|
398
398
|
\`\`\`
|
|
399
399
|
|
|
400
400
|
It is _not_ the path to a certificate file, though you can set a registry-scoped
|
|
401
|
-
"
|
|
401
|
+
"certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
|
|
402
402
|
`,
|
|
403
403
|
deprecated: `
|
|
404
404
|
\`key\` and \`cert\` are no longer used for most registry operations.
|
|
405
|
-
Use registry scoped \`keyfile\` and \`
|
|
405
|
+
Use registry scoped \`keyfile\` and \`certfile\` instead.
|
|
406
406
|
Example:
|
|
407
407
|
//other-registry.tld/:keyfile=/path/to/key.pem
|
|
408
|
-
//other-registry.tld/:
|
|
408
|
+
//other-registry.tld/:certfile=/path/to/cert.crt
|
|
409
409
|
`,
|
|
410
410
|
flatten,
|
|
411
411
|
}),
|
|
@@ -1094,10 +1094,10 @@ const definitions = {
|
|
|
1094
1094
|
`,
|
|
1095
1095
|
deprecated: `
|
|
1096
1096
|
\`key\` and \`cert\` are no longer used for most registry operations.
|
|
1097
|
-
Use registry scoped \`keyfile\` and \`
|
|
1097
|
+
Use registry scoped \`keyfile\` and \`certfile\` instead.
|
|
1098
1098
|
Example:
|
|
1099
1099
|
//other-registry.tld/:keyfile=/path/to/key.pem
|
|
1100
|
-
//other-registry.tld/:
|
|
1100
|
+
//other-registry.tld/:certfile=/path/to/cert.crt
|
|
1101
1101
|
`,
|
|
1102
1102
|
flatten,
|
|
1103
1103
|
}),
|
package/lib/env-replace.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// replace any ${ENV} values with the appropriate environ.
|
|
2
|
+
// optional "?" modifier can be used like this: ${ENV?} so in case of the variable being not defined, it evaluates into empty string.
|
|
2
3
|
|
|
3
|
-
const envExpr = /(?<!\\)(\\*)\$\{([^${}]+)
|
|
4
|
+
const envExpr = /(?<!\\)(\\*)\$\{([^${}?]+)(\?)?\}/g
|
|
4
5
|
|
|
5
|
-
module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => {
|
|
6
|
-
const
|
|
6
|
+
module.exports = (f, env) => f.replace(envExpr, (orig, esc, name, modifier) => {
|
|
7
|
+
const fallback = modifier === '?' ? '' : `$\{${name}}`
|
|
8
|
+
const val = env[name] !== undefined ? env[name] : fallback
|
|
7
9
|
|
|
8
10
|
// consume the escape chars that are relevant.
|
|
9
11
|
if (esc.length % 2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/config",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@npmcli/eslint-config": "^5.0.1",
|
|
35
35
|
"@npmcli/mock-globals": "^1.0.0",
|
|
36
|
-
"@npmcli/template-oss": "4.
|
|
36
|
+
"@npmcli/template-oss": "4.25.1",
|
|
37
37
|
"tap": "^16.3.8"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@npmcli/map-workspaces": "^
|
|
41
|
-
"@npmcli/package-json": "^
|
|
40
|
+
"@npmcli/map-workspaces": "^5.0.0",
|
|
41
|
+
"@npmcli/package-json": "^7.0.0",
|
|
42
42
|
"ci-info": "^4.0.0",
|
|
43
43
|
"ini": "^5.0.0",
|
|
44
44
|
"nopt": "^8.1.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"templateOSS": {
|
|
53
53
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
54
|
-
"version": "4.
|
|
54
|
+
"version": "4.25.1",
|
|
55
55
|
"content": "../../scripts/template-oss/index.js"
|
|
56
56
|
}
|
|
57
57
|
}
|