Skip to content

Commit 7d7486f

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/undici-6.21.2
2 parents 2ab4c7e + fa53253 commit 7d7486f

15 files changed

Lines changed: 154 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,21 @@ jobs:
4646
fail-fast: false
4747
matrix:
4848
node:
49-
- 18
5049
- 20
5150
- 22
52-
- 23
51+
- 24
5352
platform:
5453
- ubuntu-latest
5554
- macos-latest
5655
- windows-latest
5756

57+
# Temporarily skipping Node.js 24 under Windows due to issue
58+
# https://github.com/nodejs/corepack/issues/715
59+
# vitest fails "handle integrity checks" on Windows with Node.js 24.x
60+
exclude:
61+
- node: 24
62+
platform: windows-latest
63+
5864
name: "${{matrix.platform}} w/ Node.js ${{matrix.node}}.x"
5965
runs-on: ${{matrix.platform}}
6066

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ env:
88
YARN_ENABLE_GLOBAL_CACHE: false
99

1010
permissions:
11-
contents: write
12-
pull-requests: write
11+
contents: read
1312

1413
jobs:
1514
release-please:
1615
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
1719
outputs:
1820
release_created: ${{ steps.release.outputs.release_created }}
1921
release_tag: ${{ steps.release.outputs.tag_name }}
@@ -30,6 +32,7 @@ jobs:
3032
if: ${{ needs.release-please.outputs.release_created }}
3133
runs-on: ubuntu-latest
3234
permissions:
35+
contents: write
3336
id-token: write
3437
steps:
3538
- uses: actions/checkout@v4

CHANGELOG.md

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

