fix: switch to nodeModulesDir: "manual" (#3588)

The `"auto"` value causes all kinds of race conditions between various
processes trying to auto install their view of dependencies.
This commit is contained in:
Marvin Hagemeister
2025-10-30 14:50:49 +01:00
committed by GitHub
parent 45bb094bd6
commit 5e94dfe9fd
6 changed files with 129 additions and 28 deletions
+11 -1
View File
@@ -86,6 +86,7 @@ export async function initProject(
builder?: boolean | null;
help?: boolean | null;
h?: boolean | null;
skipInstall?: boolean | null;
} = {},
): Promise<void> {
const freshVersion = await getLatestVersion("@fresh/core", FRESH_VERSION);
@@ -559,7 +560,7 @@ if (Deno.args.includes("build")) {
}
const denoJson = {
nodeModulesDir: "auto",
nodeModulesDir: "manual",
tasks: {
check: "deno fmt --check . && deno lint . && deno check",
dev: "deno run -A --watch=static/,routes/ dev.ts",
@@ -763,6 +764,15 @@ This will watch the project directory and restart as necessary.`;
}
}
if (!flags.skipInstall) {
console.log("Installing dependencies...");
await new Deno.Command(Deno.execPath(), {
cwd: unresolvedDirectory,
args: ["install"],
}).output();
console.log("Installing dependencies...%cdone!", "color: green");
}
// Specifically print unresolvedDirectory, rather than resolvedDirectory in order to
// not leak personal info (e.g. `/Users/MyName`)
console.log(