Skip to content

Commit d7a25a4

Browse files
Merge branch 'npm:latest' into fix/8008
2 parents c960981 + 7eca19c commit d7a25a4

File tree

21 files changed

+209
-43
lines changed

21 files changed

+209
-43
lines changed

.github/workflows/create-node-pr.yml

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
dryRun:
1717
description: "Setting this to anything will run all the steps except opening the PR"
1818

19+
permissions:
20+
contents: write
21+
1922
jobs:
2023
create-pull-request:
2124
name: Create Node PR

.release-please-manifest.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
".": "11.2.0",
3-
"workspaces/arborist": "9.0.1",
2+
".": "11.3.0",
3+
"workspaces/arborist": "9.0.2",
44
"workspaces/libnpmaccess": "10.0.0",
5-
"workspaces/libnpmdiff": "8.0.1",
6-
"workspaces/libnpmexec": "10.1.0",
7-
"workspaces/libnpmfund": "7.0.1",
5+
"workspaces/libnpmdiff": "8.0.2",
6+
"workspaces/libnpmexec": "10.1.1",
7+
"workspaces/libnpmfund": "7.0.2",
88
"workspaces/libnpmorg": "8.0.0",
9-
"workspaces/libnpmpack": "9.0.1",
9+
"workspaces/libnpmpack": "9.0.2",
1010
"workspaces/libnpmpublish": "11.0.0",
1111
"workspaces/libnpmsearch": "9.0.0",
1212
"workspaces/libnpmteam": "8.0.0",
1313
"workspaces/libnpmversion": "8.0.0",
14-
"workspaces/config": "10.1.0"
14+
"workspaces/config": "10.2.0"
1515
}

AUTHORS

