feat: unify package artifact validation (#10197)

* feat: unify package artifact validation

* fix: restrict local artifact output paths

* fix: clarify package artifact module names

* feat: support pnpm package artifact consumers

* fix: preserve local release package installs

Keep npm and Bun consumer installs as runnable release artifacts while retaining isolated validation for other packages. Simplify smoke fixtures and avoid redundant release work.
This commit is contained in:
Christian Klotz 2026-10-06 13:30:02 +02:00 • committed by GitHub
parent 428a12bc77
commit 23cf2b948d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1172 additions and 512 deletions

48
scripts/pack-packages.mjs Normal file
View file

@ -0,0 +1,48 @@
#!/usr/bin/env node
import { resolve } from "node:path";
import { parseArgs } from "node:util";
import { produceArtifactSet } from "./package-artifacts.mjs";
function printUsage() {
console.log(`Usage: node scripts/pack-packages.mjs --out <dir> [options]
Builds every public package and writes one coherent local artifact set.
Options:
--out <dir> Output directory; .artifacts/ is ignored by Git
--force Replace an existing output directory
--offline-model-data Build with already-hydrated model data
--skip-build Pack existing build output without rebuilding
--help Show this help
`);
}
const { values } = parseArgs({
options: {
force: { type: "boolean", default: false },
help: { type: "boolean", default: false },
"offline-model-data": { type: "boolean", default: false },
out: { type: "string" },
"skip-build": { type: "boolean", default: false },
},
});
if (values.help) {
printUsage();
process.exit(0);
}
if (!values.out) throw new Error("--out is required");
const artifactSet = produceArtifactSet({
build: !values["skip-build"],
force: values.force,
offlineModelData: values["offline-model-data"],
outDir: values.out,
repoRoot: process.cwd(),
});
console.log(`\nLocal package artifacts created: ${artifactSet.artifactDirectory}`);
console.log(`Manifest: ${artifactSet.manifestPath}`);
console.log("\nConnect an external npm project with:");
console.log(
` node ${resolve("scripts/use-local-packages.mjs")} --manifest ${artifactSet.manifestPath} --consumer <project> --package <name>`,
);