pm-dedup-core 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.
Files changed (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/dist/buildIdentifiedFixesMap.js +6 -0
  4. package/dist/buildIdentifiedFixesMap.js.map +1 -0
  5. package/dist/buildLockstepClusters.js +119 -0
  6. package/dist/buildLockstepClusters.js.map +1 -0
  7. package/dist/buildLockstepClusters.test.js +71 -0
  8. package/dist/buildLockstepClusters.test.js.map +1 -0
  9. package/dist/clusterLabel.js +59 -0
  10. package/dist/clusterLabel.js.map +1 -0
  11. package/dist/clusterLabel.test.js +56 -0
  12. package/dist/clusterLabel.test.js.map +1 -0
  13. package/dist/compareCandidateVersions.js +18 -0
  14. package/dist/compareCandidateVersions.js.map +1 -0
  15. package/dist/compareCandidateVersions.test.js +32 -0
  16. package/dist/compareCandidateVersions.test.js.map +1 -0
  17. package/dist/createPackageFilter.js +81 -0
  18. package/dist/createPackageFilter.js.map +1 -0
  19. package/dist/createPackageFilter.test.js +115 -0
  20. package/dist/createPackageFilter.test.js.map +1 -0
  21. package/dist/definitions/buildIdentifiedFixesMap.d.ts +4 -0
  22. package/dist/definitions/buildIdentifiedFixesMap.d.ts.map +1 -0
  23. package/dist/definitions/buildLockstepClusters.d.ts +8 -0
  24. package/dist/definitions/buildLockstepClusters.d.ts.map +1 -0
  25. package/dist/definitions/buildLockstepClusters.test.d.ts +2 -0
  26. package/dist/definitions/buildLockstepClusters.test.d.ts.map +1 -0
  27. package/dist/definitions/clusterLabel.d.ts +8 -0
  28. package/dist/definitions/clusterLabel.d.ts.map +1 -0
  29. package/dist/definitions/clusterLabel.test.d.ts +2 -0
  30. package/dist/definitions/clusterLabel.test.d.ts.map +1 -0
  31. package/dist/definitions/compareCandidateVersions.d.ts +10 -0
  32. package/dist/definitions/compareCandidateVersions.d.ts.map +1 -0
  33. package/dist/definitions/compareCandidateVersions.test.d.ts +2 -0
  34. package/dist/definitions/compareCandidateVersions.test.d.ts.map +1 -0
  35. package/dist/definitions/createPackageFilter.d.ts +45 -0
  36. package/dist/definitions/createPackageFilter.d.ts.map +1 -0
  37. package/dist/definitions/createPackageFilter.test.d.ts +2 -0
  38. package/dist/definitions/createPackageFilter.test.d.ts.map +1 -0
  39. package/dist/definitions/duplicateSnapshot.d.ts +8 -0
  40. package/dist/definitions/duplicateSnapshot.d.ts.map +1 -0
  41. package/dist/definitions/fileSnapshot.d.ts +7 -0
  42. package/dist/definitions/fileSnapshot.d.ts.map +1 -0
  43. package/dist/definitions/findProjectRoot.d.ts +27 -0
  44. package/dist/definitions/findProjectRoot.d.ts.map +1 -0
  45. package/dist/definitions/findProjectRoot.test.d.ts +2 -0
  46. package/dist/definitions/findProjectRoot.test.d.ts.map +1 -0
  47. package/dist/definitions/identifyLockstepClusterFixes.d.ts +89 -0
  48. package/dist/definitions/identifyLockstepClusterFixes.d.ts.map +1 -0
  49. package/dist/definitions/identifyLockstepClusterFixes.test.d.ts +2 -0
  50. package/dist/definitions/identifyLockstepClusterFixes.test.d.ts.map +1 -0
  51. package/dist/definitions/identifyResolutionFixes.d.ts +28 -0
  52. package/dist/definitions/identifyResolutionFixes.d.ts.map +1 -0
  53. package/dist/definitions/identifyResolutionFixes.test.d.ts +2 -0
  54. package/dist/definitions/identifyResolutionFixes.test.d.ts.map +1 -0
  55. package/dist/definitions/index.d.ts +44 -0
  56. package/dist/definitions/index.d.ts.map +1 -0
  57. package/dist/definitions/packageDependenciesUtils.d.ts +47 -0
  58. package/dist/definitions/packageDependenciesUtils.d.ts.map +1 -0
  59. package/dist/definitions/packageDependenciesUtils.test.d.ts +2 -0
  60. package/dist/definitions/packageDependenciesUtils.test.d.ts.map +1 -0
  61. package/dist/definitions/packageFilterArgs.d.ts +74 -0
  62. package/dist/definitions/packageFilterArgs.d.ts.map +1 -0
  63. package/dist/definitions/packageFilterArgs.test.d.ts +2 -0
  64. package/dist/definitions/packageFilterArgs.test.d.ts.map +1 -0
  65. package/dist/definitions/packageStyles.d.ts +14 -0
  66. package/dist/definitions/packageStyles.d.ts.map +1 -0
  67. package/dist/definitions/packageStyles.test.d.ts +2 -0
  68. package/dist/definitions/packageStyles.test.d.ts.map +1 -0
  69. package/dist/definitions/parseBinArgs.d.ts +14 -0
  70. package/dist/definitions/parseBinArgs.d.ts.map +1 -0
  71. package/dist/definitions/parseBinArgs.test.d.ts +2 -0
  72. package/dist/definitions/parseBinArgs.test.d.ts.map +1 -0
  73. package/dist/definitions/planClusterApply.d.ts +39 -0
  74. package/dist/definitions/planClusterApply.d.ts.map +1 -0
  75. package/dist/definitions/planClusterApply.test.d.ts +2 -0
  76. package/dist/definitions/planClusterApply.test.d.ts.map +1 -0
  77. package/dist/definitions/renderApplyPlan.d.ts +22 -0
  78. package/dist/definitions/renderApplyPlan.d.ts.map +1 -0
  79. package/dist/definitions/renderApplyPlan.test.d.ts +2 -0
  80. package/dist/definitions/renderApplyPlan.test.d.ts.map +1 -0
  81. package/dist/definitions/renderDedupeSummary.d.ts +22 -0
  82. package/dist/definitions/renderDedupeSummary.d.ts.map +1 -0
  83. package/dist/definitions/renderDedupeSummary.test.d.ts +2 -0
  84. package/dist/definitions/renderDedupeSummary.test.d.ts.map +1 -0
  85. package/dist/definitions/renderDuplicatesReport.d.ts +39 -0
  86. package/dist/definitions/renderDuplicatesReport.d.ts.map +1 -0
  87. package/dist/definitions/renderDuplicatesReport.test.d.ts +2 -0
  88. package/dist/definitions/renderDuplicatesReport.test.d.ts.map +1 -0
  89. package/dist/definitions/reportColors.d.ts +25 -0
  90. package/dist/definitions/reportColors.d.ts.map +1 -0
  91. package/dist/definitions/reportColors.test.d.ts +2 -0
  92. package/dist/definitions/reportColors.test.d.ts.map +1 -0
  93. package/dist/definitions/reportText.d.ts +29 -0
  94. package/dist/definitions/reportText.d.ts.map +1 -0
  95. package/dist/definitions/selectExplainedPackages.d.ts +22 -0
  96. package/dist/definitions/selectExplainedPackages.d.ts.map +1 -0
  97. package/dist/definitions/selectExplainedPackages.test.d.ts +2 -0
  98. package/dist/definitions/selectExplainedPackages.test.d.ts.map +1 -0
  99. package/dist/definitions/unconditionalOverrides.d.ts +24 -0
  100. package/dist/definitions/unconditionalOverrides.d.ts.map +1 -0
  101. package/dist/definitions/unconditionalOverrides.test.d.ts +2 -0
  102. package/dist/definitions/unconditionalOverrides.test.d.ts.map +1 -0
  103. package/dist/definitions/versionsSnapshot.d.ts +40 -0
  104. package/dist/definitions/versionsSnapshot.d.ts.map +1 -0
  105. package/dist/definitions/versionsSnapshot.test.d.ts +2 -0
  106. package/dist/definitions/versionsSnapshot.test.d.ts.map +1 -0
  107. package/dist/definitions/workspaceManifest.d.ts +21 -0
  108. package/dist/definitions/workspaceManifest.d.ts.map +1 -0
  109. package/dist/definitions/workspaceManifest.test.d.ts +2 -0
  110. package/dist/definitions/workspaceManifest.test.d.ts.map +1 -0
  111. package/dist/duplicateSnapshot.js +10 -0
  112. package/dist/duplicateSnapshot.js.map +1 -0
  113. package/dist/fileSnapshot.js +21 -0
  114. package/dist/fileSnapshot.js.map +1 -0
  115. package/dist/findProjectRoot.js +48 -0
  116. package/dist/findProjectRoot.js.map +1 -0
  117. package/dist/findProjectRoot.test.js +53 -0
  118. package/dist/findProjectRoot.test.js.map +1 -0
  119. package/dist/identifyLockstepClusterFixes.js +352 -0
  120. package/dist/identifyLockstepClusterFixes.js.map +1 -0
  121. package/dist/identifyLockstepClusterFixes.test.js +372 -0
  122. package/dist/identifyLockstepClusterFixes.test.js.map +1 -0
  123. package/dist/identifyResolutionFixes.js +102 -0
  124. package/dist/identifyResolutionFixes.js.map +1 -0
  125. package/dist/identifyResolutionFixes.test.js +70 -0
  126. package/dist/identifyResolutionFixes.test.js.map +1 -0
  127. package/dist/index.js +24 -0
  128. package/dist/index.js.map +1 -0
  129. package/dist/packageDependenciesUtils.js +91 -0
  130. package/dist/packageDependenciesUtils.js.map +1 -0
  131. package/dist/packageDependenciesUtils.test.js +539 -0
  132. package/dist/packageDependenciesUtils.test.js.map +1 -0
  133. package/dist/packageFilterArgs.js +65 -0
  134. package/dist/packageFilterArgs.js.map +1 -0
  135. package/dist/packageFilterArgs.test.js +93 -0
  136. package/dist/packageFilterArgs.test.js.map +1 -0
  137. package/dist/packageStyles.js +33 -0
  138. package/dist/packageStyles.js.map +1 -0
  139. package/dist/packageStyles.test.js +58 -0
  140. package/dist/packageStyles.test.js.map +1 -0
  141. package/dist/parseBinArgs.js +28 -0
  142. package/dist/parseBinArgs.js.map +1 -0
  143. package/dist/parseBinArgs.test.js +62 -0
  144. package/dist/parseBinArgs.test.js.map +1 -0
  145. package/dist/planClusterApply.js +69 -0
  146. package/dist/planClusterApply.js.map +1 -0
  147. package/dist/planClusterApply.test.js +152 -0
  148. package/dist/planClusterApply.test.js.map +1 -0
  149. package/dist/renderApplyPlan.js +51 -0
  150. package/dist/renderApplyPlan.js.map +1 -0
  151. package/dist/renderApplyPlan.test.js +106 -0
  152. package/dist/renderApplyPlan.test.js.map +1 -0
  153. package/dist/renderDedupeSummary.js +38 -0
  154. package/dist/renderDedupeSummary.js.map +1 -0
  155. package/dist/renderDedupeSummary.test.js +91 -0
  156. package/dist/renderDedupeSummary.test.js.map +1 -0
  157. package/dist/renderDuplicatesReport.js +375 -0
  158. package/dist/renderDuplicatesReport.js.map +1 -0
  159. package/dist/renderDuplicatesReport.test.js +598 -0
  160. package/dist/renderDuplicatesReport.test.js.map +1 -0
  161. package/dist/reportColors.js +51 -0
  162. package/dist/reportColors.js.map +1 -0
  163. package/dist/reportColors.test.js +49 -0
  164. package/dist/reportColors.test.js.map +1 -0
  165. package/dist/reportText.js +29 -0
  166. package/dist/reportText.js.map +1 -0
  167. package/dist/selectExplainedPackages.js +42 -0
  168. package/dist/selectExplainedPackages.js.map +1 -0
  169. package/dist/selectExplainedPackages.test.js +55 -0
  170. package/dist/selectExplainedPackages.test.js.map +1 -0
  171. package/dist/unconditionalOverrides.js +36 -0
  172. package/dist/unconditionalOverrides.js.map +1 -0
  173. package/dist/unconditionalOverrides.test.js +71 -0
  174. package/dist/unconditionalOverrides.test.js.map +1 -0
  175. package/dist/versionsSnapshot.js +49 -0
  176. package/dist/versionsSnapshot.js.map +1 -0
  177. package/dist/versionsSnapshot.test.js +79 -0
  178. package/dist/versionsSnapshot.test.js.map +1 -0
  179. package/dist/workspaceManifest.js +63 -0
  180. package/dist/workspaceManifest.js.map +1 -0
  181. package/dist/workspaceManifest.test.js +159 -0
  182. package/dist/workspaceManifest.test.js.map +1 -0
  183. package/package.json +68 -0
  184. package/src/buildIdentifiedFixesMap.ts +22 -0
  185. package/src/buildLockstepClusters.test.ts +90 -0
  186. package/src/buildLockstepClusters.ts +155 -0
  187. package/src/clusterLabel.test.ts +79 -0
  188. package/src/clusterLabel.ts +75 -0
  189. package/src/compareCandidateVersions.test.ts +39 -0
  190. package/src/compareCandidateVersions.ts +23 -0
  191. package/src/createPackageFilter.test.ts +156 -0
  192. package/src/createPackageFilter.ts +142 -0
  193. package/src/duplicateSnapshot.ts +24 -0
  194. package/src/fileSnapshot.ts +28 -0
  195. package/src/findProjectRoot.test.ts +66 -0
  196. package/src/findProjectRoot.ts +61 -0
  197. package/src/identifyLockstepClusterFixes.test.ts +462 -0
  198. package/src/identifyLockstepClusterFixes.ts +602 -0
  199. package/src/identifyResolutionFixes.test.ts +133 -0
  200. package/src/identifyResolutionFixes.ts +183 -0
  201. package/src/index.ts +123 -0
  202. package/src/packageDependenciesUtils.test.ts +593 -0
  203. package/src/packageDependenciesUtils.ts +156 -0
  204. package/src/packageFilterArgs.test.ts +116 -0
  205. package/src/packageFilterArgs.ts +98 -0
  206. package/src/packageStyles.test.ts +77 -0
  207. package/src/packageStyles.ts +42 -0
  208. package/src/parseBinArgs.test.ts +73 -0
  209. package/src/parseBinArgs.ts +33 -0
  210. package/src/planClusterApply.test.ts +163 -0
  211. package/src/planClusterApply.ts +105 -0
  212. package/src/renderApplyPlan.test.ts +136 -0
  213. package/src/renderApplyPlan.ts +95 -0
  214. package/src/renderDedupeSummary.test.ts +121 -0
  215. package/src/renderDedupeSummary.ts +78 -0
  216. package/src/renderDuplicatesReport.test.ts +724 -0
  217. package/src/renderDuplicatesReport.ts +645 -0
  218. package/src/reportColors.test.ts +57 -0
  219. package/src/reportColors.ts +78 -0
  220. package/src/reportText.ts +58 -0
  221. package/src/selectExplainedPackages.test.ts +67 -0
  222. package/src/selectExplainedPackages.ts +79 -0
  223. package/src/unconditionalOverrides.test.ts +99 -0
  224. package/src/unconditionalOverrides.ts +60 -0
  225. package/src/versionsSnapshot.test.ts +146 -0
  226. package/src/versionsSnapshot.ts +93 -0
  227. package/src/workspaceManifest.test.ts +220 -0
  228. package/src/workspaceManifest.ts +100 -0
@@ -0,0 +1,74 @@
1
+ import type { PackageFilterOptions } from "./createPackageFilter.ts";
2
+ export declare const packageFilterParseArgsOptions: {
3
+ readonly packages: {
4
+ readonly type: "string";
5
+ readonly multiple: true;
6
+ };
7
+ readonly scopes: {
8
+ readonly type: "string";
9
+ readonly multiple: true;
10
+ };
11
+ readonly exclude: {
12
+ readonly type: "string";
13
+ readonly multiple: true;
14
+ };
15
+ readonly "exclude-scopes": {
16
+ readonly type: "string";
17
+ readonly multiple: true;
18
+ };
19
+ };
20
+ export declare const packageFilterUsage = " --packages <names> only these packages, as names or globs\n --scopes <scopes> only these scopes\n --exclude <names> never these packages\n --exclude-scopes <scopes> never these scopes\n\nEvery filter flag takes a comma list, or is repeated.";
21
+ export interface PackageFilterArgValues {
22
+ packages?: string[];
23
+ scopes?: string[];
24
+ exclude?: string[];
25
+ "exclude-scopes"?: string[];
26
+ }
27
+ export declare const toPackageFilterOptions: (values: PackageFilterArgValues) => PackageFilterOptions;
28
+ export declare const whyDuplicateParseArgsOptions: {
29
+ readonly packages: {
30
+ readonly type: "string";
31
+ readonly multiple: true;
32
+ };
33
+ readonly scopes: {
34
+ readonly type: "string";
35
+ readonly multiple: true;
36
+ };
37
+ readonly exclude: {
38
+ readonly type: "string";
39
+ readonly multiple: true;
40
+ };
41
+ readonly "exclude-scopes": {
42
+ readonly type: "string";
43
+ readonly multiple: true;
44
+ };
45
+ readonly all: {
46
+ readonly type: "boolean";
47
+ readonly short: "a";
48
+ };
49
+ readonly details: {
50
+ readonly type: "boolean";
51
+ readonly short: "d";
52
+ };
53
+ };
54
+ export declare const whyDuplicateUsage = " -a, --all keep packages that are not duplicated\n -d, --details every dependent of every version, not one line each\n\n --packages <names> only these packages, as names or globs\n --scopes <scopes> only these scopes\n --exclude <names> never these packages\n --exclude-scopes <scopes> never these scopes\n\nEvery filter flag takes a comma list, or is repeated.";
55
+ export interface WhyDuplicateArgValues extends PackageFilterArgValues {
56
+ all?: boolean;
57
+ details?: boolean;
58
+ }
59
+ export interface WhyDuplicateRequest {
60
+ filter: PackageFilterOptions;
61
+ explains: boolean;
62
+ all: boolean;
63
+ details: boolean;
64
+ }
65
+ /**
66
+ * The positional a `why-duplicate` bin takes is the short form of `--packages`.
67
+ * Naming something to explain is what separates the two reports: without it
68
+ * there is nothing to be `--all` about, and the whole lockfile is listed.
69
+ *
70
+ * Naming one is also asking why it is duplicated, which the one-line form does
71
+ * not answer — so an explained selection is detailed unless it is a listing.
72
+ */
73
+ export declare const toWhyDuplicateRequest: (values: WhyDuplicateArgValues, positionals: string[]) => WhyDuplicateRequest;
74
+ //# sourceMappingURL=packageFilterArgs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageFilterArgs.d.ts","sourceRoot":"","sources":["../../src/packageFilterArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIrE,eAAO,MAAM,6BAA6B;aACxC,QAAQ;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;aACpC,MAAM;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;aAClC,OAAO;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;aACnC,gBAAgB;iBAAI,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;CACpC,CAAC;AAGX,eAAO,MAAM,kBAAkB,6RAKuB,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAaD,eAAO,MAAM,sBAAsB,WACzB,sBAAsB,KAC7B,oBAKD,CAAC;AAGH,eAAO,MAAM,4BAA4B;;iBA1C3B,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;;iBAC1B,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;;iBACvB,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;;iBACf,IAAI,EAAE,QAAQ;iBAAE,QAAQ;;;iBAwCrC,IAAI,EAAE,SAAS;iBAAE,KAAK,EAAE,GAAG;;;iBACvB,IAAI,EAAE,SAAS;iBAAE,KAAK,EAAE,GAAG;;CAE9B,CAAC;AAEX,eAAO,MAAM,iBAAiB,ybAGR,CAAC;AAEvB,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;IACnE,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,oBAAoB,CAAC;IAE7B,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IAEb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WACxB,qBAAqB,eAChB,MAAM,EAAE,KACpB,mBAcF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=packageFilterArgs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageFilterArgs.test.d.ts","sourceRoot":"","sources":["../../src/packageFilterArgs.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { Colorize, ReportStyle } from "./reportColors.ts";
2
+ /**
3
+ * A package name in two tones: the scope one shade deeper than the name it
4
+ * prefixes, so the half that identifies stays the readable one without the
5
+ * other fading out.
6
+ */
7
+ export declare const stylePackageName: (color: Colorize, name: string, styles?: ReportStyle[]) => string;
8
+ /**
9
+ * A `name@version` reference. Anything without a version is returned untouched:
10
+ * the reports also list requesters that are not packages at all, such as
11
+ * `package.json in devDependencies`.
12
+ */
13
+ export declare const stylePackageReference: (color: Colorize, reference: string) => string;
14
+ //# sourceMappingURL=packageStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageStyles.d.ts","sourceRoot":"","sources":["../../src/packageStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UACpB,QAAQ,QACT,MAAM,WACJ,WAAW,EAAE,KACpB,MAQF,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UACzB,QAAQ,aACJ,MAAM,KAChB,MAIF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=packageStyles.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageStyles.test.d.ts","sourceRoot":"","sources":["../../src/packageStyles.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import { parseArgs } from "node:util";
2
+ type ParseArgsConfig = NonNullable<Parameters<typeof parseArgs>[0]>;
3
+ /**
4
+ * `parseArgs` with the two things a bin still has to do itself: answer
5
+ * `--help`, and turn an unknown flag into a readable line instead of a stack
6
+ * trace. Rejecting the unknown flag matters more than it reads: a mistyped
7
+ * `--dry-run` silently ignored is a run that applies its changes.
8
+ *
9
+ * Returns null when the bin has nothing left to do — the usage was asked for,
10
+ * or the arguments were rejected and the exit code already says so.
11
+ */
12
+ export declare const parseBinArgs: <T extends ParseArgsConfig>(usage: string, config: T) => ReturnType<typeof parseArgs<T>> | null;
13
+ export {};
14
+ //# sourceMappingURL=parseBinArgs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBinArgs.d.ts","sourceRoot":"","sources":["../../src/parseBinArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,KAAK,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,eAAe,SAC7C,MAAM,UACL,CAAC,KACR,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,IAgBpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parseBinArgs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBinArgs.test.d.ts","sourceRoot":"","sources":["../../src/parseBinArgs.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import type { ClusterFix } from "./identifyLockstepClusterFixes.ts";
2
+ import type { WorkspaceRangeEdit } from "./workspaceManifest.ts";
3
+ export interface PlannedManifestEdit extends WorkspaceRangeEdit {
4
+ importerPath: string;
5
+ }
6
+ export interface PlannedOverride {
7
+ packageName: string;
8
+ version: string;
9
+ reason: "converge" | "reuse";
10
+ }
11
+ export interface ClusterApplyPlan {
12
+ manifestEdits: PlannedManifestEdit[];
13
+ overrides: PlannedOverride[];
14
+ conflicts: {
15
+ packageName: string;
16
+ kept: string;
17
+ dropped: string;
18
+ }[];
19
+ unresolvableChanges: string[];
20
+ }
21
+ /**
22
+ * Turn the detector's records into the two edits every package manager
23
+ * understands:
24
+ *
25
+ * - a `workspaceChanges` entry is a range the user declares, so it is edited in
26
+ * place in the importer's `package.json`;
27
+ * - everything else is a transitive edge, which only an override can repoint.
28
+ *
29
+ * The overrides are per package name and carry no scoping: a package manager
30
+ * whose overrides apply unconditionally (bun) has to drop the ones a third-party
31
+ * range would reject, where one with conditional overrides (pnpm's convergence
32
+ * overrides) can write them all and let the resolver spare the members
33
+ * `excludedMembers` lists.
34
+ *
35
+ * `reuseFixes` come first: they converge on `anchor`, the version the user
36
+ * pinned, and a pin outranks a version the detector merely computed.
37
+ */
38
+ export declare const planClusterApply: (fixes: ClusterFix[]) => ClusterApplyPlan;
39
+ //# sourceMappingURL=planClusterApply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planClusterApply.d.ts","sourceRoot":"","sources":["../../src/planClusterApply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,SAAS,EAAE,eAAe,EAAE,CAAC;IAG7B,SAAS,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAEpE,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,UAAW,UAAU,EAAE,KAAG,gBA+DtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=planClusterApply.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planClusterApply.test.d.ts","sourceRoot":"","sources":["../../src/planClusterApply.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ export interface ApplyPlanFileChange {
2
+ path: string;
3
+ transient?: string;
4
+ changes: string[];
5
+ }
6
+ export interface ApplyPlanOptions {
7
+ fileChanges: ApplyPlanFileChange[];
8
+ skipped?: string[];
9
+ packageManagerResiduals?: string;
10
+ dedupeCommand: string;
11
+ color?: boolean;
12
+ log?: (message?: string) => void;
13
+ }
14
+ export interface ApplyPlanSummary {
15
+ changeCount: number;
16
+ }
17
+ /**
18
+ * The plan a dedupe run would apply, shared by `--check` and `--dry-run`. The
19
+ * returned `changeCount` is what `--check` gates its exit code on.
20
+ */
21
+ export declare const renderApplyPlan: ({ fileChanges, skipped, packageManagerResiduals, dedupeCommand, color: colorEnabled, log, }: ApplyPlanOptions) => ApplyPlanSummary;
22
+ //# sourceMappingURL=renderApplyPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderApplyPlan.d.ts","sourceRoot":"","sources":["../../src/renderApplyPlan.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAElC,IAAI,EAAE,MAAM,CAAC;IAEb,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAEnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,gGAOzB,gBAAgB,KAAG,gBAuDrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=renderApplyPlan.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderApplyPlan.test.d.ts","sourceRoot":"","sources":["../../src/renderApplyPlan.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import type { DedupedPackage } from "./versionsSnapshot.ts";
2
+ export interface DedupeSummaryOptions {
3
+ deduped: DedupedPackage[];
4
+ remainingDuplicates: number;
5
+ whyCommand: string;
6
+ color?: boolean;
7
+ log?: (message?: string) => void;
8
+ }
9
+ /**
10
+ * What a dedupe run actually collapsed, one line per package. Shared by every
11
+ * tool so the three of them report a run the same way; the caller still says
12
+ * what it wrote, which only it knows.
13
+ *
14
+ * Both sides are counted and named: `2 versions (1.2.1, 1.3.0) -> 1 version
15
+ * (1.2.1)` is the copy that went away, where a bare `1.3.0 -> 1.2.1` reads as a
16
+ * downgrade the tool decided on its own.
17
+ *
18
+ * Nothing is printed when nothing was deduped: the caller has its own wording
19
+ * for that, and an empty table reads as a failure it may not be.
20
+ */
21
+ export declare const renderDedupeSummary: ({ deduped, remainingDuplicates, whyCommand, color: colorEnabled, log, }: DedupeSummaryOptions) => void;
22
+ //# sourceMappingURL=renderDedupeSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDedupeSummary.d.ts","sourceRoot":"","sources":["../../src/renderDedupeSummary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAG1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAeD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,4EAM7B,oBAAoB,KAAG,IA8BzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=renderDedupeSummary.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDedupeSummary.test.d.ts","sourceRoot":"","sources":["../../src/renderDedupeSummary.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import type { ClusterFix } from "./identifyLockstepClusterFixes.ts";
2
+ export interface DuplicateResolutionView {
3
+ resolution: string;
4
+ version?: string;
5
+ installations: string[];
6
+ }
7
+ export interface DuplicateDependentView {
8
+ requester: string;
9
+ range: string;
10
+ resolvedVersion?: string;
11
+ resolvedResolution?: string;
12
+ peer?: boolean;
13
+ }
14
+ export interface DuplicateDedupeView {
15
+ from: string[];
16
+ to: string;
17
+ direction?: ClusterFix["direction"];
18
+ }
19
+ export interface DuplicatePackageView {
20
+ packageName: string;
21
+ resolutions: DuplicateResolutionView[];
22
+ dependents: DuplicateDependentView[];
23
+ dedupe: DuplicateDedupeView[];
24
+ }
25
+ export type DuplicatesReportTitle = "duplicates" | "matches";
26
+ export interface DuplicatesReportOptions {
27
+ title: DuplicatesReportTitle;
28
+ packages: DuplicatePackageView[];
29
+ notice?: string;
30
+ totalDependencies: number;
31
+ clusterFixes?: ClusterFix[];
32
+ dedupeCommand: string;
33
+ whyCommand?: string;
34
+ details?: boolean;
35
+ color?: boolean;
36
+ log?: (message?: string) => void;
37
+ }
38
+ export declare const renderDuplicatesReport: ({ title, packages, notice, totalDependencies, clusterFixes, dedupeCommand, whyCommand, details, color: colorEnabled, log, }: DuplicatesReportOptions) => void;
39
+ //# sourceMappingURL=renderDuplicatesReport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDuplicatesReport.d.ts","sourceRoot":"","sources":["../../src/renderDuplicatesReport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,mCAAmC,CAAC;AAM3C,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IAInB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IAKd,eAAe,CAAC,EAAE,MAAM,CAAC;IAIzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,uBAAuB,EAAE,CAAC;IACvC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAID,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IAGjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AA8dD,eAAO,MAAM,sBAAsB,gIAWhC,uBAAuB,KAAG,IA+E5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=renderDuplicatesReport.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderDuplicatesReport.test.d.ts","sourceRoot":"","sources":["../../src/renderDuplicatesReport.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ declare const palette: {
2
+ readonly scope: {
3
+ readonly hex: "#d75f00";
4
+ readonly ansi256: 166;
5
+ };
6
+ readonly packageName: {
7
+ readonly hex: "#d7875f";
8
+ readonly ansi256: 173;
9
+ };
10
+ };
11
+ export type PaletteStyle = keyof typeof palette;
12
+ export type ReportStyle = PaletteStyle | "bold" | "cyan" | "dim" | "green" | "red" | "yellow";
13
+ export type Colorize = (styles: ReportStyle | ReportStyle[], text: string) => string;
14
+ /**
15
+ * `styleText`'s own stream detection always looks at `process.stdout`, and bun
16
+ * has emitted escape codes regardless of it in the past. The bins run under
17
+ * both runtimes and also report on stderr, so the decision is taken here and
18
+ * `styleText` is called with `validateStream: false`.
19
+ */
20
+ export declare const shouldColorize: (stream?: {
21
+ isTTY?: boolean;
22
+ }) => boolean;
23
+ export declare const createColorize: (enabled: boolean) => Colorize;
24
+ export {};
25
+ //# sourceMappingURL=reportColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportColors.d.ts","sourceRoot":"","sources":["../../src/reportColors.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO;aACX,KAAK;iBAAI,GAAG,EAAE,SAAS;iBAAE,OAAO,EAAE,GAAG;;aACrC,WAAW;iBAAI,GAAG,EAAE,SAAS;iBAAE,OAAO,EAAE,GAAG;;CACnC,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,OAAO,CAAC;AAEhD,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,KAAK,GACL,QAAQ,CAAC;AAEb,MAAM,MAAM,QAAQ,GAAG,CACrB,MAAM,EAAE,WAAW,GAAG,WAAW,EAAE,EACnC,IAAI,EAAE,MAAM,KACT,MAAM,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YACjB;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,KAC1B,OAQF,CAAC;AAkCF,eAAO,MAAM,cAAc,YAAa,OAAO,KAAG,QACxB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reportColors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportColors.test.d.ts","sourceRoot":"","sources":["../../src/reportColors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The wording every report shares. Kept in one place so `why-duplicate` and the
3
+ * summary of a dedupe run cannot drift on how they count versions: both mean
4
+ * "this many remain", never "this many were merged".
5
+ */
6
+ export declare const plural: (count: number, singular: string, pluralForm: string) => string;
7
+ /**
8
+ * How wide a left column may get before it starts pushing what follows off the
9
+ * right of the screen. A value longer than the budget keeps its own line width
10
+ * — the column is sized on the longest one that fits, so the outlier overflows
11
+ * alone instead of clamping the column below what every other row needs.
12
+ */
13
+ export declare const maxColumnWidth = 44;
14
+ export declare const maxItemsListed = 5;
15
+ export declare const columnWidth: (values: string[], budget?: number) => number;
16
+ export declare const padTo: (width: number, value: string) => string;
17
+ interface ListTextOptions {
18
+ items: string[];
19
+ render?: (item: string) => string;
20
+ limit?: number;
21
+ more: (rest: number) => string;
22
+ }
23
+ /**
24
+ * `a, b, c, +2 more` — the tail counted rather than dropped, so a truncated
25
+ * list never reads as a complete one.
26
+ */
27
+ export declare const listText: ({ items, render, limit, more, }: ListTextOptions) => string;
28
+ export {};
29
+ //# sourceMappingURL=reportText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportText.d.ts","sourceRoot":"","sources":["../../src/reportText.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,MAAM,UACV,MAAM,YACH,MAAM,cACJ,MAAM,KACjB,MAA2D,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAGjC,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,WAAW,WACd,MAAM,EAAE,WACR,MAAM,KACb,MAIA,CAAC;AAGJ,eAAO,MAAM,KAAK,UAAW,MAAM,SAAS,MAAM,KAAG,MACN,CAAC;AAEhD,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,oCAKlB,eAAe,KAAG,MAKpB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { PackageFilter } from "./createPackageFilter.ts";
2
+ import type { DuplicatesReportTitle } from "./renderDuplicatesReport.ts";
3
+ export interface SelectExplainedPackagesOptions<Resolutions extends readonly unknown[]> {
4
+ packagesMap: Record<string, Resolutions>;
5
+ filter: PackageFilter;
6
+ all: boolean;
7
+ }
8
+ export interface ExplainedPackagesSelection<Resolutions extends readonly unknown[]> {
9
+ packages: Record<string, Resolutions>;
10
+ title: DuplicatesReportTitle;
11
+ notice: string | undefined;
12
+ }
13
+ /**
14
+ * The packages a `why-duplicate` run reports on. Naming a package is asking why
15
+ * it is duplicated, and the honest answer to "it is not" is its dependents, not
16
+ * an empty report: a selection holding no duplicate is kept whole, and the
17
+ * notice says why it is being shown.
18
+ *
19
+ * `--all` asks for that unconditionally, so it never needs the fallback.
20
+ */
21
+ export declare const selectExplainedPackages: <Resolutions extends readonly unknown[]>({ packagesMap, filter, all, }: SelectExplainedPackagesOptions<Resolutions>) => ExplainedPackagesSelection<Resolutions>;
22
+ //# sourceMappingURL=selectExplainedPackages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectExplainedPackages.d.ts","sourceRoot":"","sources":["../../src/selectExplainedPackages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,MAAM,WAAW,8BAA8B,CAC7C,WAAW,SAAS,SAAS,OAAO,EAAE;IAGtC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACzC,MAAM,EAAE,aAAa,CAAC;IAEtB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,0BAA0B,CACzC,WAAW,SAAS,SAAS,OAAO,EAAE;IAEtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAG7B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAYD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,SAAS,SAAS,OAAO,EAAE,iCAKrC,8BAA8B,CAAC,WAAW,CAAC,KAAG,0BAA0B,CAAC,WAAW,CA8BtF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=selectExplainedPackages.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectExplainedPackages.test.d.ts","sourceRoot":"","sources":["../../src/selectExplainedPackages.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import type { ClusterExternalConstraint, ClusterFix } from "./identifyLockstepClusterFixes.ts";
2
+ import type { PlannedOverride } from "./planClusterApply.ts";
3
+ export interface RejectedOverride {
4
+ override: PlannedOverride;
5
+ rejectedBy: ClusterExternalConstraint[];
6
+ }
7
+ export interface PartitionedOverrides {
8
+ safe: PlannedOverride[];
9
+ rejected: RejectedOverride[];
10
+ }
11
+ /**
12
+ * Split the planned overrides for a package manager whose overrides apply to
13
+ * every requester of the package, whatever range it declares (bun's
14
+ * `overrides`, pnpm's plain ones). Such an override cannot spare the dependents
15
+ * a conditional one would — pnpm's convergence overrides only repoint the edges
16
+ * that accept the version — so one a third-party range rejects would force that
17
+ * dependent onto a version it never allowed.
18
+ *
19
+ * The `converge` overrides are safe by construction: the detector only converges
20
+ * a member no third-party range holds elsewhere. A `reuse` override is derived
21
+ * from a single requester's range, and another requester can still reject it.
22
+ */
23
+ export declare const partitionUnconditionalOverrides: (fixes: ClusterFix[], overrides: PlannedOverride[]) => PartitionedOverrides;
24
+ //# sourceMappingURL=unconditionalOverrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unconditionalOverrides.d.ts","sourceRoot":"","sources":["../../src/unconditionalOverrides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,UAAU,EACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,yBAAyB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AASD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,+BAA+B,UACnC,UAAU,EAAE,aACR,eAAe,EAAE,KAC3B,oBAoBF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=unconditionalOverrides.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unconditionalOverrides.test.d.ts","sourceRoot":"","sources":["../../src/unconditionalOverrides.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Every version a package resolves to in a lockfile, by package name.
3
+ *
4
+ * The duplicate snapshot only carries the resolutions of packages that have
5
+ * several, so it cannot name the version a merge landed on: once a package is
6
+ * deduplicated it leaves the snapshot altogether. Saying what a run deduped
7
+ * needs the whole picture, before and after.
8
+ */
9
+ export type VersionsSnapshot = Map<string, string[]>;
10
+ /**
11
+ * The shape every package manager's parsed package already has. `version` is
12
+ * only there for npm resolutions — a `git:` or `file:` copy is identified by its
13
+ * resolution instead, which is unique per install just the same.
14
+ */
15
+ export interface SnapshotPackage {
16
+ type: string;
17
+ name: string;
18
+ resolution: string;
19
+ version?: string;
20
+ }
21
+ export declare const buildVersionsSnapshot: (packages: Iterable<SnapshotPackage>) => VersionsSnapshot;
22
+ export interface DedupedPackage {
23
+ packageName: string;
24
+ before: string[];
25
+ after: string[];
26
+ }
27
+ /**
28
+ * What the two snapshots say a run collapsed, one entry per package: both sides
29
+ * whole, so a family converging on an older release reads as the two copies
30
+ * becoming one rather than as a downgrade.
31
+ *
32
+ * Only a package resolved fewer times than before is reported. A version that
33
+ * moved without a copy going away is a re-resolution, not a dedupe — the pass
34
+ * that made the edit already said so — and a package that left the lockfile
35
+ * entirely is neither: the in-memory rewrite drops the private subtrees of the
36
+ * versions it replaced, entries the next install resolves again.
37
+ */
38
+ export declare const diffVersionsSnapshots: (before: VersionsSnapshot, after: VersionsSnapshot) => DedupedPackage[];
39
+ export declare const countDuplicatedPackages: (snapshot: VersionsSnapshot) => number;
40
+ //# sourceMappingURL=versionsSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versionsSnapshot.d.ts","sourceRoot":"","sources":["../../src/versionsSnapshot.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,eAAO,MAAM,qBAAqB,aACtB,QAAQ,CAAC,eAAe,CAAC,KAClC,gBAgBF,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,WACxB,gBAAgB,SACjB,gBAAgB,KACtB,cAAc,EAYhB,CAAC;AAGF,eAAO,MAAM,uBAAuB,aAAc,gBAAgB,KAAG,MACI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=versionsSnapshot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versionsSnapshot.test.d.ts","sourceRoot":"","sources":["../../src/versionsSnapshot.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ export interface WorkspaceRangeEdit {
2
+ packageName: string;
3
+ depType: string;
4
+ range: string;
5
+ to: string;
6
+ }
7
+ /**
8
+ * Keep the user's range style when it still expresses the same intent: a caret
9
+ * or tilde range moved to the target line stays a caret or tilde range. Any
10
+ * other shape (`*`, `0.83 - 0.86`, `>=1`) has no target-line equivalent, so the
11
+ * exact version is the only faithful rewrite.
12
+ */
13
+ export declare const nextSelector: (range: string, to: string) => string;
14
+ /**
15
+ * Rewrite one declared range in a workspace `package.json`, as a targeted edit
16
+ * on the raw text: reserializing would reformat a file the tool does not own.
17
+ * Returns `undefined` when the declaration is not there any more, which is the
18
+ * caller's signal that the lockfile it read from is stale.
19
+ */
20
+ export declare const applyWorkspaceRangeEdit: (content: string, edit: WorkspaceRangeEdit) => string | undefined;
21
+ //# sourceMappingURL=workspaceManifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceManifest.d.ts","sourceRoot":"","sources":["../../src/workspaceManifest.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAEjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM,MAAM,MAAM,KAAG,MAKxD,CAAC;AAqCF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,YACzB,MAAM,QACT,kBAAkB,KACvB,MAAM,GAAG,SA8BX,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workspaceManifest.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceManifest.test.d.ts","sourceRoot":"","sources":["../../src/workspaceManifest.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export const diffDuplicates = (before, after) => {
2
+ const removed = [...before].filter((resolution) => !after.has(resolution));
3
+ const added = [...after].filter((resolution) => !before.has(resolution));
4
+ return {
5
+ removed: removed.toSorted((a, b) => a.localeCompare(b)),
6
+ added: added.toSorted((a, b) => a.localeCompare(b)),
7
+ improved: added.length === 0 && removed.length > 0,
8
+ };
9
+ };
10
+ //# sourceMappingURL=duplicateSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duplicateSnapshot.js","sourceRoot":"","sources":["../src/duplicateSnapshot.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAyB,EACzB,KAAwB,EACT,EAAE;IACjB,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IAEzE,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvD,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACnD,QAAQ,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { readFileSync, rmSync, writeFileSync } from "node:fs";
2
+ const readIfExists = (path) => {
3
+ try {
4
+ return readFileSync(path, "utf8");
5
+ }
6
+ catch {
7
+ return undefined;
8
+ }
9
+ };
10
+ export const captureFiles = (paths) => paths.map((path) => ({ path, content: readIfExists(path) }));
11
+ export const restoreFiles = (snapshots) => {
12
+ for (const { path, content } of snapshots) {
13
+ if (content === undefined) {
14
+ rmSync(path, { force: true });
15
+ }
16
+ else {
17
+ writeFileSync(path, content);
18
+ }
19
+ }
20
+ };
21
+ //# sourceMappingURL=fileSnapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileSnapshot.js","sourceRoot":"","sources":["../src/fileSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ9D,MAAM,YAAY,GAAG,CAAC,IAAY,EAAsB,EAAE;IACxD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAe,EAAkB,EAAE,CAC9D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAyB,EAAQ,EAAE;IAC9D,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,EAAE,CAAC;QAC1C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}