2026-06-19 23:18:19 +00:00
|
|
|
import concurrently from "concurrently";
|
2026-06-24 08:03:40 +00:00
|
|
|
import { commandPlan } from "./check-plan.mjs";
|
2026-06-19 23:18:19 +00:00
|
|
|
|
|
|
|
|
const args = process.argv.slice(2);
|
|
|
|
|
const validArgs = new Set(["--ci", "--lint"]);
|
|
|
|
|
const unknownArgs = args.filter((arg) => !validArgs.has(arg));
|
|
|
|
|
|
|
|
|
|
if (unknownArgs.length > 0) {
|
|
|
|
|
console.error("Usage: node scripts/check.mjs [--ci] [--lint]");
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ciMode = args.includes("--ci");
|
|
|
|
|
const lintOnly = args.includes("--lint");
|
|
|
|
|
const concurrentOptions = {
|
|
|
|
|
group: true,
|
|
|
|
|
padPrefix: true,
|
|
|
|
|
prefix: "name",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
try {
|
2026-06-24 08:03:40 +00:00
|
|
|
const plan = commandPlan({ ciMode, lintOnly });
|
|
|
|
|
for (const phase of plan.phases) {
|
|
|
|
|
await runConcurrently(phase.commands);
|
2026-06-19 23:18:19 +00:00
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function runConcurrently(commands) {
|
|
|
|
|
await concurrently(commands, concurrentOptions).result;
|
|
|
|
|
}
|