@pnpm/deps.graph-hasher 1100.2.9 → 1100.2.11
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/CHANGELOG.md +24 -0
- package/package.json +8 -8
- package/lib/index.d.ts +0 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @pnpm/calc-dep-state
|
|
2
2
|
|
|
3
|
+
## 1100.2.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies:
|
|
8
|
+
- @pnpm/deps.path@1100.0.10
|
|
9
|
+
- @pnpm/engine.runtime.system-version@1100.0.5
|
|
10
|
+
- @pnpm/lockfile.types@1100.0.15
|
|
11
|
+
- @pnpm/lockfile.utils@1100.1.4
|
|
12
|
+
- @pnpm/resolving.resolver-base@1100.5.3
|
|
13
|
+
- @pnpm/types@1101.5.0
|
|
14
|
+
|
|
15
|
+
## 1100.2.10
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies:
|
|
20
|
+
- @pnpm/deps.path@1100.0.9
|
|
21
|
+
- @pnpm/engine.runtime.system-version@1100.0.4
|
|
22
|
+
- @pnpm/lockfile.types@1100.0.14
|
|
23
|
+
- @pnpm/lockfile.utils@1100.1.3
|
|
24
|
+
- @pnpm/resolving.resolver-base@1100.5.2
|
|
25
|
+
- @pnpm/types@1101.4.0
|
|
26
|
+
|
|
3
27
|
## 1100.2.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/deps.graph-hasher",
|
|
3
|
-
"version": "1100.2.
|
|
3
|
+
"version": "1100.2.11",
|
|
4
4
|
"description": "Calculates the state of a dependency",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@pnpm/crypto.object-hasher": "1100.0.0",
|
|
31
|
-
"@pnpm/deps.path": "1100.0.
|
|
32
|
-
"@pnpm/engine.runtime.system-version": "1100.0.
|
|
33
|
-
"@pnpm/lockfile.types": "1100.0.
|
|
34
|
-
"@pnpm/lockfile.utils": "1100.1.
|
|
35
|
-
"@pnpm/resolving.resolver-base": "1100.5.
|
|
36
|
-
"@pnpm/types": "1101.
|
|
31
|
+
"@pnpm/deps.path": "1100.0.10",
|
|
32
|
+
"@pnpm/engine.runtime.system-version": "1100.0.5",
|
|
33
|
+
"@pnpm/lockfile.types": "1100.0.15",
|
|
34
|
+
"@pnpm/lockfile.utils": "1100.1.4",
|
|
35
|
+
"@pnpm/resolving.resolver-base": "1100.5.3",
|
|
36
|
+
"@pnpm/types": "1101.5.0",
|
|
37
37
|
"detect-libc": "^2.1.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@jest/globals": "30.4.1",
|
|
41
|
-
"@pnpm/deps.graph-hasher": "1100.2.
|
|
41
|
+
"@pnpm/deps.graph-hasher": "1100.2.11"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=22.13"
|
package/lib/index.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { LockfileObject, LockfileResolution, PackageSnapshot } from '@pnpm/lockfile.types';
|
|
2
|
-
import type { AllowBuild, DepPath, PkgIdWithPatchHash, SupportedArchitectures } from '@pnpm/types';
|
|
3
|
-
/**
|
|
4
|
-
* Scan an iterable of lockfile snapshot keys for the resolved
|
|
5
|
-
* `engines.runtime` / `devEngines.runtime` Node version and return
|
|
6
|
-
* its bare version string (e.g. `"22.11.0"`), or `undefined` when
|
|
7
|
-
* no snapshot pins a runtime.
|
|
8
|
-
*
|
|
9
|
-
* Pnpm's runtime resolver writes the pinned Node into the lockfile as
|
|
10
|
-
* a snapshot with key `node@runtime:<version>[(<peers>)]`
|
|
11
|
-
* (see [`engine/runtime/node-resolver/src/index.ts`](https://github.com/pnpm/pnpm/blob/29a42efc3b/engine/runtime/node-resolver/src/index.ts)).
|
|
12
|
-
* The first such key found is treated as authoritative. This is fine
|
|
13
|
-
* as an install-wide fallback (project-pin in the typical case), but
|
|
14
|
-
* snapshots that pin their own Node still need
|
|
15
|
-
* {@link readSnapshotRuntimePin} to get a per-snapshot result.
|
|
16
|
-
*
|
|
17
|
-
* Callers typically pass `Object.keys(lockfile.packages ?? {})` — the
|
|
18
|
-
* in-memory `LockfileObject` merges the on-disk `packages:` and
|
|
19
|
-
* `snapshots:` sections under a single `packages` field, so its keys
|
|
20
|
-
* include every snapshot key the install will hash.
|
|
21
|
-
*/
|
|
22
|
-
export declare function findRuntimeNodeVersion(snapshotKeys: Iterable<string>): string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Read a single graph node's own `engines.runtime` Node pin from its
|
|
25
|
-
* `children` map. The resolver desugars `engines.runtime` declared on
|
|
26
|
-
* a dependency's manifest into `dependencies.node: 'runtime:<version>'`
|
|
27
|
-
* (see [`installing/deps-resolver/src/resolveDependencies.ts`](https://github.com/pnpm/pnpm/blob/29a42efc3b/installing/deps-resolver/src/resolveDependencies.ts)),
|
|
28
|
-
* which then becomes a `children.node` entry pointing at the
|
|
29
|
-
* `node@runtime:<version>[(peers)]` snapshot key.
|
|
30
|
-
*
|
|
31
|
-
* Returns the bare version (e.g. `"22.11.0"`) when this snapshot pins
|
|
32
|
-
* its own Node — or `undefined` when it doesn't and the caller should
|
|
33
|
-
* fall back to the install-wide pin / host probe.
|
|
34
|
-
*
|
|
35
|
-
* Per-snapshot resolution matters because the bin linker routes
|
|
36
|
-
* lifecycle-script spawns for a pinning package through *that
|
|
37
|
-
* package's* downloaded Node — anchoring the snapshot's GVS engine
|
|
38
|
-
* hash to an install-wide value would produce the wrong
|
|
39
|
-
* side-effects-cache key for cross-pinning installs.
|
|
40
|
-
*/
|
|
41
|
-
export declare function readSnapshotRuntimePin(children: Record<string, string> | undefined): string | undefined;
|
|
42
|
-
export type DepsGraph<T extends string> = Record<T, DepsGraphNode<T>>;
|
|
43
|
-
export interface DepsGraphNode<T extends string> {
|
|
44
|
-
children: {
|
|
45
|
-
[alias: string]: T;
|
|
46
|
-
};
|
|
47
|
-
pkgIdWithPatchHash?: PkgIdWithPatchHash;
|
|
48
|
-
resolution?: LockfileResolution;
|
|
49
|
-
fullPkgId?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface DepsStateCache {
|
|
52
|
-
[depPath: string]: string;
|
|
53
|
-
}
|
|
54
|
-
export declare function calcDepState<T extends string>(depsGraph: DepsGraph<T>, cache: DepsStateCache, depPath: string, opts: {
|
|
55
|
-
patchFileHash?: string;
|
|
56
|
-
includeDepGraphHash: boolean;
|
|
57
|
-
supportedArchitectures?: SupportedArchitectures;
|
|
58
|
-
/**
|
|
59
|
-
* Install-wide fallback `engines.runtime` / `devEngines.runtime`
|
|
60
|
-
* Node version (e.g. `"22.11.0"`). Used only when the snapshot at
|
|
61
|
-
* `depPath` doesn't itself pin a Node: per-snapshot pins take
|
|
62
|
-
* precedence so the side-effects-cache key reflects the actual
|
|
63
|
-
* script-runner Node the bin linker would spawn for the package
|
|
64
|
-
* (see {@link readSnapshotRuntimePin}). Typically computed once
|
|
65
|
-
* per install via {@link findRuntimeNodeVersion} over the
|
|
66
|
-
* lockfile's snapshot keys.
|
|
67
|
-
*/
|
|
68
|
-
nodeVersion?: string;
|
|
69
|
-
}): string;
|
|
70
|
-
export interface PkgMeta {
|
|
71
|
-
depPath: DepPath;
|
|
72
|
-
name: string;
|
|
73
|
-
version: string;
|
|
74
|
-
}
|
|
75
|
-
export type PkgMetaIterator<T extends PkgMeta> = IterableIterator<T>;
|
|
76
|
-
export interface HashedDepPath<T extends PkgMeta> {
|
|
77
|
-
pkgMeta: T;
|
|
78
|
-
hash: string;
|
|
79
|
-
}
|
|
80
|
-
export declare function iterateHashedGraphNodes<T extends PkgMeta>(graph: DepsGraph<DepPath>, pkgMetaIterator: PkgMetaIterator<T>, allowBuild?: AllowBuild, supportedArchitectures?: SupportedArchitectures,
|
|
81
|
-
/**
|
|
82
|
-
* Install-wide fallback `engines.runtime` / `devEngines.runtime`
|
|
83
|
-
* Node version. Used only for snapshots that don't pin their own
|
|
84
|
-
* Node; pinning snapshots get resolved per-snapshot via
|
|
85
|
-
* {@link readSnapshotRuntimePin} so the GVS engine hash matches
|
|
86
|
-
* the Node the bin linker would actually spawn for each package
|
|
87
|
-
* (see [`bins/linker/src/index.ts`](https://github.com/pnpm/pnpm/blob/29a42efc3b/bins/linker/src/index.ts)).
|
|
88
|
-
* Typically obtained via {@link findRuntimeNodeVersion} over the
|
|
89
|
-
* lockfile's snapshot keys. `undefined` falls back to
|
|
90
|
-
* {@link engineName}'s default (system `node --version`, with
|
|
91
|
-
* `process.version` as a last resort).
|
|
92
|
-
*/
|
|
93
|
-
nodeVersion?: string): IterableIterator<HashedDepPath<T>>;
|
|
94
|
-
export declare function calcGraphNodeHash<T extends PkgMeta>({ graph, cache, builtDepPaths, buildRequiredCache, supportedArchitectures, nodeVersion }: {
|
|
95
|
-
graph: DepsGraph<DepPath>;
|
|
96
|
-
cache: DepsStateCache;
|
|
97
|
-
builtDepPaths?: Set<DepPath>;
|
|
98
|
-
buildRequiredCache?: Record<string, boolean>;
|
|
99
|
-
supportedArchitectures?: SupportedArchitectures;
|
|
100
|
-
/** See [`iterateHashedGraphNodes`]'s `nodeVersion` parameter. */
|
|
101
|
-
nodeVersion?: string;
|
|
102
|
-
}, pkgMeta: T): string;
|
|
103
|
-
export declare function calcLeafGlobalVirtualStorePath(fullPkgId: string, name: string, version: string): string;
|
|
104
|
-
/**
|
|
105
|
-
* `subdepIds` maps each direct child's alias to its full pkg id
|
|
106
|
-
* (`${name}@${version}:${integrity}`). Each child contributes a leaf hash
|
|
107
|
-
* (no transitive walk) to the parent's hash, so the resulting path differs
|
|
108
|
-
* whenever the set or versions of children change. One level deep only —
|
|
109
|
-
* use {@link calcGraphNodeHash} when full graph traversal is needed.
|
|
110
|
-
*/
|
|
111
|
-
export declare function calcGlobalVirtualStorePathWithSubdeps(fullPkgId: string, name: string, version: string, subdepIds: Record<string, string>): string;
|
|
112
|
-
export interface PkgMetaAndSnapshot extends PkgMeta {
|
|
113
|
-
pkgSnapshot: PackageSnapshot;
|
|
114
|
-
pkgIdWithPatchHash: PkgIdWithPatchHash;
|
|
115
|
-
}
|
|
116
|
-
export declare function iteratePkgMeta(lockfile: LockfileObject, graph: DepsGraph<DepPath>): PkgMetaIterator<PkgMetaAndSnapshot>;
|
|
117
|
-
export declare function lockfileToDepGraph(lockfile: LockfileObject, supportedArchitectures?: SupportedArchitectures): DepsGraph<DepPath>;
|