From dfe01e4f18647f723506f79b827eea3bc8e7ad06 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 10 Feb 2026 17:10:13 +0000 Subject: [PATCH] Improve pnpm-link script Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- scripts/pnpm-link.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/pnpm-link.ts b/scripts/pnpm-link.ts index d928643bc4..6797b11083 100755 --- a/scripts/pnpm-link.ts +++ b/scripts/pnpm-link.ts @@ -16,6 +16,7 @@ Please see LICENSE files in the repository root for full details. import fs from "node:fs/promises"; import { join, dirname } from "node:path"; import { fileURLToPath } from "node:url"; +import { execSync } from "node:child_process"; const __dirname = dirname(fileURLToPath(import.meta.url)); const configPath = join(__dirname, "..", ".link-config"); @@ -43,6 +44,11 @@ try { console.log(`Linking ${dependency} to ${path}`); await fs.symlink(path, dependencyPath); + + // pnpm install may have wiped out the `node_modules` dir so we have to restore it + execSync("pnpm i --ignore-scripts --frozen-lockfile", { + cwd: dependencyPath, + }); } catch (e) { console.error(`Failed to link ${dependency}`, e); }