Conversation
Prefer .vercel/project.json over repo.json and skip eager linked-project lookup when relinking. Co-authored-by: Marcos Grappeggia <Grappeggia@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
🦋 Changeset detectedLatest commit: 184f2d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-h36qe0puv.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-h36qe0puv.vercel.sh/tarballs/vercel.tgz"
}
}
} |
🧪 Unit Test StrategyComparing: Strategy: Code changed outside of a package - running all unit tests Affected packages - 15 (38%)
Unaffected packages - 25 (63%)
Results
This comment is automatically generated based on the affected testing strategy |
Fallback to latest successful Vercel preview in PR when head commit has no deployment (e.g. changes that don't affect tarballs).
…onorepo projects Reverts the precedence change from #15017 that caused `getProjectLink()` to check `project.json` before `repo.json`. For repo-linked monorepos, `writeProjectSettings()` writes a settings-only `project.json` (without `projectId`/`orgId`), which then failed AJV validation on subsequent runs with "Project Settings are invalid". Changes: - Restore original `repo.json`-first precedence in `getProjectLink()` - Return `null` from `getLinkFromDir()` on validation failure instead of throwing, since a settings-only file is not corrupted - Ignore orphaned settings-only `project.json` in `vc build` when no link is found, so the user is properly prompted to re-link
Fixes
vc linkprompting for project selection twice and ensuresenv pulluses the newly linked project.The CLI previously prompted twice for project selection during
vc linkbecauseensureLink()eagerly calledgetLinkedProject()even when relinking, which could trigger a repo-level project selection prompt. Additionally,getProjectLink()incorrectly prioritized.vercel/repo.jsonover a freshly created.vercel/project.json, leadingenv pullto re-prompt and potentially fetch environment variables for the wrong project. This PR ensures local project links take precedence and avoids the eager lookup during relinking.Slack Thread
Note
Low Risk Change
This PR fixes CLI UX issues with duplicate prompts during
vc linkby changing the order of precedence for project link resolution and skipping eager lookups during relinking; changes are limited to CLI logic, CI workflow improvements, and tests.project.jsonoverrepo.jsonRisk assessment for commit 184f2d3.