Skip to content

feat!: support pnpm global virtual store paths and upgrade pnpm to 10.32.1 - #20

Merged
SoonIter merged 6 commits into
mainfrom
syt-vibe-kanban/c158-image-png-vibe-i
Mar 17, 2026
Merged

feat!: support pnpm global virtual store paths and upgrade pnpm to 10.32.1#20
SoonIter merged 6 commits into
mainfrom
syt-vibe-kanban/c158-image-png-vibe-i

Conversation

@SoonIter

@SoonIter SoonIter commented Mar 17, 2026

Copy link
Copy Markdown
Member

Summary

Related issues

AI Summary


What changed

  • Added global virtual store regex matchers in src/matchers.ts: new posix and win32 patterns to match pnpm's global virtual store path structure (pnpm/store/<versions>/links/<pkg>/<ver>/<hash>/node_modules), replacing them with <PNPM_INNER> just like local .pnpm virtual store paths.
  • Upgraded pnpm from 9.14.4 to 10.32.1 in packageManager field.
  • Enabled enableGlobalVirtualStore via .npmrc (enable-global-virtual-store=true).
  • Added e2e tests (e2e/pnpmGlobalVirtualStore.test.ts) covering posix, win32, and scoped package paths for the global virtual store.
  • Updated existing snapshots to reflect the new global virtual store path resolution (e.g. <HOME>/Library/<PNPM_INNER>/... instead of <ROOT>/node_modules/<PNPM_INNER>/...).

Why

When pnpm's enableGlobalVirtualStore is enabled, resolved dependency paths point to a centralized store (e.g. ~/Library/pnpm/store/v3/v10/links/react/19.2.4/<hash>/node_modules/react/...) instead of the local node_modules/.pnpm/ directory. The existing replacePnpmInner feature only handled local virtual store paths, causing these global store paths to leak into snapshots unprocessed.

Implementation details

  • The global store regex uses .+? (not [^/]+) between store/ and /links to handle multi-segment version directories like v3/v10.
  • The matchers are applied in the same pipeline position as the existing local .pnpm matchers, ensuring consistent <PNPM_INNER> replacement regardless of store location.

This PR was written using Vibe Kanban


Add regex matchers for pnpm's global virtual store path pattern
(e.g. Library/pnpm/store/v10/links/<pkg>/<ver>/<hash>/node_modules)
so they are replaced with <PNPM_INNER> just like local .pnpm paths.
- Upgrade packageManager from pnpm@9.14.4 to pnpm@10.32.1
- Add .npmrc with enable-global-virtual-store=true
- Fix global virtual store regex to handle multi-segment store versions
  (e.g. pnpm/store/v3/v10/links/...)
- Update e2e snapshots to reflect new global virtual store paths
Copilot AI review requested due to automatic review settings March 17, 2026 07:11
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在增强路径序列化工具对 pnpm 全局虚拟存储路径的兼容性。通过引入新的匹配器和更新相关测试,确保在使用 pnpm 全局虚拟存储功能时,路径序列化能够保持一致性和准确性,从而提高项目的兼容性和稳定性。

Highlights

  • 新增 pnpm 全局虚拟存储路径支持: 扩展了路径序列化工具,以正确识别和处理 pnpm 全局虚拟存储的路径格式。
  • 更新快照测试: 调整了现有的快照测试,以适应 pnpm 全局虚拟存储路径的序列化结果。
  • 新增全局虚拟存储测试文件: 引入了一个新的测试文件 e2e/pnpmGlobalVirtualStore.test.ts,专门用于验证 pnpm 全局虚拟存储路径的序列化功能。
  • 更新 pnpm 版本: package.jsonpackageManager 字段的 pnpm 版本已更新。
  • 启用全局虚拟存储: 添加了 .npmrc 文件以启用 pnpm 的 enable-global-virtual-store 功能。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .npmrc
    • 新增了 .npmrc 文件,配置 enable-global-virtual-store=true 以启用 pnpm 全局虚拟存储。
  • e2e/snapshots/index.test.ts.snap
    • 更新了快照,以反映 pnpm 路径序列化的新行为。
  • e2e/features.test.ts
    • 重新排序了导入语句。
    • 更新了内联快照,以适应 pnpm 全局虚拟存储路径。
  • e2e/index.test.ts
    • 重新排序了导入语句。
    • 更新了多个内联快照,以适应 pnpm 全局虚拟存储路径。
  • e2e/pnpmGlobalVirtualStore.test.ts
    • 新增了测试文件,包含针对 pnpm 全局虚拟存储路径(包括 Posix 和 Win32 格式)的序列化测试。
  • package.json
    • 更新了 packageManager 字段中的 pnpm 版本。
  • src/matchers.ts
    • 扩展了 createPnpmInnerMatchers 函数,新增了针对 pnpm 全局虚拟存储路径(Posix 和 Win32 格式)的正则表达式匹配器。
