Update npm commands in sync.sh to include workspace root dependencies

This commit is contained in:
Mario Campos
2026-09-10 17:22:50 -05:00
parent f6491d646e
commit 297617deb9

View File

@@ -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