Skip to content

[cli] move builders to peer dependencies (try 2)#15023

Merged
mehulkar merged 9 commits intomainfrom
mk/peer-dep-builders-2
Feb 12, 2026
Merged

[cli] move builders to peer dependencies (try 2)#15023
mehulkar merged 9 commits intomainfrom
mk/peer-dep-builders-2

Conversation

@mehulkar
Copy link
Copy Markdown
Contributor

@mehulkar mehulkar commented Feb 12, 2026

Merged in #14763, reverted in #15022.

Re-submitting and running e2e tests now via label. e2e tests are coming back by default to PRs in #15008

  • Moves builders to peerDependencies and tells pnpm that they're optional dependencies. With this config, pnpm will not bundle them into the publishd vercel CLI, but they will be in the manifest.
  • Add a feature to the resolveBuilders function that reads the peerDependencies section of package.json at runtime and installs that correct version of the builder. It stores this builder in a local cache (.vercel/builders) so it only has to get them from the registry once.

Note

Low Risk Change

This PR moves builder packages from dependencies to peerDependencies and adds on-demand installation logic, which is a build/packaging infrastructure change without security implications.

  • Moves @vercel/* builders from dependencies to peerDependencies with optional metadata
  • Adds resolveBuilders logic to install builders from peerDeps on demand to .vercel/builders cache
  • Updates CI workflows and tests to handle peer dependency builds

Risk assessment for commit 7d94411.

- Moves builders to peerDependencies and tells pnpm that they're
optional dependencies. With this config, `pnpm` will not bundle them
into the publishd `vercel` CLI, but they will be in the manifest.
- Add a feature to the `resolveBuilders` function that reads the
peerDependencies section of package.json at runtime and installs that
correct version of the builder. It stores this builder in a local cache
(`.vercel/builders`) so it only has to get them from the registry once.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 7d94411

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Minor

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

@mehulkar mehulkar changed the title [cli] move builders to peer dependencies (#14763) [cli] move builders to peer dependencies Feb 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 12, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-gngswvl5n.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-gngswvl5n.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 12, 2026

🧪 Unit Test Strategy

Comparing: cf38fab7d94411 (view diff)

Strategy: Code changed outside of a package - running all unit tests

⚠️ All unit tests will run because global code changes could impact all packages.

Affected packages - 15 (38%)
  1. vercel
  2. @vercel/build-utils
  3. @vercel/client
  4. @vercel/firewall
  5. @vercel/fs-detectors
  6. @vercel/go
  7. @vercel/hydrogen
  8. @vercel/next
  9. @vercel/node
  10. @vercel/python
  11. @vercel/remix-builder
  12. @vercel/ruby
  13. @vercel/rust
  14. @vercel/static-build
  15. examples
Unaffected packages - 25 (63%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/cervel
  4. @vercel/cli-auth
  5. @vercel/config
  6. @vercel/detect-agent
  7. @vercel/edge
  8. @vercel/elysia
  9. @vercel/error-utils
  10. @vercel/express
  11. @vercel/fastify
  12. @vercel/frameworks
  13. @vercel/functions
  14. @vercel/gatsby-plugin-vercel-builder
  15. @vercel/h3
  16. @vercel/hono
  17. @vercel/koa
  18. @vercel/nestjs
  19. @vercel/oidc
  20. @vercel/oidc-aws-credentials-provider
  21. @vercel/python-analysis
  22. @vercel/redwood
  23. @vercel/related-projects
  24. @vercel/routing-utils
  25. @vercel/static-config

Results

  • Unit tests: All affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: All affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@mehulkar mehulkar changed the title [cli] move builders to peer dependencies [cli] move builders to peer dependencies (try 2) Feb 12, 2026
@mehulkar mehulkar marked this pull request as ready for review February 12, 2026 15:28
@mehulkar mehulkar requested review from a team and ijjk as code owners February 12, 2026 15:28
@mehulkar mehulkar requested a review from jeffsee55 February 12, 2026 15:31
mehulkar added a commit that referenced this pull request Feb 12, 2026
I"m seeing the 11ty builder fail in
#15023, and can't explain why.
Probably has to do with which builder is being resolved. Adding some
debug logging here

<!-- VADE_RISK_START -->
> [!NOTE]
> Low Risk Change
>
> This PR adds debug logging for resolved builders and documentation
comments, with no security or logic changes.
> 
> - Adds debug log output showing resolved builder versions
> - Adds JSDoc comments to BuilderWithPkg interface properties
> - Adds description field to static-build package.json
>
> <sup>Risk assessment for [commit
9547170](https://github.com/vercel/vercel/commit/9547170eaa7136321f2e4ec7cfc7dee0cbc376b6).</sup>
<!-- VADE_RISK_END -->
@mehulkar mehulkar merged commit 127547d into main Feb 12, 2026
196 of 198 checks passed
@mehulkar mehulkar deleted the mk/peer-dep-builders-2 branch February 12, 2026 21:42
mehulkar pushed a commit that referenced this pull request Feb 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## vercel@50.17.0

### Minor Changes

- Install builder packages on demand
([#15023](#15023))

- Display functions exceeding 250MB uncompressed size limit with total
size and breakdown of largest dependencies (requires environment
variable VERCEL_ANALYZE_BUILD_OUTPUT=1).
([#14067](#14067))

### Patch Changes

- Add `--format=json` option to `vercel integration list` and show
project name in table header when results are scoped to a project
([#15007](#15007))

- Fix builder import resolution from pre-installed depenencies
([#15041](#15041))

- Services routing improvements:
([#15018](#15018))

- Fix route ownership scoping so parent service catch-alls (e.g. Vite
SPA fallback) don't capture sibling service prefixes
- Move shared ownership-guard helpers (`getOwnershipGuard`,
`scopeRouteSourceToOwnership`) to `@vercel/routing-utils`
- Place runtime service function outputs under internal
`/_svc/<service>/index` namespace to prevent filesystem path leakage
    -   Block `/_svc` as a reserved routePrefix in service validation
- Scope all builder-emitted routes (not just route-owning builders) to
their service ownership before merging

-   Updated dependencies \[]:
    -   @vercel/static-build@2.8.37
    -   @vercel/build-utils@13.4.0
    -   @vercel/next@4.15.28
    -   @vercel/redwood@2.4.9
    -   @vercel/rust@1.0.5

## @vercel/client@17.2.41

### Patch Changes

- Updated dependencies
\[[`3cd0b559f1815fdb13f7aa05114bae2b0b0b0e68`](3cd0b55)]:
    -   @vercel/routing-utils@5.3.3
    -   @vercel/build-utils@13.4.0

## @vercel/fs-detectors@5.8.6

### Patch Changes

- Services routing improvements:
([#15018](#15018))

- Fix route ownership scoping so parent service catch-alls (e.g. Vite
SPA fallback) don't capture sibling service prefixes
- Move shared ownership-guard helpers (`getOwnershipGuard`,
`scopeRouteSourceToOwnership`) to `@vercel/routing-utils`
- Place runtime service function outputs under internal
`/_svc/<service>/index` namespace to prevent filesystem path leakage
    -   Block `/_svc` as a reserved routePrefix in service validation
- Scope all builder-emitted routes (not just route-owning builders) to
their service ownership before merging

- Updated dependencies
\[[`3cd0b559f1815fdb13f7aa05114bae2b0b0b0e68`](3cd0b55)]:
    -   @vercel/routing-utils@5.3.3
    -   @vercel/frameworks@3.17.1

## @vercel/routing-utils@5.3.3

### Patch Changes

- Services routing improvements:
([#15018](#15018))

- Fix route ownership scoping so parent service catch-alls (e.g. Vite
SPA fallback) don't capture sibling service prefixes
- Move shared ownership-guard helpers (`getOwnershipGuard`,
`scopeRouteSourceToOwnership`) to `@vercel/routing-utils`
- Place runtime service function outputs under internal
`/_svc/<service>/index` namespace to prevent filesystem path leakage
    -   Block `/_svc` as a reserved routePrefix in service validation
- Scope all builder-emitted routes (not just route-owning builders) to
their service ownership before merging


<!-- VADE_RISK_START -->
> [!NOTE]
> Low Risk Change
>
> This PR is an automated Changesets release that only updates version
numbers in package.json files and adds changelog entries - no source
code changes are present.
> 
> - Deletes changeset markdown files after consuming them
> - Bumps version numbers in 4 package.json files
> - Adds changelog entries documenting previous changes
>
> <sup>Risk assessment for [commit
9186d29](https://github.com/vercel/vercel/commit/9186d293adee9d555b8582f5c1d0cec87689acf1).</sup>
<!-- VADE_RISK_END -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
mehulkar added a commit that referenced this pull request Feb 16, 2026
2 commits related moving builders out of the bundle:

- #15023
- #15041

Since it's isn't a clean revert, I've:

- moved builders back into dependencies, and reverted import-builders
and its tests to the commit at 3cd0b55
(parent of
127547d).
No other commits have landed to these files since then, so it seems like
the best way of doing this.

This commit also contains a timestamp update on all builders `.deploy`
files. This is just a way to invalidate the builders so all e2e tests
run on this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants