Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
import { spawnSync } from "node:child_process";
|
|
import fs from "node:fs";
|
|
import { fingerprint, readState, root, writeState } from "./web-build-fingerprint.mjs";
|
|
|
|
const currentFingerprint = fingerprint();
|
|
const state = readState("web-build-success.json");
|
|
const index = `${root}/web/dist/index.html`;
|
|
if (state?.fingerprint === currentFingerprint && fs.existsSync(index)) {
|
|
process.stdout.write(`web-build-reused fingerprint=${currentFingerprint}\n`);
|
|
process.exit(0);
|
|
}
|
|
|
|
if (process.env.WBV2_SKIP_TYPECHECK !== "1") {
|
|
const typecheck = spawnSync(process.execPath, ["tools/web/run-incremental-typecheck.mjs"], {
|
|
cwd: root,
|
|
stdio: "inherit",
|
|
});
|
|
if (typecheck.status !== 0) process.exit(typecheck.status ?? 1);
|
|
}
|
|
const vite = spawnSync(process.execPath, ["./node_modules/vite/bin/vite.js", "build", "--config", "app/vite.config.ts"], {
|
|
cwd: `${root}/web`,
|
|
stdio: "inherit",
|
|
});
|
|
if (vite.status !== 0) process.exit(vite.status ?? 1);
|
|
writeState("web-build-success.json", { schemaVersion: 1, fingerprint: currentFingerprint });
|