From 29afa08053a593f922d9f22d831a88e675816822 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 13 Aug 2026 14:30:21 -0700 Subject: [PATCH] Update link_deps for pnpm 11 --- .husky/pre-commit | 2 +- link_deps | 7 ++++++- pnpm-workspace.yaml | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 7083da50..f7d48723 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,7 @@ pnpm run lint pnpm run check -if [[ ! -z $(cat package.json | grep 'link:') ]]; then +if [[ ! -z $(grep 'link:' package.json pnpm-workspace.yaml) ]]; then echo "Some packages are linked to local files!" exit 1 fi diff --git a/link_deps b/link_deps index b6b4d64b..6600bc55 100755 --- a/link_deps +++ b/link_deps @@ -49,5 +49,10 @@ fs.writeFileSync(file, workspace.replace(/^overrides:$/m, `overrides:\n${links}` try { execSync('pnpm i', { stdio: 'inherit' }) } finally { - execSync(`git checkout -f ${file} pnpm-lock.yaml`, { stdio: 'inherit' }) + // Restore what was read rather than checking the file out, so any unrelated edits survive. + fs.writeFileSync(file, workspace) + execSync('git checkout -f pnpm-lock.yaml', { stdio: 'inherit' }) } + +console.log('\nWelshman is linked. pnpm will warn that node_modules is out of sync until you') +console.log('run `pnpm i` again, which unlinks it.') diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8c27bfba..f86777f4 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,6 @@ +# Allow link_deps to change stuff in the working tree +verifyDepsBeforeRun: warn + allowBuilds: nostr-signer-capacitor-plugin: true cbor-extract: false