Skip to content

fix(pnpm-store): support pnpm 11's config.yaml for store-dir#37

Merged
baxyz merged 2 commits into
mainfrom
pnpm-11-support
Jun 16, 2026
Merged

fix(pnpm-store): support pnpm 11's config.yaml for store-dir#37
baxyz merged 2 commits into
mainfrom
pnpm-11-support

Conversation

@baxyz

@baxyz baxyz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pnpm 11 stopped reading non-auth settings (incl. store-dir) from ~/.npmrc — they must now live in pnpm-workspace.yaml or the global ~/.config/pnpm/config.yaml.
  • With only ~/.npmrc set, store-dir silently resolved to undefined under pnpm 11, so pnpm fell back to creating a .pnpm-store folder relative to cwd — the exact stray folder this feature exists to prevent (observed in the typescript repo when pnpm switched itself to the packageManager-pinned version).
  • install.sh (build time) and the devcontainer-pnpm-store guard (postCreate) now also write storeDir: /workspaces/.pnpm-store to ~/.config/pnpm/config.yaml, alongside the existing ~/.npmrc write, so the feature works for pnpm <11 and >=11.
  • Bumped feature version to 1.0.7 and documented the pnpm 11 behavior change in the README.

Test plan

  • CI feature tests pass (test/pnpm-store/test.sh)
  • Manually verified in a running container: removed a stray /workspaces/typescript/.pnpm-store, wrote ~/.config/pnpm/config.yaml, confirmed pnpm config get store-dir now resolves to /workspaces/.pnpm-store (was undefined), and pnpm install no longer recreates a local store folder

🤖 Generated with Claude Code

- add support for pnpm 11 in config files
- write storeDir to both .npmrc and config.yaml
- ensure ownership of config directory
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

✅ PR Validation Passed

All checks passed!


📋 Pipeline Status

Job Status
🧾 Conventional Commits passing
🧪 Feature Tests passing
🐚 ShellCheck passing

🤖 Generated by @helpers4 CI • 2026-06-16

- grep-and-replace storeDir in ~/.config/pnpm/config.yaml instead of
  overwriting the whole file, matching the .npmrc handling
- make the config.yaml write atomic (tmp + mv) and non-fatal on mkdir
  failure, so it can't abort the rest of install.sh or the guard
- chown only the pnpm config subdir recursively, not all of ~/.config
- add a test.sh assertion for the new config.yaml mechanism

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@baxyz baxyz merged commit 7c6c142 into main Jun 16, 2026
30 checks passed
@baxyz baxyz deleted the pnpm-11-support branch June 16, 2026 20:48
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