Skip to content

Commit e7d2499

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update corepack to 0.34.3
1 parent 8a76958 commit e7d2499

File tree

3 files changed

+68
-50
lines changed

3 files changed

+68
-50
lines changed

deps/corepack/CHANGELOG.md

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

3+
## [0.34.3](https://github.com/nodejs/corepack/compare/v0.34.2...v0.34.3) (2025-11-07)
4+
5+
6+
### Bug Fixes
7+
8+
* update package manager versions ([#765](https://github.com/nodejs/corepack/issues/765)) ([13a2e98](https://github.com/nodejs/corepack/commit/13a2e989ee37694a7ec1b1d60acdaa28f90642d1))
9+
* Yarn switch install support and tests ([#761](https://github.com/nodejs/corepack/issues/761)) ([d04d483](https://github.com/nodejs/corepack/commit/d04d4839aeecaf4fca989c577f6c000dc90be933))
10+
311
## [0.34.2](https://github.com/nodejs/corepack/compare/v0.34.1...v0.34.2) (2025-10-31)
412

513

deps/corepack/dist/lib/corepack.cjs

Lines changed: 59 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21677,7 +21677,7 @@ function String2(descriptor, ...args) {
2167721677
}
2167821678

2167921679
// package.json
21680-
var version = "0.34.2";
21680+
var version = "0.34.3";
2168121681

2168221682
// sources/Engine.ts
2168321683
var import_fs6 = __toESM(require("fs"));
@@ -21792,7 +21792,7 @@ var config_default = {
2179221792
package: "yarn"
2179321793
},
2179421794
transparent: {
21795-
default: "4.10.3+sha224.6020b3cdcdfbd7dbc24b7a7b75d58a249ce36068a8bf97d39aa8cc6d",
21795+
default: "4.11.0+sha224.209a3e277c6bbc03df6e4206fbfcb0c1621c27ecf0688f79a0c619f0",
2179621796
commands: [
2179721797
[
2179821798
"yarn",
@@ -22099,6 +22099,50 @@ async function getProxyAgent(input) {
2209922099
return new ProxyAgent(proxy);
2210022100
}
2210122101

22102+
// sources/nodeUtils.ts
22103+
var import_os2 = __toESM(require("os"));
22104+
function isNodeError(err) {
22105+
return !!err?.code;
22106+
}
22107+
function isExistError(err) {
22108+
return err.code === `EEXIST` || err.code === `ENOTEMPTY`;
22109+
}
22110+
function getEndOfLine(content) {
22111+
const matches = content.match(/\r?\n/g);
22112+
if (matches === null)
22113+
return import_os2.default.EOL;
22114+
const crlf = matches.filter((nl) => nl === `\r
22115+
`).length;
22116+
const lf = matches.length - crlf;
22117+
return crlf > lf ? `\r
22118+
` : `
22119+
`;
22120+
}
22121+
function normalizeLineEndings(originalContent, newContent) {
22122+
return newContent.replace(/\r?\n/g, getEndOfLine(originalContent));
22123+
}
22124+
function getIndent(content) {
22125+
const indentMatch = content.match(/^[ \t]+/m);
22126+
if (indentMatch) {
22127+
return indentMatch[0];
22128+
} else {
22129+
return ` `;
22130+
}
22131+
}
22132+
function stripBOM(content) {
22133+
if (content.charCodeAt(0) === 65279) {
22134+
return content.slice(1);
22135+
} else {
22136+
return content;
22137+
}
22138+
}
22139+
function readPackageJson(content) {
22140+
return {
22141+
data: JSON.parse(stripBOM(content) || `{}`),
22142+
indent: getIndent(content)
22143+
};
22144+
}
22145+
2210222146
// sources/corepackUtils.ts
2210322147
var YARN_SWITCH_REGEX = /[/\\]switch[/\\]bin[/\\]/;
2210422148
function isYarnSwitchPath(p) {
@@ -22156,7 +22200,7 @@ async function findInstalledVersion(installTarget, descriptor) {
2215622200
try {
2215722201
cacheDirectory = await import_fs4.default.promises.opendir(installFolder);
2215822202
} catch (error) {
22159-
if (error.code === `ENOENT`) {
22203+
if (isNodeError(error) && error.code === `ENOENT`) {
2216022204
return null;
2216122205
} else {
2216222206
throw error;
@@ -22228,9 +22272,13 @@ async function download(installTarget, url, algo, binPath = null) {
2222822272
try {
2222922273
await renameSafe(downloadedBin, outputFile);
2223022274
} catch (err) {
22231-
if (err?.code === `ENOENT`)
22275+
if (isNodeError(err) && err.code === `ENOENT`)
2223222276
throw new Error(`Cannot locate '${binPath}' in downloaded tarball`, { cause: err });
22233-
throw err;
22277+
if (isNodeError(err) && isExistError(err)) {
22278+
await import_fs4.default.promises.rm(downloadedBin);
22279+
} else {
22280+
throw err;
22281+
}
2223422282
}
2223522283
const fileStream = import_fs4.default.createReadStream(outputFile);
2223622284
hash = fileStream.pipe((0, import_crypto2.createHash)(algo));
@@ -22258,7 +22306,7 @@ async function installVersion(installTarget, locator, { spec }) {
2225822306
bin: corepackData.bin
2225922307
};
2226022308
} catch (err) {
22261-
if (err?.code !== `ENOENT`) {
22309+
if (isNodeError(err) && err.code !== `ENOENT`) {
2226222310
throw err;
2226322311
}
2226422312
}
@@ -22336,8 +22384,8 @@ async function installVersion(installTarget, locator, { spec }) {
2233622384
try {
2233722385
await renameSafe(tmpFolder, installFolder);
2233822386
} catch (err) {
22339-
if (err.code === `ENOTEMPTY` || // On Windows the error code is EPERM so we check if it is a directory
22340-
err.code === `EPERM` && (await import_fs4.default.promises.stat(installFolder)).isDirectory()) {
22387+
if (isNodeError(err) && (isExistError(err) || // On Windows the error code is EPERM so we check if it is a directory
22388+
err.code === `EPERM` && (await import_fs4.default.promises.stat(installFolder)).isDirectory())) {
2234122389
log(`Another instance of corepack installed ${locator.name}@${locator.reference}`);
2234222390
await import_fs4.default.promises.rm(tmpFolder, { recursive: true, force: true });
2234322391
} else {
@@ -22376,7 +22424,7 @@ async function renameUnderWindows(oldPath, newPath) {
2237622424
await import_fs4.default.promises.rename(oldPath, newPath);
2237722425
break;
2237822426
} catch (err) {
22379-
if ((err.code === `ENOENT` || err.code === `EPERM`) && i < retries - 1) {
22427+
if (isNodeError(err) && (err.code === `ENOENT` || err.code === `EPERM`) && i < retries - 1) {
2238022428
await (0, import_promises2.setTimeout)(100 * 2 ** i);
2238122429
continue;
2238222430
} else {
@@ -22467,44 +22515,6 @@ var import_valid = __toESM(require_valid());
2246722515
var import_valid2 = __toESM(require_valid2());
2246822516
var import_util = require("util");
2246922517

22470-
// sources/nodeUtils.ts
22471-
var import_os2 = __toESM(require("os"));
22472-
function getEndOfLine(content) {
22473-
const matches = content.match(/\r?\n/g);
22474-
if (matches === null)
22475-
return import_os2.default.EOL;
22476-
const crlf = matches.filter((nl) => nl === `\r
22477-
`).length;
22478-
const lf = matches.length - crlf;
22479-
return crlf > lf ? `\r
22480-
` : `
22481-
`;
22482-
}
22483-
function normalizeLineEndings(originalContent, newContent) {
22484-
return newContent.replace(/\r?\n/g, getEndOfLine(originalContent));
22485-
}
22486-
function getIndent(content) {
22487-
const indentMatch = content.match(/^[ \t]+/m);
22488-
if (indentMatch) {
22489-
return indentMatch[0];
22490-
} else {
22491-
return ` `;
22492-
}
22493-
}
22494-
function stripBOM(content) {
22495-
if (content.charCodeAt(0) === 65279) {
22496-
return content.slice(1);
22497-
} else {
22498-
return content;
22499-
}
22500-
}
22501-
function readPackageJson(content) {
22502-
return {
22503-
data: JSON.parse(stripBOM(content) || `{}`),
22504-
indent: getIndent(content)
22505-
};
22506-
}
22507-
2250822518
// sources/types.ts
2250922519
var SupportedPackageManagers = /* @__PURE__ */ ((SupportedPackageManagers3) => {
2251022520
SupportedPackageManagers3["Npm"] = `npm`;
@@ -23149,8 +23159,8 @@ var EnableCommand = class extends Command {
2314923159
const file = import_path7.default.join(installDirectory, binName);
2315023160
const symlink = import_path7.default.relative(installDirectory, import_path7.default.join(distFolder, `${binName}.js`));
2315123161
if (import_fs9.default.existsSync(file)) {
23152-
const currentSymlink = await import_fs9.default.promises.readlink(file);
23153-
if (binName.includes(`yarn`) && isYarnSwitchPath(await import_fs9.default.promises.realpath(file))) {
23162+
const currentSymlink = await import_fs9.default.promises.realpath(file);
23163+
if (binName.includes(`yarn`) && isYarnSwitchPath(currentSymlink)) {
2315423164
console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`);
2315523165
return;
2315623166
}

deps/corepack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "corepack",
3-
"version": "0.34.2",
3+
"version": "0.34.3",
44
"homepage": "https://github.com/nodejs/corepack#readme",
55
"bugs": {
66
"url": "https://github.com/nodejs/corepack/issues"

0 commit comments

Comments
 (0)