Harden local setup and development startup

This commit is contained in:
2026-07-25 17:14:19 -06:00
parent e8d2435cc2
commit feaa882fc3
10 changed files with 221 additions and 46 deletions
+17
View File
@@ -0,0 +1,17 @@
import path from "node:path";
import { spawnSync } from "node:child_process";
const cacheDir = path.resolve(".cache", "npm");
const npmCli = process.env.npm_execpath || path.join(path.dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js");
const result = spawnSync(process.execPath, [npmCli, "ci", "--cache", cacheDir], {
stdio: "inherit",
// Invoke npm-cli.js through node so paths with spaces need no shell quoting.
shell: false,
});
if (result.error) {
console.error(`No se pudo ejecutar npm: ${result.error.message}`);
process.exit(1);
}
process.exit(result.status ?? 1);