fix(update): verify packaged dist inventory

This commit is contained in:
Ayaan Zaidi
2026-04-15 08:55:44 +05:30
parent 277885f0a4
commit 18d0af3a13
7 changed files with 164 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import { spawnSync } from "node:child_process";
import { existsSync, readdirSync } from "node:fs";
import { pathToFileURL } from "node:url";
import { formatErrorMessage } from "../src/infra/errors.ts";
import { writePackageDistInventory } from "../src/infra/package-dist-inventory.ts";
const skipPrepackPreparedEnv = "OPENCLAW_PREPACK_PREPARED";
const requiredPreparedPathGroups = [
@@ -116,18 +117,24 @@ function runBuildSmoke(): void {
run(process.execPath, ["scripts/test-built-bundled-channel-entry-smoke.mjs"]);
}
function main(): void {
async function writeDistInventory(): Promise<void> {
await writePackageDistInventory(process.cwd());
}
async function main(): Promise<void> {
const pnpmCommand = process.platform === "win32" ? "pnpm.cmd" : "pnpm";
if (shouldSkipPrepack()) {
ensurePreparedArtifacts();
await writeDistInventory();
runBuildSmoke();
return;
}
run(pnpmCommand, ["build"]);
run(pnpmCommand, ["ui:build"]);
await writeDistInventory();
runBuildSmoke();
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
main();
await main();
}