Activity
  • 目前没有人工活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@SoonIter SoonIter changed the title ![image.png](.vibe-images/a3160c8e-2109-4a14-87f6-4f40bf309953_image.png) (vibe-kanban) feat: support pnpm global virtual store paths and upgrade pnpm to 10.32.1 Mar 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

你好,感谢你为 path-serializer 增加对 pnpm global virtual store 路径的兼容性。这次的改动很棒,特别是增加了新的测试用例来覆盖这些场景。

我 review 了代码,发现 src/matchers.ts 中有机会可以简化。由于 transformWin32Path 默认开启,win32 特定的路径匹配器在默认情况下是冗余的。我已经在具体的代码行上提出了一个建议,希望能让代码更简洁。

除此之外,其他改动看起来都很好。

Comment thread src/matchers.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 旨在让 path-serializer 兼容 pnpm 启用 globalVirtualStore 后出现的新路径结构(pnpm/store/.../links/.../node_modules),从而在快照中稳定地序列化并标记为 <PNPM_INNER>

Changes:

  • createPnpmInnerMatchers 中新增对 pnpm global virtual store(posix/win32)的匹配规则
  • 升级 packageManager 到 pnpm 10,并通过 .npmrc 启用 enable-global-virtual-store
  • 新增/更新 e2e 用例与快照以覆盖 global virtual store 场景

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/matchers.ts 新增 global virtual store 的路径正则匹配规则,以便替换为 <PNPM_INNER>
package.json 更新 packageManager 到 pnpm 10(带 corepack integrity)
.npmrc 启用 enable-global-virtual-store=true 以改变 pnpm 安装布局
e2e/pnpmGlobalVirtualStore.test.ts 新增 global virtual store 的序列化测试(含 posix/win32)
e2e/index.test.ts 更新现有 e2e 快照期望以适配新的 pnpm 路径布局
e2e/features.test.ts 同步更新 features 相关快照期望
e2e/snapshots/index.test.ts.snap 更新对应的持久化快照内容

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .npmrc
Comment thread e2e/index.test.ts
Comment thread e2e/index.test.ts
Comment thread e2e/index.test.ts
Comment thread e2e/features.test.ts
Comment thread e2e/__snapshots__/index.test.ts.snap Outdated
Comment thread e2e/pnpmGlobalVirtualStore.test.ts Outdated
Strip environment-dependent prefix before <PNPM_INNER> so that both
local virtual store (<ROOT>/node_modules/<PNPM_INNER>/pkg/...) and
global virtual store (<HOME>/Library/<PNPM_INNER>/pkg/...) normalize
to just <PNPM_INNER>/pkg/..., making snapshots portable across
environments with different enableGlobalVirtualStore settings.
Comment thread src/createSnapshotSerializer.ts Fixed
- Remove redundant win32 global virtual store matcher since
  transformWin32Path normalizes paths before matching (Gemini)
- Fix ReDoS vulnerability by replacing regex with string-based
  stripPnpmInnerPrefix using split/join (CodeQL)
- OS-dependent snapshots are already fixed by prefix stripping,
  output is now <PNPM_INNER>/pkg/... regardless of platform (Copilot)
…ction

Move pnpm inner path replacement from the matcher-based pipeline into
a dedicated `replacePnpmInnerPath` function in utils.ts. This function
handles regex matching (local + global virtual store) and prefix
stripping in one place, making the logic clearer and self-contained.
Extract replacePnpmInnerPath into src/pnpm/replacePnpmInnerPath.ts
with a barrel export from src/pnpm/index.ts.
@SoonIter
SoonIter merged commit 329436c into main Mar 17, 2026
5 checks passed
@SoonIter
SoonIter deleted the syt-vibe-kanban/c158-image-png-vibe-i branch March 17, 2026 09:54
@SoonIter SoonIter changed the title feat: support pnpm global virtual store paths and upgrade pnpm to 10.32.1 feat!: support pnpm global virtual store paths and upgrade pnpm to 10.32.1 Mar 23, 2026
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.

3 participants