Commit Graph

3 Commits

Author SHA1 Message Date
Sebastian "Sebbie" Silbermann 7240c74b23 [ci] Create unique preview build versions for canary previews (#93490) 2026-05-05 15:39:45 +02:00
Joseph 762bff650f fix: run lerna on a branch (#91092)
Trying to fix: `lerna ERR! ENOGIT Detached git HEAD, please checkout a
branch to choose versions.` on `set-preview-version.js`

[Slack
thread](https://vercel.slack.com/archives/C02CDC2ALJH/p1773051154649349)
2026-03-09 13:09:47 +01:00
Hendrik Liebau 87a8fb2f8f Fix preview version in window.next.version for PR builds (#90937)
Preview builds served via `vercel-packages.vercel.app` were showing the
published canary version instead of the PR-specific preview version.
This happened because `create-preview-tarballs.js` updated
`package.json` after the build, but the version was already baked into
the compiled `dist/` files by `setNextVersion` in `taskfile-swc.js`.

This extracts the version computation from `create-preview-tarballs.js`
into a new `set-preview-version.js` script that runs before `pnpm run
build`, so the compiled output naturally includes the correct version.
`create-preview-tarballs.js` now reads the version from
`packages/next/package.json` instead of computing it independently.

## Test Plan

1. Create a new app: `pnpm create next-app@canary`
2. Install the preview build from this PR: `pnpm i
https://vercel-packages.vercel.app/next/commits/06681c21e886a97e39d277808780884151c00318/next`
3. Run `pnpm dev` and inspect `next.version` in DevTools — should show
`16.2.0-preview-06681c21-20260306` instead of the canary version
2026-03-06 12:30:19 +01:00