diff --git a/patches/@changesets__cli@2.31.0.patch b/patches/@changesets__cli@2.31.0.patch index 5f073b376..424948bb0 100644 --- a/patches/@changesets__cli@2.31.0.patch +++ b/patches/@changesets__cli@2.31.0.patch @@ -1,8 +1,33 @@ diff --git a/dist/changesets-cli.cjs.js b/dist/changesets-cli.cjs.js -index 9f0bd6c5f96011be225269a71365a878cb822bb7..bdfeb1dee761de629736e750a1d3f16eb1dedadc 100644 +index 9f0bd6c5f9..21405ffde2 100644 --- a/dist/changesets-cli.cjs.js +++ b/dist/changesets-cli.cjs.js -@@ -870,7 +870,7 @@ async function infoAllow404(packageJson) { +@@ -842,9 +842,23 @@ function getPackageInfo(packageJson) { + } + }; + } +- return jsonParse(result.stdout.toString()); ++ return normalizeNpmInfo(jsonParse(result.stdout.toString())); + }); + } ++// npm 12 prints `npm info --json` as a one-element array around the ++// packument. Changesets reads `.versions` on that document; an array has ++// none, so every current version looks unpublished. ++function normalizeNpmInfo(parsed) { ++ if (!Array.isArray(parsed)) return parsed; ++ const withVersions = parsed.find(item => item && Array.isArray(item.versions)); ++ if (withVersions) return withVersions; ++ if (parsed.length === 1 && parsed[0] && typeof parsed[0] === "object") return parsed[0]; ++ return { ++ error: { ++ code: "E404" ++ } ++ }; ++} + async function infoAllow404(packageJson) { + var _pkgInfo$error; + let pkgInfo = await getPackageInfo(packageJson); +@@ -870,7 +884,7 @@ async function infoAllow404(packageJson) { // we check `npm info` before publishing but `npm info` can return stale data at times // so we need to gracefully handle this situation function isAlreadyPublishedError(output) { @@ -11,12 +36,12 @@ index 9f0bd6c5f96011be225269a71365a878cb822bb7..bdfeb1dee761de629736e750a1d3f16e } // we have this so that we can do try a publish again after a publish without // the call being wrapped in the npm request limit and causing the publishes to potentially never run -@@ -950,7 +950,7 @@ async function internalPublish(packageJson, opts, twoFactorState) { +@@ -954,7 +968,7 @@ async function internalPublish(packageJson, opts, twoFactorState) { let json = getLastJsonObjectFromString(stderr.toString()) || getLastJsonObjectFromString(stdout.toString()); if (json !== null && json !== void 0 && json.error) { var _json$error$detail; - if (json.error.code === "E403" && isAlreadyPublishedError(json.error.summary)) { -+ if (json.error.code === "E403" && [json.error.summary, json.error.detail, json.error.message].some(isAlreadyPublishedError)) { ++ if ((json.error.code === "E403" || json.error.code === "ERR_PNPM_FAILED_TO_PUBLISH") && [json.error.summary, json.error.detail, json.error.message].some(isAlreadyPublishedError)) { // we don't need to log anything here, it just turned out the version was already published so we gracefully exit the publish process return { result: "skipped" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4eff72fcd..7655bb4a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -222,7 +222,7 @@ overrides: vue: ^3.5.35 patchedDependencies: - "@changesets/cli@2.31.0": 95925d75f7717446362cdc612dba13b5c4df074f3ca64d90c068ff405c8e1b27 + "@changesets/cli@2.31.0": c9b080d02343ec5517f97d61b809f935de0d61aa5406ff37449ef3e5fae12086 "@sendgrid/mail": 3d2dd1cd5f52d3eef1772e4be48776258a596f9277c00adf0a471f54fcd3e21a "@tanstack/query-core": c98953cf4906c12283dbf72aa23b2066fccbe5186c91cf2ae01043004cf0e3f2 ts-plugin-sort-import-suggestions: 4664506575d0f4e799401cb7140b6f15f34a6fe213da6314d68439f7e8d30561 @@ -240,7 +240,7 @@ importers: devDependencies: "@changesets/cli": specifier: ^2.31.0 - version: 2.31.0(patch_hash=95925d75f7717446362cdc612dba13b5c4df074f3ca64d90c068ff405c8e1b27)(@types/node@25.9.1) + version: 2.31.0(patch_hash=c9b080d02343ec5517f97d61b809f935de0d61aa5406ff37449ef3e5fae12086)(@types/node@25.9.1) "@effect-app/cli": specifier: workspace:* version: link:packages/cli @@ -10144,7 +10144,7 @@ snapshots: dependencies: "@changesets/types": 6.1.0 - "@changesets/cli@2.31.0(patch_hash=95925d75f7717446362cdc612dba13b5c4df074f3ca64d90c068ff405c8e1b27)(@types/node@25.9.1)": + "@changesets/cli@2.31.0(patch_hash=c9b080d02343ec5517f97d61b809f935de0d61aa5406ff37449ef3e5fae12086)(@types/node@25.9.1)": dependencies: "@changesets/apply-release-plan": 7.1.1 "@changesets/assemble-release-plan": 6.0.10