Skip to content

Write pnpm overrides to pnpm-workspace.yaml on pnpm 11 and later - #1109

Merged
NullVoxPopuli merged 2 commits into
ember-cli:mainfrom
NullVoxPopuli-ai-agent:nvp/pnpm-workspace-overrides
Nov 12, 2026
Merged

NullVoxPopuli merged 2 commits into
ember-cli:mainfrom
NullVoxPopuli-ai-agent:nvp/pnpm-workspace-overrides

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown

On pnpm 11 and later, scenario overrides now go to pnpm-workspace.yaml. Before this change, they had no effect.

pnpm 11 stopped reading the pnpm field in package.json:

[WARN] The "pnpm" field in package.json is no longer read by pnpm. The following keys were ignored: "pnpm.overrides".

ember-try writes scenario pnpm.overrides to that field, and also the automatic $name overrides for prerelease and tarball versions, so pnpm ignores both. In ember-learn/ember-styleguide#564, the Ember 7 scenarios lost their ember-cli-htmlbars override and failed with Cannot read properties of undefined (reading 'templateCompiler').

Changes:

  • The pnpm adapter stores the pnpm version during setup.
  • On pnpm 11 and later, the adapter merges the scenario overrides into the overrides setting of pnpm-workspace.yaml. The merge keeps the other settings and the comments. A null value removes an existing override.
  • The adapter backs up pnpm-workspace.yaml and restores it at cleanup. If ember-try created the file, cleanup deletes it.
  • pnpm 10 and older keep the package.json behavior.
  • The new dependency is yaml, so that edits keep the comments in the file.

Tests:

  • pnpm test passes (158 tests). Five new tests cover pnpm 11 and later: a new file, a merge into an existing file, the tarball override, no file without overrides, and the pnpm 10 behavior.
  • I linked this branch into ember-styleguide with pnpm 12.18.0 and ran ember try:one ember-release. ember-cli-htmlbars went to 7.0.1, and the scenario passed.

Related: #970 (overrides in pnpm monorepos).

🤖 Generated with Claude Code

pnpm 11 stopped reading the `pnpm` field in package.json. Scenario
overrides, and the automatic `$name` overrides for prerelease and
tarball versions, went to `pnpm.overrides` and had no effect.

On pnpm 11 and later, the pnpm adapter now merges these overrides into
the `overrides` setting of pnpm-workspace.yaml. The adapter backs up
that file and restores it at cleanup. If ember-try created the file,
cleanup deletes it. pnpm 10 and older keep the package.json behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.49%. Comparing base (88714fd) to head (ee67c7d).

Files with missing lines Patch % Lines
lib/dependency-manager-adapters/pnpm.js 95.12% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1109      +/-   ##
==========================================
- Coverage   95.54%   95.49%   -0.05%     
==========================================
  Files          21       21              
  Lines         516      555      +39     
==========================================
+ Hits          493      530      +37     
- Misses         23       25       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NullVoxPopuli
NullVoxPopuli merged commit bc7b79f into ember-cli:main Nov 12, 2026
32 of 34 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
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.

3 participants