From 297617deb9b0f9856a54fb2db2f47cc75fce6b63 Mon Sep 17 00:00:00 2001 From: Mario Campos Date: Thu, 10 Sep 2026 17:22:50 -0500 Subject: [PATCH] Update npm commands in sync.sh to include workspace root dependencies --- pr-checks/sync.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pr-checks/sync.sh b/pr-checks/sync.sh index c05959449..dd0e0b468 100755 --- a/pr-checks/sync.sh +++ b/pr-checks/sync.sh @@ -4,12 +4,19 @@ set -e cd "$(dirname "$0")" # Run `npm ci` in CI or `npm install` otherwise. +# +# `pr-checks` is an npm workspace of the repository root and the two share a single hoisted +# `node_modules` directory. Running npm from this directory puts it in workspace mode, where it +# ignores the root project's own dependencies by default. `npm ci` would then rebuild the shared +# `node_modules` with only this workspace's dependencies, removing the root's ones, which breaks +# anything that imports from `src` (such as `sync.ts` itself). `--include-workspace-root` keeps the +# root project's dependencies in the installed tree. if [ "$GITHUB_ACTIONS" = "true" ]; then echo "In Actions, running 'npm ci' for 'sync.ts'..." - npm ci + npm ci --include-workspace-root else echo "Running 'npm install' for 'sync.ts'..." - npm install --no-audit --no-fund + npm install --no-audit --no-fund --include-workspace-root fi npx tsx sync.ts