+5
Original file line numberDiff line numberDiff line change
@@ -955,3 +955,8 @@ Chris Sidi <[email protected]>
955955
Maksim Koryukov <[email protected]>
956956
Trevor Burnham <[email protected]>
957957
Michael Smith <[email protected]>
958+
terrainvidia <[email protected]>
959+
Tyler Albee <[email protected]>
960+
William Briggs <[email protected]>
961+
Gabriel Bouyssou <[email protected]>
962+

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## [11.3.0](https://github.com/npm/cli/compare/v11.2.0...v11.3.0) (2025-04-08)
4+
### Features
5+
* [`b306d25`](https://github.com/npm/cli/commit/b306d25df2f2e6ae75fd4f6657e0858b6dd71c43) [#8129](https://github.com/npm/cli/pull/8129) add `node-gyp` as actual config (@wraithgar)
6+
### Bug Fixes
7+
* [`2f5392a`](https://github.com/npm/cli/commit/2f5392ae1f87fd3df3d7e521e0e69222fb9899e5) [#8135](https://github.com/npm/cli/pull/8135) make `npm run` autocomplete work with workspaces (#8135) (@terrainvidia)
8+
### Documentation
9+
* [`26b6454`](https://github.com/npm/cli/commit/26b64543ebb27e421c05643eb996f6765c13444c) fix grammer in local path note (@cgay)
10+
* [`1c0e83d`](https://github.com/npm/cli/commit/1c0e83d6c165a714c7c37c0887e350042e53cf34) [#7886](https://github.com/npm/cli/pull/7886) fix typo in package-json.md (#7886) (@stoneLeaf)
11+
* [`14efa57`](https://github.com/npm/cli/commit/14efa57f13b2bbbf10b0b217b981f919556789cd) [#8178](https://github.com/npm/cli/pull/8178) fix example package name in `overrides` explainer (#8178) (@G-Rath)
12+
* [`4183cba`](https://github.com/npm/cli/commit/4183cba3e13bcfea83fa3ef2b6c5b0c9685f79bc) [#8162](https://github.com/npm/cli/pull/8162) logging: replace proceeding with preceding in loglevels details (#8162) (@tyleralbee)
13+
### Dependencies
14+
* [`e57f112`](https://github.com/npm/cli/commit/e57f1126e496aa88e7164bf3102147b95d96c9c8) [#8207](https://github.com/npm/cli/pull/8207) `[email protected]`
15+
* [`3daabb1`](https://github.com/npm/cli/commit/3daabb1a0cd048db303a9246ab6855f2a0550c96) [#8207](https://github.com/npm/cli/pull/8207) `[email protected]`
16+
* [`c7a7527`](https://github.com/npm/cli/commit/c7a752709509baffe674ca6d49e480835ff4a2df) [#8207](https://github.com/npm/cli/pull/8207) `[email protected]`
17+
* [`20b09b6`](https://github.com/npm/cli/commit/20b09b67bedca8d2d49404d32d031bf1d875bf81) [#8207](https://github.com/npm/cli/pull/8207) `[email protected]`
18+
* [`679bc4a`](https://github.com/npm/cli/commit/679bc4a71614bffedfbea3058af13c7deb69fcd4) [#8129](https://github.com/npm/cli/pull/8129) `@npmcli/[email protected]`
19+
### Chores
20+
* [`3fbed84`](https://github.com/npm/cli/commit/3fbed848c1f909cf1321ad0916f938bae116219f) [#8207](https://github.com/npm/cli/pull/8207) install rimraf as a devdependency for smoke tests (@owlstronaut)
21+
* [`43f0b41`](https://github.com/npm/cli/commit/43f0b41a17b32997e7de9369c485acc8aa661c0a) [#8207](https://github.com/npm/cli/pull/8207) dev dependency updates (@wraithgar)
22+
* [`26803bc`](https://github.com/npm/cli/commit/26803bc46cf85e400b66644c975ee99f6fd0575e) [#8147](https://github.com/npm/cli/pull/8147) release integration node 23 yml (#8147) (@reggi)
23+
* [`d679a1a`](https://github.com/npm/cli/commit/d679a1ae9e22eb01663d3390b9522b1b5380db32) [#8146](https://github.com/npm/cli/pull/8146) release integration node 23 (#8146) (@reggi)
24+
* [workspace](https://github.com/npm/cli/releases/tag/arborist-v9.0.2): `@npmcli/[email protected]`
25+
* [workspace](https://github.com/npm/cli/releases/tag/config-v10.2.0): `@npmcli/[email protected]`
26+
* [workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v8.0.2): `[email protected]`
27+
* [workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v10.1.1): `[email protected]`
28+
* [workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v7.0.2): `[email protected]`
29+
* [workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v9.0.2): `[email protected]`
30+
331
## [11.2.0](https://github.com/npm/cli/compare/v11.1.0...v11.2.0) (2025-03-05)
432
### Features
533
* [`247ee1d`](https://github.com/npm/cli/commit/247ee1d95a12983e181c3c3f2f1fdb790dd21794) [#8100](https://github.com/npm/cli/pull/8100) cache: add npx commands (@wraithgar)

package-lock.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "npm",
3-
"version": "11.2.0",
3+
"version": "11.3.0",
44
"lockfileVersion": 3,
55
"requires": true,
66
"packages": {
77
"": {
88
"name": "npm",
9-
"version": "11.2.0",
9+
"version": "11.3.0",
1010
"bundleDependencies": [
1111
"@isaacs/string-locale-compare",
1212
"@npmcli/arborist",
@@ -85,8 +85,8 @@
8585
],
8686
"dependencies": {
8787
"@isaacs/string-locale-compare": "^1.1.0",
88-
"@npmcli/arborist": "^9.0.1",
89-
"@npmcli/config": "^10.1.0",
88+
"@npmcli/arborist": "^9.0.2",
89+
"@npmcli/config": "^10.2.0",
9090
"@npmcli/fs": "^4.0.0",
9191
"@npmcli/map-workspaces": "^4.0.2",
9292
"@npmcli/package-json": "^6.1.1",
@@ -110,11 +110,11 @@
110110
"is-cidr": "^5.1.1",
111111
"json-parse-even-better-errors": "^4.0.0",
112112
"libnpmaccess": "^10.0.0",
113-
"libnpmdiff": "^8.0.1",
114-
"libnpmexec": "^10.1.0",
115-
"libnpmfund": "^7.0.1",
113+
"libnpmdiff": "^8.0.2",
114+
"libnpmexec": "^10.1.1",
115+
"libnpmfund": "^7.0.2",
116116
"libnpmorg": "^8.0.0",
117-
"libnpmpack": "^9.0.1",
117+
"libnpmpack": "^9.0.2",
118118
"libnpmpublish": "^11.0.0",
119119
"libnpmsearch": "^9.0.0",
120120
"libnpmteam": "^8.0.0",
@@ -18899,7 +18899,7 @@
1889918899
},
1890018900
"workspaces/arborist": {
1890118901
"name": "@npmcli/arborist",
18902-
"version": "9.0.1",
18902+
"version": "9.0.2",
1890318903
"license": "ISC",
1890418904
"dependencies": {
1890518905
"@isaacs/string-locale-compare": "^1.1.0",
@@ -18957,7 +18957,7 @@
1895718957
},
1895818958
"workspaces/config": {
1895918959
"name": "@npmcli/config",
18960-
"version": "10.1.0",
18960+
"version": "10.2.0",
1896118961
"license": "ISC",
1896218962
"dependencies": {
1896318963
"@npmcli/map-workspaces": "^4.0.1",
@@ -18997,10 +18997,10 @@
1899718997
}
1899818998
},
1899918999
"workspaces/libnpmdiff": {
19000-
"version": "8.0.1",
19000+
"version": "8.0.2",
1900119001
"license": "ISC",
1900219002
"dependencies": {
19003-
"@npmcli/arborist": "^9.0.1",
19003+
"@npmcli/arborist": "^9.0.2",
1900419004
"@npmcli/installed-package-contents": "^3.0.0",
1900519005
"binary-extensions": "^3.0.0",
1900619006
"diff": "^7.0.0",
@@ -19019,10 +19019,10 @@
1901919019
}
1902019020
},
1902119021
"workspaces/libnpmexec": {
19022-
"version": "10.1.0",
19022+
"version": "10.1.1",
1902319023
"license": "ISC",
1902419024
"dependencies": {
19025-
"@npmcli/arborist": "^9.0.1",
19025+
"@npmcli/arborist": "^9.0.2",
1902619026
"@npmcli/package-json": "^6.1.1",
1902719027
"@npmcli/run-script": "^9.0.1",
1902819028
"ci-info": "^4.0.0",
@@ -19049,10 +19049,10 @@
1904919049
}
1905019050
},
1905119051
"workspaces/libnpmfund": {
19052-
"version": "7.0.1",
19052+
"version": "7.0.2",
1905319053
"license": "ISC",
1905419054
"dependencies": {
19055-
"@npmcli/arborist": "^9.0.1"
19055+
"@npmcli/arborist": "^9.0.2"
1905619056
},
1905719057
"devDependencies": {
1905819058
"@npmcli/eslint-config": "^5.0.1",
@@ -19082,10 +19082,10 @@
1908219082
}
1908319083
},
1908419084
"workspaces/libnpmpack": {
19085-
"version": "9.0.1",
19085+
"version": "9.0.2",
1908619086
"license": "ISC",
1908719087
"dependencies": {
19088-
"@npmcli/arborist": "^9.0.1",
19088+
"@npmcli/arborist": "^9.0.2",
1908919089
"@npmcli/run-script": "^9.0.1",
1909019090
"npm-package-arg": "^12.0.0",
1909119091
"pacote": "^21.0.0"

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "11.2.0",
2+
"version": "11.3.0",
33
"name": "npm",
44
"description": "a package manager for JavaScript",
55
"workspaces": [
@@ -52,8 +52,8 @@
5252
},
5353
"dependencies": {
5454
"@isaacs/string-locale-compare": "^1.1.0",
55-
"@npmcli/arborist": "^9.0.1",
56-
"@npmcli/config": "^10.1.0",
55+
"@npmcli/arborist": "^9.0.2",
56+
"@npmcli/config": "^10.2.0",
5757
"@npmcli/fs": "^4.0.0",
5858
"@npmcli/map-workspaces": "^4.0.2",
5959
"@npmcli/package-json": "^6.1.1",
@@ -77,11 +77,11 @@
7777
"is-cidr": "^5.1.1",
7878
"json-parse-even-better-errors": "^4.0.0",
7979
"libnpmaccess": "^10.0.0",
80-
"libnpmdiff": "^8.0.1",
81-
"libnpmexec": "^10.1.0",
82-
"libnpmfund": "^7.0.1",
80+
"libnpmdiff": "^8.0.2",
81+
"libnpmexec": "^10.1.1",
82+
"libnpmfund": "^7.0.2",
8383
"libnpmorg": "^8.0.0",
84-
"libnpmpack": "^9.0.1",
84+
"libnpmpack": "^9.0.2",
8585
"libnpmpublish": "^11.0.0",
8686
"libnpmsearch": "^9.0.0",
8787
"libnpmteam": "^8.0.0",

scripts/template-oss/create-node-pr-yml.hbs

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
dryRun:
1515
description: "Setting this to anything will run all the steps except opening the PR"
1616

17+
permissions:
18+
contents: write
19+
1720
jobs:
1821
create-pull-request:
1922
{{> jobYml jobName="Create Node PR" jobCheckout=(obj fetch-depth=0) }}

workspaces/arborist/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [9.0.2](https://github.com/npm/cli/compare/arborist-v9.0.1...arborist-v9.0.2) (2025-04-08)
4+
### Bug Fixes
5+
* [`a96d8f6`](https://github.com/npm/cli/commit/a96d8f6295886c219076178460718837d2fe45d6) [#8184](https://github.com/npm/cli/pull/8184) arborist: omit failed optional dependencies from installed deps (#8184) (@owlstronaut, @zkat)
6+
* [`04f53ce`](https://github.com/npm/cli/commit/04f53ce13201b460123067d7153f1681342548e1) [#8180](https://github.com/npm/cli/pull/8180) arborist: safely fallback on unresolved $ dependency references (#8180) (@owlstronaut)
7+
* [`885accd`](https://github.com/npm/cli/commit/885accdc750dd45fc9e4b5faf11bcc81292e17ad) [#8185](https://github.com/npm/cli/pull/8185) arborist: only replace hostname for resolved URL (#8185) (@billy-briggs-dev)
8+
* [`8b7bb12`](https://github.com/npm/cli/commit/8b7bb12617e80f3e5061c96d06dd723331fffa2d) [#8168](https://github.com/npm/cli/pull/8168) arborist: Allow downgrades to hoisted version dedupe workspace i… (#8168) (@owlstronaut)
9+
* [`1642556`](https://github.com/npm/cli/commit/1642556fe47d837ab7d0800d96bd2eebd0c908fd) [#8160](https://github.com/npm/cli/pull/8160) arborist: workspaces respect overrides on subsequent installs (#8160) (@owlstronaut)
10+
### Chores
11+
* [`88a7b52`](https://github.com/npm/cli/commit/88a7b52a69ba6a4f44216220d09000bf8468cae1) [#8174](https://github.com/npm/cli/pull/8174) add load-virtual and reify tests for workspace override test coverage (#8174) (@owlstronaut, @TrevorBurnham)
12+
313
## [9.0.1](https://github.com/npm/cli/compare/arborist-v9.0.0...arborist-v9.0.1) (2025-03-05)
414
### Bug Fixes
515
* [`b9225e5`](https://github.com/npm/cli/commit/b9225e524074239bd8db9a27f3e9ab72f2b5c09e) [#8089](https://github.com/npm/cli/pull/8089) resolve override conflicts and apply correct versions (#8089) (@owlstronaut)

workspaces/arborist/lib/arborist/reify.js

+38-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,14 @@ module.exports = cls => class Reifier extends cls {
825825
// symlink
826826
const dir = dirname(node.path)
827827
const target = node.realpath
828-
const rel = relative(dir, target)
828+
829+
let rel
830+
if (node.resolved?.startsWith('file:')) {
831+
rel = this.#calculateRelativePath(node, dir, target, nm)
832+
} else {
833+
rel = relative(dir, target)
834+
}
835+
829836
await mkdir(dir, { recursive: true })
830837
return symlink(rel, node.path, 'junction')
831838
}
@@ -843,6 +850,36 @@ module.exports = cls => class Reifier extends cls {
843850
}) : p).then(() => node)
844851
}
845852

853+
#calculateRelativePath (node, dir, target) {
854+
// Check if the node is affected by a root override
855+
let hasRootOverride = [...node.edgesIn].some(edge => edge.from.isRoot && edge.overrides)
856+
// If not set via edges, see if the root package.json explicitly lists an override
857+
if (!hasRootOverride && node.root) {
858+
const rootPackage = node.root.target
859+
hasRootOverride = !!(rootPackage &&
860+
rootPackage.package.overrides &&
861+
rootPackage.package.overrides[node.name])
862+
}
863+
if (!hasRootOverride) {
864+
return relative(dir, target)
865+
}
866+
// If an override is detected, attempt to retrieve the override spec from the root package.json
867+
const overrideSpec = node.root?.target?.package?.overrides?.[node.name]
868+
if (typeof overrideSpec === 'string' && overrideSpec.startsWith('file:')) {
869+
const overridePath = overrideSpec.replace(/^file:/, '')
870+
const rootDir = node.root.target.path
871+
return relative(dir, resolve(rootDir, overridePath))
872+
}
873+
874+
// Fallback: derive the package name from node.resolved in a platform-agnostic way
875+
const filePath = node.resolved.replace(/^file:/, '')
876+
// A node.package.name could be different than the folder name
877+
const pathParts = filePath.split(/[\\/]/)
878+
const packageName = pathParts[pathParts.length - 1]
879+
880+
return join('..', packageName)
881+
}
882+
846883
#registryResolved (resolved) {
847884
// the default registry url is a magic value meaning "the currently
848885
// configured registry".

workspaces/arborist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/arborist",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"description": "Manage node_modules trees",
55
"dependencies": {
66
"@isaacs/string-locale-compare": "^1.1.0",

workspaces/arborist/test/arborist/reify.js

+52
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const fs = require('node:fs')
88
const fsp = require('node:fs/promises')
99
const npmFs = require('@npmcli/fs')
1010
const MockRegistry = require('@npmcli/mock-registry')
11+
const { dirname, relative } = require('node:path')
1112

1213
let failRm = false
1314
let failRename = null
@@ -3204,6 +3205,57 @@ t.test('installLinks', (t) => {
32043205
t.end()
32053206
})
32063207

3208+
t.test('root overrides with file: paths are visible to workspaces', async t => {
3209+
const path = t.testdir({
3210+
'package.json': JSON.stringify({
3211+
name: 'root',
3212+
workspaces: ['hello'],
3213+
dependencies: {},
3214+
overrides: {
3215+
print: 'file:./print',
3216+
},
3217+
}),
3218+
hello: {
3219+
'package.json': JSON.stringify({
3220+
name: 'hello',
3221+
version: '1.0.0',
3222+
dependencies: {
3223+
print: '../print',
3224+
},
3225+
}),
3226+
},
3227+
print: {
3228+
'package.json': JSON.stringify({
3229+
name: 'print',
3230+
version: '1.0.0',
3231+
main: 'index.js',
3232+
}),
3233+
},
3234+
})
3235+
3236+
createRegistry(t, false)
3237+
await reify(path)
3238+
3239+
const printSymlink = fs.readlinkSync(resolve(path, 'node_modules/print'))
3240+
3241+
// Create a platform-agnostic way to compare symlink targets
3242+
const normalizeLinkTarget = target => {
3243+
if (process.platform === 'win32') {
3244+
// For Windows: convert absolute paths to relative and normalize slashes
3245+
const linkDir = dirname(resolve(path, 'node_modules/print'))
3246+
return relative(linkDir, target).replace(/\\/g, '/')
3247+
}
3248+
// For Unix: already a relative path
3249+
return target
3250+
}
3251+
3252+
t.equal(
3253+
normalizeLinkTarget(printSymlink),
3254+
'../print',
3255+
'print symlink points to ../print (normalized for platform)'
3256+
)
3257+
})
3258+
32073259
t.test('should preserve exact ranges, missing actual tree', async (t) => {
32083260
const Pacote = require('pacote')
32093261
const Arborist = t.mock('../../lib/arborist', {

workspaces/config/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [10.2.0](https://github.com/npm/cli/compare/config-v10.1.0...config-v10.2.0) (2025-04-08)
4+
### Features
5+
* [`b306d25`](https://github.com/npm/cli/commit/b306d25df2f2e6ae75fd4f6657e0858b6dd71c43) [#8129](https://github.com/npm/cli/pull/8129) add `node-gyp` as actual config (@wraithgar)
6+
### Bug Fixes
7+
* [`9e73338`](https://github.com/npm/cli/commit/9e733383ba8183da0ee18ae1d6694a679168e18b) [#8129](https://github.com/npm/cli/pull/8129) warn on non-default npm-version (@wraithgar)
8+
* [`1814b45`](https://github.com/npm/cli/commit/1814b451d4b14c04cd8cb61f934277fa4d0d4723) [#8145](https://github.com/npm/cli/pull/8145) re-add positional arg and abbrev warnings (#8145) (@wraithgar)
9+
310
## [10.1.0](https://github.com/npm/cli/compare/config-v10.0.1...config-v10.1.0) (2025-03-05)
411
### Features
512
* [`3a80a7b`](https://github.com/npm/cli/commit/3a80a7b7d168c23b5e297cba7b47ba5b9875934d) [#8081](https://github.com/npm/cli/pull/8081) add --init-type flag (#8081) (@reggi)

workspaces/config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@npmcli/config",
3-
"version": "10.1.0",
3+
"version": "10.2.0",
44
"files": [
55
"bin/",
66
"lib/"

0 commit comments

Comments
 (0)