@pnpm/deps.graph-builder 0.0.0

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
+ Copyright (c) 2016-2023 Zoltan Kochan and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # @pnpm/deps.graph-builder
2
+
3
+ > A package for building a dependency graph from a lockfile
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ pnpm install @pnpm/deps.graph.builder
9
+ ```
10
+
11
+ ## License
12
+
13
+ [MIT](LICENSE)
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lockfileToDepGraph';
package/lib/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lockfileToDepGraph"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC"}
@@ -0,0 +1,62 @@
1
+ import { type Lockfile } from '@pnpm/lockfile-file';
2
+ import { type IncludedDependencies } from '@pnpm/modules-yaml';
3
+ import { type PatchFile, type Registries } from '@pnpm/types';
4
+ import { type PackageFilesResponse, type StoreController } from '@pnpm/store-controller-types';
5
+ export interface DependenciesGraphNode {
6
+ alias?: string;
7
+ hasBundledDependencies: boolean;
8
+ modules: string;
9
+ name: string;
10
+ fetchingFiles: () => Promise<PackageFilesResponse>;
11
+ finishing: () => Promise<void>;
12
+ dir: string;
13
+ children: Record<string, string>;
14
+ optionalDependencies: Set<string>;
15
+ optional: boolean;
16
+ depPath: string;
17
+ isBuilt?: boolean;
18
+ requiresBuild: boolean;
19
+ prepare: boolean;
20
+ hasBin: boolean;
21
+ filesIndexFile: string;
22
+ patchFile?: PatchFile;
23
+ }
24
+ export interface DependenciesGraph {
25
+ [depPath: string]: DependenciesGraphNode;
26
+ }
27
+ export interface LockfileToDepGraphOptions {
28
+ autoInstallPeers: boolean;
29
+ engineStrict: boolean;
30
+ force: boolean;
31
+ importerIds: string[];
32
+ include: IncludedDependencies;
33
+ ignoreScripts: boolean;
34
+ lockfileDir: string;
35
+ nodeVersion: string;
36
+ pnpmVersion: string;
37
+ patchedDependencies?: Record<string, PatchFile>;
38
+ registries: Registries;
39
+ sideEffectsCacheRead: boolean;
40
+ skipped: Set<string>;
41
+ storeController: StoreController;
42
+ storeDir: string;
43
+ virtualStoreDir: string;
44
+ }
45
+ export interface DirectDependenciesByImporterId {
46
+ [importerId: string]: {
47
+ [alias: string]: string;
48
+ };
49
+ }
50
+ export interface DepHierarchy {
51
+ [depPath: string]: Record<string, DepHierarchy>;
52
+ }
53
+ export interface LockfileToDepGraphResult {
54
+ directDependenciesByImporterId: DirectDependenciesByImporterId;
55
+ graph: DependenciesGraph;
56
+ hierarchy?: DepHierarchy;
57
+ hoistedLocations?: Record<string, string[]>;
58
+ symlinkedDirectDependenciesByImporterId?: DirectDependenciesByImporterId;
59
+ prevGraph?: DependenciesGraph;
60
+ pkgLocationsByDepPath?: Record<string, string[]>;
61
+ }
62
+ export declare function lockfileToDepGraph(lockfile: Lockfile, currentLockfile: Lockfile | null, opts: LockfileToDepGraphOptions): Promise<LockfileToDepGraphResult>;
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.lockfileToDepGraph = void 0;
30
+ const path_1 = __importDefault(require("path"));
31
+ const constants_1 = require("@pnpm/constants");
32
+ const core_loggers_1 = require("@pnpm/core-loggers");
33
+ const lockfile_utils_1 = require("@pnpm/lockfile-utils");
34
+ const logger_1 = require("@pnpm/logger");
35
+ const package_is_installable_1 = require("@pnpm/package-is-installable");
36
+ const dp = __importStar(require("@pnpm/dependency-path"));
37
+ const path_exists_1 = __importDefault(require("path-exists"));
38
+ const equals_1 = __importDefault(require("ramda/src/equals"));
39
+ const brokenModulesLogger = (0, logger_1.logger)('_broken_node_modules');
40
+ async function lockfileToDepGraph(lockfile, currentLockfile, opts) {
41
+ const currentPackages = currentLockfile?.packages ?? {};
42
+ const graph = {};
43
+ const directDependenciesByImporterId = {};
44
+ if (lockfile.packages != null) {
45
+ const pkgSnapshotByLocation = {};
46
+ await Promise.all(Object.entries(lockfile.packages).map(async ([depPath, pkgSnapshot]) => {
47
+ if (opts.skipped.has(depPath))
48
+ return;
49
+ // TODO: optimize. This info can be already returned by pkgSnapshotToResolution()
50
+ const { name: pkgName, version: pkgVersion } = (0, lockfile_utils_1.nameVerFromPkgSnapshot)(depPath, pkgSnapshot);
51
+ const modules = path_1.default.join(opts.virtualStoreDir, dp.depPathToFilename(depPath), 'node_modules');
52
+ const packageId = (0, lockfile_utils_1.packageIdFromSnapshot)(depPath, pkgSnapshot, opts.registries);
53
+ const pkg = {
54
+ name: pkgName,
55
+ version: pkgVersion,
56
+ engines: pkgSnapshot.engines,
57
+ cpu: pkgSnapshot.cpu,
58
+ os: pkgSnapshot.os,
59
+ libc: pkgSnapshot.libc,
60
+ };
61
+ if (!opts.force &&
62
+ (0, package_is_installable_1.packageIsInstallable)(packageId, pkg, {
63
+ engineStrict: opts.engineStrict,
64
+ lockfileDir: opts.lockfileDir,
65
+ nodeVersion: opts.nodeVersion,
66
+ optional: pkgSnapshot.optional === true,
67
+ pnpmVersion: opts.pnpmVersion,
68
+ }) === false) {
69
+ opts.skipped.add(depPath);
70
+ return;
71
+ }
72
+ const dir = path_1.default.join(modules, pkgName);
73
+ if (!(0, lockfile_utils_1.refIsLocalDirectory)(depPath) &&
74
+ currentPackages[depPath] && (0, equals_1.default)(currentPackages[depPath].dependencies, lockfile.packages[depPath].dependencies) &&
75
+ (0, equals_1.default)(currentPackages[depPath].optionalDependencies, lockfile.packages[depPath].optionalDependencies)) {
76
+ if (await (0, path_exists_1.default)(dir)) {
77
+ return;
78
+ }
79
+ brokenModulesLogger.debug({
80
+ missing: dir,
81
+ });
82
+ }
83
+ const resolution = (0, lockfile_utils_1.pkgSnapshotToResolution)(depPath, pkgSnapshot, opts.registries);
84
+ core_loggers_1.progressLogger.debug({
85
+ packageId,
86
+ requester: opts.lockfileDir,
87
+ status: 'resolved',
88
+ });
89
+ let fetchResponse;
90
+ try {
91
+ fetchResponse = opts.storeController.fetchPackage({
92
+ force: false,
93
+ lockfileDir: opts.lockfileDir,
94
+ ignoreScripts: opts.ignoreScripts,
95
+ pkg: {
96
+ id: packageId,
97
+ resolution,
98
+ },
99
+ expectedPkg: {
100
+ name: pkgName,
101
+ version: pkgVersion,
102
+ },
103
+ });
104
+ if (fetchResponse instanceof Promise)
105
+ fetchResponse = await fetchResponse;
106
+ }
107
+ catch (err) { // eslint-disable-line
108
+ if (pkgSnapshot.optional)
109
+ return;
110
+ throw err;
111
+ }
112
+ graph[dir] = {
113
+ children: {},
114
+ depPath,
115
+ dir,
116
+ fetchingFiles: fetchResponse.files,
117
+ filesIndexFile: fetchResponse.filesIndexFile,
118
+ finishing: fetchResponse.finishing,
119
+ hasBin: pkgSnapshot.hasBin === true,
120
+ hasBundledDependencies: pkgSnapshot.bundledDependencies != null,
121
+ modules,
122
+ name: pkgName,
123
+ optional: !!pkgSnapshot.optional,
124
+ optionalDependencies: new Set(Object.keys(pkgSnapshot.optionalDependencies ?? {})),
125
+ prepare: pkgSnapshot.prepare === true,
126
+ requiresBuild: pkgSnapshot.requiresBuild === true,
127
+ patchFile: opts.patchedDependencies?.[`${pkgName}@${pkgVersion}`],
128
+ };
129
+ pkgSnapshotByLocation[dir] = pkgSnapshot;
130
+ }));
131
+ const ctx = {
132
+ force: opts.force,
133
+ graph,
134
+ lockfileDir: opts.lockfileDir,
135
+ pkgSnapshotsByDepPaths: lockfile.packages,
136
+ registries: opts.registries,
137
+ sideEffectsCacheRead: opts.sideEffectsCacheRead,
138
+ skipped: opts.skipped,
139
+ storeController: opts.storeController,
140
+ storeDir: opts.storeDir,
141
+ virtualStoreDir: opts.virtualStoreDir,
142
+ };
143
+ for (const [dir, node] of Object.entries(graph)) {
144
+ const pkgSnapshot = pkgSnapshotByLocation[dir];
145
+ const allDeps = {
146
+ ...pkgSnapshot.dependencies,
147
+ ...(opts.include.optionalDependencies ? pkgSnapshot.optionalDependencies : {}),
148
+ };
149
+ const peerDeps = pkgSnapshot.peerDependencies ? new Set(Object.keys(pkgSnapshot.peerDependencies)) : null;
150
+ node.children = getChildrenPaths(ctx, allDeps, peerDeps, '.');
151
+ }
152
+ for (const importerId of opts.importerIds) {
153
+ const projectSnapshot = lockfile.importers[importerId];
154
+ const rootDeps = {
155
+ ...(opts.include.devDependencies ? projectSnapshot.devDependencies : {}),
156
+ ...(opts.include.dependencies ? projectSnapshot.dependencies : {}),
157
+ ...(opts.include.optionalDependencies ? projectSnapshot.optionalDependencies : {}),
158
+ };
159
+ directDependenciesByImporterId[importerId] = getChildrenPaths(ctx, rootDeps, null, importerId);
160
+ }
161
+ }
162
+ return { graph, directDependenciesByImporterId };
163
+ }
164
+ exports.lockfileToDepGraph = lockfileToDepGraph;
165
+ function getChildrenPaths(ctx, allDeps, peerDeps, importerId) {
166
+ const children = {};
167
+ for (const [alias, ref] of Object.entries(allDeps)) {
168
+ const childDepPath = dp.refToAbsolute(ref, alias, ctx.registries);
169
+ if (childDepPath === null) {
170
+ children[alias] = path_1.default.resolve(ctx.lockfileDir, importerId, ref.slice(5));
171
+ continue;
172
+ }
173
+ const childRelDepPath = dp.refToRelative(ref, alias);
174
+ const childPkgSnapshot = ctx.pkgSnapshotsByDepPaths[childRelDepPath];
175
+ if (ctx.graph[childRelDepPath]) {
176
+ children[alias] = ctx.graph[childRelDepPath].dir;
177
+ }
178
+ else if (childPkgSnapshot) {
179
+ if (ctx.skipped.has(childRelDepPath))
180
+ continue;
181
+ const pkgName = (0, lockfile_utils_1.nameVerFromPkgSnapshot)(childRelDepPath, childPkgSnapshot).name;
182
+ children[alias] = path_1.default.join(ctx.virtualStoreDir, dp.depPathToFilename(childRelDepPath), 'node_modules', pkgName);
183
+ }
184
+ else if (ref.indexOf('file:') === 0) {
185
+ children[alias] = path_1.default.resolve(ctx.lockfileDir, ref.slice(5));
186
+ }
187
+ else if (!ctx.skipped.has(childRelDepPath) && ((peerDeps == null) || !peerDeps.has(alias))) {
188
+ throw new Error(`${childRelDepPath} not found in ${constants_1.WANTED_LOCKFILE}`);
189
+ }
190
+ }
191
+ return children;
192
+ }
193
+ //# sourceMappingURL=lockfileToDepGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockfileToDepGraph.js","sourceRoot":"","sources":["../src/lockfileToDepGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAuB;AACvB,+CAAiD;AACjD,qDAE2B;AAK3B,yDAK6B;AAC7B,yCAAqC;AAErC,yEAAmE;AAOnE,0DAA2C;AAC3C,8DAAoC;AACpC,8DAAqC;AAErC,MAAM,mBAAmB,GAAG,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AC,eAAe,CAAC,CAAC,GAAG,CAAA;SACjD;aAAM,IAAI,gBAAgB,EAAE;YAC3B,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;gBAAE,SAAQ;YAC9C,MAAM,OAAO,GAAG,IAAA,uCAAsB,EAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAA;YAC9E,QAAQ,CAAC,KAAK,CAAC,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;SACjH;aAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACrC,QAAQ,CAAC,KAAK,CAAC,GAAG,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;SAC9D;aAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5F,MAAM,IAAI,KAAK,CAAC,GAAG,eAAe,iBAAiB,2BAAe,EAAE,CAAC,CAAA;SACtE;KACF;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@pnpm/deps.graph-builder",
3
+ "description": "A package for building a dependency graph from a lockfile",
4
+ "version": "0.0.0",
5
+ "bugs": {
6
+ "url": "https://github.com/pnpm/pnpm/issues"
7
+ },
8
+ "main": "lib/index.js",
9
+ "types": "lib/index.d.ts",
10
+ "files": [
11
+ "lib",
12
+ "!*.map"
13
+ ],
14
+ "funding": "https://opencollective.com/pnpm",
15
+ "exports": {
16
+ ".": "./lib/index.js"
17
+ },
18
+ "peerDependencies": {
19
+ "@pnpm/logger": "^5.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/ramda": "0.28.20",
23
+ "@pnpm/deps.graph-builder": "0.0.0"
24
+ },
25
+ "homepage": "https://github.com/pnpm/pnpm/blob/main/deps/graph-builder#readme",
26
+ "keywords": [
27
+ "pnpm8",
28
+ "pnpm"
29
+ ],
30
+ "license": "MIT",
31
+ "engines": {
32
+ "node": ">=16.14"
33
+ },
34
+ "repository": "https://github.com/pnpm/pnpm/blob/main/deps/graph-builder",
35
+ "dependencies": {
36
+ "path-exists": "^4.0.0",
37
+ "ramda": "npm:@pnpm/ramda@0.28.1",
38
+ "@pnpm/core-loggers": "9.0.1",
39
+ "@pnpm/constants": "7.1.1",
40
+ "@pnpm/dependency-path": "2.1.2",
41
+ "@pnpm/lockfile-utils": "8.0.2",
42
+ "@pnpm/modules-yaml": "12.1.1",
43
+ "@pnpm/package-is-installable": "8.0.3",
44
+ "@pnpm/store-controller-types": "15.0.1",
45
+ "@pnpm/lockfile-file": "8.1.1",
46
+ "@pnpm/types": "9.1.0"
47
+ },
48
+ "scripts": {
49
+ "lint": "eslint \"src/**/*.ts\"",
50
+ "test": "pnpm run compile",
51
+ "compile": "tsc --build && pnpm run lint --fix"
52
+ }
53
+ }