feat: branch protection + deps caching

This commit is contained in:
2026-05-31 02:44:12 -05:00
parent d5d2e5b58e
commit 19671c6299
6 changed files with 40 additions and 23 deletions
+24 -5
View File
@@ -11,11 +11,30 @@ const dir = dirname(fileURLToPath(import.meta.url));
if (!existsSync(`${dir}/node_modules`)) {
console.error("» installing dependencies...");
execSync("npm install --no-fund --no-audit", {
cwd: dir,
stdio: "inherit",
timeout: 120_000,
});
// Try to activate pnpm via corepack (Node 24 ships corepack).
// If that works, use pnpm with the lockfile for a fast, reproducible install.
// Otherwise fall back to plain npm install.
let installed = false;
try {
execSync("corepack enable pnpm", { stdio: "pipe" });
execSync("pnpm install --frozen-lockfile", {
cwd: dir,
stdio: "inherit",
timeout: 120_000,
});
installed = true;
} catch {
// corepack or pnpm not available
}
if (!installed) {
execSync("npm install --no-fund --no-audit", {
cwd: dir,
stdio: "inherit",
timeout: 120_000,
});
}
}
const [{ main }, core] = await Promise.all([