fix(release): skip lifecycle scripts in npm precheck

This commit is contained in:
Peter Steinberger
2026-03-28 22:29:47 +00:00
parent 587e18cd3f
commit 1249dad6c4

View File

@@ -418,23 +418,25 @@ function collectPackedTarballErrors(): string[] {
const errors: string[] = [];
let stdout = "";
try {
stdout = runNpmCommand(["pack", "--json", "--dry-run"]);
stdout = runNpmCommand(["pack", "--json", "--dry-run", "--ignore-scripts"]);
} catch (error) {
const message = describeExecFailure(error);
errors.push(
`Failed to inspect npm tarball contents via \`npm pack --json --dry-run\`: ${message}`,
`Failed to inspect npm tarball contents via \`npm pack --json --dry-run --ignore-scripts\`: ${message}`,
);
return errors;
}
const packResults = parseNpmPackJsonOutput(stdout);
if (!packResults) {
errors.push("Failed to parse JSON output from `npm pack --json --dry-run`.");
errors.push("Failed to parse JSON output from `npm pack --json --dry-run --ignore-scripts`.");
return errors;
}
const firstResult = packResults[0];
if (!firstResult || !Array.isArray(firstResult.files)) {
errors.push("`npm pack --json --dry-run` did not return a files list to validate.");
errors.push(
"`npm pack --json --dry-run --ignore-scripts` did not return a files list to validate.",
);
return errors;
}