@pnpm/lockfile.fs 1100.1.0 → 1100.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lockfileFormatConverters.js +19 -2
- package/package.json +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LOCKFILE_VERSION } from '@pnpm/constants';
|
|
2
|
-
import { refToRelative, removeSuffix } from '@pnpm/deps.path';
|
|
2
|
+
import { parse, refToRelative, removeSuffix } from '@pnpm/deps.path';
|
|
3
3
|
import { DEPENDENCIES_FIELDS } from '@pnpm/types';
|
|
4
4
|
import { isEmpty, map as _mapValues, omit, pick, pickBy } from 'ramda';
|
|
5
5
|
// Minimal duplicate of `isGitHostedPkgUrl` from `@pnpm/fetching.pick-fetcher`,
|
|
@@ -120,12 +120,29 @@ function pruneTimeInLockfile(time, importers) {
|
|
|
120
120
|
}
|
|
121
121
|
return pickBy((_, depPath) => rootDepPaths.has(depPath), time);
|
|
122
122
|
}
|
|
123
|
+
// Mirrors `isFilename` in `resolving/local-resolver/src/parseBareSpecifier.ts`
|
|
124
|
+
// so the directory-vs-tarball boundary applied at lockfile load time
|
|
125
|
+
// matches the resolver's at resolve time.
|
|
126
|
+
const LOCAL_TARBALL_RE = /\.(?:tgz|tar\.gz|tar)$/i;
|
|
123
127
|
export function convertToLockfileObject(lockfile) {
|
|
124
128
|
const { importers, ...rest } = lockfile;
|
|
125
129
|
const packages = {};
|
|
126
130
|
for (const [depPath, pkg] of Object.entries(lockfile.snapshots ?? {})) {
|
|
127
131
|
const pkgId = removeSuffix(depPath);
|
|
128
|
-
|
|
132
|
+
const snapshot = Object.assign(pkg, lockfile.packages?.[pkgId]);
|
|
133
|
+
// Defense-in-depth for pruned lockfiles (older `turbo prune --docker`,
|
|
134
|
+
// pre vercel/turborepo#12825): a peer-variant injected workspace
|
|
135
|
+
// snapshot whose base `packages:` entry was dropped now has a null
|
|
136
|
+
// `resolution`. Reconstruct it from the `file:` depPath — same value
|
|
137
|
+
// pnpm's writer emits — so every downstream reader sees a complete
|
|
138
|
+
// snapshot without per-reader guards.
|
|
139
|
+
if (snapshot.resolution == null) {
|
|
140
|
+
const ref = parse(depPath).nonSemverVersion;
|
|
141
|
+
if (ref != null && ref.startsWith('file:') && !LOCAL_TARBALL_RE.test(ref)) {
|
|
142
|
+
snapshot.resolution = { directory: ref.slice('file:'.length), type: 'directory' };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
packages[depPath] = snapshot;
|
|
129
146
|
enrichGitHostedFlag(packages[depPath]?.resolution);
|
|
130
147
|
}
|
|
131
148
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/lockfile.fs",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.2",
|
|
4
4
|
"description": "Read/write pnpm-lock.yaml files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -31,21 +31,21 @@
|
|
|
31
31
|
"js-yaml": "npm:@zkochan/js-yaml@0.0.11",
|
|
32
32
|
"normalize-path": "^3.0.0",
|
|
33
33
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
34
|
-
"semver": "^7.
|
|
34
|
+
"semver": "^7.8.1",
|
|
35
35
|
"strip-bom": "^5.0.0",
|
|
36
|
-
"write-file-atomic": "^7.0.
|
|
37
|
-
"@pnpm/deps.path": "1100.0.3",
|
|
36
|
+
"write-file-atomic": "^7.0.1",
|
|
38
37
|
"@pnpm/constants": "1100.0.0",
|
|
39
|
-
"@pnpm/
|
|
40
|
-
"@pnpm/
|
|
38
|
+
"@pnpm/error": "1100.0.0",
|
|
39
|
+
"@pnpm/lockfile.types": "1100.0.8",
|
|
41
40
|
"@pnpm/network.git-utils": "1100.0.1",
|
|
42
|
-
"@pnpm/lockfile.
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/
|
|
45
|
-
"@pnpm/
|
|
41
|
+
"@pnpm/lockfile.merger": "1100.0.8",
|
|
42
|
+
"@pnpm/object.key-sorting": "1100.0.0",
|
|
43
|
+
"@pnpm/types": "1101.2.0",
|
|
44
|
+
"@pnpm/lockfile.utils": "1100.0.10",
|
|
45
|
+
"@pnpm/deps.path": "1100.0.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@pnpm/logger": "
|
|
48
|
+
"@pnpm/logger": "^1001.0.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@jest/globals": "30.3.0",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"tempy": "3.0.0",
|
|
58
58
|
"write-yaml-file": "^6.0.0",
|
|
59
59
|
"yaml-tag": "1.1.0",
|
|
60
|
-
"@pnpm/
|
|
61
|
-
"@pnpm/
|
|
60
|
+
"@pnpm/lockfile.fs": "1100.1.2",
|
|
61
|
+
"@pnpm/logger": "1100.0.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22.13"
|