Repository navigation
ci(e2e): Run E2E tests with pnpm 12 - #25334
Conversation
Volta cannot run pnpm 12, so pnpm is now a root devDependency. Volta only pins node per app. pnpm 11+ reads settings only from pnpm-workspace.yaml and blocks unlisted build scripts, so each app now has a pnpm-workspace.yaml with allowBuilds and minimumReleaseAge: 0.
| "typescript": "~5.8.3", | ||
| "vite": "^7.3.2" | ||
| }, | ||
| "volta": { |
There was a problem hiding this comment.
not directly related to this test, but we should actually replace these with a reference to the workspace volta config.
There was a problem hiding this comment.
(I may open a PR to update this everywhere)
|
Semi related, opened #25369 to actually update volta config in e2e test apps to better align with the fact we are using node 24 anyhow now by default! |
# Conflicts: # dev-packages/e2e-tests/test-applications/browser-bfcache/package.json # dev-packages/e2e-tests/test-applications/browser-mfe-vite/package.json # dev-packages/e2e-tests/test-applications/browser-webworker-vite/package.json # dev-packages/e2e-tests/test-applications/remix-v3/package.json
# Conflicts: # dev-packages/bundler-plugin-integration-tests/fixtures/esbuild/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rolldown/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rollup3/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/rollup4/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite4/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite6/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite7/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/vite8/package.json # dev-packages/bundler-plugin-integration-tests/fixtures/webpack5/package.json
JPeer264
left a comment
There was a problem hiding this comment.
LGTM. Just added nits mostly
| - **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests` | ||
| - **Build failures**: Fix build errors before running tests | ||
| - **pnpm errors such as `packages field missing or empty`**: The app needs the pnpm version in its `volta.pnpm`. Run with Volta, which installs that version | ||
| - **`ERR_PNPM_IGNORED_BUILDS`**: A dependency has a build script that the app's `allowBuilds` does not list. Add it to the app's `pnpm-workspace.yaml`: `true` if the app needs the script, `false` if the script only prints a message |
There was a problem hiding this comment.
l: Theoretically pnpm approve-builds is adding it - maybe worth to add this here
| steps: | ||
| - name: Resolve pnpm version | ||
| id: pnpm-version | ||
| # The devDependency is the one pnpm version for CI and local runs. An app that needs another version sets |
There was a problem hiding this comment.
super-l: It is weird that it is written devDependency and not "dev dependency" - maybe we can rename it to the latter. First I read it any thought that something is off 😅
| # The devDependency is the one pnpm version for CI and local runs. An app that needs another version sets | |
| # The dev dependency is the one pnpm version for CI and local runs. An app that needs another version sets |
| @@ -0,0 +1 @@ | |||
| minimumReleaseAge: 0 | |||
There was a problem hiding this comment.
q/l: Couldn't we make one more global pnpm-workspace.yaml in the e2e test root and copy it over into each directory? Theoretically we don't treat each folder as own workspace, but we potentially forget to set minimumRelaseAge: 0 on new tests.
If we keep it though, we should add a bugbot rule that this is set as a minimum on new e2e tests or make sure in our runners that this is set. wdyt?
There was a problem hiding this comment.
I'll add a rule for that 👍
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "nitro": "latest || *", | ||
| "nitro": "^3.0.0", |
There was a problem hiding this comment.
q: Is that change necessary in this PR? Or was it required to be changed
There was a problem hiding this comment.
yes, listed in the PR description:
The tanstackstart apps use "nitro": "^3.0.0", because pnpm 12 resolved latest || * to the placeholder nitro@0.0.0. This installs the same nitro@3.0.0 as pnpm 9. A follow-up moves them to the nitro beta, which needs Vite 8.
There was a problem hiding this comment.
Thanks for confirming. Sorry I forgot the PR description after scrolling through all the changes 😅
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "nitro": "latest || *", | ||
| "nitro": "^3.0.0", |
There was a problem hiding this comment.
Follow-up to #25334. The tanstackstart-react apps now use the nitro beta instead of the deprecated `nitro@3.0.0`. The beta needs Vite 8, so the apps also use Vite 8 and `@vitejs/plugin-react-swc` 4, which is the first version that supports Vite 8. The SDK still supports Vite 7. Only the test apps changed.
This moves the monorepo from Yarn 1 to pnpm 12.11.2 (`packageManager`): scripts, CI workflows, the release script and the contributor docs. Review it commit by commit: 1. A plain `pnpm import` of `yarn.lock`. Most of the added lines of the PR are here. 2. The dependency changes against that import: the root `workspace:*` entries, `h3` and `unstorage` for `@sentry/nitro` and `@sentry/nuxt`, the `yarn.lock` versions of the npm aliases (`pnpm import` resolves them again), and `pnpm dedupe`. 3. The move from Yarn to pnpm. This commit does not change the lockfile. 4. The bump to pnpm 12: the settings move to `pnpm-workspace.yaml`, the pnpm dev dependency of #25334 is removed, and `pnpm dedupe` with pnpm 12 merges 10 versions (no new versions). Other changes beyond the rename: - Scripts are called with `pnpm run <script>` and package binaries with `pnpm exec <bin>`. Volta's pnpm 9 rejects the options of `pnpm test` (for example `--watch`) before it switches to pnpm 12. - `@sentry/server-runtime-injection` vendors the same files as with Yarn. It declares `supports-color` 7.2.0, because pnpm installs another version next to `debug`, and it names vendored files by their path after the last `node_modules/`. - The Lambda layer build writes its overrides to a `pnpm-workspace.yaml` (pnpm 12 does not read `resolutions`), and it no longer writes through pnpm's hard links into `packages/core/build`. - The rollup bundler fixtures declare `@babel/preset-react`, like the webpack fixture. Their configs use it, and with Yarn they found it in the root `node_modules`. pnpm 12 installs it only in `packages/bundler-plugins/node_modules`. ## Install layout decisions `nodeLinker: hoisted` and `autoInstallPeers: false` give the same flat `node_modules` as Yarn 1. This is only for now, to make the switch from Yarn easier. The next PR moves to the isolated pnpm default, where every package must declare all its imports. ## Workspace decisions All workspace packages are root `devDependencies` (`workspace:*`), because some configs import workspace packages without declaring them. The next PR removes them. The `workspaces` list stays in `package.json` for Deno. `verify-packages-versions.js` checks that it matches the `packages` list of `pnpm-workspace.yaml`, and that every workspace package is in the root `devDependencies`. New packages must go into all three. ## pnpm version decisions This goes directly to pnpm 12, because a pnpm 9 root does not work with the pnpm 12 dev dependency of #25334: nested `pnpm` calls in scripts get pnpm 12, which refuses the pnpm 9 install. Volta cannot run pnpm 12.4 or newer ([volta-cli/volta#2114](volta-cli/volta#2114)), so it keeps pnpm 9.15.9, and `manage-package-manager-versions` in `.npmrc` switches it to the `packageManager` version. ## Known issues - The release and canary workflows did not run on this branch. A local simulation of 11.8.0 ran the pre-release script, the CI build, the tarballs and `npm publish --dry-run`. The tarballs have the same files as the published 11.7.0. - npm commands in the repo warn about `manage-package-manager-versions` in `.npmrc`. npm does not use this setting, but Volta's pnpm 9 needs it to switch to pnpm 12. - The Cursor cloud setup sets `VOLTA_FEATURE_PNPM=1` only in its own commands. A new shell that reads only `~/.bashrc` does not find pnpm. - Dependency Review (not a required check) fails, because it treats every package of the new lockfile as added. It reports advisories for `yarn.lock` versions that are dismissed in Dependabot. After the merge, it checks only lockfile changes again. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Moves the E2E tests from pnpm 9 to pnpm 12. Volta still manages node.
pnpm-workspace.yaml. pnpm 11+ reads its settings only from this file.allowBuilds: pnpm 11+ fails the install on build scripts that are not listed.falseis only for scripts that just print a message.minimumReleaseAge: 0: by default, pnpm 11+ installs only releases that are at least 24 hours old, and falls back to older versions. The apps test against the newest releases, so the E2E runner fails if an app does not set it.@electron/rebuild^4.2.1. Older versions depend on@electron/node-gypfrom git, and pnpm 11+ blocks git dependencies of dependencies.package.json#pnpm, and some apps usedpackage.json#resolutions. pnpm 11+ ignores both without an error. The E2E runner now fails if an app still uses them.next/package.json.pnpm add next@15now saves^15.x.y, and the old version checks did not work with the^."nitro": "^3.0.0", because pnpm 12 resolvedlatest || *to the placeholdernitro@0.0.0. This installs the samenitro@3.0.0as pnpm 9. A follow-up moves them to the nitro beta, which needs Vite 8.npx playwright installintest:build. CI already installs the app's Playwright version, and the second install ran at the same time and failed.Why pnpm is a root dev dependency
pnpm switches to the version in a
packageManagerfield, but a pnpm must already be installed to do that. Yarn installs that first pnpm as a dev dependency, because Volta can't run pnpm 12 and is unmaintained. Thepnpmpackage is a native binary, so it does not depend on the node version that an app pins.yarn.lockpins the version, so local runs and CI use the same pnpm. Contributors need no extra setup, and CI caches pnpm withnode_modules.Rejected alternatives:
pnpm/action-setupalone: it only installs pnpm in CI. Contributors would have to install pnpm themselves, and their version could differ from CI.packageManagerin the rootpackage.json. A test app can still pin another pnpm version (10.30 or newer, which readsallowBuilds) with its ownpackageManagerfield.