-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathbuild.js
More file actions
24 lines (19 loc) · 872 Bytes
/
Copy pathbuild.js
File metadata and controls
24 lines (19 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { spawnSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, "..");
function run(command, args, label) {
process.stdout.write(`\n[${label}] ${command} ${args.join(" ")}\n`);
const result = spawnSync(command, args, { stdio: "inherit", cwd: root, shell: true });
if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}
console.log("=========================================");
console.log(" Deep Code CLI — Build");
console.log("=========================================");
run("npm", ["run", "build", "--workspace=@vegamo/deepcode-core"], "1/3");
run("node", ["scripts/rewrite-esm-imports.js"], "2/3");
run("npm", ["run", "bundle"], "3/3");
console.log("\n✅ Build complete.\n\n");