Skip to content

Commit 26a5013

Browse files
author
Nathan Fritz
committed
Merge branch 'latest' of github.com:npm/cli into vibailly/isolated-mode
2 parents b9495f6 + 9dc6983 commit 26a5013

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1618
-745
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,3 +846,4 @@ MapleCCC <littlelittlemaple@gmail.com>
846846
Patryk Ludwikowski <psychoxivi@gmail.com>
847847
Takuya N <takninnovationresearch@gmail.com>
848848
Neel Dani <neeldani@github.com>
849+
Anton Rieder <1301152+aried3r@users.noreply.github.com>

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## v8.17.0 (2022-08-10)
4+
5+
### Features
6+
7+
* [`96b6781`](https://github.com/npm/cli/commit/96b6781086143d7285c2c5bf7808c24b2c87e4dd) [#5263](https://github.com/npm/cli/pull/5263) feat(arborist): add option to forcibly skip loading a virtual tree ([@nlf](https://github.com/nlf))
8+
9+
### Bug Fixes
10+
11+
* [`9078e27`](https://github.com/npm/cli/commit/9078e27cef0233d6fc81e0ca824a34fd7685d93c) [#5263](https://github.com/npm/cli/pull/5263) fix(query): tell arborist to load an actual tree, not a virtual one ([@nlf](https://github.com/nlf))
12+
* [`c992fd6`](https://github.com/npm/cli/commit/c992fd6757505974dc8e92a9e2886d2233e098eb) [#5273](https://github.com/npm/cli/pull/5273) fix: look up local command bins from local tree ([@wraithgar](https://github.com/wraithgar))
13+
* [`95ae9f2`](https://github.com/npm/cli/commit/95ae9f2e2555ef592777399bf8fee5206d77f41d) [#5253](https://github.com/npm/cli/pull/5253) fix: only try to run global bin if the bin name exists ([@wraithgar](https://github.com/wraithgar))
14+
* [`daaf461`](https://github.com/npm/cli/commit/daaf4619c85ecf62346770735cfa8e2ddecbef8b) [#5291](https://github.com/npm/cli/pull/5291) fix: ignore global prefix if --prefix is used ([@wraithgar](https://github.com/wraithgar))
15+
16+
### Documentation
17+
18+
* [`f281ec8`](https://github.com/npm/cli/commit/f281ec8a1aec43439281a8fca4c255b0d94a0c94) [#5257](https://github.com/npm/cli/pull/5257) docs: Fix link syntax in `dependency-selectors.md` ([@aried3r](https://github.com/aried3r))
19+
20+
### Dependencies
21+
22+
* [`741bccf`](https://github.com/npm/cli/commit/741bccf24ad1fa420a6c6182e04487abc02f8ccf) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/config@4.2.1`
23+
* [`7f31b85`](https://github.com/npm/cli/commit/7f31b85db650c7a2b3b0577840251f5e25e63a01) [#5284](https://github.com/npm/cli/pull/5284) deps: `nopt@6.0.0`
24+
* [`2569d82`](https://github.com/npm/cli/commit/2569d82d0408e158b4b28cab6f23e1b7dc468553) [#5284](https://github.com/npm/cli/pull/5284) deps: `node-gyp@9.1.0`
25+
* [`a396f8d`](https://github.com/npm/cli/commit/a396f8dd0968971ddb6f491a0bc645132c82021a) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/map-workspaces@2.0.4`
26+
* [`a9b5306`](https://github.com/npm/cli/commit/a9b5306627058b8869a6221a0c099493c206a3f2) [#5284](https://github.com/npm/cli/pull/5284) deps: `is-core-module@2.10.0`
27+
* [`786f753`](https://github.com/npm/cli/commit/786f753b0db49340a0e26ec8fb5425773a7f0558) [#5284](https://github.com/npm/cli/pull/5284) deps: `lru-cache@7.13.2`
28+
* [`7b702b6`](https://github.com/npm/cli/commit/7b702b6d490d37bdfa52b623dd42ce185846b1bc) [#5284](https://github.com/npm/cli/pull/5284) deps: `are-we-there-yet@3.0.1`
29+
* [`e74f99e`](https://github.com/npm/cli/commit/e74f99e7ccdfce1519cc45bb58054d94b748146c) [#5284](https://github.com/npm/cli/pull/5284) deps: `just-diff@5.1.1`
30+
* [`9833066`](https://github.com/npm/cli/commit/983306637579ab5c062878c0153671007cceea2b) [#5284](https://github.com/npm/cli/pull/5284) deps: `just-diff-apply@5.4.1`
31+
* [`4e5dd73`](https://github.com/npm/cli/commit/4e5dd732d7fe39490be1d9f8e81cbdba602c67fe) [#5284](https://github.com/npm/cli/pull/5284) deps: `socks@2.7.0`
32+
* [`d0f5995`](https://github.com/npm/cli/commit/d0f5995e0399a093c8037057150a922e56b1d7ca) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/run-script@4.2.1`
33+
* [`8d870c5`](https://github.com/npm/cli/commit/8d870c56eed20f352695c3c06be07a656ada4ba7) [#5275](https://github.com/npm/cli/pull/5275) deps: `libnpmexec@4.0.10`
34+
335
## v8.16.0 (2022-08-03)
436

537
### Features

docs/content/using-npm/dependency-selectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ arb.loadActual((tree) => {
165165
## See Also
166166

167167
* [npm query](/commands/npm-query)
168-
* [@npmcli/arborist](https://npm.im/@npmcli/arborist]
168+
* [@npmcli/arborist](https://npm.im/@npmcli/arborist)

lib/commands/exec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Exec extends BaseCommand {
3434

3535
const args = [..._args]
3636
const call = this.npm.config.get('call')
37+
let globalPath
3738
const {
3839
flatOptions,
3940
localBin,
@@ -44,6 +45,12 @@ class Exec extends BaseCommand {
4445
const scriptShell = this.npm.config.get('script-shell') || undefined
4546
const packages = this.npm.config.get('package')
4647
const yes = this.npm.config.get('yes')
48+
// --prefix sets both of these to the same thing, meaning the global prefix
49+
// is invalid (i.e. no lib/node_modules). This is not a trivial thing to
50+
// untangle and fix so we work around it here.
51+
if (this.npm.localPrefix !== this.npm.globalPrefix) {
52+
globalPath = path.resolve(globalDir, '..')
53+
}
4754

4855
if (call && _args.length) {
4956
throw this.usageError()
@@ -59,7 +66,7 @@ class Exec extends BaseCommand {
5966
localBin,
6067
locationMsg,
6168
globalBin,
62-
globalPath: path.resolve(globalDir, '..'),
69+
globalPath,
6370
output,
6471
packages,
6572
path: localPrefix,

lib/commands/query.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Query extends BaseCommand {
5858
const opts = {
5959
...this.npm.flatOptions,
6060
path: where,
61+
forceActual: true,
6162
}
6263
const arb = new Arborist(opts)
6364
const tree = await arb.loadActual(opts)

node_modules/@npmcli/config/lib/index.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ class Config {
296296
// might be a security hazard, which was the intention.
297297
try {
298298
this.setCredentialsByURI(reg, creds)
299+
// eslint-disable-next-line no-empty
299300
} catch (_) {}
300301
process.emit('timeEnd', 'config:load:credentials')
301302

@@ -366,9 +367,11 @@ class Config {
366367
if (!/^npm_config_/i.test(envKey) || envVal === '') {
367368
continue
368369
}
369-
const key = envKey.slice('npm_config_'.length)
370-
.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key
371-
.toLowerCase()
370+
let key = envKey.slice('npm_config_'.length)
371+
if (!key.startsWith('//')) { // don't normalize nerf-darted keys
372+
key = key.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key
373+
.toLowerCase()
374+
}
372375
conf[key] = envVal
373376
}
374377
this[_loadObject](conf, 'env', 'environment')
@@ -654,6 +657,7 @@ class Config {
654657
// saved back to the .npmrc file, so we're good.
655658
try {
656659
this.setCredentialsByURI(reg, creds)
660+
// eslint-disable-next-line no-empty
657661
} catch (_) {}
658662
}
659663

@@ -691,8 +695,6 @@ class Config {
691695
this.delete(`_password`, 'user')
692696
this.delete(`username`, 'user')
693697
}
694-
this.delete(`${nerfed}:-authtoken`, 'user')
695-
this.delete(`${nerfed}:_authtoken`, 'user')
696698
this.delete(`${nerfed}:_authToken`, 'user')
697699
this.delete(`${nerfed}:_auth`, 'user')
698700
this.delete(`${nerfed}:_password`, 'user')
@@ -732,8 +734,6 @@ class Config {
732734
// send auth if we have it, only to the URIs under the nerf dart.
733735
this.delete(`${nerfed}:always-auth`, 'user')
734736

735-
this.delete(`${nerfed}:-authtoken`, 'user')
736-
this.delete(`${nerfed}:_authtoken`, 'user')
737737
this.delete(`${nerfed}:email`, 'user')
738738
if (certfile && keyfile) {
739739
this.set(`${nerfed}:certfile`, certfile, 'user')
@@ -781,8 +781,6 @@ class Config {
781781
}
782782

783783
const tokenReg = this.get(`${nerfed}:_authToken`) ||
784-
this.get(`${nerfed}:_authtoken`) ||
785-
this.get(`${nerfed}:-authtoken`) ||
786784
nerfed === nerfDart(this.get('registry')) && this.get('_authToken')
787785

788786
if (tokenReg) {

node_modules/@npmcli/config/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/config",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"files": [
55
"bin/",
66
"lib/"
@@ -38,7 +38,7 @@
3838
"@npmcli/map-workspaces": "^2.0.2",
3939
"ini": "^3.0.0",
4040
"mkdirp-infer-owner": "^2.0.0",
41-
"nopt": "^5.0.0",
41+
"nopt": "^6.0.0",
4242
"proc-log": "^2.0.0",
4343
"read-package-json-fast": "^2.0.3",
4444
"semver": "^7.3.5",

node_modules/@npmcli/map-workspaces/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function appendNegatedPatterns (patterns) {
1212
for (let pattern of patterns) {
1313
const excl = pattern.match(/^!+/)
1414
if (excl) {
15-
pattern = pattern.substr(excl[0].length)
15+
pattern = pattern.slice(excl[0].length)
1616
}
1717

1818
// strip off any / from the start of the pattern. /foo => foo

node_modules/@npmcli/map-workspaces/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/map-workspaces",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"main": "lib/index.js",
55
"files": [
66
"bin/",
@@ -42,7 +42,7 @@
4242
},
4343
"devDependencies": {
4444
"@npmcli/eslint-config": "^3.0.1",
45-
"@npmcli/template-oss": "3.4.1",
45+
"@npmcli/template-oss": "3.5.0",
4646
"tap": "^16.0.1"
4747
},
4848
"dependencies": {
@@ -53,6 +53,6 @@
5353
},
5454
"templateOSS": {
5555
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
56-
"version": "3.4.1"
56+
"version": "3.5.0"
5757
}
5858
}

node_modules/@npmcli/run-script/lib/escape.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ const cmd = (input, doubleEscape) => {
3636
}
3737

3838
// and finally, prefix shell meta chars with a ^
39-
result = result.replace(/[ !^&()<>|"]/g, '^$&')
39+
result = result.replace(/[ !%^&()<>|"]/g, '^$&')
4040
if (doubleEscape) {
41-
result = result.replace(/[ !^&()<>|"]/g, '^$&')
41+
result = result.replace(/[ !%^&()<>|"]/g, '^$&')
4242
}
4343

44-
// except for % which is escaped with another %, and only once
45-
result = result.replace(/%/g, '%%')
46-
4744
return result
4845
}
4946

@@ -65,13 +62,7 @@ const sh = (input) => {
6562
return result
6663
}
6764

68-
// disabling the no-control-regex rule for this line as we very specifically _do_ want to
69-
// replace those characters if they somehow exist at this point, which is highly unlikely
70-
// eslint-disable-next-line no-control-regex
71-
const filename = (input) => input.replace(/[<>:"/\\|?*\x00-\x1F]/g, '')
72-
7365
module.exports = {
7466
cmd,
7567
sh,
76-
filename,
7768
}

0 commit comments

Comments
 (0)