feat: centralize application framework primitives
Quality / quality (ubuntu-latest) (push) Failing after 14m38s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-08-22 23:07:46 +05:30
1 parent 96e082b943
commit a3ddd39b7b
73 files changed
+1429 -84

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { runBuild } from "./build.ts";
import { runTypecheck } from "./types.ts";
async function runScript(root: string, name: string): Promise<void> {
const child = Bun.spawn(["bun", "run", name], {
cwd: root,
stdin: "inherit",
stdout: "inherit",
stderr: "inherit",
});
const code = await child.exited;
if (code !== 0) throw new Error(`WRN-CHECK: '${name}' failed with exit code ${code}`);
}
/** Canonical generated-artifact-aware application verification pipeline. */
export async function runCheck(appRoot: string): Promise<void> {
const root = resolve(appRoot);
const manifest = JSON.parse(readFileSync(resolve(root, "package.json"), "utf8")) as {
scripts?: Record<string, string>;
};
await runBuild(root);
if (!(await runTypecheck(root))) throw new Error("WRN-CHECK: application typecheck failed");
for (const name of ["lint", "test", "format:check"] as const) {
if (manifest.scripts?.[name]) await runScript(root, name);
}
}