fix: bump missing packages to 0.2.0 and handle 404 in npmVersionExists

- Bump acp-http-client and persist-* packages from 0.1.0 to 0.2.0
- Fix npmVersionExists to handle 404 for never-published packages
This commit is contained in:
Nathan Flurry 2026-02-11 17:57:02 -08:00
parent 46193747e6
commit cb1f770b47
6 changed files with 14 additions and 14 deletions

View file

@ -81,16 +81,16 @@ async function npmVersionExists(
return true;
} catch (error: any) {
if (error.stderr) {
if (
!error.stderr.includes(
`No match found for version ${version}`,
) &&
!error.stderr.includes(
`'${packageName}@${version}' is not in this registry.`,
)
) {
const stderr = error.stderr;
// Expected errors when version or package doesn't exist
const expected =
stderr.includes(`No match found for version ${version}`) ||
stderr.includes(`'${packageName}@${version}' is not in this registry.`) ||
stderr.includes("404 Not Found") ||
stderr.includes("is not in the npm registry");
if (!expected) {
throw new Error(
`unexpected npm view version output: ${error.stderr}`,
`unexpected npm view version output: ${stderr}`,
);
}
}