pnpm-dedup 2.1.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 +21 -0
- package/README.md +218 -0
- package/dist/applyClusterFixes.js +252 -0
- package/dist/applyClusterFixes.js.map +1 -0
- package/dist/applyClusterFixes.test.js +474 -0
- package/dist/applyClusterFixes.test.js.map +1 -0
- package/dist/bin/pnpm-dedupe.js +35 -0
- package/dist/bin/pnpm-dedupe.js.map +1 -0
- package/dist/bin/pnpm-why-duplicate.js +23 -0
- package/dist/bin/pnpm-why-duplicate.js.map +1 -0
- package/dist/bin/pnpm-why-duplicate.test.js +57 -0
- package/dist/bin/pnpm-why-duplicate.test.js.map +1 -0
- package/dist/dedupe.js +86 -0
- package/dist/dedupe.js.map +1 -0
- package/dist/dedupeCheckConsistency.test.js +149 -0
- package/dist/dedupeCheckConsistency.test.js.map +1 -0
- package/dist/dedupeEndToEnd.test.js +121 -0
- package/dist/dedupeEndToEnd.test.js.map +1 -0
- package/dist/dedupePeers.test.js +105 -0
- package/dist/dedupePeers.test.js.map +1 -0
- package/dist/definitions/applyClusterFixes.d.ts +24 -0
- package/dist/definitions/applyClusterFixes.d.ts.map +1 -0
- package/dist/definitions/applyClusterFixes.test.d.ts +2 -0
- package/dist/definitions/applyClusterFixes.test.d.ts.map +1 -0
- package/dist/definitions/bin/pnpm-dedupe.d.ts +3 -0
- package/dist/definitions/bin/pnpm-dedupe.d.ts.map +1 -0
- package/dist/definitions/bin/pnpm-why-duplicate.d.ts +3 -0
- package/dist/definitions/bin/pnpm-why-duplicate.d.ts.map +1 -0
- package/dist/definitions/bin/pnpm-why-duplicate.test.d.ts +2 -0
- package/dist/definitions/bin/pnpm-why-duplicate.test.d.ts.map +1 -0
- package/dist/definitions/dedupe.d.ts +15 -0
- package/dist/definitions/dedupe.d.ts.map +1 -0
- package/dist/definitions/dedupeCheckConsistency.test.d.ts +2 -0
- package/dist/definitions/dedupeCheckConsistency.test.d.ts.map +1 -0
- package/dist/definitions/dedupeEndToEnd.test.d.ts +2 -0
- package/dist/definitions/dedupeEndToEnd.test.d.ts.map +1 -0
- package/dist/definitions/dedupePeers.test.d.ts +2 -0
- package/dist/definitions/dedupePeers.test.d.ts.map +1 -0
- package/dist/definitions/displayMany.d.ts +16 -0
- package/dist/definitions/displayMany.d.ts.map +1 -0
- package/dist/definitions/displayMany.test.d.ts +2 -0
- package/dist/definitions/displayMany.test.d.ts.map +1 -0
- package/dist/definitions/helpers/buildIdentifiedFixesMap.test.d.ts +2 -0
- package/dist/definitions/helpers/buildIdentifiedFixesMap.test.d.ts.map +1 -0
- package/dist/definitions/helpers/buildPnpmPackagesMap.d.ts +13 -0
- package/dist/definitions/helpers/buildPnpmPackagesMap.d.ts.map +1 -0
- package/dist/definitions/helpers/buildPnpmPackagesMap.test.d.ts +2 -0
- package/dist/definitions/helpers/buildPnpmPackagesMap.test.d.ts.map +1 -0
- package/dist/definitions/helpers/collectDependentRanges.d.ts +22 -0
- package/dist/definitions/helpers/collectDependentRanges.d.ts.map +1 -0
- package/dist/definitions/helpers/collectDependentRanges.test.d.ts +2 -0
- package/dist/definitions/helpers/collectDependentRanges.test.d.ts.map +1 -0
- package/dist/definitions/helpers/collectPnpmDependents.d.ts +8 -0
- package/dist/definitions/helpers/collectPnpmDependents.d.ts.map +1 -0
- package/dist/definitions/helpers/collectPnpmDependents.test.d.ts +2 -0
- package/dist/definitions/helpers/collectPnpmDependents.test.d.ts.map +1 -0
- package/dist/definitions/helpers/duplicateSnapshot.d.ts +3 -0
- package/dist/definitions/helpers/duplicateSnapshot.d.ts.map +1 -0
- package/dist/definitions/helpers/parsePnpmLockPackages.d.ts +44 -0
- package/dist/definitions/helpers/parsePnpmLockPackages.d.ts.map +1 -0
- package/dist/definitions/helpers/parsePnpmLockPackages.test.d.ts +2 -0
- package/dist/definitions/helpers/parsePnpmLockPackages.test.d.ts.map +1 -0
- package/dist/definitions/helpers/pnpmProtocol.d.ts +2 -0
- package/dist/definitions/helpers/pnpmProtocol.d.ts.map +1 -0
- package/dist/definitions/helpers/pnpmVersion.d.ts +11 -0
- package/dist/definitions/helpers/pnpmVersion.d.ts.map +1 -0
- package/dist/definitions/helpers/pnpmWorkspaceYaml.d.ts +23 -0
- package/dist/definitions/helpers/pnpmWorkspaceYaml.d.ts.map +1 -0
- package/dist/definitions/helpers/pnpmWorkspaceYaml.test.d.ts +2 -0
- package/dist/definitions/helpers/pnpmWorkspaceYaml.test.d.ts.map +1 -0
- package/dist/definitions/helpers/projectDir.d.ts +3 -0
- package/dist/definitions/helpers/projectDir.d.ts.map +1 -0
- package/dist/definitions/helpers/readInstalledManifest.d.ts +32 -0
- package/dist/definitions/helpers/readInstalledManifest.d.ts.map +1 -0
- package/dist/definitions/helpers/readInstalledManifest.test.d.ts +2 -0
- package/dist/definitions/helpers/readInstalledManifest.test.d.ts.map +1 -0
- package/dist/definitions/helpers/runPnpm.d.ts +11 -0
- package/dist/definitions/helpers/runPnpm.d.ts.map +1 -0
- package/dist/definitions/helpers/tempProjects.d.ts +8 -0
- package/dist/definitions/helpers/tempProjects.d.ts.map +1 -0
- package/dist/definitions/helpers/toLockstepGraph.d.ts +12 -0
- package/dist/definitions/helpers/toLockstepGraph.d.ts.map +1 -0
- package/dist/definitions/helpers/toLockstepGraph.test.d.ts +2 -0
- package/dist/definitions/helpers/toLockstepGraph.test.d.ts.map +1 -0
- package/dist/definitions/helpers/versionsSnapshot.d.ts +3 -0
- package/dist/definitions/helpers/versionsSnapshot.d.ts.map +1 -0
- package/dist/definitions/identifyClusterFixes.d.ts +7 -0
- package/dist/definitions/identifyClusterFixes.d.ts.map +1 -0
- package/dist/definitions/identifyClusterFixes.test.d.ts +2 -0
- package/dist/definitions/identifyClusterFixes.test.d.ts.map +1 -0
- package/dist/definitions/identifyResolutionFixes.test.d.ts +2 -0
- package/dist/definitions/identifyResolutionFixes.test.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +25 -0
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/definitions/pnpmLockTypes.d.ts +42 -0
- package/dist/definitions/pnpmLockTypes.d.ts.map +1 -0
- package/dist/definitions/readPnpmLock.d.ts +3 -0
- package/dist/definitions/readPnpmLock.d.ts.map +1 -0
- package/dist/displayMany.js +56 -0
- package/dist/displayMany.js.map +1 -0
- package/dist/displayMany.test.js +146 -0
- package/dist/displayMany.test.js.map +1 -0
- package/dist/helpers/buildIdentifiedFixesMap.test.js +27 -0
- package/dist/helpers/buildIdentifiedFixesMap.test.js.map +1 -0
- package/dist/helpers/buildPnpmPackagesMap.js +23 -0
- package/dist/helpers/buildPnpmPackagesMap.js.map +1 -0
- package/dist/helpers/buildPnpmPackagesMap.test.js +68 -0
- package/dist/helpers/buildPnpmPackagesMap.test.js.map +1 -0
- package/dist/helpers/collectDependentRanges.js +118 -0
- package/dist/helpers/collectDependentRanges.js.map +1 -0
- package/dist/helpers/collectDependentRanges.test.js +211 -0
- package/dist/helpers/collectDependentRanges.test.js.map +1 -0
- package/dist/helpers/collectPnpmDependents.js +55 -0
- package/dist/helpers/collectPnpmDependents.js.map +1 -0
- package/dist/helpers/collectPnpmDependents.test.js +78 -0
- package/dist/helpers/collectPnpmDependents.test.js.map +1 -0
- package/dist/helpers/duplicateSnapshot.js +5 -0
- package/dist/helpers/duplicateSnapshot.js.map +1 -0
- package/dist/helpers/parsePnpmLockPackages.js +62 -0
- package/dist/helpers/parsePnpmLockPackages.js.map +1 -0
- package/dist/helpers/parsePnpmLockPackages.test.js +62 -0
- package/dist/helpers/parsePnpmLockPackages.test.js.map +1 -0
- package/dist/helpers/pnpmProtocol.js +2 -0
- package/dist/helpers/pnpmProtocol.js.map +1 -0
- package/dist/helpers/pnpmVersion.js +23 -0
- package/dist/helpers/pnpmVersion.js.map +1 -0
- package/dist/helpers/pnpmWorkspaceYaml.js +48 -0
- package/dist/helpers/pnpmWorkspaceYaml.js.map +1 -0
- package/dist/helpers/pnpmWorkspaceYaml.test.js +91 -0
- package/dist/helpers/pnpmWorkspaceYaml.test.js.map +1 -0
- package/dist/helpers/projectDir.js +10 -0
- package/dist/helpers/projectDir.js.map +1 -0
- package/dist/helpers/readInstalledManifest.js +139 -0
- package/dist/helpers/readInstalledManifest.js.map +1 -0
- package/dist/helpers/readInstalledManifest.test.js +83 -0
- package/dist/helpers/readInstalledManifest.test.js.map +1 -0
- package/dist/helpers/runPnpm.js +16 -0
- package/dist/helpers/runPnpm.js.map +1 -0
- package/dist/helpers/tempProjects.js +85 -0
- package/dist/helpers/tempProjects.js.map +1 -0
- package/dist/helpers/toLockstepGraph.js +34 -0
- package/dist/helpers/toLockstepGraph.js.map +1 -0
- package/dist/helpers/toLockstepGraph.test.js +81 -0
- package/dist/helpers/toLockstepGraph.test.js.map +1 -0
- package/dist/helpers/versionsSnapshot.js +5 -0
- package/dist/helpers/versionsSnapshot.js.map +1 -0
- package/dist/identifyClusterFixes.js +53 -0
- package/dist/identifyClusterFixes.js.map +1 -0
- package/dist/identifyClusterFixes.test.js +307 -0
- package/dist/identifyClusterFixes.test.js.map +1 -0
- package/dist/identifyResolutionFixes.test.js +49 -0
- package/dist/identifyResolutionFixes.test.js.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/pnpmLockTypes.js +7 -0
- package/dist/pnpmLockTypes.js.map +1 -0
- package/dist/readPnpmLock.js +6 -0
- package/dist/readPnpmLock.js.map +1 -0
- package/package.json +71 -0
- package/src/applyClusterFixes.test.ts +560 -0
- package/src/applyClusterFixes.ts +466 -0
- package/src/bin/pnpm-dedupe.ts +44 -0
- package/src/bin/pnpm-why-duplicate.test.ts +79 -0
- package/src/bin/pnpm-why-duplicate.ts +34 -0
- package/src/dedupe.ts +124 -0
- package/src/dedupeCheckConsistency.test.ts +218 -0
- package/src/dedupeEndToEnd.test.ts +168 -0
- package/src/dedupePeers.test.ts +175 -0
- package/src/displayMany.test.ts +208 -0
- package/src/displayMany.ts +104 -0
- package/src/helpers/buildIdentifiedFixesMap.test.ts +33 -0
- package/src/helpers/buildPnpmPackagesMap.test.ts +119 -0
- package/src/helpers/buildPnpmPackagesMap.ts +53 -0
- package/src/helpers/collectDependentRanges.test.ts +311 -0
- package/src/helpers/collectDependentRanges.ts +185 -0
- package/src/helpers/collectPnpmDependents.test.ts +112 -0
- package/src/helpers/collectPnpmDependents.ts +79 -0
- package/src/helpers/duplicateSnapshot.ts +18 -0
- package/src/helpers/parsePnpmLockPackages.test.ts +93 -0
- package/src/helpers/parsePnpmLockPackages.ts +99 -0
- package/src/helpers/pnpmProtocol.ts +12 -0
- package/src/helpers/pnpmVersion.ts +28 -0
- package/src/helpers/pnpmWorkspaceYaml.test.ts +140 -0
- package/src/helpers/pnpmWorkspaceYaml.ts +77 -0
- package/src/helpers/projectDir.ts +14 -0
- package/src/helpers/readInstalledManifest.test.ts +124 -0
- package/src/helpers/readInstalledManifest.ts +202 -0
- package/src/helpers/runPnpm.ts +34 -0
- package/src/helpers/tempProjects.ts +94 -0
- package/src/helpers/toLockstepGraph.test.ts +98 -0
- package/src/helpers/toLockstepGraph.ts +52 -0
- package/src/helpers/versionsSnapshot.ts +9 -0
- package/src/identifyClusterFixes.test.ts +430 -0
- package/src/identifyClusterFixes.ts +114 -0
- package/src/identifyResolutionFixes.test.ts +82 -0
- package/src/index.ts +159 -0
- package/src/pnpmLockTypes.ts +44 -0
- package/src/readPnpmLock.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"displayMany.d.ts","sourceRoot":"","sources":["../../src/displayMany.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAGV,qBAAqB,EACtB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,qBAAqB,CAAC;IAE7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB,EAAE,WAAW,CAAC;IAGnC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAiED,eAAO,MAAM,WAAW,YAAa,kBAAkB,KAAG,IAezD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"displayMany.test.d.ts","sourceRoot":"","sources":["../../src/displayMany.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildIdentifiedFixesMap.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/buildIdentifiedFixesMap.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NpmPackage, Package, ParsedPnpmPackages } from "./parsePnpmLockPackages.ts";
|
|
2
|
+
export interface PackageResolution {
|
|
3
|
+
resolution: string;
|
|
4
|
+
package: Package;
|
|
5
|
+
installations: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface NpmPackageResolution extends PackageResolution {
|
|
8
|
+
package: NpmPackage;
|
|
9
|
+
}
|
|
10
|
+
export type PackagesMap = Record<string, PackageResolution[]>;
|
|
11
|
+
export declare function buildPnpmPackagesMap({ packages, installationsByResolution, }: ParsedPnpmPackages): PackagesMap;
|
|
12
|
+
export declare function filterDuplicatesPnpmPackagesMap(packagesMap: PackagesMap): PackagesMap;
|
|
13
|
+
//# sourceMappingURL=buildPnpmPackagesMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPnpmPackagesMap.d.ts","sourceRoot":"","sources":["../../../src/helpers/buildPnpmPackagesMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAK9D,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,yBAAyB,GAC1B,EAAE,kBAAkB,GAAG,WAAW,CAkBlC;AAED,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,WAAW,GACvB,WAAW,CAMb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPnpmPackagesMap.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/buildPnpmPackagesMap.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClusterWorkspaceRef } from "pm-dedup-core";
|
|
2
|
+
import type { PnpmLockFile } from "../pnpmLockTypes.ts";
|
|
3
|
+
import type { ManifestReader } from "./readInstalledManifest.ts";
|
|
4
|
+
export interface DependentRange {
|
|
5
|
+
key: string;
|
|
6
|
+
range: string;
|
|
7
|
+
resolvedVersion?: string;
|
|
8
|
+
requesterName?: string;
|
|
9
|
+
aliasKey?: string;
|
|
10
|
+
workspace?: ClusterWorkspaceRef;
|
|
11
|
+
peer?: true;
|
|
12
|
+
}
|
|
13
|
+
export type DependentRangesMap = Map<string, DependentRange[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Collect, for each duplicated package, the real semver range every dependent
|
|
16
|
+
* declares. Direct (importer) dependents carry their specifier; transitive
|
|
17
|
+
* dependents' ranges are read from their installed manifest (the pnpm lockfile
|
|
18
|
+
* only stores the resolved version, not the range). When a manifest is missing
|
|
19
|
+
* (project not installed), the resolved version is used as an exact fallback.
|
|
20
|
+
*/
|
|
21
|
+
export declare const collectDependentRanges: (lock: PnpmLockFile, duplicatePackageNames: Set<string>, readManifest: ManifestReader) => DependentRangesMap;
|
|
22
|
+
//# sourceMappingURL=collectDependentRanges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectDependentRanges.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectDependentRanges.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IAEd,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAIhC,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;AAyE/D;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,SAC3B,YAAY,yBACK,GAAG,CAAC,MAAM,CAAC,gBACpB,cAAc,KAC3B,kBAiEF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectDependentRanges.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectDependentRanges.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PnpmLockFile } from "../pnpmLockTypes.ts";
|
|
2
|
+
export interface Dependent {
|
|
3
|
+
key: string;
|
|
4
|
+
version: string;
|
|
5
|
+
}
|
|
6
|
+
export type DependentsMap = Map<string, Dependent[]>;
|
|
7
|
+
export declare function collectPnpmDependents(lock: PnpmLockFile, onlyPackageNames?: string[]): DependentsMap;
|
|
8
|
+
//# sourceMappingURL=collectPnpmDependents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectPnpmDependents.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectPnpmDependents.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOxD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAUrD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,aAAa,CAiDf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectPnpmDependents.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/collectPnpmDependents.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicateSnapshot.d.ts","sourceRoot":"","sources":["../../../src/helpers/duplicateSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQvD,eAAO,MAAM,qBAAqB,aAAc,MAAM,KAAG,iBAStD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PnpmLockFile } from "../pnpmLockTypes.ts";
|
|
2
|
+
export interface NpmPackage {
|
|
3
|
+
type: "npm";
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
resolution: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OtherPackage {
|
|
9
|
+
type: "other";
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
resolution: string;
|
|
13
|
+
}
|
|
14
|
+
export type Package = NpmPackage | OtherPackage;
|
|
15
|
+
export type PnpmLockPackages = Map<string, Package>;
|
|
16
|
+
export interface ParsedPnpmPackages {
|
|
17
|
+
packages: PnpmLockPackages;
|
|
18
|
+
installationsByResolution: Map<string, string[]>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Strip a pnpm peer-dependency suffix (everything from the first `(`).
|
|
22
|
+
*
|
|
23
|
+
* eg `@scope/name@1.2.3(eslint@9)(typescript@5)` -> `@scope/name@1.2.3`
|
|
24
|
+
*/
|
|
25
|
+
export declare const stripPeerSuffix: (id: string) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Parse a pnpm package id (`name@version`, optionally peer-suffixed) into its
|
|
28
|
+
* name and version. Handles scoped names (`@scope/name@1.2.3`).
|
|
29
|
+
*/
|
|
30
|
+
export declare const parsePackageId: (id: string) => {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Resolve a snapshot dependency entry. The value is either a resolved version
|
|
36
|
+
* (`1.2.3`, possibly peer-suffixed) for which the key is the real npm name, or
|
|
37
|
+
* an aliased `realName@version` form when the key is a local alias.
|
|
38
|
+
*/
|
|
39
|
+
export declare const resolveSnapshotDependency: (depName: string, depValue: string) => {
|
|
40
|
+
name: string;
|
|
41
|
+
version: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const parsePnpmLockPackages: (lock: PnpmLockFile) => ParsedPnpmPackages;
|
|
44
|
+
//# sourceMappingURL=parsePnpmLockPackages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsePnpmLockPackages.d.ts","sourceRoot":"","sources":["../../../src/helpers/parsePnpmLockPackages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,YAAY,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAClD;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,OAAQ,MAAM,KAAG,MAG5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,OACrB,MAAM,KACT;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAOjC,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,YAC3B,MAAM,YACL,MAAM,KACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAOjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAC1B,YAAY,KACjB,kBAyBF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsePnpmLockPackages.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/parsePnpmLockPackages.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmProtocol.d.ts","sourceRoot":"","sources":["../../../src/helpers/pnpmProtocol.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,MAAM,GACN,KAAK,GACL,UAAU,GACV,WAAW,GACX,SAAS,GACT,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PnpmRunner } from "./runPnpm.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Convergence overrides (`overrides: { "pkg@": "1.2.3" }`, empty range selector)
|
|
4
|
+
* landed in pnpm 11.13.0. They rewrite a dependency edge only when the declared
|
|
5
|
+
* range accepts the exact version, which is what lets a cluster converge without
|
|
6
|
+
* forcing the members a third-party range legitimately pins elsewhere.
|
|
7
|
+
*/
|
|
8
|
+
export declare const convergenceOverridesMinVersion = "11.13.0";
|
|
9
|
+
export declare const readPnpmVersion: (run?: PnpmRunner) => string | null;
|
|
10
|
+
export declare const supportsConvergenceOverrides: (version: string) => boolean;
|
|
11
|
+
//# sourceMappingURL=pnpmVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmVersion.d.ts","sourceRoot":"","sources":["../../../src/helpers/pnpmVersion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,YAAY,CAAC;AAExD,eAAO,MAAM,eAAe,SAAS,UAAU,KAAa,MAAM,GAAG,IAYpE,CAAC;AAEF,eAAO,MAAM,4BAA4B,YAAa,MAAM,KAAG,OACV,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A convergence override (pnpm >= 11.13.0) is an override key with an empty
|
|
3
|
+
* range selector. It repoints a dependency edge only when the edge's declared
|
|
4
|
+
* range accepts the exact version, so the members a third-party range
|
|
5
|
+
* legitimately pins elsewhere keep their own resolution instead of being forced.
|
|
6
|
+
* The plain key is the unconditional one: every requester gets the version.
|
|
7
|
+
*/
|
|
8
|
+
export declare const overrideKey: (packageName: string, convergence: boolean) => string;
|
|
9
|
+
export interface AddOverridesOptions {
|
|
10
|
+
convergence?: boolean;
|
|
11
|
+
comment?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Add overrides to a `pnpm-workspace.yaml`, editing the document rather than
|
|
15
|
+
* reserializing it: the user's comments, key order and formatting have to
|
|
16
|
+
* survive. Pass `undefined` for a file that does not exist yet.
|
|
17
|
+
*
|
|
18
|
+
* `comment` is attached above the first entry added, not above the `overrides`
|
|
19
|
+
* key, so an existing block and whatever the user wrote about it stay untouched.
|
|
20
|
+
*/
|
|
21
|
+
export declare const addOverrides: (content: string | undefined, overrides: Map<string, string>, { convergence, comment }?: AddOverridesOptions) => string;
|
|
22
|
+
export declare const readConvergenceOverrides: (content: string) => Map<string, string>;
|
|
23
|
+
//# sourceMappingURL=pnpmWorkspaceYaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmWorkspaceYaml.d.ts","sourceRoot":"","sources":["../../../src/helpers/pnpmWorkspaceYaml.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,gBACT,MAAM,eACN,OAAO,KACnB,MAAyD,CAAC;AAgB7D,MAAM,WAAW,mBAAmB;IAElC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,YACd,MAAM,GAAG,SAAS,aAChB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,6BACG,mBAAmB,KACnD,MAcF,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAC1B,MAAM,KACd,GAAG,CAAC,MAAM,EAAE,MAAM,CAYpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmWorkspaceYaml.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/pnpmWorkspaceYaml.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectDir.d.ts","sourceRoot":"","sources":["../../../src/helpers/projectDir.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,eAAgB,MAAM,KAAG,MAChB,CAAC;AAMjC,eAAO,MAAM,qBAAqB,QAAO,MAAM,GAAG,IACb,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface InstalledManifest {
|
|
2
|
+
version?: string;
|
|
3
|
+
dependencies?: Record<string, string>;
|
|
4
|
+
optionalDependencies?: Record<string, string>;
|
|
5
|
+
peerDependencies?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export type ManifestReader = (name: string, version: string) => InstalledManifest | undefined;
|
|
8
|
+
export interface ManifestReaderStats {
|
|
9
|
+
found: number;
|
|
10
|
+
missed: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build a reader that locates an installed package's manifest, whichever
|
|
14
|
+
* node-linker the project uses:
|
|
15
|
+
*
|
|
16
|
+
* - virtual store (pnpm's default): the dep path gives the directory,
|
|
17
|
+
* `node_modules/.pnpm/<name with / replaced by +>@<version>[(peers)|_hash]/node_modules/<name>`;
|
|
18
|
+
* - `nodeLinker: hoisted`: the layout is npm-shaped and placement is a hoisting
|
|
19
|
+
* decision, so `node_modules/.modules.yaml` is consulted for the exact paths;
|
|
20
|
+
* a flat `node_modules/<name>` and one level of nesting are tried as a
|
|
21
|
+
* fallback when that file is missing.
|
|
22
|
+
*
|
|
23
|
+
* `stats` tells callers whether anything was readable at all: every declared
|
|
24
|
+
* range comes from these manifests, so a reader that finds nothing silently
|
|
25
|
+
* turns every dependent's range into an exact pin and hides every fix.
|
|
26
|
+
*/
|
|
27
|
+
export declare const createManifestReaderWithStats: (projectDir: string) => {
|
|
28
|
+
readManifest: ManifestReader;
|
|
29
|
+
stats: () => ManifestReaderStats;
|
|
30
|
+
};
|
|
31
|
+
export declare const createManifestReader: (projectDir: string) => ManifestReader;
|
|
32
|
+
//# sourceMappingURL=readInstalledManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readInstalledManifest.d.ts","sourceRoot":"","sources":["../../../src/helpers/readInstalledManifest.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,KACZ,iBAAiB,GAAG,SAAS,CAAC;AAEnC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAkED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,eAC5B,MAAM,KACjB;IAAE,YAAY,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,mBAAmB,CAAA;CA+FlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAgB,MAAM,KAAG,cACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readInstalledManifest.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/readInstalledManifest.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PnpmRunResult {
|
|
2
|
+
status: number | null;
|
|
3
|
+
output: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RunPnpmOptions {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
stdio?: "inherit" | "pipe";
|
|
8
|
+
}
|
|
9
|
+
export type PnpmRunner = (args: string[], options?: RunPnpmOptions) => PnpmRunResult;
|
|
10
|
+
export declare const runPnpm: PnpmRunner;
|
|
11
|
+
//# sourceMappingURL=runPnpm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runPnpm.d.ts","sourceRoot":"","sources":["../../../src/helpers/runPnpm.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG,CACvB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,cAAc,KACrB,aAAa,CAAC;AAEnB,eAAO,MAAM,OAAO,EAAE,UAerB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TempProjects {
|
|
2
|
+
/** A new empty directory, removed by `cleanup`. */
|
|
3
|
+
create: () => string;
|
|
4
|
+
/** Removes every directory created since the last call. */
|
|
5
|
+
cleanup: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const createTempProjects: (prefix: string) => TempProjects;
|
|
8
|
+
//# sourceMappingURL=tempProjects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempProjects.d.ts","sourceRoot":"","sources":["../../../src/helpers/tempProjects.ts"],"names":[],"mappings":"AAoEA,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,WAAY,MAAM,KAAG,YAkBnD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LockstepGraph } from "pm-dedup-core";
|
|
2
|
+
import type { PnpmLockFile } from "../pnpmLockTypes.ts";
|
|
3
|
+
import type { PackagesMap } from "./buildPnpmPackagesMap.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Adapt the pnpm lockfile model into the package-manager-neutral graph consumed
|
|
6
|
+
* by `buildLockstepClusters`. pnpm snapshots store the *resolved* version of
|
|
7
|
+
* each dependency instead of the requested range, which co-version detection
|
|
8
|
+
* handles; one entry is emitted per installation, so a resolution installed in
|
|
9
|
+
* several peer contexts contributes every context it appears in.
|
|
10
|
+
*/
|
|
11
|
+
export declare const toLockstepGraph: (lock: PnpmLockFile, packagesMap: PackagesMap) => LockstepGraph;
|
|
12
|
+
//# sourceMappingURL=toLockstepGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toLockstepGraph.d.ts","sourceRoot":"","sources":["../../../src/helpers/toLockstepGraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAwB7D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SACpB,YAAY,eACL,WAAW,KACvB,aAeA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toLockstepGraph.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/toLockstepGraph.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionsSnapshot.d.ts","sourceRoot":"","sources":["../../../src/helpers/versionsSnapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,eAAO,MAAM,oBAAoB,aAAc,MAAM,KAAG,gBAGrD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ClusterFix } from "pm-dedup-core";
|
|
2
|
+
import type { PackagesMap } from "./helpers/buildPnpmPackagesMap.ts";
|
|
3
|
+
import type { ManifestReader } from "./helpers/readInstalledManifest.ts";
|
|
4
|
+
import type { PnpmLockFile } from "./pnpmLockTypes.ts";
|
|
5
|
+
export type { ClusterExternalConstraint, ClusterFix, ClusterReuseFix, } from "pm-dedup-core";
|
|
6
|
+
export declare const identifyClusterFixes: (lock: PnpmLockFile, packagesMap: PackagesMap, readManifest: ManifestReader) => ClusterFix[];
|
|
7
|
+
//# sourceMappingURL=identifyClusterFixes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifyClusterFixes.d.ts","sourceRoot":"","sources":["../../src/identifyClusterFixes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,YAAY,EACV,yBAAyB,EACzB,UAAU,EACV,eAAe,GAChB,MAAM,eAAe,CAAC;AAmEvB,eAAO,MAAM,oBAAoB,SACzB,YAAY,eACL,WAAW,gBACV,cAAc,KAC3B,UAAU,EAuBZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifyClusterFixes.test.d.ts","sourceRoot":"","sources":["../../src/identifyClusterFixes.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifyResolutionFixes.test.d.ts","sourceRoot":"","sources":["../../src/identifyResolutionFixes.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PackageFilterOptions } from "pm-dedup-core";
|
|
2
|
+
export { dedupe } from "./dedupe.ts";
|
|
3
|
+
export { applyClusterFixes } from "./applyClusterFixes.ts";
|
|
4
|
+
export { identifyClusterFixes } from "./identifyClusterFixes.ts";
|
|
5
|
+
export { toLockstepGraph } from "./helpers/toLockstepGraph.ts";
|
|
6
|
+
export { displayMany } from "./displayMany.ts";
|
|
7
|
+
export { readPnpmLock } from "./readPnpmLock.ts";
|
|
8
|
+
export { parsePnpmLockPackages } from "./helpers/parsePnpmLockPackages.ts";
|
|
9
|
+
export { buildPnpmPackagesMap, filterDuplicatesPnpmPackagesMap, } from "./helpers/buildPnpmPackagesMap.ts";
|
|
10
|
+
export { collectPnpmDependents } from "./helpers/collectPnpmDependents.ts";
|
|
11
|
+
export { collectDependentRanges } from "./helpers/collectDependentRanges.ts";
|
|
12
|
+
export { readVersionsSnapshot } from "./helpers/versionsSnapshot.ts";
|
|
13
|
+
export { createManifestReader, createManifestReaderWithStats, } from "./helpers/readInstalledManifest.ts";
|
|
14
|
+
export interface WhyDuplicateOptions {
|
|
15
|
+
filter?: PackageFilterOptions;
|
|
16
|
+
all?: boolean;
|
|
17
|
+
details?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function whyDuplicate({ filter: filterOptions, all, details, }: WhyDuplicateOptions): void;
|
|
20
|
+
export interface ListDuplicatesOptions {
|
|
21
|
+
filter?: PackageFilterOptions;
|
|
22
|
+
details?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function listDuplicates({ filter: filterOptions, details, }?: ListDuplicatesOptions): void;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAoB1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAA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6
|
+
export interface PnpmImporterDependency {
|
|
7
|
+
specifier: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ProjectSnapshot {
|
|
11
|
+
dependencies?: Record<string, PnpmImporterDependency>;
|
|
12
|
+
devDependencies?: Record<string, PnpmImporterDependency>;
|
|
13
|
+
optionalDependencies?: Record<string, PnpmImporterDependency>;
|
|
14
|
+
}
|
|
15
|
+
export interface PackageMeta {
|
|
16
|
+
resolution?: {
|
|
17
|
+
integrity?: string;
|
|
18
|
+
tarball?: string;
|
|
19
|
+
};
|
|
20
|
+
engines?: Record<string, string>;
|
|
21
|
+
peerDependencies?: Record<string, string>;
|
|
22
|
+
hasBin?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PackageSnapshot {
|
|
25
|
+
dependencies?: Record<string, string>;
|
|
26
|
+
optionalDependencies?: Record<string, string>;
|
|
27
|
+
transitivePeerDependencies?: string[];
|
|
28
|
+
optional?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface PnpmLockSettings {
|
|
31
|
+
autoInstallPeers?: boolean;
|
|
32
|
+
dedupePeers?: boolean;
|
|
33
|
+
excludeLinksFromLockfile?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface PnpmLockFile {
|
|
36
|
+
lockfileVersion: string;
|
|
37
|
+
settings?: PnpmLockSettings;
|
|
38
|
+
importers?: Record<string, ProjectSnapshot>;
|
|
39
|
+
packages?: Record<string, PackageMeta>;
|
|
40
|
+
snapshots?: Record<string, PackageSnapshot>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pnpmLockTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmLockTypes.d.ts","sourceRoot":"","sources":["../../src/pnpmLockTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,M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C;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readPnpmLock.d.ts","sourceRoot":"","sources":["../../src/readPnpmLock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,YAE/C,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { renderDuplicatesReport } from "pm-dedup-core";
|
|
2
|
+
// A cluster of one is the package's own fix: nothing else converges with it, so
|
|
3
|
+
// it is rendered in the package's block instead of the cluster section.
|
|
4
|
+
const isSingleton = (fix) => fix.members.length === 1;
|
|
5
|
+
const toDedupeViews = (packageName, clusterFixes) => clusterFixes
|
|
6
|
+
.filter((fix) => isSingleton(fix) &&
|
|
7
|
+
fix.members[0] === packageName &&
|
|
8
|
+
fix.applicable &&
|
|
9
|
+
fix.target !== null)
|
|
10
|
+
.map((fix) => ({
|
|
11
|
+
// the target is what the copies merge into; the other installed versions
|
|
12
|
+
// are what goes away
|
|
13
|
+
from: (fix.memberVersions[packageName]?.versions ?? []).filter((version) => version !== fix.target),
|
|
14
|
+
to: fix.target,
|
|
15
|
+
direction: fix.direction,
|
|
16
|
+
}))
|
|
17
|
+
.filter((view) => view.from.length > 0);
|
|
18
|
+
const toPackageViews = ({ duplicatesPackagesMap, dependents, clusterFixes = [], }) => Object.entries(duplicatesPackagesMap).map(([packageName, resolutions]) => {
|
|
19
|
+
if (!resolutions) {
|
|
20
|
+
throw new Error(`Unexpected error: no resolutions found for package ${packageName}`);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
packageName,
|
|
24
|
+
resolutions: resolutions.map(({ resolution, package: pnpmPackage, installations }) => ({
|
|
25
|
+
resolution,
|
|
26
|
+
version: pnpmPackage.type === "npm" ? pnpmPackage.version : undefined,
|
|
27
|
+
installations,
|
|
28
|
+
})),
|
|
29
|
+
dependents: (dependents.get(packageName) ?? []).map((dependent) => ({
|
|
30
|
+
// the range alone does not say which declaration it comes from when the
|
|
31
|
+
// requester reaches the package through a key of another name
|
|
32
|
+
requester: dependent.aliasKey === undefined
|
|
33
|
+
? dependent.key
|
|
34
|
+
: `${dependent.key} (as "${dependent.aliasKey}")`,
|
|
35
|
+
range: dependent.range,
|
|
36
|
+
resolvedVersion: dependent.resolvedVersion,
|
|
37
|
+
peer: dependent.peer,
|
|
38
|
+
})),
|
|
39
|
+
dedupe: toDedupeViews(packageName, clusterFixes),
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
export const displayMany = (options) => {
|
|
43
|
+
renderDuplicatesReport({
|
|
44
|
+
title: options.title,
|
|
45
|
+
notice: options.notice,
|
|
46
|
+
packages: toPackageViews(options),
|
|
47
|
+
totalDependencies: options.totalDependencies,
|
|
48
|
+
clusterFixes: (options.clusterFixes ?? []).filter((fix) => !isSingleton(fix)),
|
|
49
|
+
dedupeCommand: "pnpm-dedupe",
|
|
50
|
+
whyCommand: "pnpm-why-duplicate",
|
|
51
|
+
details: options.details,
|
|
52
|
+
color: options.color,
|
|
53
|
+
log: options.log,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=displayMany.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"displayMany.js","sourceRoot":"","sources":["../src/displayMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAyBvD,gFAAgF;AAChF,wEAAwE;AACxE,MAAM,WAAW,GAAG,CAAC,GAAe,EAAW,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;AAE3E,MAAM,aAAa,GAAG,CACpB,WAAmB,EACnB,YAA0B,EACH,EAAE,CACzB,YAAY;KACT,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,CACN,WAAW,CAAC,GAAG,CAAC;IAChB,GAAG,CAAC,OAAO,CAAC,CAAC,CAA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