🎉 init: 小龙的工作空间

This commit is contained in:
大海
2026-06-06 10:40:48 +08:00
commit a188ee1426
3201 changed files with 231817 additions and 0 deletions
@@ -0,0 +1,32 @@
#!/usr/bin/env node
/**
* Dev script — starts both web and api in parallel.
* Usage: node scripts/dev.mjs
*/
import { spawn } from "node:child_process";
function start(name, command, args, cwd) {
const child = spawn(command, args, {
cwd,
stdio: "inherit",
shell: true,
env: { ...process.env, FORCE_COLOR: "1" },
});
child.on("error", (err) => console.error(`[${name}] Failed: ${err.message}`));
child.on("exit", (code) => {
if (code !== 0 && code !== null) console.error(`[${name}] Exited with code ${code}`);
});
return child;
}
const ROOT = new URL("..", import.meta.url).pathname;
console.log("🚀 Starting fullstack dev servers...\n");
const api = start("api", "npm", ["run", "dev"], `${ROOT}/apps/api`);
const web = start("web", "npm", ["run", "dev"], `${ROOT}/apps/web`);
process.on("SIGINT", () => { api.kill(); web.kill(); process.exit(0); });
process.on("SIGTERM", () => { api.kill(); web.kill(); process.exit(0); });