| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ffebf8e commit 479c929
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,22 @@ | |||
| 1 | 1 | # Changelog | |
| 2 | 2 | ||
| 3 | + ## [0.34.4](https://github.com/nodejs/corepack/compare/v0.34.3...v0.34.4) (2025-11-14) | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + ### Bug Fixes | ||
| 7 | + | ||
| 8 | + * bump pnpm version in `config.json` ([#768](https://github.com/nodejs/corepack/issues/768)) ([99a9a6e](https://github.com/nodejs/corepack/commit/99a9a6eb1b6e918ceb896b3d558bb5ed583bdc70)) | ||
| 9 | + * ignore devEngines version range when CLI provides a version ([#762](https://github.com/nodejs/corepack/issues/762)) ([ac518c4](https://github.com/nodejs/corepack/commit/ac518c4106f8d9ceb4e85e6c3614b1eba5d03fcb)) | ||
| 10 | + * use `lstatSync` in `generatePosixLink` ([#767](https://github.com/nodejs/corepack/issues/767)) ([a02bea0](https://github.com/nodejs/corepack/commit/a02bea078eb584ed7492ec561626987e35386bae)) | ||
| 11 | + | ||
| 12 | + ## [0.34.3](https://github.com/nodejs/corepack/compare/v0.34.2...v0.34.3) (2025-11-07) | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + ### Bug Fixes | ||
| 16 | + | ||
| 17 | + * update package manager versions ([#765](https://github.com/nodejs/corepack/issues/765)) ([13a2e98](https://github.com/nodejs/corepack/commit/13a2e989ee37694a7ec1b1d60acdaa28f90642d1)) | ||
| 18 | + * Yarn switch install support and tests ([#761](https://github.com/nodejs/corepack/issues/761)) ([d04d483](https://github.com/nodejs/corepack/commit/d04d4839aeecaf4fca989c577f6c000dc90be933)) | ||
| 19 | + | ||
| 3 | 20 | ## [0.34.2](https://github.com/nodejs/corepack/compare/v0.34.1...v0.34.2) (2025-10-31) | |
| 4 | 21 | ||
| 5 | 22 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21677,7 +21677,7 @@ function String2(descriptor, ...args) { | |||
| 21677 | 21677 | } | |
| 21678 | 21678 | ||
| 21679 | 21679 | // package.json | |
| 21680 | - var version = "0.34.2"; | ||
| 21680 | + var version = "0.34.4"; | ||
| 21681 | 21681 | ||
| 21682 | 21682 | // sources/Engine.ts | |
| 21683 | 21683 | var import_fs6 = __toESM(require("fs")); | |
@@ -21728,7 +21728,7 @@ var config_default = { | |||
| 21728 | 21728 | } | |
| 21729 | 21729 | }, | |
| 21730 | 21730 | pnpm: { | |
| 21731 | - default: "10.20.0+sha1.a9bfe8cf88011d4758e1acbeb0da8883ecbd52ce", | ||
| 21731 | + default: "10.22.0+sha1.3e9e4d522d30f3cf4cabb7506f5d15b89feffd04", | ||
| 21732 | 21732 | fetchLatestFrom: { | |
| 21733 | 21733 | type: "npm", | |
| 21734 | 21734 | package: "pnpm" | |
@@ -21792,7 +21792,7 @@ var config_default = { | |||
| 21792 | 21792 | package: "yarn" | |
| 21793 | 21793 | }, | |
| 21794 | 21794 | transparent: { | |
| 21795 | - default: "4.10.3+sha224.6020b3cdcdfbd7dbc24b7a7b75d58a249ce36068a8bf97d39aa8cc6d", | ||
| 21795 | + default: "4.11.0+sha224.209a3e277c6bbc03df6e4206fbfcb0c1621c27ecf0688f79a0c619f0", | ||
| 21796 | 21796 | commands: [ | |
| 21797 | 21797 | [ | |
| 21798 | 21798 | "yarn", | |
@@ -22099,6 +22099,50 @@ async function getProxyAgent(input) { | |||
| 22099 | 22099 | return new ProxyAgent(proxy); | |
| 22100 | 22100 | } | |
| 22101 | 22101 | ||
| 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 | + | ||
| 22102 | 22146 | // sources/corepackUtils.ts | |
| 22103 | 22147 | var YARN_SWITCH_REGEX = /[/\\]switch[/\\]bin[/\\]/; | |
| 22104 | 22148 | function isYarnSwitchPath(p) { | |
@@ -22156,7 +22200,7 @@ async function findInstalledVersion(installTarget, descriptor) { | |||
| 22156 | 22200 | try { | |
| 22157 | 22201 | cacheDirectory = await import_fs4.default.promises.opendir(installFolder); | |
| 22158 | 22202 | } catch (error) { | |
| 22159 | - if (error.code === `ENOENT`) { | ||
| 22203 | + if (isNodeError(error) && error.code === `ENOENT`) { | ||
| 22160 | 22204 | return null; | |
| 22161 | 22205 | } else { | |
| 22162 | 22206 | throw error; | |
@@ -22228,9 +22272,13 @@ async function download(installTarget, url, algo, binPath = null) { | |||
| 22228 | 22272 | try { | |
| 22229 | 22273 | await renameSafe(downloadedBin, outputFile); | |
| 22230 | 22274 | } catch (err) { | |
| 22231 | - if (err?.code === `ENOENT`) | ||
| 22275 | + if (isNodeError(err) && err.code === `ENOENT`) | ||
| 22232 | 22276 | 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 | + } | ||
| 22234 | 22282 | } | |
| 22235 | 22283 | const fileStream = import_fs4.default.createReadStream(outputFile); | |
| 22236 | 22284 | hash = fileStream.pipe((0, import_crypto2.createHash)(algo)); | |
@@ -22258,7 +22306,7 @@ async function installVersion(installTarget, locator, { spec }) { | |||
| 22258 | 22306 | bin: corepackData.bin | |
| 22259 | 22307 | }; | |
| 22260 | 22308 | } catch (err) { | |
| 22261 | - if (err?.code !== `ENOENT`) { | ||
| 22309 | + if (isNodeError(err) && err.code !== `ENOENT`) { | ||
| 22262 | 22310 | throw err; | |
| 22263 | 22311 | } | |
| 22264 | 22312 | } | |
@@ -22336,8 +22384,8 @@ async function installVersion(installTarget, locator, { spec }) { | |||
| 22336 | 22384 | try { | |
| 22337 | 22385 | await renameSafe(tmpFolder, installFolder); | |
| 22338 | 22386 | } 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())) { | ||
| 22341 | 22389 | log(`Another instance of corepack installed ${locator.name}@${locator.reference}`); | |
| 22342 | 22390 | await import_fs4.default.promises.rm(tmpFolder, { recursive: true, force: true }); | |
| 22343 | 22391 | } else { | |
@@ -22376,7 +22424,7 @@ async function renameUnderWindows(oldPath, newPath) { | |||
| 22376 | 22424 | await import_fs4.default.promises.rename(oldPath, newPath); | |
| 22377 | 22425 | break; | |
| 22378 | 22426 | } 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) { | ||
| 22380 | 22428 | await (0, import_promises2.setTimeout)(100 * 2 ** i); | |
| 22381 | 22429 | continue; | |
| 22382 | 22430 | } else { | |
@@ -22467,44 +22515,6 @@ var import_valid = __toESM(require_valid()); | |||
| 22467 | 22515 | var import_valid2 = __toESM(require_valid2()); | |
| 22468 | 22516 | var import_util = require("util"); | |
| 22469 | 22517 | ||
| 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 | - | ||
| 22508 | 22518 | // sources/types.ts | |
| 22509 | 22519 | var SupportedPackageManagers = /* @__PURE__ */ ((SupportedPackageManagers3) => { | |
| 22510 | 22520 | SupportedPackageManagers3["Npm"] = `npm`; | |
@@ -22691,7 +22701,7 @@ async function loadSpec(initialCwd) { | |||
| 22691 | 22701 | onFail: selection.data.devEngines.packageManager.onFail | |
| 22692 | 22702 | }, | |
| 22693 | 22703 | // Lazy-loading it so we do not throw errors on commands that do not need valid spec. | |
| 22694 | - getSpec: () => parseSpec(rawPmSpec, import_path4.default.relative(initialCwd, selection.manifestPath)) | ||
| 22704 | + getSpec: ({ enforceExactVersion = true } = {}) => parseSpec(rawPmSpec, import_path4.default.relative(initialCwd, selection.manifestPath), { enforceExactVersion }) | ||
| 22695 | 22705 | }; | |
| 22696 | 22706 | } | |
| 22697 | 22707 | ||
@@ -22874,7 +22884,7 @@ var Engine = class { | |||
| 22874 | 22884 | * project using the default package managers, and configure it so that we | |
| 22875 | 22885 | * don't need to ask again in the future. | |
| 22876 | 22886 | */ | |
| 22877 | - async findProjectSpec(initialCwd, locator, { transparent = false } = {}) { | ||
| 22887 | + async findProjectSpec(initialCwd, locator, { transparent = false, binaryVersion } = {}) { | ||
| 22878 | 22888 | const fallbackDescriptor = { name: locator.name, range: `${locator.reference}` }; | |
| 22879 | 22889 | if (import_process3.default.env.COREPACK_ENABLE_PROJECT_SPEC === `0`) { | |
| 22880 | 22890 | if (typeof locator.reference === `function`) | |
@@ -22909,7 +22919,7 @@ var Engine = class { | |||
| 22909 | 22919 | return fallbackDescriptor; | |
| 22910 | 22920 | } | |
| 22911 | 22921 | case `Found`: { | |
| 22912 | - const spec = result.getSpec(); | ||
| 22922 | + const spec = result.getSpec({ enforceExactVersion: !binaryVersion }); | ||
| 22913 | 22923 | if (spec.name !== locator.name) { | |
| 22914 | 22924 | if (transparent) { | |
| 22915 | 22925 | if (typeof locator.reference === `function`) | |
@@ -22948,7 +22958,7 @@ var Engine = class { | |||
| 22948 | 22958 | reference: fallbackReference | |
| 22949 | 22959 | }; | |
| 22950 | 22960 | } | |
| 22951 | - const descriptor = await this.findProjectSpec(cwd, fallbackLocator, { transparent: isTransparentCommand }); | ||
| 22961 | + const descriptor = await this.findProjectSpec(cwd, fallbackLocator, { transparent: isTransparentCommand, binaryVersion }); | ||
| 22952 | 22962 | if (binaryVersion) | |
| 22953 | 22963 | descriptor.range = binaryVersion; | |
| 22954 | 22964 | const resolved = await this.resolveDescriptor(descriptor, { allowTags: true }); | |
@@ -23148,17 +23158,19 @@ var EnableCommand = class extends Command { | |||
| 23148 | 23158 | async generatePosixLink(installDirectory, distFolder, binName) { | |
| 23149 | 23159 | const file = import_path7.default.join(installDirectory, binName); | |
| 23150 | 23160 | const symlink = import_path7.default.relative(installDirectory, import_path7.default.join(distFolder, `${binName}.js`)); | |
| 23151 | - 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))) { | ||
| 23154 | - console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`); | ||
| 23155 | - return; | ||
| 23156 | - } | ||
| 23157 | - if (currentSymlink !== symlink) { | ||
| 23158 | - await import_fs9.default.promises.unlink(file); | ||
| 23159 | - } else { | ||
| 23160 | - return; | ||
| 23161 | + const stats = import_fs9.default.lstatSync(file, { throwIfNoEntry: false }); | ||
| 23162 | + if (stats) { | ||
| 23163 | + if (stats.isSymbolicLink()) { | ||
| 23164 | + const currentSymlink = await import_fs9.default.promises.readlink(file); | ||
| 23165 | + if (binName.includes(`yarn`) && isYarnSwitchPath(await import_fs9.default.promises.realpath(file))) { | ||
| 23166 | + console.warn(`${binName} is already installed in ${file} and points to a Yarn Switch install - skipping`); | ||
| 23167 | + return; | ||
| 23168 | + } | ||
| 23169 | + if (currentSymlink === symlink) { | ||
| 23170 | + return; | ||
| 23171 | + } | ||
| 23161 | 23172 | } | |
| 23173 | + await import_fs9.default.promises.unlink(file); | ||
| 23162 | 23174 | } | |
| 23163 | 23175 | await import_fs9.default.promises.symlink(symlink, file); | |
| 23164 | 23176 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "name": "corepack", | |
| 3 | - "version": "0.34.2", | ||
| 3 | + "version": "0.34.4", | ||
| 4 | 4 | "homepage": "https://github.com/nodejs/corepack#readme", | |
| 5 | 5 | "bugs": { | |
| 6 | 6 | "url": "https://github.com/nodejs/corepack/issues" | |
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | "./package.json": "./package.json" | |
| 17 | 17 | }, | |
| 18 | 18 | "license": "MIT", | |
| 19 | - "packageManager": "yarn@4.10.3+sha224.6020b3cdcdfbd7dbc24b7a7b75d58a249ce36068a8bf97d39aa8cc6d", | ||
| 19 | + "packageManager": "yarn@4.11.0+sha224.209a3e277c6bbc03df6e4206fbfcb0c1621c27ecf0688f79a0c619f0", | ||
| 20 | 20 | "devDependencies": { | |
| 21 | 21 | "@types/debug": "^4.1.5", | |
| 22 | 22 | "@types/node": "^20.4.6", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments