packtory 0.0.96 → 0.0.98

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 (517) hide show
  1. package/artifacts/artifacts-builder.js +37 -4
  2. package/artifacts/artifacts-builder.js.map +1 -1
  3. package/artifacts/content-collection.js +59 -2
  4. package/artifacts/content-collection.js.map +1 -1
  5. package/artifacts/folder-writer.js +25 -2
  6. package/artifacts/folder-writer.js.map +1 -1
  7. package/bundle-emitter/emitter.js +137 -6
  8. package/bundle-emitter/emitter.js.map +1 -1
  9. package/bundle-emitter/extract-package-tarball.js +13 -2
  10. package/bundle-emitter/extract-package-tarball.js.map +1 -1
  11. package/bundle-emitter/fetch-published-artifacts.js +19 -2
  12. package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
  13. package/bundle-emitter/publication-outcome.js +5 -0
  14. package/bundle-emitter/publication-outcome.js.map +1 -1
  15. package/bundle-emitter/publish-error/auto-mode-error-matching.js +28 -2
  16. package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
  17. package/bundle-emitter/publish-error/error-shape-helpers.js +9 -0
  18. package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
  19. package/bundle-emitter/publish-error/file-mode-error-matching.js +33 -2
  20. package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
  21. package/bundle-emitter/publish-error/publish-error-messages.js +24 -0
  22. package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
  23. package/bundle-emitter/registry/metadata-auth-retry.js +24 -1
  24. package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
  25. package/bundle-emitter/registry/oidc-token-exchange.js +68 -3
  26. package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
  27. package/bundle-emitter/registry/package-metadata-fetcher.js +210 -7
  28. package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
  29. package/bundle-emitter/registry/publish-settings-bridge.js +34 -3
  30. package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
  31. package/bundle-emitter/registry/registry-auth-config.js +106 -0
  32. package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
  33. package/bundle-emitter/registry/registry-client.js +74 -4
  34. package/bundle-emitter/registry/registry-client.js.map +1 -1
  35. package/bundle-emitter/registry/registry-package-path.js +3 -0
  36. package/bundle-emitter/registry/registry-package-path.js.map +1 -1
  37. package/bundle-emitter/registry/registry-response-schemas.js +50 -2
  38. package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
  39. package/bundle-emitter/registry/tarball-integrity.js +31 -1
  40. package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
  41. package/bundle-emitter/registry/validate-tarball-host.js +26 -1
  42. package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
  43. package/bundle-emitter/release-artifact-canonicalizer.js +31 -5
  44. package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
  45. package/checks/check-runner.js +8 -0
  46. package/checks/check-runner.js.map +1 -1
  47. package/checks/rule.js +12 -2
  48. package/checks/rule.js.map +1 -1
  49. package/checks/rules/duplicate-detection.js +23 -1
  50. package/checks/rules/duplicate-detection.js.map +1 -1
  51. package/checks/rules/duplicate-messages.js +22 -0
  52. package/checks/rules/duplicate-messages.js.map +1 -1
  53. package/checks/rules/file-ownership.js +15 -0
  54. package/checks/rules/file-ownership.js.map +1 -1
  55. package/checks/rules/max-bundle-size.js +55 -1
  56. package/checks/rules/max-bundle-size.js.map +1 -1
  57. package/checks/rules/no-dev-dependency-imports.js +51 -1
  58. package/checks/rules/no-dev-dependency-imports.js.map +1 -1
  59. package/checks/rules/no-duplicated-files.js +53 -3
  60. package/checks/rules/no-duplicated-files.js.map +1 -1
  61. package/checks/rules/no-side-effects.js +50 -1
  62. package/checks/rules/no-side-effects.js.map +1 -1
  63. package/checks/rules/no-unexposed-executables.js +43 -2
  64. package/checks/rules/no-unexposed-executables.js.map +1 -1
  65. package/checks/rules/no-unused-bundle-dependencies.js +30 -2
  66. package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
  67. package/checks/rules/registry.js +22 -9
  68. package/checks/rules/registry.js.map +1 -1
  69. package/checks/rules/required-files.js +41 -3
  70. package/checks/rules/required-files.js.map +1 -1
  71. package/checks/rules/type-script-declaration-integrity.js +81 -3
  72. package/checks/rules/type-script-declaration-integrity.js.map +1 -1
  73. package/checks/rules/type-script-declaration-paths.js +55 -1
  74. package/checks/rules/type-script-declaration-paths.js.map +1 -1
  75. package/checks/rules/type-script-declaration-project.js +202 -3
  76. package/checks/rules/type-script-declaration-project.js.map +1 -1
  77. package/checks/rules/type-script-declaration-reachability.js +38 -2
  78. package/checks/rules/type-script-declaration-reachability.js.map +1 -1
  79. package/checks/rules/type-script-declaration-roots.js +29 -0
  80. package/checks/rules/type-script-declaration-roots.js.map +1 -1
  81. package/checks/rules/type-script-integrity.js +72 -2
  82. package/checks/rules/type-script-integrity.js.map +1 -1
  83. package/checks/rules/type-script-package-resolution.js +42 -1
  84. package/checks/rules/type-script-package-resolution.js.map +1 -1
  85. package/checks/rules/type-script-resolution-summary.js +53 -0
  86. package/checks/rules/type-script-resolution-summary.js.map +1 -1
  87. package/checks/rules/unique-target-paths.js +34 -2
  88. package/checks/rules/unique-target-paths.js.map +1 -1
  89. package/common/bundled-dependency-groups.js +27 -0
  90. package/common/bundled-dependency-groups.js.map +1 -1
  91. package/common/code-files.js +28 -0
  92. package/common/code-files.js.map +1 -1
  93. package/common/declaration-companion-paths.js +24 -0
  94. package/common/declaration-companion-paths.js.map +1 -1
  95. package/common/package-name-map.js +7 -0
  96. package/common/package-name-map.js.map +1 -1
  97. package/common/stable-json.js +42 -2
  98. package/common/stable-json.js.map +1 -1
  99. package/common/worklist.js +22 -0
  100. package/common/worklist.js.map +1 -1
  101. package/config/additional-files.js +6 -2
  102. package/config/additional-files.js.map +1 -1
  103. package/config/additional-package-json-attributes-schema.js +6 -2
  104. package/config/additional-package-json-attributes-schema.js.map +1 -1
  105. package/config/automatic-versioning-settings.js +6 -2
  106. package/config/automatic-versioning-settings.js.map +1 -1
  107. package/config/changelog-settings.js +120 -3
  108. package/config/changelog-settings.js.map +1 -1
  109. package/config/common-package-settings-schemas.js +19 -3
  110. package/config/common-package-settings-schemas.js.map +1 -1
  111. package/config/config.js +3 -1
  112. package/config/config.js.map +1 -1
  113. package/config/cross-package-validation.js +17 -0
  114. package/config/cross-package-validation.js.map +1 -1
  115. package/config/dead-code-elimination-settings.js +36 -2
  116. package/config/dead-code-elimination-settings.js.map +1 -1
  117. package/config/dependency-existence-validation.js +19 -1
  118. package/config/dependency-existence-validation.js.map +1 -1
  119. package/config/dependency-policy.js +5 -2
  120. package/config/dependency-policy.js.map +1 -1
  121. package/config/main-package-json-schema.js +11 -2
  122. package/config/main-package-json-schema.js.map +1 -1
  123. package/config/manual-versioning-settings.d.ts +12 -0
  124. package/config/manual-versioning-settings.d.ts.map +1 -1
  125. package/config/manual-versioning-settings.js +29 -2
  126. package/config/manual-versioning-settings.js.map +1 -1
  127. package/config/optional-package-settings-schema.js +16 -7
  128. package/config/optional-package-settings-schema.js.map +1 -1
  129. package/config/package-config.js +2 -1
  130. package/config/package-config.js.map +1 -1
  131. package/config/package-graph-builder.js +14 -2
  132. package/config/package-graph-builder.js.map +1 -1
  133. package/config/package-interface.js +25 -2
  134. package/config/package-interface.js.map +1 -1
  135. package/config/package-json.d.ts.map +1 -1
  136. package/config/package-json.js +16 -0
  137. package/config/package-json.js.map +1 -1
  138. package/config/packtory-config-without-registry-schema.js +6 -0
  139. package/config/packtory-config-without-registry-schema.js.map +1 -1
  140. package/config/per-package-settings-schema.js +22 -6
  141. package/config/per-package-settings-schema.js.map +1 -1
  142. package/config/pre-graph-validation.js +20 -5
  143. package/config/pre-graph-validation.js.map +1 -1
  144. package/config/publish-settings.js +25 -3
  145. package/config/publish-settings.js.map +1 -1
  146. package/config/publish-settings.report.js +17 -1
  147. package/config/publish-settings.report.js.map +1 -1
  148. package/config/registry-settings.js +40 -2
  149. package/config/registry-settings.js.map +1 -1
  150. package/config/registry-settings.report.js +46 -0
  151. package/config/registry-settings.report.js.map +1 -1
  152. package/config/root-config-validation.js +141 -0
  153. package/config/root-config-validation.js.map +1 -1
  154. package/config/root.js +6 -2
  155. package/config/root.js.map +1 -1
  156. package/config/sbom-settings.js +4 -1
  157. package/config/sbom-settings.js.map +1 -1
  158. package/config/settings-validation.js +28 -0
  159. package/config/settings-validation.js.map +1 -1
  160. package/config/versioning-settings.js +10 -3
  161. package/config/versioning-settings.js.map +1 -1
  162. package/dead-code-eliminator/analyzed-bundle.js +7 -0
  163. package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
  164. package/dead-code-eliminator/artifact-module-reference-contract.js +27 -0
  165. package/dead-code-eliminator/artifact-module-reference-contract.js.map +1 -0
  166. package/dead-code-eliminator/bundle-analysis.js +38 -5
  167. package/dead-code-eliminator/bundle-analysis.js.map +1 -1
  168. package/dead-code-eliminator/class-purity.js +48 -2
  169. package/dead-code-eliminator/class-purity.js.map +1 -1
  170. package/dead-code-eliminator/code-file-analyzer.js +68 -4
  171. package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
  172. package/dead-code-eliminator/cross-bundle/bundle-index.js +10 -0
  173. package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
  174. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +22 -3
  175. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
  176. package/dead-code-eliminator/cross-bundle/import-export-walker.js +164 -3
  177. package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
  178. package/dead-code-eliminator/cross-bundle/seed-store.js +10 -0
  179. package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
  180. package/dead-code-eliminator/dependency-metadata.js +172 -2
  181. package/dead-code-eliminator/dependency-metadata.js.map +1 -1
  182. package/dead-code-eliminator/elimination-emitter.js +52 -0
  183. package/dead-code-eliminator/elimination-emitter.js.map +1 -1
  184. package/dead-code-eliminator/eliminator.js +22 -4
  185. package/dead-code-eliminator/eliminator.js.map +1 -1
  186. package/dead-code-eliminator/expression-unwrapping.js +16 -1
  187. package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
  188. package/dead-code-eliminator/imported-expression-origin.js +101 -2
  189. package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
  190. package/dead-code-eliminator/liveness/asset-side-effects.js +9 -1
  191. package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
  192. package/dead-code-eliminator/liveness/boolean-facts.js +98 -2
  193. package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
  194. package/dead-code-eliminator/liveness/external-purity-summary.js +314 -3
  195. package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
  196. package/dead-code-eliminator/liveness/external-purity.js +39 -3
  197. package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
  198. package/dead-code-eliminator/liveness/module-analysis.js +27 -2
  199. package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
  200. package/dead-code-eliminator/liveness/resource-retention.js +91 -1
  201. package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
  202. package/dead-code-eliminator/liveness/runtime-code.js +15 -1
  203. package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
  204. package/dead-code-eliminator/load-bundle.js +86 -5
  205. package/dead-code-eliminator/load-bundle.js.map +1 -1
  206. package/dead-code-eliminator/pure-expression.js +178 -5
  207. package/dead-code-eliminator/pure-expression.js.map +1 -1
  208. package/dead-code-eliminator/reachability/bfs-closure.js +53 -0
  209. package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
  210. package/dead-code-eliminator/reachability/binding-extractor.js +100 -2
  211. package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
  212. package/dead-code-eliminator/reachability/binding-id.js +106 -1
  213. package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
  214. package/dead-code-eliminator/reachability/identifier-target-collector.js +96 -1
  215. package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
  216. package/dead-code-eliminator/reachability/impure-statements.js +11 -2
  217. package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
  218. package/dead-code-eliminator/reachability/local-seed-gathering.js +91 -4
  219. package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
  220. package/dead-code-eliminator/reachability/reachability.js +70 -4
  221. package/dead-code-eliminator/reachability/reachability.js.map +1 -1
  222. package/dead-code-eliminator/side-effect-classifier.js +39 -4
  223. package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
  224. package/dead-code-eliminator/side-effects-field.js +23 -1
  225. package/dead-code-eliminator/side-effects-field.js.map +1 -1
  226. package/dead-code-eliminator/source-map-recomposition.js +29 -2
  227. package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
  228. package/dead-code-eliminator/statement-classifiers.js +94 -4
  229. package/dead-code-eliminator/statement-classifiers.js.map +1 -1
  230. package/dead-code-eliminator/syntax-kind-sets.js +16 -0
  231. package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
  232. package/dead-code-eliminator/transform/atom-translator.js +57 -2
  233. package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
  234. package/dead-code-eliminator/transform/declaration-removal.js +183 -5
  235. package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
  236. package/dead-code-eliminator/transform/declaration-remover.js +17 -2
  237. package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
  238. package/dead-code-eliminator/transform/line-index.js +20 -0
  239. package/dead-code-eliminator/transform/line-index.js.map +1 -1
  240. package/dead-code-eliminator/transform/named-declaration-kinds.js +3 -0
  241. package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
  242. package/dead-code-eliminator/transform/source-map-composer.js +84 -3
  243. package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
  244. package/dead-code-eliminator/variable-declaration-bindings.js +25 -1
  245. package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
  246. package/dependency-scanner/dependency-graph.js +77 -3
  247. package/dependency-scanner/dependency-graph.js.map +1 -1
  248. package/dependency-scanner/external-dependencies.js +55 -1
  249. package/dependency-scanner/external-dependencies.js.map +1 -1
  250. package/dependency-scanner/file-host-predicates.js +9 -0
  251. package/dependency-scanner/file-host-predicates.js.map +1 -1
  252. package/dependency-scanner/host-method-binding.js +18 -0
  253. package/dependency-scanner/host-method-binding.js.map +1 -1
  254. package/dependency-scanner/injected-dynamic-imports.js +232 -1
  255. package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
  256. package/dependency-scanner/node-modules-manifest-synthesizer.js +52 -4
  257. package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
  258. package/dependency-scanner/package-owned-asset-file-path.js +9 -1
  259. package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
  260. package/dependency-scanner/scanner.js +109 -4
  261. package/dependency-scanner/scanner.js.map +1 -1
  262. package/dependency-scanner/source-file-references.js +171 -6
  263. package/dependency-scanner/source-file-references.js.map +1 -1
  264. package/dependency-scanner/source-map-file-locator.js +66 -2
  265. package/dependency-scanner/source-map-file-locator.js.map +1 -1
  266. package/dependency-scanner/typescript-compiler-options.js +21 -1
  267. package/dependency-scanner/typescript-compiler-options.js.map +1 -1
  268. package/dependency-scanner/typescript-file-host.js +49 -5
  269. package/dependency-scanner/typescript-file-host.js.map +1 -1
  270. package/dependency-scanner/typescript-module-resolution.js +214 -0
  271. package/dependency-scanner/typescript-module-resolution.js.map +1 -0
  272. package/dependency-scanner/typescript-project-analyzer.js +32 -3
  273. package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
  274. package/dependency-scanner/virtual-package-json-host.js +45 -4
  275. package/dependency-scanner/virtual-package-json-host.js.map +1 -1
  276. package/directed-graph/graph.js +240 -1
  277. package/directed-graph/graph.js.map +1 -1
  278. package/file-manager/compare.js +23 -2
  279. package/file-manager/compare.js.map +1 -1
  280. package/file-manager/equal.js +5 -0
  281. package/file-manager/equal.js.map +1 -1
  282. package/file-manager/file-description.js +3 -0
  283. package/file-manager/file-description.js.map +1 -1
  284. package/file-manager/permissions.js +28 -1
  285. package/file-manager/permissions.js.map +1 -1
  286. package/git/current-git-head.js +24 -0
  287. package/git/current-git-head.js.map +1 -1
  288. package/git/git-command.js +49 -1
  289. package/git/git-command.js.map +1 -1
  290. package/linker/linked-bundle.js +5 -0
  291. package/linker/linked-bundle.js.map +1 -1
  292. package/linker/linker.js +51 -5
  293. package/linker/linker.js.map +1 -1
  294. package/linker/replacement-lookup.js +297 -8
  295. package/linker/replacement-lookup.js.map +1 -1
  296. package/linker/resource-graph.js +65 -2
  297. package/linker/resource-graph.js.map +1 -1
  298. package/linker/source-modifier/import-paths.js +80 -3
  299. package/linker/source-modifier/import-paths.js.map +1 -1
  300. package/linker/substitute-bundles.js +166 -3
  301. package/linker/substitute-bundles.js.map +1 -1
  302. package/linker/substituted-resource-graph.js +111 -2
  303. package/linker/substituted-resource-graph.js.map +1 -1
  304. package/npm-oidc-id-token-resolver.js +82 -0
  305. package/npm-oidc-id-token-resolver.js.map +1 -1
  306. package/pack-emitter/pack-emitter.js +27 -0
  307. package/pack-emitter/pack-emitter.js.map +1 -1
  308. package/package-surface/bin-field.js +8 -2
  309. package/package-surface/bin-field.js.map +1 -1
  310. package/package-surface/explicit-bin.js +24 -2
  311. package/package-surface/explicit-bin.js.map +1 -1
  312. package/package-surface/explicit-exports.js +26 -3
  313. package/package-surface/explicit-exports.js.map +1 -1
  314. package/package-surface/export-map.js +9 -2
  315. package/package-surface/export-map.js.map +1 -1
  316. package/package-surface/implicit-bin.js +25 -1
  317. package/package-surface/implicit-bin.js.map +1 -1
  318. package/package-surface/implicit-exports.js +10 -3
  319. package/package-surface/implicit-exports.js.map +1 -1
  320. package/package-surface/implicit-root-exports.js +13 -2
  321. package/package-surface/implicit-root-exports.js.map +1 -1
  322. package/package-surface/package-json-export.js +9 -0
  323. package/package-surface/package-json-export.js.map +1 -1
  324. package/package-surface/package-shape.js +10 -1
  325. package/package-surface/package-shape.js.map +1 -1
  326. package/package-surface/package-surface-index.js +165 -3
  327. package/package-surface/package-surface-index.js.map +1 -1
  328. package/package-surface/public-module-usage.js +46 -3
  329. package/package-surface/public-module-usage.js.map +1 -1
  330. package/package-surface/public-specifiers.js +7 -1
  331. package/package-surface/public-specifiers.js.map +1 -1
  332. package/package-surface/root-registry.js +26 -0
  333. package/package-surface/root-registry.js.map +1 -1
  334. package/package-surface/specifier-syntax.js +4 -0
  335. package/package-surface/specifier-syntax.js.map +1 -1
  336. package/package-surface/substitution-exports.js +101 -3
  337. package/package-surface/substitution-exports.js.map +1 -1
  338. package/package-surface/surface.js +12 -0
  339. package/package-surface/surface.js.map +1 -1
  340. package/package.json +2 -2
  341. package/packages/package-processor.composition.js +161 -34
  342. package/packages/package-processor.composition.js.map +1 -1
  343. package/packtory/map-config.js +35 -4
  344. package/packtory/map-config.js.map +1 -1
  345. package/packtory/normalize-paths.js +25 -1
  346. package/packtory/normalize-paths.js.map +1 -1
  347. package/packtory/options/bundle-dependency-resolution.js +17 -1
  348. package/packtory/options/bundle-dependency-resolution.js.map +1 -1
  349. package/packtory/options/dead-code-elimination-resolution.js +10 -1
  350. package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
  351. package/packtory/options/prepare-package-options.js +46 -5
  352. package/packtory/options/prepare-package-options.js.map +1 -1
  353. package/packtory/options/required-value-helpers.js +17 -0
  354. package/packtory/options/required-value-helpers.js.map +1 -1
  355. package/packtory/options/setting-resolvers.js +47 -3
  356. package/packtory/options/setting-resolvers.js.map +1 -1
  357. package/packtory/options/surface-resolution.js +15 -2
  358. package/packtory/options/surface-resolution.js.map +1 -1
  359. package/packtory/options/version-provider-context.js +24 -2
  360. package/packtory/options/version-provider-context.js.map +1 -1
  361. package/packtory/options/version-trigger.js +39 -2
  362. package/packtory/options/version-trigger.js.map +1 -1
  363. package/packtory/pack-output-preflight.js +60 -3
  364. package/packtory/pack-output-preflight.js.map +1 -1
  365. package/packtory/package-processor-build.js +97 -3
  366. package/packtory/package-processor-build.js.map +1 -1
  367. package/packtory/package-processor-publish.js +297 -6
  368. package/packtory/package-processor-publish.js.map +1 -1
  369. package/packtory/package-processor.js +10 -2
  370. package/packtory/package-processor.js.map +1 -1
  371. package/packtory/packtory-pack.js +298 -10
  372. package/packtory/packtory-pack.js.map +1 -1
  373. package/packtory/packtory-package-dependencies.js +116 -2
  374. package/packtory/packtory-package-dependencies.js.map +1 -1
  375. package/packtory/packtory-package-inspection.js +26 -5
  376. package/packtory/packtory-package-inspection.js.map +1 -1
  377. package/packtory/packtory-package-side-effects.js +64 -3
  378. package/packtory/packtory-package-side-effects.js.map +1 -1
  379. package/packtory/packtory-package-tree.js +43 -4
  380. package/packtory/packtory-package-tree.js.map +1 -1
  381. package/packtory/packtory-publish.js +17 -4
  382. package/packtory/packtory-publish.js.map +1 -1
  383. package/packtory/packtory-release-analysis.js +64 -6
  384. package/packtory/packtory-release-analysis.js.map +1 -1
  385. package/packtory/packtory-release-diff.js +48 -5
  386. package/packtory/packtory-release-diff.js.map +1 -1
  387. package/packtory/packtory-release-plan.js +87 -6
  388. package/packtory/packtory-release-plan.js.map +1 -1
  389. package/packtory/packtory-resolve.js +16 -5
  390. package/packtory/packtory-resolve.js.map +1 -1
  391. package/packtory/packtory.js +242 -13
  392. package/packtory/packtory.js.map +1 -1
  393. package/packtory/publish-failure-mapping.js +6 -0
  394. package/packtory/publish-failure-mapping.js.map +1 -1
  395. package/packtory/publish-target-preflight.js +25 -3
  396. package/packtory/publish-target-preflight.js.map +1 -1
  397. package/packtory/published-release-state.js +11 -0
  398. package/packtory/published-release-state.js.map +1 -1
  399. package/packtory/release-analysis.js +153 -5
  400. package/packtory/release-analysis.js.map +1 -1
  401. package/packtory/release-diff-failure-mapping.js +6 -0
  402. package/packtory/release-diff-failure-mapping.js.map +1 -1
  403. package/packtory/release-plan.js +135 -7
  404. package/packtory/release-plan.js.map +1 -1
  405. package/packtory/report-attachment.js +35 -2
  406. package/packtory/report-attachment.js.map +1 -1
  407. package/packtory/resolved-package.js +97 -3
  408. package/packtory/resolved-package.js.map +1 -1
  409. package/packtory/scheduler.js +99 -1
  410. package/packtory/scheduler.js.map +1 -1
  411. package/packtory/stages/package-analysis-stage.js +50 -2
  412. package/packtory/stages/package-analysis-stage.js.map +1 -1
  413. package/packtory/stages/package-resolution-stage.js +80 -5
  414. package/packtory/stages/package-resolution-stage.js.map +1 -1
  415. package/packtory/stages/publish-stage.js +125 -4
  416. package/packtory/stages/publish-stage.js.map +1 -1
  417. package/packtory/stages/release-diff-stage.js +84 -5
  418. package/packtory/stages/release-diff-stage.js.map +1 -1
  419. package/progress/progress-broadcaster.js +45 -0
  420. package/progress/progress-broadcaster.js.map +1 -1
  421. package/published-package/published-package.js +12 -1
  422. package/published-package/published-package.js.map +1 -1
  423. package/report/aggregator/artifact-entry-merger.js +20 -0
  424. package/report/aggregator/artifact-entry-merger.js.map +1 -1
  425. package/report/aggregator/package-report-materialization.js +75 -2
  426. package/report/aggregator/package-report-materialization.js.map +1 -1
  427. package/report/aggregator/report-aggregator.js +37 -2
  428. package/report/aggregator/report-aggregator.js.map +1 -1
  429. package/report/aggregator/report-event-handlers.js +141 -2
  430. package/report/aggregator/report-event-handlers.js.map +1 -1
  431. package/report/aggregator/report-types.js +3 -0
  432. package/report/aggregator/report-types.js.map +1 -1
  433. package/report/config-redactor.js +29 -3
  434. package/report/config-redactor.js.map +1 -1
  435. package/report/decorators.js +85 -0
  436. package/report/decorators.js.map +1 -1
  437. package/report/inspectors/inspect-artifact-sizes.js +34 -1
  438. package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
  439. package/report/inspectors/inspect-linker-rewrites.js +14 -1
  440. package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
  441. package/report/inspectors/inspect-package-json-provenance.js +15 -0
  442. package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
  443. package/report/inspectors/inspect-scan-results.js +15 -0
  444. package/report/inspectors/inspect-scan-results.js.map +1 -1
  445. package/report/release-diff/release-version-transition.js +18 -0
  446. package/report/release-diff/release-version-transition.js.map +1 -1
  447. package/resource-resolver/bundle-resource-lookup.js +25 -0
  448. package/resource-resolver/bundle-resource-lookup.js.map +1 -1
  449. package/resource-resolver/content.js +136 -4
  450. package/resource-resolver/content.js.map +1 -1
  451. package/resource-resolver/dependency-resolution-walker.js +73 -2
  452. package/resource-resolver/dependency-resolution-walker.js.map +1 -1
  453. package/resource-resolver/resolved-bundle.js +3 -0
  454. package/resource-resolver/resolved-bundle.js.map +1 -1
  455. package/resource-resolver/resource-resolve-options.js +13 -1
  456. package/resource-resolver/resource-resolve-options.js.map +1 -1
  457. package/resource-resolver/resource-resolver.js +128 -6
  458. package/resource-resolver/resource-resolver.js.map +1 -1
  459. package/sbom/extract-license.js +11 -1
  460. package/sbom/extract-license.js.map +1 -1
  461. package/sbom/license-resolver.js +23 -2
  462. package/sbom/license-resolver.js.map +1 -1
  463. package/sbom/sbom-builder.js +57 -2
  464. package/sbom/sbom-builder.js.map +1 -1
  465. package/sbom/sbom-canonicalizer.js +45 -3
  466. package/sbom/sbom-canonicalizer.js.map +1 -1
  467. package/sbom/sbom-file.js +54 -5
  468. package/sbom/sbom-file.js.map +1 -1
  469. package/sbom/sbom-serializer.js +14 -1
  470. package/sbom/sbom-serializer.js.map +1 -1
  471. package/sbom/tool-version.js +49 -1
  472. package/sbom/tool-version.js.map +1 -1
  473. package/sbom.cdx.json +10 -10
  474. package/tar/extract-tar.js +83 -3
  475. package/tar/extract-tar.js.map +1 -1
  476. package/tar/gzipped-pack.js +20 -0
  477. package/tar/gzipped-pack.js.map +1 -1
  478. package/tar/tarball-builder.js +44 -4
  479. package/tar/tarball-builder.js.map +1 -1
  480. package/vendor-materializer/vendor-entry.js +20 -1
  481. package/vendor-materializer/vendor-entry.js.map +1 -1
  482. package/vendor-materializer/vendor-materializer.js +240 -8
  483. package/vendor-materializer/vendor-materializer.js.map +1 -1
  484. package/version-manager/dependencies/bundle-dependency-grouping.js +32 -2
  485. package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
  486. package/version-manager/dependencies/dependency-groups.js +11 -1
  487. package/version-manager/dependencies/dependency-groups.js.map +1 -1
  488. package/version-manager/dependencies/external-dependency-classification.js +82 -3
  489. package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
  490. package/version-manager/dependencies/versioned-bundle-dependencies.js +8 -3
  491. package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
  492. package/version-manager/imports/hash-import-scanner.js +20 -2
  493. package/version-manager/imports/hash-import-scanner.js.map +1 -1
  494. package/version-manager/imports/imports-key-matcher.js +22 -0
  495. package/version-manager/imports/imports-key-matcher.js.map +1 -1
  496. package/version-manager/imports/versioned-bundle-imports.js +44 -2
  497. package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
  498. package/version-manager/manager.js +46 -6
  499. package/version-manager/manager.js.map +1 -1
  500. package/version-manager/manifest/builder.js +51 -1
  501. package/version-manager/manifest/builder.js.map +1 -1
  502. package/version-manager/manifest/serialize.js +8 -1
  503. package/version-manager/manifest/serialize.js.map +1 -1
  504. package/version-manager/optional-bundle-fields.js +5 -1
  505. package/version-manager/optional-bundle-fields.js.map +1 -1
  506. package/version-manager/representative-root.js +9 -1
  507. package/version-manager/representative-root.js.map +1 -1
  508. package/version-manager/specifier-classifier.js +42 -2
  509. package/version-manager/specifier-classifier.js.map +1 -1
  510. package/version-manager/specifier-errors.js +58 -0
  511. package/version-manager/specifier-errors.js.map +1 -1
  512. package/version-manager/versioned-bundle.js +31 -6
  513. package/version-manager/versioned-bundle.js.map +1 -1
  514. package/zip/zip-builder.js +81 -2
  515. package/zip/zip-builder.js.map +1 -1
  516. package/dead-code-eliminator/liveness/external-module-resolution.js +0 -3
  517. package/dead-code-eliminator/liveness/external-module-resolution.js.map +0 -1
package/sbom.cdx.json CHANGED
@@ -9,16 +9,16 @@
9
9
  {
10
10
  "type": "application",
11
11
  "name": "packtory",
12
- "version": "0.0.99"
12
+ "version": "0.0.108"
13
13
  }
14
14
  ]
15
15
  },
16
16
  "component": {
17
17
  "type": "library",
18
18
  "name": "packtory",
19
- "version": "0.0.96",
20
- "bom-ref": "pkg:npm/packtory@0.0.96",
21
- "purl": "pkg:npm/packtory@0.0.96"
19
+ "version": "0.0.98",
20
+ "bom-ref": "pkg:npm/packtory@0.0.98",
21
+ "purl": "pkg:npm/packtory@0.0.98"
22
22
  }
23
23
  },
24
24
  "components": [
@@ -194,15 +194,15 @@
194
194
  {
195
195
  "type": "library",
196
196
  "name": "remeda",
197
- "version": "2.45.0",
198
- "bom-ref": "pkg:npm/remeda@2.45.0",
197
+ "version": "2.46.0",
198
+ "bom-ref": "pkg:npm/remeda@2.46.0",
199
199
  "scope": "required",
200
200
  "licenses": [
201
201
  {
202
202
  "expression": "MIT"
203
203
  }
204
204
  ],
205
- "purl": "pkg:npm/remeda@2.45.0"
205
+ "purl": "pkg:npm/remeda@2.46.0"
206
206
  },
207
207
  {
208
208
  "type": "library",
@@ -376,7 +376,7 @@
376
376
  "ref": "pkg:npm/npm-registry-fetch@20.0.1"
377
377
  },
378
378
  {
379
- "ref": "pkg:npm/packtory@0.0.96",
379
+ "ref": "pkg:npm/packtory@0.0.98",
380
380
  "dependsOn": [
381
381
  "pkg:npm/@arethetypeswrong/core@0.18.5",
382
382
  "pkg:npm/@cyclonedx/cyclonedx-library@10.2.0",
@@ -391,7 +391,7 @@
391
391
  "pkg:npm/libnpmpublish@12.0.0",
392
392
  "pkg:npm/npm-package-arg@14.0.0",
393
393
  "pkg:npm/npm-registry-fetch@20.0.1",
394
- "pkg:npm/remeda@2.45.0",
394
+ "pkg:npm/remeda@2.46.0",
395
395
  "pkg:npm/semver@7.8.5",
396
396
  "pkg:npm/spdx-expression-parse@5.0.0",
397
397
  "pkg:npm/ssri@14.0.0",
@@ -405,7 +405,7 @@
405
405
  ]
406
406
  },
407
407
  {
408
- "ref": "pkg:npm/remeda@2.45.0"
408
+ "ref": "pkg:npm/remeda@2.46.0"
409
409
  },
410
410
  {
411
411
  "ref": "pkg:npm/semver@7.8.5"
@@ -1,4 +1,84 @@
1
- import 'node:zlib';
2
- import 'node:stream';
3
- import 'tar-stream';
1
+ import { createGunzip } from 'node:zlib';
2
+ import { Readable } from 'node:stream';
3
+ import { extract } from 'tar-stream';
4
+ function defaultExtractTarLimits() {
5
+ return {
6
+ maxEntryCount: 50_000,
7
+ maxEntryPathLength: 4096,
8
+ maxExtractedBytes: 1_073_741_824
9
+ };
10
+ }
11
+ function toError(error) {
12
+ return error instanceof Error ? error : new Error(String(error));
13
+ }
14
+ function assertWithinEntryCountLimit(entries, limits) {
15
+ if (entries.length >= limits.maxEntryCount) {
16
+ throw new Error(`Refusing to extract tarball with more than ${limits.maxEntryCount} entries`);
17
+ }
18
+ }
19
+ function assertWithinEntryPathLimit(entry, limits) {
20
+ if (entry.header.name.length > limits.maxEntryPathLength) {
21
+ throw new Error(`Refusing to extract tarball entry with path longer than ${limits.maxEntryPathLength} characters`);
22
+ }
23
+ }
24
+ function assertWithinExtractedSizeLimit(extractedBytes, limits) {
25
+ if (extractedBytes > limits.maxExtractedBytes) {
26
+ throw new Error(`Refusing to extract tarball larger than ${limits.maxExtractedBytes} bytes`);
27
+ }
28
+ }
29
+ async function readEntryContent(entry, currentExtractedBytes, limits) {
30
+ let result = '';
31
+ let extractedBytes = currentExtractedBytes;
32
+ for await (const chunk of entry) {
33
+ extractedBytes += chunk.length;
34
+ assertWithinExtractedSizeLimit(extractedBytes, limits);
35
+ result += chunk.toString();
36
+ }
37
+ return { content: result, extractedBytes };
38
+ }
39
+ function stableTarHeader(header) {
40
+ const contentHeader = { ...header };
41
+ Reflect.deleteProperty(contentHeader, 'byteOffset');
42
+ return contentHeader;
43
+ }
44
+ async function collectTarEntries(stream, limits) {
45
+ const entries = [];
46
+ let extractedBytes = 0;
47
+ for await (const entry of stream) {
48
+ assertWithinEntryCountLimit(entries, limits);
49
+ assertWithinEntryPathLimit(entry, limits);
50
+ const content = await readEntryContent(entry, extractedBytes, limits);
51
+ extractedBytes = content.extractedBytes;
52
+ entries.push({ header: stableTarHeader(entry.header), content: content.content });
53
+ }
54
+ return entries;
55
+ }
56
+ async function waitForStreamError(stream) {
57
+ return await new Promise(function (_resolve, reject) {
58
+ stream.once('error', function (error) {
59
+ reject(toError(error));
60
+ });
61
+ });
62
+ }
63
+ function appendOutcome(outcomes, outcome) {
64
+ outcomes.add(outcome);
65
+ return outcomes;
66
+ }
67
+ async function raceExtractionOutcomes(streams, limits) {
68
+ const entries = await Promise.race(appendOutcome(appendOutcome(appendOutcome(appendOutcome(new Set(), collectTarEntries(streams.tarEntries, limits)), waitForStreamError(streams.source)), waitForStreamError(streams.gunzip)), waitForStreamError(streams.extractStream)));
69
+ return Array.from(entries);
70
+ }
71
+ export async function extractTarEntries(buffer, dependencies = {}, limits = defaultExtractTarLimits()) {
72
+ const createSource = dependencies.createSource ?? Readable.from;
73
+ const extractStream = extract();
74
+ const source = createSource(buffer);
75
+ const gunzip = createGunzip();
76
+ const tarEntries = source.pipe(gunzip).pipe(extractStream);
77
+ try {
78
+ return await raceExtractionOutcomes({ extractStream, gunzip, source, tarEntries }, limits);
79
+ }
80
+ catch (error) {
81
+ throw toError(error);
82
+ }
83
+ }
4
84
  //# sourceMappingURL=extract-tar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-tar.js","sourceRoot":"","sources":["../../../../source/tar/extract-tar.ts"],"names":[],"mappings":"AAAA,OAA6B,WAAW,CAAC;AACzC,OAAyB,aAAa,CAAC;AACvC,OAAyD,YAAY,CAAC"}
1
+ {"version":3,"file":"extract-tar.js","sourceRoot":"","sources":["../../../../source/tar/extract-tar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAmC,MAAM,YAAY,CAAC;AA6BtE,SAAS,uBAAuB;IAC5B,OAAO;QACH,aAAa,EAAE,MAAM;QACrB,kBAAkB,EAAE,IAAI;QACxB,iBAAiB,EAAE,aAA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buffer.from(data);
5
+ normalized[gzipHeaderOperatingSystemFieldIndex] = gzipHeaderOperatingSystemUnknown;
6
+ return normalized;
7
+ }
8
+ function gzipStreamChunkToBuffer(chunk) {
9
+ if (typeof chunk === 'string' || chunk instanceof Uint8Array) {
10
+ return Buffer.from(chunk);
11
+ }
12
+ throw new TypeError('Expected gzip stream to yield Buffer, Uint8Array, or string chunks');
13
+ }
14
+ export async function collectGzippedPack(pack, gzip) {
15
+ const chunks = [];
16
+ for await (const chunk of pack.pipe(gzip)) {
17
+ chunks.push(gzipStreamChunkToBuffer(chunk));
18
+ }
19
+ return normalizeGzipHeader(Buffer.concat(chunks));
20
+ }
1
21
  //# sourceMappingURL=gzipped-pack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gzipped-pack.js","sourceRoot":"","sources":["../../../../source/tar/gzipped-pack.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"gzipped-pack.js","sourceRoot":"","sources":["../../../../source/tar/gzipped-pack.ts"],"names":[],"mappings":"AAGA,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAC9C,MAAM,gCAAgC,GAAG,GAAG,CAAC;AAE7C,SAAS,mBAAmB,CAAC,IAAY;IACrC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,UAAU,CAAC,mCAAmC,CAAC,GAAG,gCAAgC,CAAC;IACnF,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,IAAI,SAAS,CAAC,oEAAoE,CAAC,CAAC;AAC9F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,IAAwB,EACxB,IAAwC;IAExC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -1,6 +1,46 @@
1
- import 'node:zlib';
2
- import 'tar-stream';
3
- import "../vendor-materializer/vendor-entry.js";
4
- import "./gzipped-pack.js";
1
+ import zlib from 'node:zlib';
2
+ import tar, {} from 'tar-stream';
3
+ import { validateVendorEntrySource } from "../vendor-materializer/vendor-entry.js";
4
+ import { collectGzippedPack } from "./gzipped-pack.js";
5
5
  const staticFileModificationTime = new Date(0);
6
+ const executableFileMode = 493;
7
+ const nonExecutableFileMode = 420;
8
+ export function createTarballBuilder(dependencies = {}) {
9
+ const createGzip = dependencies.createGzip ?? zlib.createGzip;
10
+ const fileManager = dependencies.fileManager ?? {
11
+ async getRealPath(filePath) {
12
+ return filePath;
13
+ },
14
+ async readFileBytes() {
15
+ throw new Error('readFileBytes is required to materialize vendor entries into the tarball');
16
+ }
17
+ };
18
+ function addEntry(pack, filePath, isExecutable, payload) {
19
+ const entry = pack.entry({
20
+ name: filePath,
21
+ mtime: staticFileModificationTime,
22
+ mode: isExecutable ? executableFileMode : nonExecutableFileMode
23
+ }, payload);
24
+ entry.end();
25
+ }
26
+ async function createPack(fileDescriptions, vendorEntries) {
27
+ const pack = tar.pack();
28
+ for (const fileDescription of fileDescriptions) {
29
+ addEntry(pack, fileDescription.filePath, fileDescription.isExecutable, fileDescription.content);
30
+ }
31
+ for (const vendorEntry of vendorEntries) {
32
+ await validateVendorEntrySource(fileManager, vendorEntry);
33
+ const payload = await fileManager.readFileBytes(vendorEntry.sourceAbsolutePath);
34
+ addEntry(pack, vendorEntry.targetRelativePath, vendorEntry.isExecutable, payload);
35
+ }
36
+ pack.finalize();
37
+ return pack;
38
+ }
39
+ return {
40
+ async build(fileDescriptions, vendorEntries = []) {
41
+ const pack = await createPack(fileDescriptions, vendorEntries);
42
+ return collectGzippedPack(pack, createGzip({ level: 9 }));
43
+ }
44
+ };
45
+ }
6
46
  //# sourceMappingURL=tarball-builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tarball-builder.js","sourceRoot":"","sources":["../../../../source/tar/tarball-builder.ts"],"names":[],"mappings":"AAAA,OAAiB,WAAW,CAAC;AAC7B,OAA+B,YAAY,CAAC;AAG5C,OAA4D,wCAAwC,CAAC;AACrG,OAAmC,mBAAmB,CAAC;AAWvD,MAAM,0BAA0B,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"tarball-builder.js","sourceRoot":"","sources":["../../../../source/tar/tarball-builder.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,EAAE,EAAa,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,yBAAyB,EAAoB,MAAM,wCAAwC,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAWvD,MAAM,0BAA0B,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,UAAU,oBAAoB,CAAC,eAAoD,EAAE;IACvF,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,IAAI;QAC5C,KAAK,CAAC,WAAW,CAAC,QAAgB;YAC9B,OAAO,QAAQ,CAAC;QACpB,CAAC;QACD,KAAK,CAAC,aAAa;YACf,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAChG,CAAC;KACJ,CAAC;IAEF,SAAS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,CAAC;AACN,CAAC"}
@@ -1,2 +1,21 @@
1
- import 'node:path';
1
+ import path from 'node:path';
2
+ function isInFolder(folder, candidate) {
3
+ const relativePath = path.relative(folder, candidate);
4
+ return !relativePath.startsWith('..') && !path.isAbsolute(relativePath);
5
+ }
6
+ export async function validateVendorEntrySource(validator, entry) {
7
+ const rootPath = path.resolve(entry.sourcePackageRootPath);
8
+ const realSourcePath = await validator.getRealPath(entry.sourceAbsolutePath);
9
+ if (!isInFolder(rootPath, path.resolve(realSourcePath))) {
10
+ throw new Error(`Vendored file "${entry.sourceAbsolutePath}" resolved outside package root "${entry.sourcePackageRootPath}"`);
11
+ }
12
+ }
13
+ export function applyPrefixToVendorEntry(prefix, entry) {
14
+ return {
15
+ sourceAbsolutePath: entry.sourceAbsolutePath,
16
+ sourcePackageRootPath: entry.sourcePackageRootPath,
17
+ targetRelativePath: `${prefix}/${entry.targetRelativePath}`,
18
+ isExecutable: entry.isExecutable
19
+ };
20
+ }
2
21
  //# sourceMappingURL=vendor-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-entry.js","sourceRoot":"","sources":["../../../../source/vendor-materializer/vendor-entry.ts"],"names":[],"mappings":"AAAA,OAAiB,WAAW,CAAC"}
1
+ {"version":3,"file":"vendor-entry.js","sourceRoot":"","sources":["../../../../source/vendor-materializer/vendor-entry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAY7B,SAAS,UAAU,CAAC,MAAc,EAAE,SAAiB;IACjD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtD,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC3C,SAAqC,EACrC,KAAkB;IAElB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAE7E,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CACX,kBAAkB,KAAK,CAAC,kBAAkB,oCAAoC,KAAK,CAAC,qBAAqB,GAAG,CAC/G,CAAC;IACN,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,MAAc,EAAE,KAAkB;IACvE,OAAO;QACH,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;QAClD,kBAAkB,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,kBAAkB,EAAE;QAC3D,YAAY,EAAE,KAAK,CAAC,YAAY;KACnC,CAAC;AACN,CAAC"}
@@ -1,9 +1,241 @@
1
- import 'node:path';
2
- import 'npm-package-arg';
3
- import 'true-myth';
4
- import 'true-myth/result';
5
- import 'zod/mini';
6
- import "../common/schema-validation.js";
7
- import "../common/package-layout.js";
8
- import "../common/worklist.js";
1
+ import path from 'node:path';
2
+ import parsePackageArgument from 'npm-package-arg';
3
+ import { Result } from 'true-myth';
4
+ import { tryOr } from 'true-myth/result';
5
+ import { z } from 'zod/mini';
6
+ import { safeParse } from "../common/schema-validation.js";
7
+ import { ancestorInstalledDependencyPathCandidates, bundledInstalledDependencyPath, installedDependenciesFolderName, packageManifestPathIn } from "../common/package-layout.js";
8
+ import { createWorklist } from "../common/worklist.js";
9
+ export const vendorMaterializerFailureType = {
10
+ dependencyNotFound: 'dependency-not-found',
11
+ invalidDependencyName: 'invalid-dependency-name',
12
+ symlinkTargetOutsidePackage: 'symlink-target-outside-package'
13
+ };
14
+ const dependencyMapSchema = z.optional(z.record(z.string(), z.string()));
15
+ function packageManifestSchema() {
16
+ return z.object({
17
+ dependencies: dependencyMapSchema,
18
+ peerDependencies: dependencyMapSchema
19
+ });
20
+ }
21
+ function getPackageArgumentName(name) {
22
+ const parsed = tryOr(undefined, function () {
23
+ return parsePackageArgument(name).name ?? undefined;
24
+ });
25
+ return parsed.isOk ? parsed.value : undefined;
26
+ }
27
+ function findFirstInvalidDependencyName(names) {
28
+ for (const name of names) {
29
+ if (getPackageArgumentName(name) !== name) {
30
+ return name;
31
+ }
32
+ }
33
+ return undefined;
34
+ }
35
+ function parseManifestSummary(sourcePackageName, content) {
36
+ const parsed = safeParse(packageManifestSchema(), JSON.parse(content));
37
+ if (!parsed.success) {
38
+ return Result.ok({ dependencies: [], peers: [] });
39
+ }
40
+ const dependencyNames = Object.keys(parsed.data.dependencies ?? {});
41
+ const peerDependencyNames = Object.keys(parsed.data.peerDependencies ?? {});
42
+ const invalidDependencyName = findFirstInvalidDependencyName(dependencyNames.concat(peerDependencyNames));
43
+ if (invalidDependencyName !== undefined) {
44
+ return Result.err({
45
+ type: vendorMaterializerFailureType.invalidDependencyName,
46
+ sourcePackageName,
47
+ invalidDependencyName
48
+ });
49
+ }
50
+ return Result.ok({
51
+ dependencies: dependencyNames,
52
+ peers: peerDependencyNames
53
+ });
54
+ }
55
+ async function collectPackageFileEntry(walker, state, relativeEntryPath) {
56
+ const sourceAbsolutePath = path.join(state.packageDirectory.rootDirectory, relativeEntryPath);
57
+ const targetRelativePath = bundledInstalledDependencyPath(state.packageDirectory.packageName, relativeEntryPath);
58
+ const fileDescription = await walker.getTransferableFileDescriptionFromPath(sourceAbsolutePath, targetRelativePath);
59
+ state.collected.push({
60
+ sourceAbsolutePath,
61
+ sourcePackageRootPath: state.packageDirectory.rootDirectory,
62
+ targetRelativePath,
63
+ isExecutable: fileDescription.isExecutable
64
+ });
65
+ }
66
+ async function getResolvedTargetPath(walker, absoluteEntryPath) {
67
+ try {
68
+ return Result.ok(await walker.getRealPath(absoluteEntryPath));
69
+ }
70
+ catch {
71
+ return Result.err(absoluteEntryPath);
72
+ }
73
+ }
74
+ function isPathInsideRoot(rootDirectory, candidatePath) {
75
+ const normalizedRoot = path.resolve(rootDirectory);
76
+ const normalizedCandidate = path.resolve(candidatePath);
77
+ return normalizedCandidate === normalizedRoot || normalizedCandidate.startsWith(`${normalizedRoot}${path.sep}`);
78
+ }
79
+ async function checkSymlinkInsidePackage(walker, rootDirectory, packageName, relativeEntryPath) {
80
+ const absoluteEntryPath = path.join(rootDirectory, relativeEntryPath);
81
+ const normalizedEntryRelativePath = relativeEntryPath.split(path.sep).join('/');
82
+ const resolvedTarget = await getResolvedTargetPath(walker, absoluteEntryPath);
83
+ const resolvedTargetPath = resolvedTarget.isOk ? resolvedTarget.value : resolvedTarget.error;
84
+ if (resolvedTarget.isErr) {
85
+ return Result.err({
86
+ type: vendorMaterializerFailureType.symlinkTargetOutsidePackage,
87
+ packageName,
88
+ entryRelativePath: normalizedEntryRelativePath,
89
+ resolvedTargetPath
90
+ });
91
+ }
92
+ if (!isPathInsideRoot(rootDirectory, resolvedTargetPath)) {
93
+ return Result.err({
94
+ type: vendorMaterializerFailureType.symlinkTargetOutsidePackage,
95
+ packageName,
96
+ entryRelativePath: normalizedEntryRelativePath,
97
+ resolvedTargetPath
98
+ });
99
+ }
100
+ return Result.ok(undefined);
101
+ }
102
+ async function validatePackageDirectoryEntry(walker, packageDirectory, relativeEntryPath, entry) {
103
+ if (!entry.isSymbolicLink) {
104
+ return Result.ok(undefined);
105
+ }
106
+ return checkSymlinkInsidePackage(walker, packageDirectory.rootDirectory, packageDirectory.packageName, relativeEntryPath);
107
+ }
108
+ const walkPackageDirectory = async function (walker, state, relativeDirectory) {
109
+ const absoluteDirectory = path.join(state.packageDirectory.rootDirectory, relativeDirectory);
110
+ const entries = await walker.listDirectoryEntries(absoluteDirectory);
111
+ const collectDirectoryEntry = async function (entry) {
112
+ if (entry.name === installedDependenciesFolderName) {
113
+ return Result.ok(undefined);
114
+ }
115
+ const relativeEntryPath = path.join(relativeDirectory, entry.name);
116
+ const symlinkCheck = await validatePackageDirectoryEntry(walker, state.packageDirectory, relativeEntryPath, entry);
117
+ if (symlinkCheck.isErr) {
118
+ return symlinkCheck;
119
+ }
120
+ if (entry.isDirectory) {
121
+ return walkPackageDirectory(walker, state, relativeEntryPath);
122
+ }
123
+ await collectPackageFileEntry(walker, state, relativeEntryPath);
124
+ return Result.ok(undefined);
125
+ };
126
+ for (const entry of entries) {
127
+ const result = await collectDirectoryEntry(entry);
128
+ if (result.isErr) {
129
+ return result;
130
+ }
131
+ }
132
+ return Result.ok(undefined);
133
+ };
134
+ export function createVendorMaterializer(dependencies) {
135
+ const { fileManager } = dependencies;
136
+ function queueItem(name, fromFolder, sourcePackageName, required) {
137
+ return { name, fromFolder, required, sourcePackageName };
138
+ }
139
+ function scheduleManifestDependencies(closure, name, realPath, summary) {
140
+ closure.pendingPackages.scheduleAll(summary.dependencies.map(function (dependencyName) {
141
+ return queueItem(dependencyName, realPath, name, true);
142
+ }));
143
+ closure.pendingPackages.scheduleAll(summary.peers.map(function (dependencyName) {
144
+ return queueItem(dependencyName, realPath, name, false);
145
+ }));
146
+ }
147
+ async function collectVendorEntries(packageName, realPath) {
148
+ const collected = [];
149
+ const walkResult = await walkPackageDirectory(fileManager, { packageDirectory: { rootDirectory: realPath, packageName }, collected }, '');
150
+ if (walkResult.isErr) {
151
+ return Result.err(walkResult.error);
152
+ }
153
+ return Result.ok(Array.from(collected));
154
+ }
155
+ async function readManifestSummary(packageName, realPath) {
156
+ const manifestPath = packageManifestPathIn(realPath);
157
+ const content = await fileManager.readFile(manifestPath);
158
+ return parseManifestSummary(packageName, content);
159
+ }
160
+ async function findPackageRealPath(packageName, startFolder) {
161
+ for (const candidatePath of ancestorInstalledDependencyPathCandidates(startFolder, packageName)) {
162
+ const readability = await fileManager.checkReadability(candidatePath);
163
+ if (readability.isReadable) {
164
+ return await fileManager.getRealPath(candidatePath);
165
+ }
166
+ }
167
+ return undefined;
168
+ }
169
+ async function ingestResolvedPackage(closure, name, realPath) {
170
+ const summaryResult = await readManifestSummary(name, realPath);
171
+ if (summaryResult.isErr) {
172
+ return Result.err(summaryResult.error);
173
+ }
174
+ scheduleManifestDependencies(closure, name, realPath, summaryResult.value);
175
+ closure.peerRequirements.set(name, summaryResult.value.peers);
176
+ const collectedResult = await collectVendorEntries(name, realPath);
177
+ if (collectedResult.isErr) {
178
+ return Result.err(collectedResult.error);
179
+ }
180
+ closure.entries.push(...collectedResult.value);
181
+ return Result.ok(undefined);
182
+ }
183
+ async function processPendingPackageItem(closure, item) {
184
+ if (closure.visited.has(item.name)) {
185
+ return Result.ok(undefined);
186
+ }
187
+ const realPath = await findPackageRealPath(item.name, item.fromFolder);
188
+ if (realPath === undefined) {
189
+ if (item.required) {
190
+ return Result.err({
191
+ type: vendorMaterializerFailureType.dependencyNotFound,
192
+ sourcePackageName: item.sourcePackageName,
193
+ dependencyName: item.name
194
+ });
195
+ }
196
+ return Result.ok(undefined);
197
+ }
198
+ closure.visited.add(item.name);
199
+ return ingestResolvedPackage(closure, item.name, realPath);
200
+ }
201
+ async function drainPendingPackages(closure) {
202
+ for (let item = closure.pendingPackages.takeNext(); item !== undefined; item = closure.pendingPackages.takeNext()) {
203
+ const processed = await processPendingPackageItem(closure, item);
204
+ if (processed.isErr) {
205
+ return processed;
206
+ }
207
+ }
208
+ return Result.ok(undefined);
209
+ }
210
+ return {
211
+ async materializeExternals(options) {
212
+ const invalidInitialName = findFirstInvalidDependencyName(options.initialDependencyNames);
213
+ if (invalidInitialName !== undefined) {
214
+ return Result.err({
215
+ type: vendorMaterializerFailureType.invalidDependencyName,
216
+ sourcePackageName: undefined,
217
+ invalidDependencyName: invalidInitialName
218
+ });
219
+ }
220
+ const entries = [];
221
+ const closure = {
222
+ visited: new Set(),
223
+ entries,
224
+ pendingPackages: createWorklist(options.initialDependencyNames.map(function (name) {
225
+ return queueItem(name, options.projectFolder, undefined, true);
226
+ })),
227
+ peerRequirements: new Map()
228
+ };
229
+ const drained = await drainPendingPackages(closure);
230
+ if (drained.isErr) {
231
+ return Result.err(drained.error);
232
+ }
233
+ return Result.ok({
234
+ entries: Array.from(closure.entries),
235
+ packageNames: Array.from(closure.visited),
236
+ peerRequirements: new Map(closure.peerRequirements)
237
+ });
238
+ }
239
+ };
240
+ }
9
241
  //# sourceMappingURL=vendor-materializer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-materializer.js","sourceRoot":"","sources":["../../../../source/vendor-materializer/vendor-materializer.ts"],"names":[],"mappings":"AAAA,OAAiB,WAAW,CAAC;AAC7B,OAAiC,iBAAiB,CAAC;AACnD,OAAuB,WAAW,CAAC;AACnC,OAAsB,kBAAkB,CAAC;AACzC,OAAkB,UAAU,CAAC;AAC7B,OAA0B,gCAAgC,CAAC;AAC3D,OAKO,6BAA6B,CAAC;AACrC,OAA8C,uBAAuB,CAAC"}
1
+ {"version":3,"file":"vendor-materializer.js","sourceRoot":"","sources":["../../../../source/vendor-materializer/vendor-materializer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,oBAAoB,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EACH,yCAAyC,EACzC,8BAA8B,EAC9B,+BAA+B,EAC/B,qBAAqB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAiB,MAAM,uBAAuB,CAAC;AAItE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,kBAAkB,EAAE,sBAAsB;IAC1C,qBAAqB,EAAE,yBAAyB;IAChD,2BAA2B,EAAE,gCAAgC;CACvD,CAAC;AAyDX,MAAM,mBAAmB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CAAC,CAAC;gBACnE,CAAC,CAAC,CACL;gBACD,gBAAgB,EAAE,IAAI,GAAG,EAA6B;aACzD,CAAC;YACF,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAChB,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,MAAM,CAAC,EAAE,CAAC;gBACb,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;gBACpC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;gBACzC,gBAAgB,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC;aACtD,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -1,3 +1,33 @@
1
- import "../../common/bundled-dependency-groups.js";
2
- import "../../common/package-name-map.js";
1
+ import { bundledDependencyGroup, bundledDependencyLookupOrder } from "../../common/bundled-dependency-groups.js";
2
+ import { packageNameMap } from "../../common/package-name-map.js";
3
+ function matchingGroupedDependency(groupedDependenciesByName, dependencyName) {
4
+ for (const group of bundledDependencyLookupOrder()) {
5
+ const matchingDependency = groupedDependenciesByName[group.propertyName].get(dependencyName);
6
+ if (matchingDependency !== undefined) {
7
+ return { manifestProperty: group.manifestProperty, version: matchingDependency.version };
8
+ }
9
+ }
10
+ return undefined;
11
+ }
12
+ function createDependencyRecord() {
13
+ return {};
14
+ }
15
+ export function groupBundleDependencies(bundle, bundlePeerDependencies, bundleDependencies) {
16
+ const grouped = {
17
+ dependencies: createDependencyRecord(),
18
+ peerDependencies: createDependencyRecord()
19
+ };
20
+ const groupedDependenciesByName = {
21
+ [bundledDependencyGroup.bundle.propertyName]: packageNameMap(bundleDependencies),
22
+ [bundledDependencyGroup.peer.propertyName]: packageNameMap(bundlePeerDependencies)
23
+ };
24
+ for (const dependencyName of bundle.linkedBundleDependencies.keys()) {
25
+ const matchingDependency = matchingGroupedDependency(groupedDependenciesByName, dependencyName);
26
+ if (matchingDependency === undefined) {
27
+ throw new Error(`Couldn’t determine version number of bundle dependency ${dependencyName}`);
28
+ }
29
+ grouped[matchingDependency.manifestProperty][dependencyName] = matchingDependency.version;
30
+ }
31
+ return grouped;
32
+ }
3
33
  //# sourceMappingURL=bundle-dependency-grouping.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-dependency-grouping.js","sourceRoot":"","sources":["../../../../../source/version-manager/dependencies/bundle-dependency-grouping.ts"],"names":[],"mappings":"AACA,OAAqE,2CAA2C,CAAC;AACjH,OAA+B,kCAAkC,CAAC"}
1
+ {"version":3,"file":"bundle-dependency-grouping.js","sourceRoot":"","sources":["../../../../../source/version-manager/dependencies/bundle-dependency-grouping.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAkBlE,SAAS,yBAAyB,CAC9B,yBAAoD,EACpD,cAAsB;IAEtB,KAAK,MAAM,KAAK,IAAI,4BAA4B,EAAE,EAAE,CAAC;QACjD,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC7F,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAC7F,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,sBAAsB;IAC3B,OAAO,EAAE,CAAC;AACd,CAAC;AAED,MAAM,UAAU,uBAAuB,CACnC,MAAwD,EACxD,sBAAsD,EACtD,kBAAkD;IAElD,MAAM,OAAO,GAAG;QACZ,YAAY,EAAE,sBAAsB,EAAE;QACtC,gBAAgB,EAAE,sBAAsB,EAAE;KAC7C,CAAC;IACF,MAAM,yBAAyB,GAAG;QAC9B,CAAC,sBAAsB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC;QAChF,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC,sBAAsB,CAAC;KACrF,CAAC;IAEF,KAAK,MAAM,cAAc,IAAI,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAAE,CAAC;QAClE,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC;QAChG,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,0DAA0D,cAAc,EAAE,CAAC,CAAC;QAChG,CAAC;QAED,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAC9F,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
@@ -1,2 +1,12 @@
1
- import 'remeda';
1
+ import { mergeAll } from 'remeda';
2
+ export function mergeDependencyGroups(...groups) {
3
+ return {
4
+ dependencies: mergeAll(groups.map(function (group) {
5
+ return group.dependencies;
6
+ })),
7
+ peerDependencies: mergeAll(groups.map(function (group) {
8
+ return group.peerDependencies;
9
+ }))
10
+ };
11
+ }
2
12
  //# sourceMappingURL=dependency-groups.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-groups.js","sourceRoot":"","sources":["../../../../../source/version-manager/dependencies/dependency-groups.ts"],"names":[],"mappings":"AAAA,OAAyB,QAAQ,CAAC"}
1
+ {"version":3,"file":"dependency-groups.js","sourceRoot":"","sources":["../../../../../source/version-manager/dependencies/dependency-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAOlC,MAAM,UAAU,qBAAqB,CAAC,GAAG,MAAsC;IAC3E,OAAO;QACH,YAAY,EAAE,QAAQ,CAClB,MAAM,CAAC,GAAG,CAAC,UAAU,KAAK;YACtB,OAAO,KAAK,CAAC,YAAY,CAAC;QAC9B,CAAC,CAAC,CACL;QACD,gBAAgB,EAAE,QAAQ,CACtB,MAAM,CAAC,GAAG,CAAC,UAAU,KAAK;YACtB,OAAO,KAAK,CAAC,gBAAgB,CAAC;QAClC,CAAC,CAAC,CACL;KACJ,CAAC;AACN,CAAC"}