refactor(build): expose prepack finalization

This commit is contained in:
Vincent Koc
2026-07-11 04:37:16 -07:00
committed by Vincent Koc
parent 9523a52871
commit 451d6314fc

View File

@@ -216,18 +216,22 @@ async function writeDistInventory(): Promise<void> {
await writePackageDistInventory(process.cwd());
}
async function main(): Promise<void> {
const buildEnv = resolvePrepackBuildEnvironment();
runPnpm(["build"], buildEnv);
runPnpm(["ui:build"], buildEnv);
export async function preparePrepackArtifacts(env: NodeJS.ProcessEnv = process.env): Promise<void> {
ensurePreparedArtifacts();
await writeDistInventory();
runBuildSmoke();
await preparePackageChangelog(process.cwd(), {
allowUnreleased: resolvePrepackAllowUnreleasedChangelog(),
allowUnreleased: resolvePrepackAllowUnreleasedChangelog(env),
});
}
async function main(): Promise<void> {
const buildEnv = resolvePrepackBuildEnvironment();
runPnpm(["build"], buildEnv);
runPnpm(["ui:build"], buildEnv);
await preparePrepackArtifacts(buildEnv);
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
await main();
}