fix: update unscoped package storage location in virtual global store#10363
fix: update unscoped package storage location in virtual global store#10363
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the storage location for unscoped packages in the virtual global store by adding an @/ prefix to maintain a uniform 4-level directory depth structure across both scoped and unscoped packages.
Key changes:
- Modified
calcGraphNodeHashto prepend@/to unscoped package paths - Updated test expectations to verify the new path structure includes the
@/directory
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/calc-dep-state/src/index.ts | Implements the @/ prefix logic for unscoped packages in the hash path generation, ensuring uniform 4-level directory depth |
| pkg-manager/core/test/install/nodeRuntime.ts | Updates two test assertions to expect the new path structure with @/ prefix for the node runtime package |
| .changeset/hip-jars-boil.md | Documents the semi-breaking change with appropriate version bumps (major for calc-dep-state, minor for pnpm) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Use @/ prefix for unscoped packages to maintain uniform 4-level directory depth | ||
| // Scoped: @scope/pkg/version/hash | ||
| // Unscoped: @/pkg/version/hash | ||
| const prefix = name.startsWith('@') ? '' : '@/' | ||
| return `${prefix}${name}/${version}/${hexDigest}` |
There was a problem hiding this comment.
The new prefix logic for unscoped packages lacks direct unit test coverage. Consider adding tests for the calcGraphNodeHash function that verify both scoped packages (returning paths like @scope/pkg/version/hash) and unscoped packages (returning paths like @/pkg/version/hash) to ensure the prefix logic works correctly for both cases.
No description provided.