Skip to content

build: move from npm to pnpm 11 - #2273

Merged
dprevost-LMI merged 10 commits into
webdriverio:mainfrom
dprevost-LMI:v8/pnpm-11
Sep 28, 2026
Merged

dprevost-LMI merged 10 commits into
webdriverio:mainfrom
dprevost-LMI:v8/pnpm-11

Conversation

@dprevost-LMI

Copy link
Copy Markdown
Collaborator

Refs #2247 (Tooling: "Move from npm to pnpm 11, the same as WebdriverIO")

WebdriverIO v10 uses pnpm 11. This PR moves the package, the playgrounds and the CI from npm to pnpm 11.27.1, the same version as WebdriverIO.

Changes

Root package

  • packageManager: pnpm@11.27.1. pnpm-lock.yaml is imported from package-lock.json (pnpm import), so no version changes
  • pnpm-workspace.yaml: allowBuilds set to false for edgedriver, esbuild and geckodriver, the same as WebdriverIO (the drivers are downloaded at runtime)
  • The scripts and the pre-commit hook use pnpm

Playgrounds

  • One pnpm workspace (playgrounds/pnpm-workspace.yaml) in place of npm workspaces
  • expect-webdriverio is link:.. (was file:.. plus an npm overrides entry)
  • The extra multi-remote-mocha/package-lock.json is removed

CI and docs

  • pnpm/action-setup v6.0.10 (pinned, the same as WebdriverIO) and pnpm install --frozen-lockfile
  • The release no longer uses npm ci --force: pnpm peers check finds no conflict
  • pnpm --filter ./<playground> in place of npm --workspace=<playground>
  • AGENTS.md, the verify skill, the PR template, the Copilot instructions and the playground README use pnpm

Problems that npm hoisting hid

Problem Fix
@types/deep-eql came from another package Dev dependency (same version, 4.0.2)
@wdio/globals installed expect-webdriverio 6.0.9 as its peer, and its global types merged with ours overrides: expect-webdriverio: link:., as the playgrounds already do
The type error filter did not match the node_modules/.pnpm/... paths pnpm paths are compared as node_modules/<package>
All playground ESLint configs import @typescript-eslint/*, but no playground declared it Added to the shared playground dependencies
browser-runner used @wdio/mocha-framework and vue without declaring them Added to browser-runner
pnpm passes -- to the script (npm removes it), so wdio ignored --spec and --exclude No -- in the Mocha snapshots:update script and in the CI

Checks

  • pnpm run checks:all after a clean install: 50 test files, 2,541 tests
  • Playgrounds: typecheck and lint pass. E2e tests pass: Jasmine, Jest, Mocha, multi-remote and Browser Runner
  • Snapshot job: each update step runs 1 spec, and the Mocha run without snapshots runs 5 of 7 spec files
  • The published tarball has the same 77 files as before (npm pack --dry-run and pnpm pack --dry-run)
  • pnpm exec release-it computes the same next version (8.0.0-alpha.0)

Notes

  • Dependabot configuration does not change: the npm ecosystem also reads pnpm 11 lock files. Check after the merge that it still opens update PRs.
  • @wdio/browser-runner logs optimizeDeps.include warnings (lodash.merge and others) with pnpm. They are only warnings, and the tests pass.
  • Follow-up: our public types import @wdio/types, which is only a dev dependency, so pnpm users cannot resolve it. Planned with [v8] Require WebdriverIO v10 and Node.js 22.19, and release v8 together with WebdriverIO v10 #2246.
  • pnpm 11 does not install a version that is less than 1 day old (minimumReleaseAge). This matters for the v8 alpha and the WebdriverIO v10 prereleases.

🤖 Generated with Claude Code

dprevost-LMI and others added 9 commits September 28, 2026 00:13
Use pnpm 11.27.1, the same as WebdriverIO v10. pnpm-lock.yaml is
imported from package-lock.json, so the versions do not change.

pnpm does not hoist, which shows two gaps that npm hid:
- @types/deep-eql came from another package: now a dev dependency
- @wdio/globals installed expect-webdriverio 6.0.9 as its peer, and its
  global types merged with ours: override it to this package, as the
  playgrounds already do

The type error filter now also matches the pnpm node_modules paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- playgrounds/pnpm-workspace.yaml lists the packages, links
  expect-webdriverio to the root (link:.., in place of file:.. and the
  npm override) and declares the ignored install scripts
- pnpm-lock.yaml is imported from package-lock.json, and the extra
  multi-remote-mocha lock file is removed
- declare the packages that npm hoisting hid: the typescript-eslint
  parser and plugin (used by every ESLint config), and
  @wdio/mocha-framework and vue in browser-runner
- pnpm passes `--` to the script, so the Mocha snapshots:update script
  no longer uses it (else wdio ignored --spec and ran every spec)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- pnpm/action-setup v6.0.10 (the same as WebdriverIO) before setup-node,
  and pnpm install --frozen-lockfile
- the release no longer uses --force: pnpm peers check finds no conflict
- pnpm --filter in place of npm --workspace, without `--`
- AGENTS.md, the verify skill, the PR template, the Copilot instructions
  and the playground README use pnpm

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test` already runs the type tests (`test:types` = `ts` and
`tsc:root-types`), and `build` already compiles, so checks:all ran
compile, tsc:root-types and every type test project twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a terminal, color codes surround each diff line, so a pattern over two
lines did not match and the playground failed outside the CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/ imports types from them, but only webdriverio depended on them.
npm hoisted them; pnpm does not, so the CI build failed. Locally, a
node_modules folder above the repository hid the error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wdio/browser-runner makes Vite pre-bundle some CommonJS packages
(optimizeDeps.include), and Vite looks for them from the project root.
pnpm does not hoist them, so the browser loaded raw CommonJS and failed
with "does not provide an export named 'default'".

p-iteration is left out: no package installs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dprevost-LMI
dprevost-LMI marked this pull request as ready for review September 28, 2026 11:13
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Switches the package manager from npm to pnpm.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR migrates the root project, playgrounds, CI, release workflow, and contributor commands from npm to pnpm 11.

  • Separate pnpm lockfiles and workspace configuration cover the root package and playgrounds.
  • The latest change restores the multi-remote failure-message test’s diff-line order check.

Reviews (2) · Last reviewed commit: "test: check the multi-remote title diff ..."

Match the two diff lines in order again, on the message without the
terminal color codes (strip-ansi, as the unit tests use).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dprevost-LMI
dprevost-LMI enabled auto-merge (squash) September 28, 2026 11:28
@dprevost-LMI
dprevost-LMI merged commit 8633d9b into webdriverio:main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant