mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-04 07:21:47 -04:00
fix: update unscoped package storage location in virtual global store (#10363)
This commit is contained in:
6
.changeset/hip-jars-boil.md
Normal file
6
.changeset/hip-jars-boil.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/calc-dep-state": major
|
||||||
|
"pnpm": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
**Semi-breaking.** Changed the location of unscoped packages in the virtual global store. They will now be stored under a directory named `@` to maintain a uniform 4-level directory depth.
|
||||||
@@ -107,8 +107,12 @@ export function * iterateHashedGraphNodes<T extends PkgMeta> (
|
|||||||
deps: _calcDepGraphHash(new Set(), depPath),
|
deps: _calcDepGraphHash(new Set(), depPath),
|
||||||
}
|
}
|
||||||
const hexDigest = hashObjectWithoutSorting(state, { encoding: 'hex' })
|
const hexDigest = hashObjectWithoutSorting(state, { encoding: 'hex' })
|
||||||
|
// 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('@') ? '' : '@/'
|
||||||
yield {
|
yield {
|
||||||
hash: `${name}/${version}/${hexDigest}`,
|
hash: `${prefix}${name}/${version}/${hexDigest}`,
|
||||||
pkgMeta,
|
pkgMeta,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user