3+
## [0.34.0](https://github.com/nodejs/corepack/compare/v0.33.0...v0.34.0) (2025-07-19)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* drop Node.js 18.x and 23.x support
9+
10+
### Features
11+
12+
* update package manager versions ([#719](https://github.com/nodejs/corepack/issues/719)) ([7707ea7](https://github.com/nodejs/corepack/commit/7707ea7350c129ad3aae8ca08e9e80fcf164dcb6))
13+
14+
15+
### Miscellaneous Chores
16+
17+
* remove Node.js 18.x and 23.x usage, add 24.x ([#718](https://github.com/nodejs/corepack/issues/718)) ([783a42f](https://github.com/nodejs/corepack/commit/783a42fbe35371964e9dde75e2263b179f53bc0c))
18+
19+
## [0.33.0](https://github.com/nodejs/corepack/compare/v0.32.0...v0.33.0) (2025-06-02)
20+
21+
22+
### Features
23+
24+
* Adds guard to avoid stepping on Yarn's feet ([#714](https://github.com/nodejs/corepack/issues/714)) ([5fc3691](https://github.com/nodejs/corepack/commit/5fc3691354eb5bdeca17a9495b234584353f0151))
25+
* update package manager versions ([#671](https://github.com/nodejs/corepack/issues/671)) ([b45b3a3](https://github.com/nodejs/corepack/commit/b45b3a3244bacfbaf65188ae8c04209a1e98307d))
26+
27+
28+
### Bug Fixes
29+
30+
* debug text typo ([#698](https://github.com/nodejs/corepack/issues/698)) ([0b94797](https://github.com/nodejs/corepack/commit/0b94797f96e30e46e466873fe7d437d0471cd92c))
31+
332
## [0.32.0](https://github.com/nodejs/corepack/compare/v0.31.0...v0.32.0) (2025-02-28)
433

534

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and pnpm without having to install them**.
1111

1212
### Default Installs
1313

14-
Corepack is [distributed by default with all recent Node.js versions](https://nodejs.org/api/corepack.html).
14+
Corepack is distributed with Node.js from version 14.19.0 up to (but not including) 25.0.0.
1515
Run `corepack enable` to install the required Yarn and pnpm binaries on your path.
1616

1717
### Manual Installs
@@ -286,8 +286,8 @@ same major line. Should you need to upgrade to a new major, use an explicit
286286
package manager, and to not update the Last Known Good version when it
287287
downloads a new version of the same major line.
288288

289-
- `COREPACK_ENABLE_AUTO_PIN` can be set to `0` to prevent Corepack from
290-
updating the `packageManager` field when it detects that the local package
289+
- `COREPACK_ENABLE_AUTO_PIN` can be set to `1` to instruct Corepack to
290+
update the `packageManager` field when it detects that the local package
291291
doesn't list it. In general we recommend to always list a `packageManager`
292292
field (which you can easily set through `corepack use [name]@[version]`), as
293293
it ensures that your project installs are always deterministic.

config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"definitions": {
33
"npm": {
4-
"default": "11.1.0+sha1.dba08f7d0f5301ebedaf968b4f74b2282f97a750",
4+
"default": "11.4.2+sha1.6f1519a03f7e04023a957a22b812832d0c4a4b33",
55
"fetchLatestFrom": {
66
"type": "npm",
77
"package": "npm"
@@ -38,7 +38,7 @@
3838
}
3939
},
4040
"pnpm": {
41-
"default": "10.5.2+sha1.ca68c0441df195b7e2992f1d1cb12fb731f82d78",
41+
"default": "10.13.1+sha1.aa8c167c4509c97519542ef77a09e4b8ab59fb6a",
4242
"fetchLatestFrom": {
4343
"type": "npm",
4444
"package": "pnpm"
@@ -102,7 +102,7 @@
102102
"package": "yarn"
103103
},
104104
"transparent": {
105-
"default": "4.6.0+sha224.acd0786f07ffc6c933940eb65fc1d627131ddf5455bddcc295dc90fd",
105+
"default": "4.9.2+sha224.b8e0b161ae590950fbda696e6f3ca071362768e5280c5fbfdadf064b",
106106
"commands": [
107107
[
108108
"yarn",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "corepack",
3-
"version": "0.32.0",
3+
"version": "0.34.0",
44
"homepage": "https://github.com/nodejs/corepack#readme",
55
"bugs": {
66
"url": "https://github.com/nodejs/corepack/issues"
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/nodejs/corepack.git"
1111
},
1212
"engines": {
13-
"node": "^18.17.1 || ^20.10.0 || >=22.11.0"
13+
"node": "^20.10.0 || ^22.11.0 || >=24.0.0"
1414
},
1515
"exports": {
1616
"./package.json": "./package.json"

sources/Engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export class Engine {
274274
if (typeof locator.reference === `function`)
275275
fallbackDescriptor.range = await locator.reference();
276276

277-
if (process.env.COREPACK_ENABLE_AUTO_PIN !== `0`) {
277+
if (process.env.COREPACK_ENABLE_AUTO_PIN === `1`) {
278278
const resolved = await this.resolveDescriptor(fallbackDescriptor, {allowTags: true});
279279
if (resolved === null)
280280
throw new UsageError(`Failed to successfully resolve '${fallbackDescriptor.range}' to a valid ${fallbackDescriptor.name} release`);

sources/commands/Disable.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import fs from 'f
33
import path from 'path';
44
import which from 'which';
55

6+
import * as corepackUtils from '../corepackUtils';
67
import {Context} from '../main';
78
import type {NodeError} from '../nodeUtils';
89
import {isSupportedPackageManager, SupportedPackageManagerSetWithoutNpm} from '../types';
@@ -70,6 +71,11 @@ export class DisableCommand extends Command<Context> {
7071
async removePosixLink(installDirectory: string, binName: string) {
7172
const file = path.join(installDirectory, binName);
7273
try {
74+
if (binName.includes(`yarn`) && corepackUtils.isYarnSwitchPath(await fs.promises.realpath(file))) {
75+
console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`);
76+
return;
77+
}
78+
7379
await fs.promises.unlink(file);
7480
} catch (err) {
7581
if ((err as NodeError).code !== `ENOENT`) {

sources/commands/Enable.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import fs from 'f
44
import path from 'path';
55
import which from 'which';
66

7+
import * as corepackUtils from '../corepackUtils';
78
import {Context} from '../main';
89
import {isSupportedPackageManager, SupportedPackageManagerSetWithoutNpm} from '../types';
910

@@ -83,6 +84,12 @@ export class EnableCommand extends Command<Context> {
8384

8485
if (fs.existsSync(file)) {
8586
const currentSymlink = await fs.promises.readlink(file);
87+
88+
if (binName.includes(`yarn`) && corepackUtils.isYarnSwitchPath(await fs.promises.realpath(file))) {
89+
console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`);
90+
return;
91+
}
92+
8693
if (currentSymlink !== symlink) {
8794
await fs.promises.unlink(file);
8895
} else {

sources/corepackUtils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import * as npmRegistryUtils from './npmRegist
1919
import {RegistrySpec, Descriptor, Locator, PackageManagerSpec} from './types';
2020
import {BinList, BinSpec, InstallSpec, DownloadSpec} from './types';
2121

22+
const YARN_SWITCH_REGEX = /[/\\]switch[/\\]bin[/\\]/;
23+
24+
export function isYarnSwitchPath(p: string) {
25+
return YARN_SWITCH_REGEX.test(p);
26+
}
27+
2228
export function getRegistryFromPackageManagerSpec(spec: PackageManagerSpec) {
2329
return process.env.COREPACK_NPM_REGISTRY
2430
? spec.npmRegistry ?? spec.registry

0 commit comments

Comments
 (0)