fix: pass rootDirectory in projectSettings for monorepo deployments
FE
6mo ago+1900+1900+0123456789012345678901234567890123456789-2188-2188-0123456789012345678901234567890123456789
Summary
When deploying monorepos via the API, the root-directory input is only passed
to @vercel/client's clientOptions (local file hashing) but never included
in the POST /v13/deployments body as projectSettings.rootDirectory.
Without this, Vercel's build server falls back to the repo root, fails to detect
the correct package manager (e.g. pnpm), and uses npm — which breaks on
workspace:* protocol with EUNSUPPORTEDPROTOCOL.
Changes
- Pass
projectSettings.rootDirectoryin the deployment options when
root-directoryis set - Add new
source-files-outside-root-directoryinput (default:true) to
support monorepos where dependencies live outside the root directory - Add unit tests for the new behavior
Test plan
- Existing unit tests pass (196/196)
- Action builds successfully
- Tested with a real monorepo deployment (pnpm + turborepo)
Summary by cubic
Fixes monorepo deployments by sending projectSettings.rootDirectory and optionally sourceFilesOutsideRootDirectory, and adds a node-version input to control Vercel’s Node.js version.
-
Bug Fixes
- Include
projectSettings.rootDirectoryinPOST /v13/deploymentsto avoid falling back to the repo root and mis-detecting the package manager. - Always apply action inputs even when
vercel.jsonexists; includerootDirectoryand/orsourceFilesOutsideRootDirectoryonly when set, and treat them independently.
- Include
-
New Features
- Added
node-versioninput to setprojectSettings.nodeVersion; the input takes precedence, and when unset falls back topackage.jsonengines.node. - Added
source-files-outside-root-directoryinput (defaultfalse) for monorepos with shared packages outside the root.
- Added