packtory 0.0.95 → 0.0.97

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 (673) hide show
  1. package/artifacts/artifacts-builder.d.ts +28 -0
  2. package/artifacts/artifacts-builder.d.ts.map +1 -0
  3. package/artifacts/artifacts-builder.js +37 -4
  4. package/artifacts/artifacts-builder.js.map +1 -1
  5. package/artifacts/content-collection.js +59 -2
  6. package/artifacts/content-collection.js.map +1 -1
  7. package/artifacts/folder-writer.js +25 -2
  8. package/artifacts/folder-writer.js.map +1 -1
  9. package/bundle-emitter/emitter.d.ts +8 -0
  10. package/bundle-emitter/emitter.d.ts.map +1 -1
  11. package/bundle-emitter/emitter.js +137 -6
  12. package/bundle-emitter/emitter.js.map +1 -1
  13. package/bundle-emitter/extract-package-tarball.js +13 -2
  14. package/bundle-emitter/extract-package-tarball.js.map +1 -1
  15. package/bundle-emitter/fetch-published-artifacts.d.ts +2 -0
  16. package/bundle-emitter/fetch-published-artifacts.d.ts.map +1 -1
  17. package/bundle-emitter/fetch-published-artifacts.js +19 -2
  18. package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
  19. package/bundle-emitter/publication-outcome.d.ts +3 -0
  20. package/bundle-emitter/publication-outcome.d.ts.map +1 -1
  21. package/bundle-emitter/publication-outcome.js +5 -0
  22. package/bundle-emitter/publication-outcome.js.map +1 -1
  23. package/bundle-emitter/publish-error/auto-mode-error-matching.js +28 -2
  24. package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
  25. package/bundle-emitter/publish-error/error-shape-helpers.js +9 -0
  26. package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
  27. package/bundle-emitter/publish-error/file-mode-error-matching.js +33 -2
  28. package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
  29. package/bundle-emitter/publish-error/publish-error-messages.js +24 -0
  30. package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
  31. package/bundle-emitter/registry/metadata-auth-retry.js +24 -1
  32. package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
  33. package/bundle-emitter/registry/oidc-token-exchange.js +68 -3
  34. package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
  35. package/bundle-emitter/registry/package-metadata-fetcher.d.ts +14 -0
  36. package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -1
  37. package/bundle-emitter/registry/package-metadata-fetcher.js +210 -7
  38. package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
  39. package/bundle-emitter/registry/publish-settings-bridge.js +34 -3
  40. package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
  41. package/bundle-emitter/registry/registry-auth-config.d.ts +17 -0
  42. package/bundle-emitter/registry/registry-auth-config.d.ts.map +1 -0
  43. package/bundle-emitter/registry/registry-auth-config.js +106 -0
  44. package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
  45. package/bundle-emitter/registry/registry-client.d.ts +13 -1
  46. package/bundle-emitter/registry/registry-client.d.ts.map +1 -1
  47. package/bundle-emitter/registry/registry-client.js +74 -4
  48. package/bundle-emitter/registry/registry-client.js.map +1 -1
  49. package/bundle-emitter/registry/registry-package-path.js +3 -0
  50. package/bundle-emitter/registry/registry-package-path.js.map +1 -1
  51. package/bundle-emitter/registry/registry-response-schemas.js +50 -2
  52. package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
  53. package/bundle-emitter/registry/tarball-integrity.d.ts +1 -0
  54. package/bundle-emitter/registry/tarball-integrity.d.ts.map +1 -1
  55. package/bundle-emitter/registry/tarball-integrity.js +31 -1
  56. package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
  57. package/bundle-emitter/registry/validate-tarball-host.js +26 -1
  58. package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
  59. package/bundle-emitter/release-artifact-canonicalizer.js +31 -5
  60. package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
  61. package/checks/check-runner.d.ts +18 -0
  62. package/checks/check-runner.d.ts.map +1 -0
  63. package/checks/check-runner.js +8 -0
  64. package/checks/check-runner.js.map +1 -1
  65. package/checks/rule.d.ts +42 -0
  66. package/checks/rule.d.ts.map +1 -0
  67. package/checks/rule.js +12 -2
  68. package/checks/rule.js.map +1 -1
  69. package/checks/rules/duplicate-detection.js +23 -1
  70. package/checks/rules/duplicate-detection.js.map +1 -1
  71. package/checks/rules/duplicate-messages.js +22 -0
  72. package/checks/rules/duplicate-messages.js.map +1 -1
  73. package/checks/rules/file-ownership.js +15 -0
  74. package/checks/rules/file-ownership.js.map +1 -1
  75. package/checks/rules/max-bundle-size.d.ts +13 -0
  76. package/checks/rules/max-bundle-size.d.ts.map +1 -0
  77. package/checks/rules/max-bundle-size.js +55 -1
  78. package/checks/rules/max-bundle-size.js.map +1 -1
  79. package/checks/rules/no-dev-dependency-imports.d.ts +11 -0
  80. package/checks/rules/no-dev-dependency-imports.d.ts.map +1 -0
  81. package/checks/rules/no-dev-dependency-imports.js +51 -1
  82. package/checks/rules/no-dev-dependency-imports.js.map +1 -1
  83. package/checks/rules/no-duplicated-files.d.ts +11 -0
  84. package/checks/rules/no-duplicated-files.d.ts.map +1 -0
  85. package/checks/rules/no-duplicated-files.js +53 -3
  86. package/checks/rules/no-duplicated-files.js.map +1 -1
  87. package/checks/rules/no-side-effects.d.ts +15 -0
  88. package/checks/rules/no-side-effects.d.ts.map +1 -0
  89. package/checks/rules/no-side-effects.js +50 -1
  90. package/checks/rules/no-side-effects.js.map +1 -1
  91. package/checks/rules/no-unexposed-executables.d.ts +8 -0
  92. package/checks/rules/no-unexposed-executables.d.ts.map +1 -0
  93. package/checks/rules/no-unexposed-executables.js +43 -2
  94. package/checks/rules/no-unexposed-executables.js.map +1 -1
  95. package/checks/rules/no-unused-bundle-dependencies.d.ts +8 -0
  96. package/checks/rules/no-unused-bundle-dependencies.d.ts.map +1 -0
  97. package/checks/rules/no-unused-bundle-dependencies.js +30 -2
  98. package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
  99. package/checks/rules/registry.d.ts +23 -0
  100. package/checks/rules/registry.d.ts.map +1 -0
  101. package/checks/rules/registry.js +22 -9
  102. package/checks/rules/registry.js.map +1 -1
  103. package/checks/rules/required-files.d.ts +15 -0
  104. package/checks/rules/required-files.d.ts.map +1 -0
  105. package/checks/rules/required-files.js +41 -3
  106. package/checks/rules/required-files.js.map +1 -1
  107. package/checks/rules/type-script-declaration-integrity.d.ts +9 -0
  108. package/checks/rules/type-script-declaration-integrity.d.ts.map +1 -0
  109. package/checks/rules/type-script-declaration-integrity.js +81 -3
  110. package/checks/rules/type-script-declaration-integrity.js.map +1 -1
  111. package/checks/rules/type-script-declaration-paths.js +55 -1
  112. package/checks/rules/type-script-declaration-paths.js.map +1 -1
  113. package/checks/rules/type-script-declaration-project.d.ts +29 -0
  114. package/checks/rules/type-script-declaration-project.d.ts.map +1 -0
  115. package/checks/rules/type-script-declaration-project.js +202 -3
  116. package/checks/rules/type-script-declaration-project.js.map +1 -1
  117. package/checks/rules/type-script-declaration-reachability.js +38 -2
  118. package/checks/rules/type-script-declaration-reachability.js.map +1 -1
  119. package/checks/rules/type-script-declaration-roots.js +29 -0
  120. package/checks/rules/type-script-declaration-roots.js.map +1 -1
  121. package/checks/rules/type-script-integrity.d.ts +24 -0
  122. package/checks/rules/type-script-integrity.d.ts.map +1 -0
  123. package/checks/rules/type-script-integrity.js +72 -2
  124. package/checks/rules/type-script-integrity.js.map +1 -1
  125. package/checks/rules/type-script-package-resolution.d.ts +29 -0
  126. package/checks/rules/type-script-package-resolution.d.ts.map +1 -0
  127. package/checks/rules/type-script-package-resolution.js +42 -1
  128. package/checks/rules/type-script-package-resolution.js.map +1 -1
  129. package/checks/rules/type-script-resolution-summary.js +53 -0
  130. package/checks/rules/type-script-resolution-summary.js.map +1 -1
  131. package/checks/rules/unique-target-paths.d.ts +8 -0
  132. package/checks/rules/unique-target-paths.d.ts.map +1 -0
  133. package/checks/rules/unique-target-paths.js +34 -2
  134. package/checks/rules/unique-target-paths.js.map +1 -1
  135. package/common/bundled-dependency-groups.js +27 -0
  136. package/common/bundled-dependency-groups.js.map +1 -1
  137. package/common/code-files.js +28 -0
  138. package/common/code-files.js.map +1 -1
  139. package/common/declaration-companion-paths.js +24 -0
  140. package/common/declaration-companion-paths.js.map +1 -1
  141. package/common/package-name-map.js +7 -0
  142. package/common/package-name-map.js.map +1 -1
  143. package/common/stable-json.js +42 -2
  144. package/common/stable-json.js.map +1 -1
  145. package/common/worklist.js +22 -0
  146. package/common/worklist.js.map +1 -1
  147. package/config/additional-files.d.ts +1 -1
  148. package/config/additional-files.js +6 -2
  149. package/config/additional-files.js.map +1 -1
  150. package/config/additional-package-json-attributes-schema.js +6 -2
  151. package/config/additional-package-json-attributes-schema.js.map +1 -1
  152. package/config/automatic-versioning-settings.js +6 -2
  153. package/config/automatic-versioning-settings.js.map +1 -1
  154. package/config/changelog-settings.d.ts +44 -0
  155. package/config/changelog-settings.d.ts.map +1 -1
  156. package/config/changelog-settings.js +120 -3
  157. package/config/changelog-settings.js.map +1 -1
  158. package/config/common-package-settings-schemas.js +19 -3
  159. package/config/common-package-settings-schemas.js.map +1 -1
  160. package/config/config.d.ts +6 -1
  161. package/config/config.d.ts.map +1 -1
  162. package/config/config.js +3 -1
  163. package/config/config.js.map +1 -1
  164. package/config/cross-package-validation.js +17 -0
  165. package/config/cross-package-validation.js.map +1 -1
  166. package/config/dead-code-elimination-settings.d.ts +1 -0
  167. package/config/dead-code-elimination-settings.d.ts.map +1 -1
  168. package/config/dead-code-elimination-settings.js +36 -2
  169. package/config/dead-code-elimination-settings.js.map +1 -1
  170. package/config/dependency-existence-validation.js +19 -1
  171. package/config/dependency-existence-validation.js.map +1 -1
  172. package/config/dependency-policy.js +5 -2
  173. package/config/dependency-policy.js.map +1 -1
  174. package/config/main-package-json-schema.js +13 -2
  175. package/config/main-package-json-schema.js.map +1 -1
  176. package/config/manual-versioning-settings.d.ts +12 -0
  177. package/config/manual-versioning-settings.d.ts.map +1 -1
  178. package/config/manual-versioning-settings.js +29 -2
  179. package/config/manual-versioning-settings.js.map +1 -1
  180. package/config/optional-package-settings-schema.js +16 -7
  181. package/config/optional-package-settings-schema.js.map +1 -1
  182. package/config/package-config.d.ts +4 -0
  183. package/config/package-config.d.ts.map +1 -1
  184. package/config/package-config.js +2 -1
  185. package/config/package-config.js.map +1 -1
  186. package/config/package-graph-builder.js +14 -2
  187. package/config/package-graph-builder.js.map +1 -1
  188. package/config/package-interface.js +25 -2
  189. package/config/package-interface.js.map +1 -1
  190. package/config/package-json.d.ts +2 -0
  191. package/config/package-json.d.ts.map +1 -1
  192. package/config/package-json.js +16 -0
  193. package/config/package-json.js.map +1 -1
  194. package/config/packtory-config-schema.d.ts +12 -12
  195. package/config/packtory-config-without-registry-schema.js +6 -0
  196. package/config/packtory-config-without-registry-schema.js.map +1 -1
  197. package/config/per-package-settings-schema.js +22 -6
  198. package/config/per-package-settings-schema.js.map +1 -1
  199. package/config/pre-graph-validation.js +20 -5
  200. package/config/pre-graph-validation.js.map +1 -1
  201. package/config/publish-settings.d.ts +3 -0
  202. package/config/publish-settings.d.ts.map +1 -1
  203. package/config/publish-settings.js +25 -3
  204. package/config/publish-settings.js.map +1 -1
  205. package/config/publish-settings.report.js +17 -1
  206. package/config/publish-settings.report.js.map +1 -1
  207. package/config/registry-settings.d.ts +41 -0
  208. package/config/registry-settings.d.ts.map +1 -1
  209. package/config/registry-settings.js +40 -2
  210. package/config/registry-settings.js.map +1 -1
  211. package/config/registry-settings.report.js +46 -0
  212. package/config/registry-settings.report.js.map +1 -1
  213. package/config/root-config-validation.js +141 -0
  214. package/config/root-config-validation.js.map +1 -1
  215. package/config/root.js +6 -2
  216. package/config/root.js.map +1 -1
  217. package/config/sbom-settings.js +4 -1
  218. package/config/sbom-settings.js.map +1 -1
  219. package/config/settings-validation.js +28 -0
  220. package/config/settings-validation.js.map +1 -1
  221. package/config/validation.d.ts.map +1 -1
  222. package/config/validation.js +35 -1
  223. package/config/validation.js.map +1 -1
  224. package/config/versioning-settings.d.ts +18 -1
  225. package/config/versioning-settings.d.ts.map +1 -1
  226. package/config/versioning-settings.js +10 -3
  227. package/config/versioning-settings.js.map +1 -1
  228. package/dead-code-eliminator/analyzed-bundle.d.ts +11 -0
  229. package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -1
  230. package/dead-code-eliminator/analyzed-bundle.js +7 -0
  231. package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
  232. package/dead-code-eliminator/bundle-analysis.js +38 -5
  233. package/dead-code-eliminator/bundle-analysis.js.map +1 -1
  234. package/dead-code-eliminator/class-purity.js +48 -2
  235. package/dead-code-eliminator/class-purity.js.map +1 -1
  236. package/dead-code-eliminator/code-file-analyzer.js +68 -4
  237. package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
  238. package/dead-code-eliminator/cross-bundle/bundle-index.js +10 -1
  239. package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
  240. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +22 -3
  241. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
  242. package/dead-code-eliminator/cross-bundle/import-export-walker.js +164 -4
  243. package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
  244. package/dead-code-eliminator/cross-bundle/seed-store.js +10 -0
  245. package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
  246. package/dead-code-eliminator/dependency-metadata.js +172 -3
  247. package/dead-code-eliminator/dependency-metadata.js.map +1 -1
  248. package/dead-code-eliminator/elimination-emitter.js +52 -0
  249. package/dead-code-eliminator/elimination-emitter.js.map +1 -1
  250. package/dead-code-eliminator/eliminator.js +22 -4
  251. package/dead-code-eliminator/eliminator.js.map +1 -1
  252. package/dead-code-eliminator/expression-unwrapping.js +16 -1
  253. package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
  254. package/dead-code-eliminator/imported-expression-origin.js +101 -2
  255. package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
  256. package/dead-code-eliminator/liveness/asset-side-effects.js +9 -1
  257. package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
  258. package/dead-code-eliminator/liveness/boolean-facts.js +98 -2
  259. package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
  260. package/dead-code-eliminator/liveness/external-module-resolution.js +172 -2
  261. package/dead-code-eliminator/liveness/external-module-resolution.js.map +1 -1
  262. package/dead-code-eliminator/liveness/external-purity-summary.js +294 -3
  263. package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
  264. package/dead-code-eliminator/liveness/external-purity.js +39 -3
  265. package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
  266. package/dead-code-eliminator/liveness/module-analysis.js +27 -2
  267. package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
  268. package/dead-code-eliminator/liveness/resource-retention.js +91 -1
  269. package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
  270. package/dead-code-eliminator/liveness/runtime-code.js +15 -1
  271. package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
  272. package/dead-code-eliminator/load-bundle.js +86 -5
  273. package/dead-code-eliminator/load-bundle.js.map +1 -1
  274. package/dead-code-eliminator/pure-expression.js +178 -5
  275. package/dead-code-eliminator/pure-expression.js.map +1 -1
  276. package/dead-code-eliminator/reachability/bfs-closure.js +53 -0
  277. package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
  278. package/dead-code-eliminator/reachability/binding-extractor.js +100 -2
  279. package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
  280. package/dead-code-eliminator/reachability/binding-id.js +106 -1
  281. package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
  282. package/dead-code-eliminator/reachability/identifier-target-collector.js +96 -2
  283. package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
  284. package/dead-code-eliminator/reachability/impure-statements.js +11 -2
  285. package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
  286. package/dead-code-eliminator/reachability/local-seed-gathering.js +91 -4
  287. package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
  288. package/dead-code-eliminator/reachability/reachability.js +65 -4
  289. package/dead-code-eliminator/reachability/reachability.js.map +1 -1
  290. package/dead-code-eliminator/side-effect-classifier.js +39 -4
  291. package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
  292. package/dead-code-eliminator/side-effects-field.js +23 -1
  293. package/dead-code-eliminator/side-effects-field.js.map +1 -1
  294. package/dead-code-eliminator/source-map-recomposition.js +29 -2
  295. package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
  296. package/dead-code-eliminator/statement-classifiers.js +94 -4
  297. package/dead-code-eliminator/statement-classifiers.js.map +1 -1
  298. package/dead-code-eliminator/syntax-kind-sets.js +16 -0
  299. package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
  300. package/dead-code-eliminator/transform/atom-translator.d.ts +8 -0
  301. package/dead-code-eliminator/transform/atom-translator.d.ts.map +1 -1
  302. package/dead-code-eliminator/transform/atom-translator.js +57 -2
  303. package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
  304. package/dead-code-eliminator/transform/declaration-removal.js +183 -5
  305. package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
  306. package/dead-code-eliminator/transform/declaration-remover.js +17 -2
  307. package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
  308. package/dead-code-eliminator/transform/line-index.d.ts +7 -0
  309. package/dead-code-eliminator/transform/line-index.d.ts.map +1 -1
  310. package/dead-code-eliminator/transform/line-index.js +20 -0
  311. package/dead-code-eliminator/transform/line-index.js.map +1 -1
  312. package/dead-code-eliminator/transform/named-declaration-kinds.js +3 -0
  313. package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
  314. package/dead-code-eliminator/transform/source-map-composer.js +84 -3
  315. package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
  316. package/dead-code-eliminator/variable-declaration-bindings.js +25 -1
  317. package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
  318. package/dependency-scanner/dependency-graph.d.ts +41 -0
  319. package/dependency-scanner/dependency-graph.d.ts.map +1 -0
  320. package/dependency-scanner/dependency-graph.js +77 -3
  321. package/dependency-scanner/dependency-graph.js.map +1 -1
  322. package/dependency-scanner/external-dependencies.d.ts +10 -1
  323. package/dependency-scanner/external-dependencies.d.ts.map +1 -1
  324. package/dependency-scanner/external-dependencies.js +55 -1
  325. package/dependency-scanner/external-dependencies.js.map +1 -1
  326. package/dependency-scanner/file-host-predicates.js +9 -0
  327. package/dependency-scanner/file-host-predicates.js.map +1 -1
  328. package/dependency-scanner/host-method-binding.js +18 -0
  329. package/dependency-scanner/host-method-binding.js.map +1 -1
  330. package/dependency-scanner/injected-dynamic-imports.js +232 -1
  331. package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
  332. package/dependency-scanner/node-modules-manifest-synthesizer.js +52 -4
  333. package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
  334. package/dependency-scanner/package-owned-asset-file-path.js +9 -1
  335. package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
  336. package/dependency-scanner/scanner.d.ts +20 -0
  337. package/dependency-scanner/scanner.d.ts.map +1 -0
  338. package/dependency-scanner/scanner.js +109 -4
  339. package/dependency-scanner/scanner.js.map +1 -1
  340. package/dependency-scanner/source-file-references.d.ts +37 -0
  341. package/dependency-scanner/source-file-references.d.ts.map +1 -0
  342. package/dependency-scanner/source-file-references.js +181 -6
  343. package/dependency-scanner/source-file-references.js.map +1 -1
  344. package/dependency-scanner/source-map-file-locator.d.ts +10 -0
  345. package/dependency-scanner/source-map-file-locator.d.ts.map +1 -0
  346. package/dependency-scanner/source-map-file-locator.js +66 -2
  347. package/dependency-scanner/source-map-file-locator.js.map +1 -1
  348. package/dependency-scanner/typescript-compiler-options.d.ts +8 -0
  349. package/dependency-scanner/typescript-compiler-options.d.ts.map +1 -0
  350. package/dependency-scanner/typescript-compiler-options.js +21 -1
  351. package/dependency-scanner/typescript-compiler-options.js.map +1 -1
  352. package/dependency-scanner/typescript-file-host.d.ts +12 -0
  353. package/dependency-scanner/typescript-file-host.d.ts.map +1 -0
  354. package/dependency-scanner/typescript-file-host.js +49 -5
  355. package/dependency-scanner/typescript-file-host.js.map +1 -1
  356. package/dependency-scanner/typescript-project-analyzer.d.ts +19 -0
  357. package/dependency-scanner/typescript-project-analyzer.d.ts.map +1 -0
  358. package/dependency-scanner/typescript-project-analyzer.js +35 -3
  359. package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
  360. package/dependency-scanner/virtual-package-json-host.js +45 -4
  361. package/dependency-scanner/virtual-package-json-host.js.map +1 -1
  362. package/directed-graph/graph.d.ts +1 -0
  363. package/directed-graph/graph.d.ts.map +1 -1
  364. package/directed-graph/graph.js +240 -1
  365. package/directed-graph/graph.js.map +1 -1
  366. package/file-manager/compare.js +23 -2
  367. package/file-manager/compare.js.map +1 -1
  368. package/file-manager/equal.js +5 -0
  369. package/file-manager/equal.js.map +1 -1
  370. package/file-manager/file-description.d.ts +2 -1
  371. package/file-manager/file-description.d.ts.map +1 -1
  372. package/file-manager/file-description.js +3 -0
  373. package/file-manager/file-description.js.map +1 -1
  374. package/file-manager/file-manager.d.ts +1 -1
  375. package/file-manager/file-manager.d.ts.map +1 -1
  376. package/file-manager/file-manager.js +4 -4
  377. package/file-manager/file-manager.js.map +1 -1
  378. package/file-manager/permissions.js +28 -1
  379. package/file-manager/permissions.js.map +1 -1
  380. package/git/current-git-head.d.ts +12 -0
  381. package/git/current-git-head.d.ts.map +1 -0
  382. package/git/current-git-head.js +24 -0
  383. package/git/current-git-head.js.map +1 -1
  384. package/git/git-command.js +49 -1
  385. package/git/git-command.js.map +1 -1
  386. package/linker/linked-bundle.d.ts +19 -2
  387. package/linker/linked-bundle.d.ts.map +1 -1
  388. package/linker/linked-bundle.js +5 -0
  389. package/linker/linked-bundle.js.map +1 -1
  390. package/linker/linker.d.ts +13 -0
  391. package/linker/linker.d.ts.map +1 -0
  392. package/linker/linker.js +51 -5
  393. package/linker/linker.js.map +1 -1
  394. package/linker/replacement-lookup.js +297 -8
  395. package/linker/replacement-lookup.js.map +1 -1
  396. package/linker/resource-graph.js +65 -2
  397. package/linker/resource-graph.js.map +1 -1
  398. package/linker/source-modifier/import-paths.js +76 -3
  399. package/linker/source-modifier/import-paths.js.map +1 -1
  400. package/linker/substitute-bundles.js +166 -3
  401. package/linker/substitute-bundles.js.map +1 -1
  402. package/linker/substituted-resource-graph.js +111 -2
  403. package/linker/substituted-resource-graph.js.map +1 -1
  404. package/npm-oidc-id-token-resolver.js +82 -0
  405. package/npm-oidc-id-token-resolver.js.map +1 -1
  406. package/pack-emitter/pack-emitter.d.ts +20 -0
  407. package/pack-emitter/pack-emitter.d.ts.map +1 -1
  408. package/pack-emitter/pack-emitter.js +27 -0
  409. package/pack-emitter/pack-emitter.js.map +1 -1
  410. package/package-surface/bin-field.js +8 -2
  411. package/package-surface/bin-field.js.map +1 -1
  412. package/package-surface/explicit-bin.js +24 -2
  413. package/package-surface/explicit-bin.js.map +1 -1
  414. package/package-surface/explicit-exports.js +26 -3
  415. package/package-surface/explicit-exports.js.map +1 -1
  416. package/package-surface/export-map.js +9 -2
  417. package/package-surface/export-map.js.map +1 -1
  418. package/package-surface/implicit-bin.js +25 -1
  419. package/package-surface/implicit-bin.js.map +1 -1
  420. package/package-surface/implicit-exports.js +10 -3
  421. package/package-surface/implicit-exports.js.map +1 -1
  422. package/package-surface/implicit-root-exports.js +13 -2
  423. package/package-surface/implicit-root-exports.js.map +1 -1
  424. package/package-surface/package-json-export.js +9 -0
  425. package/package-surface/package-json-export.js.map +1 -1
  426. package/package-surface/package-shape.js +10 -1
  427. package/package-surface/package-shape.js.map +1 -1
  428. package/package-surface/package-surface-index.js +165 -3
  429. package/package-surface/package-surface-index.js.map +1 -1
  430. package/package-surface/public-module-usage.js +46 -3
  431. package/package-surface/public-module-usage.js.map +1 -1
  432. package/package-surface/public-specifiers.js +7 -1
  433. package/package-surface/public-specifiers.js.map +1 -1
  434. package/package-surface/root-registry.js +26 -0
  435. package/package-surface/root-registry.js.map +1 -1
  436. package/package-surface/specifier-syntax.js +4 -0
  437. package/package-surface/specifier-syntax.js.map +1 -1
  438. package/package-surface/substitution-exports.js +101 -3
  439. package/package-surface/substitution-exports.js.map +1 -1
  440. package/package-surface/surface.d.ts +2 -0
  441. package/package-surface/surface.d.ts.map +1 -1
  442. package/package-surface/surface.js +12 -0
  443. package/package-surface/surface.js.map +1 -1
  444. package/package.json +1 -1
  445. package/packages/package-processor.composition.d.ts +22 -0
  446. package/packages/package-processor.composition.d.ts.map +1 -1
  447. package/packages/package-processor.composition.js +161 -34
  448. package/packages/package-processor.composition.js.map +1 -1
  449. package/packtory/changelog-source-attribution.js +16 -16
  450. package/packtory/changelog-source-attribution.js.map +1 -1
  451. package/packtory/map-config.d.ts +11 -1
  452. package/packtory/map-config.d.ts.map +1 -1
  453. package/packtory/map-config.js +35 -4
  454. package/packtory/map-config.js.map +1 -1
  455. package/packtory/normalize-paths.js +25 -1
  456. package/packtory/normalize-paths.js.map +1 -1
  457. package/packtory/options/bundle-dependency-resolution.js +17 -1
  458. package/packtory/options/bundle-dependency-resolution.js.map +1 -1
  459. package/packtory/options/dead-code-elimination-resolution.js +10 -1
  460. package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
  461. package/packtory/options/prepare-package-options.d.ts +13 -1
  462. package/packtory/options/prepare-package-options.d.ts.map +1 -1
  463. package/packtory/options/prepare-package-options.js +46 -5
  464. package/packtory/options/prepare-package-options.js.map +1 -1
  465. package/packtory/options/required-value-helpers.js +17 -0
  466. package/packtory/options/required-value-helpers.js.map +1 -1
  467. package/packtory/options/setting-resolvers.d.ts +17 -1
  468. package/packtory/options/setting-resolvers.d.ts.map +1 -1
  469. package/packtory/options/setting-resolvers.js +47 -3
  470. package/packtory/options/setting-resolvers.js.map +1 -1
  471. package/packtory/options/surface-resolution.js +15 -2
  472. package/packtory/options/surface-resolution.js.map +1 -1
  473. package/packtory/options/version-provider-context.js +24 -2
  474. package/packtory/options/version-provider-context.js.map +1 -1
  475. package/packtory/options/version-trigger.js +39 -2
  476. package/packtory/options/version-trigger.js.map +1 -1
  477. package/packtory/pack-output-preflight.js +60 -3
  478. package/packtory/pack-output-preflight.js.map +1 -1
  479. package/packtory/package-processor-build.js +97 -3
  480. package/packtory/package-processor-build.js.map +1 -1
  481. package/packtory/package-processor-publish-result.d.ts +3 -0
  482. package/packtory/package-processor-publish-result.d.ts.map +1 -1
  483. package/packtory/package-processor-publish.d.ts +2 -0
  484. package/packtory/package-processor-publish.d.ts.map +1 -1
  485. package/packtory/package-processor-publish.js +297 -6
  486. package/packtory/package-processor-publish.js.map +1 -1
  487. package/packtory/package-processor.d.ts +34 -0
  488. package/packtory/package-processor.d.ts.map +1 -1
  489. package/packtory/package-processor.js +10 -2
  490. package/packtory/package-processor.js.map +1 -1
  491. package/packtory/packtory-pack.js +298 -10
  492. package/packtory/packtory-pack.js.map +1 -1
  493. package/packtory/packtory-package-dependencies.js +116 -3
  494. package/packtory/packtory-package-dependencies.js.map +1 -1
  495. package/packtory/packtory-package-inspection.js +26 -5
  496. package/packtory/packtory-package-inspection.js.map +1 -1
  497. package/packtory/packtory-package-side-effects.js +64 -3
  498. package/packtory/packtory-package-side-effects.js.map +1 -1
  499. package/packtory/packtory-package-tree.js +43 -4
  500. package/packtory/packtory-package-tree.js.map +1 -1
  501. package/packtory/packtory-publish.js +17 -4
  502. package/packtory/packtory-publish.js.map +1 -1
  503. package/packtory/packtory-release-analysis.js +64 -6
  504. package/packtory/packtory-release-analysis.js.map +1 -1
  505. package/packtory/packtory-release-diff.js +48 -5
  506. package/packtory/packtory-release-diff.js.map +1 -1
  507. package/packtory/packtory-release-plan.js +87 -6
  508. package/packtory/packtory-release-plan.js.map +1 -1
  509. package/packtory/packtory-resolve.js +16 -5
  510. package/packtory/packtory-resolve.js.map +1 -1
  511. package/packtory/packtory.d.ts +28 -1
  512. package/packtory/packtory.d.ts.map +1 -1
  513. package/packtory/packtory.js +242 -13
  514. package/packtory/packtory.js.map +1 -1
  515. package/packtory/publish-failure-mapping.js +6 -0
  516. package/packtory/publish-failure-mapping.js.map +1 -1
  517. package/packtory/publish-target-preflight.js +25 -3
  518. package/packtory/publish-target-preflight.js.map +1 -1
  519. package/packtory/published-release-state.d.ts +19 -0
  520. package/packtory/published-release-state.d.ts.map +1 -1
  521. package/packtory/published-release-state.js +11 -0
  522. package/packtory/published-release-state.js.map +1 -1
  523. package/packtory/release-analysis.js +153 -5
  524. package/packtory/release-analysis.js.map +1 -1
  525. package/packtory/release-diff-failure-mapping.js +6 -0
  526. package/packtory/release-diff-failure-mapping.js.map +1 -1
  527. package/packtory/release-plan.js +135 -7
  528. package/packtory/release-plan.js.map +1 -1
  529. package/packtory/report-attachment.js +35 -2
  530. package/packtory/report-attachment.js.map +1 -1
  531. package/packtory/resolved-package.d.ts +11 -0
  532. package/packtory/resolved-package.d.ts.map +1 -1
  533. package/packtory/resolved-package.js +97 -3
  534. package/packtory/resolved-package.js.map +1 -1
  535. package/packtory/scheduler.d.ts +47 -0
  536. package/packtory/scheduler.d.ts.map +1 -1
  537. package/packtory/scheduler.js +99 -1
  538. package/packtory/scheduler.js.map +1 -1
  539. package/packtory/stages/package-analysis-stage.js +50 -2
  540. package/packtory/stages/package-analysis-stage.js.map +1 -1
  541. package/packtory/stages/package-resolution-stage.js +80 -5
  542. package/packtory/stages/package-resolution-stage.js.map +1 -1
  543. package/packtory/stages/publish-stage.js +125 -4
  544. package/packtory/stages/publish-stage.js.map +1 -1
  545. package/packtory/stages/release-diff-stage.js +84 -5
  546. package/packtory/stages/release-diff-stage.js.map +1 -1
  547. package/progress/progress-broadcaster.d.ts +1 -0
  548. package/progress/progress-broadcaster.d.ts.map +1 -1
  549. package/progress/progress-broadcaster.js +45 -0
  550. package/progress/progress-broadcaster.js.map +1 -1
  551. package/published-package/published-package.d.ts +2 -0
  552. package/published-package/published-package.d.ts.map +1 -1
  553. package/published-package/published-package.js +12 -1
  554. package/published-package/published-package.js.map +1 -1
  555. package/report/aggregator/artifact-entry-merger.js +20 -0
  556. package/report/aggregator/artifact-entry-merger.js.map +1 -1
  557. package/report/aggregator/package-report-materialization.js +75 -2
  558. package/report/aggregator/package-report-materialization.js.map +1 -1
  559. package/report/aggregator/report-aggregator.js +37 -2
  560. package/report/aggregator/report-aggregator.js.map +1 -1
  561. package/report/aggregator/report-event-handlers.js +141 -2
  562. package/report/aggregator/report-event-handlers.js.map +1 -1
  563. package/report/aggregator/report-types.d.ts +21 -0
  564. package/report/aggregator/report-types.d.ts.map +1 -1
  565. package/report/aggregator/report-types.js +3 -0
  566. package/report/aggregator/report-types.js.map +1 -1
  567. package/report/config-redactor.js +29 -3
  568. package/report/config-redactor.js.map +1 -1
  569. package/report/decorators.js +85 -0
  570. package/report/decorators.js.map +1 -1
  571. package/report/inspectors/inspect-artifact-sizes.js +34 -1
  572. package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
  573. package/report/inspectors/inspect-linker-rewrites.js +14 -1
  574. package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
  575. package/report/inspectors/inspect-package-json-provenance.js +15 -0
  576. package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
  577. package/report/inspectors/inspect-scan-results.js +15 -0
  578. package/report/inspectors/inspect-scan-results.js.map +1 -1
  579. package/report/release-diff/release-version-transition.js +18 -0
  580. package/report/release-diff/release-version-transition.js.map +1 -1
  581. package/resource-resolver/bundle-resource-lookup.js +25 -0
  582. package/resource-resolver/bundle-resource-lookup.js.map +1 -1
  583. package/resource-resolver/content.js +136 -3
  584. package/resource-resolver/content.js.map +1 -1
  585. package/resource-resolver/dependency-resolution-walker.js +73 -2
  586. package/resource-resolver/dependency-resolution-walker.js.map +1 -1
  587. package/resource-resolver/resolved-bundle.d.ts +54 -0
  588. package/resource-resolver/resolved-bundle.d.ts.map +1 -1
  589. package/resource-resolver/resolved-bundle.js +3 -0
  590. package/resource-resolver/resolved-bundle.js.map +1 -1
  591. package/resource-resolver/resource-resolve-options.d.ts +5 -0
  592. package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
  593. package/resource-resolver/resource-resolve-options.js +13 -1
  594. package/resource-resolver/resource-resolve-options.js.map +1 -1
  595. package/resource-resolver/resource-resolver.d.ts +15 -0
  596. package/resource-resolver/resource-resolver.d.ts.map +1 -0
  597. package/resource-resolver/resource-resolver.js +128 -5
  598. package/resource-resolver/resource-resolver.js.map +1 -1
  599. package/sbom/extract-license.js +11 -1
  600. package/sbom/extract-license.js.map +1 -1
  601. package/sbom/license-resolver.d.ts +14 -0
  602. package/sbom/license-resolver.d.ts.map +1 -0
  603. package/sbom/license-resolver.js +23 -2
  604. package/sbom/license-resolver.js.map +1 -1
  605. package/sbom/sbom-builder.js +57 -2
  606. package/sbom/sbom-builder.js.map +1 -1
  607. package/sbom/sbom-canonicalizer.js +45 -3
  608. package/sbom/sbom-canonicalizer.js.map +1 -1
  609. package/sbom/sbom-file.d.ts +10 -0
  610. package/sbom/sbom-file.d.ts.map +1 -1
  611. package/sbom/sbom-file.js +54 -5
  612. package/sbom/sbom-file.js.map +1 -1
  613. package/sbom/sbom-serializer.d.ts +8 -0
  614. package/sbom/sbom-serializer.d.ts.map +1 -0
  615. package/sbom/sbom-serializer.js +14 -1
  616. package/sbom/sbom-serializer.js.map +1 -1
  617. package/sbom/tool-version.js +49 -1
  618. package/sbom/tool-version.js.map +1 -1
  619. package/sbom.cdx.json +5 -5
  620. package/tar/extract-tar.js +83 -3
  621. package/tar/extract-tar.js.map +1 -1
  622. package/tar/gzipped-pack.js +20 -0
  623. package/tar/gzipped-pack.js.map +1 -1
  624. package/tar/tarball-builder.d.ts +14 -0
  625. package/tar/tarball-builder.d.ts.map +1 -0
  626. package/tar/tarball-builder.js +44 -4
  627. package/tar/tarball-builder.js.map +1 -1
  628. package/vendor-materializer/vendor-entry.d.ts +12 -0
  629. package/vendor-materializer/vendor-entry.d.ts.map +1 -0
  630. package/vendor-materializer/vendor-entry.js +20 -1
  631. package/vendor-materializer/vendor-entry.js.map +1 -1
  632. package/vendor-materializer/vendor-materializer.d.ts +55 -0
  633. package/vendor-materializer/vendor-materializer.d.ts.map +1 -0
  634. package/vendor-materializer/vendor-materializer.js +240 -8
  635. package/vendor-materializer/vendor-materializer.js.map +1 -1
  636. package/version-manager/dependencies/bundle-dependency-grouping.js +32 -2
  637. package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
  638. package/version-manager/dependencies/dependency-groups.js +11 -1
  639. package/version-manager/dependencies/dependency-groups.js.map +1 -1
  640. package/version-manager/dependencies/external-dependency-classification.js +82 -3
  641. package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
  642. package/version-manager/dependencies/versioned-bundle-dependencies.js +8 -3
  643. package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
  644. package/version-manager/imports/hash-import-scanner.js +20 -2
  645. package/version-manager/imports/hash-import-scanner.js.map +1 -1
  646. package/version-manager/imports/imports-key-matcher.js +22 -0
  647. package/version-manager/imports/imports-key-matcher.js.map +1 -1
  648. package/version-manager/imports/versioned-bundle-imports.js +44 -2
  649. package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
  650. package/version-manager/manager.d.ts +5 -0
  651. package/version-manager/manager.d.ts.map +1 -1
  652. package/version-manager/manager.js +46 -6
  653. package/version-manager/manager.js.map +1 -1
  654. package/version-manager/manifest/builder.js +51 -1
  655. package/version-manager/manifest/builder.js.map +1 -1
  656. package/version-manager/manifest/serialize.js +8 -1
  657. package/version-manager/manifest/serialize.js.map +1 -1
  658. package/version-manager/optional-bundle-fields.js +5 -1
  659. package/version-manager/optional-bundle-fields.js.map +1 -1
  660. package/version-manager/representative-root.js +9 -1
  661. package/version-manager/representative-root.js.map +1 -1
  662. package/version-manager/specifier-classifier.js +42 -2
  663. package/version-manager/specifier-classifier.js.map +1 -1
  664. package/version-manager/specifier-errors.js +58 -0
  665. package/version-manager/specifier-errors.js.map +1 -1
  666. package/version-manager/versioned-bundle.d.ts +3 -1
  667. package/version-manager/versioned-bundle.d.ts.map +1 -1
  668. package/version-manager/versioned-bundle.js +31 -6
  669. package/version-manager/versioned-bundle.js.map +1 -1
  670. package/zip/zip-builder.d.ts +22 -0
  671. package/zip/zip-builder.d.ts.map +1 -0
  672. package/zip/zip-builder.js +81 -2
  673. package/zip/zip-builder.js.map +1 -1
@@ -1,3 +1,51 @@
1
1
  /// <reference lib="es2024.promise" />
2
- import 'node:child_process';
2
+ import { execFile } from 'node:child_process';
3
+ function toGitCommandError(error) {
4
+ return error instanceof Error ? error : new Error('Git command failed');
5
+ }
6
+ function toGitCommandResult(result) {
7
+ const stdoutText = String(result.stdout);
8
+ const stderrText = String(result.stderr);
9
+ return { stdout: stdoutText, stderr: stderrText };
10
+ }
11
+ export function createGitCommandRunner(executeGitCommand) {
12
+ return async function (command, commandArguments) {
13
+ try {
14
+ return toGitCommandResult(await executeGitCommand(command, Array.from(commandArguments)));
15
+ }
16
+ catch (error) {
17
+ throw toGitCommandError(error);
18
+ }
19
+ };
20
+ }
21
+ function reportExecFileResult(deferred, error, stdout, stderr) {
22
+ if (error === null) {
23
+ deferred.resolve({ stdout, stderr });
24
+ return;
25
+ }
26
+ deferred.reject(error);
27
+ }
28
+ function* gitCommandCompletionSignals(output, closed) {
29
+ yield output.promise;
30
+ yield closed.promise;
31
+ }
32
+ async function runUntilOutputOrClose(output, closed) {
33
+ return await Promise.race(gitCommandCompletionSignals(output, closed));
34
+ }
35
+ export function createChildProcessGitCommandExecutor(spawnGitCommand) {
36
+ return async function (command, commandArguments) {
37
+ const output = Promise.withResolvers();
38
+ const closed = Promise.withResolvers();
39
+ const callback = function (error, stdout, stderr) {
40
+ reportExecFileResult(output, error, stdout, stderr);
41
+ };
42
+ const rejectClosedChildProcess = closed.reject.bind(undefined, new Error('Child process closed before reporting output'));
43
+ const childProcess = spawnGitCommand(command, Array.from(commandArguments), callback);
44
+ childProcess.once('close', rejectClosedChildProcess);
45
+ return await runUntilOutputOrClose(output, closed);
46
+ };
47
+ }
48
+ export function spawnChildProcessGitCommand(command, commandArguments, callback) {
49
+ return execFile(command, Array.from(commandArguments), callback);
50
+ }
3
51
  //# sourceMappingURL=git-command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"git-command.js","sourceRoot":"","sources":["../../../../source/git/git-command.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAiD,oBAAoB,CAAC"}
1
+ {"version":3,"file":"git-command.js","sourceRoot":"","sources":["../../../../source/git/git-command.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAA0B,MAAM,oBAAoB,CAAC;AA8BtE,SAAS,iBAAiB,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAgC;IACxD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,iBAAqC;IACxE,OAAO,KAAK,WAAW,OAAO,EAAE,gBAAgB;QAC5C,IAAI,CAAC;YACD,OAAO,kBAAkB,CAAC,MAAM,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC9F,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACL,CAAC,CAAC;AACN,CAAC;AAED,SAAS,oBAAoB,CACzB,QAA4C,EAC5C,KAAyC,EACzC,MAAiC,EACjC,MAAiC;IAEjC,IAAI,KAAK,KAAK,IAAI,EAAE,CAA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OAAe,EACf,gBAAmC,EACnC,QAA0B;IAE1B,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { ExternalDependencies } from '../dependency-scanner/external-dependencies.ts';
2
2
  import type { SourceMapTransform } from '../dead-code-eliminator/transform/atom-translator.ts';
3
+ import type { TransferableFileDescription } from '../file-manager/file-description.ts';
3
4
  import type { PackageSurface } from '../package-surface/surface.ts';
4
5
  import type { BundleResource, RootFileDescription } from '../resource-resolver/resolved-bundle.ts';
5
6
  export type LinkedBundleResource = BundleResource & {
@@ -12,10 +13,26 @@ export type LinkedBundle = {
12
13
  readonly surface: PackageSurface;
13
14
  readonly exportPackageJson?: true | undefined;
14
15
  readonly linkedBundleDependencies: ExternalDependencies;
15
- readonly substitutedSourceFilePathsByPackageName: ReadonlyMap<string, ReadonlySet<string>>;
16
+ readonly substitutedInputFilePathsByPackageName: ReadonlyMap<string, ReadonlySet<string>>;
16
17
  readonly sourceMapTransformsByTargetPath: ReadonlyMap<string, readonly SourceMapTransform[]>;
17
18
  readonly externalDependencies: ExternalDependencies;
18
19
  };
19
- export type BundleSubstitutionSource = Pick<LinkedBundle, 'contents' | 'name' | 'roots' | 'surface'>;
20
+ export type BundleSubstitutionSource = {
21
+ readonly contents: readonly {
22
+ readonly directDependencies: ReadonlySet<string>;
23
+ readonly fileDescription: TransferableFileDescription;
24
+ }[];
25
+ readonly name: string;
26
+ readonly roots: Readonly<Record<string, RootFileDescription>>;
27
+ readonly surface: PackageSurface;
28
+ };
29
+ type BundleWithContents<TResource extends {
30
+ readonly isSubstituted: boolean;
31
+ }> = {
32
+ readonly contents: readonly TResource[];
33
+ };
34
+ export declare function getSubstitutedResources<TResource extends {
35
+ readonly isSubstituted: boolean;
36
+ }>(bundle: BundleWithContents<TResource>): readonly TResource[];
20
37
  export {};
21
38
  //# sourceMappingURL=linked-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,MAAM,CAAC,CAAC;QACjD,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;KACzD,EAAE,CAAC;IACJ,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CACpC,CAAC;AACF,KAAK,kBAAkB,CAAC,SAAS,SAAS;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAAE,IAAI;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,SAAS,SAAS;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAAE,EAC1F,MAAM,EAAE,kBAAkB,CAAC,SAAS,CAAC,GACtC,SAAS,SAAS,EAAE,CAItB"}
@@ -1 +1,6 @@
1
+ export function getSubstitutedResources(bundle) {
2
+ return bundle.contents.filter(function (resource) {
3
+ return resource.isSubstituted;
4
+ });
5
+ }
1
6
  //# sourceMappingURL=linked-bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linked-bundle.js","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"linked-bundle.js","sourceRoot":"","sources":["../../../../source/linker/linked-bundle.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,uBAAuB,CACnC,MAAqC;IAErC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,QAAQ;QAC5C,OAAO,QAAQ,CAAC,aAAa,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ResolvedBundle } from '../resource-resolver/resolved-bundle.ts';
2
+ import type { BundleSubstitutionSource, LinkedBundle } from './linked-bundle.ts';
3
+ type LinkBundleOptions = {
4
+ readonly bundle: ResolvedBundle;
5
+ readonly bundleDependencies: readonly BundleSubstitutionSource[];
6
+ readonly bundlePeerDependencies: readonly BundleSubstitutionSource[];
7
+ };
8
+ export type BundleLinker = {
9
+ linkBundle: (options: LinkBundleOptions) => Promise<LinkedBundle>;
10
+ };
11
+ export declare function createBundleLinker(): BundleLinker;
12
+ export {};
13
+ //# sourceMappingURL=linker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../../../source/linker/linker.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGtG,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIjF,KAAK,iBAAiB,GAAG;IACrB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACjE,QAAQ,CAAC,sBAAsB,EAAE,SAAS,wBAAwB,EAAE,CAAC;CACxE,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACrE,CAAC;AA4CF,wBAAgB,kBAAkB,IAAI,YAAY,CAiBjD"}
package/linker/linker.js CHANGED
@@ -1,6 +1,52 @@
1
- import "../resource-resolver/resolved-bundle.js";
2
- import "../common/declaration-companion-paths.js";
3
- import "./substitute-bundles.js";
4
- import "./resource-graph.js";
5
- import "./replacement-lookup.js";
1
+ import { rootHasDeclarationFile } from "../resource-resolver/resolved-bundle.js";
2
+ import { declarationCompanionCandidates } from "../common/declaration-companion-paths.js";
3
+ import { substituteDependencies } from "./substitute-bundles.js";
4
+ import { createGraphFromResolvedBundle } from "./resource-graph.js";
5
+ import { ownsSourcePath } from "./replacement-lookup.js";
6
+ function flattenRoots(roots) {
7
+ return Object.values(roots).flatMap(function (root) {
8
+ if (rootHasDeclarationFile(root)) {
9
+ return [root.js.inputFilePath, root.declarationFile.inputFilePath];
10
+ }
11
+ return [root.js.inputFilePath];
12
+ });
13
+ }
14
+ function isSubstitutedBundleSourcePath(inputFilePath, bundleDependencies) {
15
+ return bundleDependencies.some(function (bundleDependency) {
16
+ return ownsSourcePath(inputFilePath, bundleDependency);
17
+ });
18
+ }
19
+ function declarationCompanionRoots(contents, bundleDependencies) {
20
+ const inputFilePaths = new Set(contents.map(function (content) {
21
+ return content.fileDescription.inputFilePath;
22
+ }));
23
+ return contents.flatMap(function (content) {
24
+ if (isSubstitutedBundleSourcePath(content.fileDescription.inputFilePath, bundleDependencies)) {
25
+ return [];
26
+ }
27
+ return declarationCompanionCandidates(content.fileDescription.inputFilePath).filter(function (candidate) {
28
+ return inputFilePaths.has(candidate) && !isSubstitutedBundleSourcePath(candidate, bundleDependencies);
29
+ });
30
+ });
31
+ }
32
+ function flattenRootFilePaths(bundle, bundleDependencies) {
33
+ return [...flattenRoots(bundle.roots), ...declarationCompanionRoots(bundle.contents, bundleDependencies)];
34
+ }
35
+ export function createBundleLinker() {
36
+ return {
37
+ async linkBundle(options) {
38
+ const { bundle, bundleDependencies, bundlePeerDependencies } = options;
39
+ const substitutionSources = [...bundleDependencies, ...bundlePeerDependencies];
40
+ const resourceGraph = createGraphFromResolvedBundle(bundle);
41
+ const substitutedGraph = substituteDependencies(resourceGraph, bundleDependencies, bundlePeerDependencies);
42
+ return {
43
+ ...substitutedGraph.flatten(flattenRootFilePaths(bundle, substitutionSources)),
44
+ name: bundle.name,
45
+ exportPackageJson: bundle.exportPackageJson,
46
+ roots: bundle.roots,
47
+ surface: bundle.surface
48
+ };
49
+ }
50
+ };
51
+ }
6
52
  //# sourceMappingURL=linker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linker.js","sourceRoot":"","sources":["../../../../source/linker/linker.ts"],"names":[],"mappings":"AAAA,OAA4D,yCAAyC,CAAC;AACtG,OA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,OAAO;aAC1B,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -1,9 +1,298 @@
1
- import 'node:path';
2
- import 'ts-morph';
3
- import "../common/declaration-companion-paths.js";
4
- import "../dead-code-eliminator/reachability/bfs-closure.js";
5
- import "../package-surface/package-surface-index.js";
6
- import "../package-surface/public-specifiers.js";
7
- import "../package-surface/root-registry.js";
8
- import "../package-surface/specifier-syntax.js";
1
+ import path from 'node:path';
2
+ import { ts as typescript } from 'ts-morph';
3
+ import { declarationCompanionCandidates, isDeclarationCompanionFilePath } from "../common/declaration-companion-paths.js";
4
+ import { bfsClosure } from "../dead-code-eliminator/reachability/bfs-closure.js";
5
+ import { rootInputFilePaths } from "../package-surface/package-surface-index.js";
6
+ import { getPublicModuleSpecifierForSourcePath } from "../package-surface/public-specifiers.js";
7
+ import { getRoot } from "../package-surface/root-registry.js";
8
+ import { toPackageSpecifier } from "../package-surface/specifier-syntax.js";
9
+ export function ownsSourcePath(file, bundle) {
10
+ return bundle.contents.some(function (content) {
11
+ return content.fileDescription.inputFilePath === file;
12
+ });
13
+ }
14
+ function needsImportReplacement(file) {
15
+ return !file.endsWith('.map');
16
+ }
17
+ function isDefined(value) {
18
+ return value !== undefined;
19
+ }
20
+ function createContentLookup(bundle) {
21
+ const contentBySourcePath = new Map();
22
+ const sourcePathByTargetPath = new Map();
23
+ for (const content of bundle.contents) {
24
+ contentBySourcePath.set(content.fileDescription.inputFilePath, content);
25
+ sourcePathByTargetPath.set(content.fileDescription.targetFilePath, content.fileDescription.inputFilePath);
26
+ }
27
+ return { contentBySourcePath, sourcePathByTargetPath };
28
+ }
29
+ function exportDeclaration(statement) {
30
+ if (!typescript.isExportDeclaration(statement)) {
31
+ return undefined;
32
+ }
33
+ return statement;
34
+ }
35
+ function moduleSpecifierText(statement) {
36
+ const { moduleSpecifier } = statement;
37
+ if (moduleSpecifier === undefined) {
38
+ return undefined;
39
+ }
40
+ if (!typescript.isStringLiteral(moduleSpecifier) || !moduleSpecifier.text.startsWith('.')) {
41
+ return undefined;
42
+ }
43
+ return moduleSpecifier.text;
44
+ }
45
+ function exportDeclarations(content) {
46
+ const sourceFile = typescript.createSourceFile(content, content, typescript.ScriptTarget.Latest);
47
+ return sourceFile
48
+ .statements
49
+ .map(exportDeclaration)
50
+ .filter(isDefined);
51
+ }
52
+ function exportedTargetPath(currentTargetFilePath, specifier) {
53
+ return path.posix.normalize(path.posix.join(path.posix.dirname(currentTargetFilePath), specifier));
54
+ }
55
+ function exportedInputFilePaths(lookup, currentTargetFilePath, specifier) {
56
+ const targetPath = exportedTargetPath(currentTargetFilePath, specifier);
57
+ const inputFilePaths = [];
58
+ for (const candidate of [targetPath, ...declarationCompanionCandidates(targetPath)]) {
59
+ for (const [targetFilePath, inputFilePath] of lookup.sourcePathByTargetPath) {
60
+ if (targetFilePath === candidate) {
61
+ inputFilePaths.push(inputFilePath);
62
+ }
63
+ }
64
+ }
65
+ return inputFilePaths;
66
+ }
67
+ function namedExports(declaration) {
68
+ const { exportClause } = declaration;
69
+ if (exportClause === undefined || !typescript.isNamedExports(exportClause)) {
70
+ return [];
71
+ }
72
+ return Array.from(exportClause.elements);
73
+ }
74
+ function isExportStar(declaration) {
75
+ return declaration.exportClause === undefined;
76
+ }
77
+ function declarationInputFilePaths(lookup, currentTargetFilePath, declaration) {
78
+ return exportedInputFilePaths(lookup, currentTargetFilePath, moduleSpecifierText(declaration) ?? '');
79
+ }
80
+ const pathClosureDependencies = {
81
+ visitedHas(visited, value) {
82
+ return visited.has(value);
83
+ },
84
+ neighborAdded: undefined
85
+ };
86
+ function exportStateValue(value, property) {
87
+ return Reflect.get(new Object(value), property);
88
+ }
89
+ function inputFilePathForState(state) {
90
+ return state.inputFilePath;
91
+ }
92
+ const exportClosureDependencies = {
93
+ visitedHas(visited, value) {
94
+ return Array.from(visited).some(function (state) {
95
+ return exportStateValue(state, 'inputFilePath') === exportStateValue(value, 'inputFilePath') &&
96
+ exportStateValue(state, 'exportName') === exportStateValue(value, 'exportName');
97
+ });
98
+ },
99
+ neighborAdded: undefined
100
+ };
101
+ function exportedStateNames(lookup, state) {
102
+ const content = lookup.contentBySourcePath.get(inputFilePathForState(state));
103
+ if (content === undefined) {
104
+ return Array.from(new Set());
105
+ }
106
+ return exportDeclarations(content.fileDescription.content).flatMap(function (declaration) {
107
+ const inputFilePaths = declarationInputFilePaths(lookup, content.fileDescription.targetFilePath, declaration);
108
+ const exportStarStates = inputFilePaths
109
+ .filter(function () {
110
+ return state.exportName !== 'default' && isExportStar(declaration);
111
+ })
112
+ .map(function (nextInputFilePath) {
113
+ return { inputFilePath: nextInputFilePath, exportName: state.exportName };
114
+ });
115
+ const namedExportStates = namedExports(declaration)
116
+ .filter(function (namedExport) {
117
+ return namedExport.name.text === state.exportName;
118
+ })
119
+ .flatMap(function (namedExport) {
120
+ const sourceExportName = namedExport.propertyName?.text ?? namedExport.name.text;
121
+ return inputFilePaths.map(function (nextInputFilePath) {
122
+ return { inputFilePath: nextInputFilePath, exportName: sourceExportName };
123
+ });
124
+ });
125
+ return [...exportStarStates, ...namedExportStates];
126
+ });
127
+ }
128
+ function publicModuleCanExport(rootInputFilePathsForModule, lookup, request, exportName) {
129
+ const closure = bfsClosure(rootInputFilePathsForModule.map(function (inputFilePath) {
130
+ return { inputFilePath, exportName };
131
+ }), function (state) {
132
+ return exportedStateNames(lookup, state);
133
+ }, new Set(), { dependencies: exportClosureDependencies, maximumNodeCount: lookup.contentBySourcePath.size });
134
+ return Array.from(closure).some(function (state) {
135
+ return inputFilePathForState(state) === request.inputFilePath;
136
+ });
137
+ }
138
+ function publicModuleReachesSourceFile(rootInputFilePathsForModule, lookup, request) {
139
+ const closure = bfsClosure(rootInputFilePathsForModule, function (inputFilePath) {
140
+ const content = lookup.contentBySourcePath.get(inputFilePath);
141
+ return content === undefined
142
+ ? new Array()
143
+ : exportDeclarations(content.fileDescription.content).flatMap(function (declaration) {
144
+ return declarationInputFilePaths(lookup, content.fileDescription.targetFilePath, declaration);
145
+ });
146
+ }, new Set(), { dependencies: pathClosureDependencies, maximumNodeCount: lookup.contentBySourcePath.size });
147
+ return closure.has(request.inputFilePath);
148
+ }
149
+ function publicModuleCanSatisfyRequest(rootInputFilePathsForModule, lookup, request) {
150
+ if (request.requiredExportNames.size === 0 && !request.requiresNamespaceExport) {
151
+ return publicModuleReachesSourceFile(rootInputFilePathsForModule, lookup, request);
152
+ }
153
+ for (const exportName of request.requiredExportNames) {
154
+ if (!publicModuleCanExport(rootInputFilePathsForModule, lookup, request, exportName)) {
155
+ return false;
156
+ }
157
+ }
158
+ if (!request.requiresNamespaceExport) {
159
+ return true;
160
+ }
161
+ return publicModuleCanExport(rootInputFilePathsForModule, lookup, request, undefined);
162
+ }
163
+ function shortestSpecifier(specifiers) {
164
+ const [specifier] = specifiers.toSorted(function (left, right) {
165
+ return left.length - right.length;
166
+ });
167
+ return specifier;
168
+ }
169
+ function getExplicitPublicModuleSpecifierForSourcePath(bundle, surface, request) {
170
+ const lookup = createContentLookup(bundle);
171
+ const specifiers = [];
172
+ const moduleEntries = surface.packageInterface.modules ?? [];
173
+ for (const moduleEntry of moduleEntries) {
174
+ const root = getRoot(bundle, moduleEntry.root);
175
+ const rootPaths = rootInputFilePaths(root);
176
+ const candidate = toPackageSpecifier(bundle.name, moduleEntry.export);
177
+ if (publicModuleCanSatisfyRequest(rootPaths, lookup, request)) {
178
+ specifiers.push(candidate);
179
+ }
180
+ }
181
+ return shortestSpecifier(specifiers);
182
+ }
183
+ function getImplicitPublicModuleSpecifierForSourcePath(bundle, surface, request) {
184
+ const lookup = createContentLookup(bundle);
185
+ const specifiers = [];
186
+ const defaultRoot = getRoot(bundle, surface.defaultModuleRoot);
187
+ if (publicModuleCanSatisfyRequest(rootInputFilePaths(defaultRoot), lookup, request)) {
188
+ specifiers.push(bundle.name);
189
+ }
190
+ for (const root of Object.values(bundle.roots)) {
191
+ const candidate = toPackageSpecifier(bundle.name, `./${root.js.targetFilePath}`);
192
+ if (publicModuleCanSatisfyRequest(rootInputFilePaths(root), lookup, request)) {
193
+ specifiers.push(candidate);
194
+ }
195
+ }
196
+ return shortestSpecifier(specifiers) ?? getPublicModuleSpecifierForSourcePath(bundle, request.inputFilePath);
197
+ }
198
+ function getExistingPublicModuleSpecifierForSourcePath(bundle, request) {
199
+ const { surface } = bundle;
200
+ if (surface.mode === 'implicit') {
201
+ return getImplicitPublicModuleSpecifierForSourcePath(bundle, surface, request);
202
+ }
203
+ return getExplicitPublicModuleSpecifierForSourcePath(bundle, surface, request);
204
+ }
205
+ function findReplacementInBundles(request, bundles, getTargetPath) {
206
+ for (const bundle of bundles) {
207
+ const targetPath = getTargetPath(bundle, request);
208
+ if (targetPath !== undefined) {
209
+ return {
210
+ bundle,
211
+ replacement: {
212
+ emittedSpecifier: targetPath,
213
+ packageName: bundle.name
214
+ }
215
+ };
216
+ }
217
+ if (needsImportReplacement(request.inputFilePath) && ownsSourcePath(request.inputFilePath, bundle)) {
218
+ throw new Error(`Package "${bundle.name}" does not expose "${request.inputFilePath}" for cross-package substitution`);
219
+ }
220
+ }
221
+ return undefined;
222
+ }
223
+ function findReplacement(request, bundleDependencies, bundlePeerDependencies) {
224
+ const dependencyReplacement = findReplacementInBundles(request, bundleDependencies, function (bundle, replacementRequest) {
225
+ return getPublicModuleSpecifierForSourcePath(bundle, replacementRequest.inputFilePath);
226
+ });
227
+ if (dependencyReplacement !== undefined) {
228
+ return dependencyReplacement;
229
+ }
230
+ return findReplacementInBundles(request, bundlePeerDependencies, getExistingPublicModuleSpecifierForSourcePath);
231
+ }
232
+ function withSubstitutedSourcePath(substitutedInputFilePathsByPackageName, packageName, file) {
233
+ const existing = substitutedInputFilePathsByPackageName.get(packageName) ?? [];
234
+ const updated = new Map(substitutedInputFilePathsByPackageName);
235
+ updated.set(packageName, new Set([...existing, file]));
236
+ return updated;
237
+ }
238
+ function contentWithInputFilePath(bundle, inputFilePath) {
239
+ return bundle.contents.find(function (content) {
240
+ return content.fileDescription.inputFilePath === inputFilePath;
241
+ });
242
+ }
243
+ function runtimeInputFilePathForDeclaration(bundle, declarationContent) {
244
+ const runtimeContent = bundle.contents.find(function (content) {
245
+ return declarationCompanionCandidates(content.fileDescription.targetFilePath)
246
+ .includes(declarationContent.fileDescription.targetFilePath);
247
+ });
248
+ return runtimeContent?.fileDescription.inputFilePath;
249
+ }
250
+ function substitutedInputFilePathsFor(bundle, file) {
251
+ const content = contentWithInputFilePath(bundle, file);
252
+ if (content === undefined || !isDeclarationCompanionFilePath(content.fileDescription.targetFilePath)) {
253
+ return declarationCompanionCandidates(file).length === 0
254
+ ? []
255
+ : [
256
+ file
257
+ ];
258
+ }
259
+ const runtimeInputFilePath = runtimeInputFilePathForDeclaration(bundle, content);
260
+ if (runtimeInputFilePath === undefined) {
261
+ return [
262
+ file
263
+ ];
264
+ }
265
+ return [
266
+ runtimeInputFilePath,
267
+ file
268
+ ];
269
+ }
270
+ function withSubstitutedSourcePaths(substitutedInputFilePathsByPackageName, match, request) {
271
+ let updated = substitutedInputFilePathsByPackageName;
272
+ for (const inputFilePath of substitutedInputFilePathsFor(match.bundle, request.inputFilePath)) {
273
+ updated = withSubstitutedSourcePath(updated, match.replacement.packageName, inputFilePath);
274
+ }
275
+ return updated;
276
+ }
277
+ export function findAllPathReplacements(requests, bundleDependencies, bundlePeerDependencies) {
278
+ const importPathReplacements = new Map();
279
+ const matchedBundleDependencies = [];
280
+ let substitutedInputFilePathsByPackageName = new Map();
281
+ function recordReplacement(match, request) {
282
+ importPathReplacements.set(request.inputFilePath, match.replacement);
283
+ matchedBundleDependencies.push(match.replacement.packageName);
284
+ substitutedInputFilePathsByPackageName = withSubstitutedSourcePaths(substitutedInputFilePathsByPackageName, match, request);
285
+ }
286
+ for (const request of requests) {
287
+ const replacement = findReplacement(request, bundleDependencies, bundlePeerDependencies);
288
+ if (replacement !== undefined) {
289
+ recordReplacement(replacement, request);
290
+ }
291
+ }
292
+ return {
293
+ importPathReplacements,
294
+ bundleDependencies: matchedBundleDependencies,
295
+ substitutedInputFilePathsByPackageName
296
+ };
297
+ }
9
298
  //# sourceMappingURL=replacement-lookup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"replacement-lookup.js","sourceRoot":"","sources":["../../../../source/linker/replacement-lookup.ts"],"names":[],"mappings":"AAAA,OAAiB,WAAW,CAAC;AAC7B,OAAiC,UAAU,CAAC;AAC5C,OAGO,0CAA0C,CAAC;AAClD,OAAwD,qDAAqD,CAAC;AAE9G,OAAoC,6CAA6C,CAAC;AAClF,OAAsD,yCAAyC,CAAC;AAChG,OAAwB,qCAAqC,CAAC;AAC9D,OAAmC,wCAAwC,CAAC"}
1
+ {"version":3,"file":"replacement-lookup.js","sourceRoot":"","sources":["../../../../source/linker/replacement-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,EAAE,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACH,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,UAAU,EAA+B,MAAM,qDAAqD,CAAC;AAE9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,qCAAqC,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAyB5E,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAgC;IACzE,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,OAAO;QACzC,OAAO,OAAO,CAAC,eAAe,CAAC,aAAa,KAAK,IAAI,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY;IACxC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAOD,SAAS,S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,GAAG,eAAe,CAAC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;QACzF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC5B,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAED,OAAO;QACH,sBAAsB;QACtB,kBAAkB,EAAE,yBAAyB;QAC7C,sCAAsC;KACzC,CAAC;AACN,CAAC"}
@@ -1,3 +1,66 @@
1
- import 'remeda';
2
- import "../directed-graph/graph.js";
1
+ import { flatMap, pipe } from 'remeda';
2
+ import { createDirectedGraph } from "../directed-graph/graph.js";
3
+ function collectResourceSpecificExternalDependencies(resource, externalDependencies) {
4
+ return pipe(Array.from(externalDependencies.values()), flatMap(function (dependency) {
5
+ const references = dependency.references?.filter(function (reference) {
6
+ return reference.targetFilePath === resource.fileDescription.targetFilePath;
7
+ });
8
+ if (references !== undefined) {
9
+ return references.map(function (reference) {
10
+ return {
11
+ name: dependency.name,
12
+ sourceSpecifier: reference.sourceSpecifier,
13
+ emittedSpecifier: reference.emittedSpecifier
14
+ };
15
+ });
16
+ }
17
+ if (dependency.referencedFrom.includes(resource.fileDescription.targetFilePath)) {
18
+ return [{
19
+ name: dependency.name,
20
+ sourceSpecifier: dependency.name,
21
+ emittedSpecifier: dependency.name
22
+ }];
23
+ }
24
+ return [];
25
+ }));
26
+ }
27
+ function targetPathIndexes(bundle) {
28
+ const inputFilePathByTargetFilePath = new Map();
29
+ const targetFilePathByInputFilePath = new Map();
30
+ for (const resource of bundle.contents) {
31
+ inputFilePathByTargetFilePath.set(resource.fileDescription.targetFilePath, resource.fileDescription.inputFilePath);
32
+ targetFilePathByInputFilePath.set(resource.fileDescription.inputFilePath, resource.fileDescription.targetFilePath);
33
+ }
34
+ return { inputFilePathByTargetFilePath, targetFilePathByInputFilePath };
35
+ }
36
+ function addResourceNodes(graph, bundle) {
37
+ for (const resource of bundle.contents) {
38
+ const externalDependencies = collectResourceSpecificExternalDependencies(resource, bundle.externalDependencies);
39
+ graph.addNode(resource.fileDescription.inputFilePath, {
40
+ fileDescription: resource.fileDescription,
41
+ moduleReferences: resource.moduleReferences,
42
+ externalDependencies,
43
+ project: resource.project,
44
+ isExplicitlyIncluded: resource.isExplicitlyIncluded,
45
+ ...resource.isGeneratedManifest ? { isGeneratedManifest: true } : {}
46
+ });
47
+ }
48
+ }
49
+ function connectDirectDependencies(graph, bundle) {
50
+ for (const resource of bundle.contents) {
51
+ for (const directDependency of resource.directDependencies) {
52
+ const inputFilePath = graph.inputFilePathByTargetFilePath.get(directDependency);
53
+ if (inputFilePath !== undefined) {
54
+ graph.connect({ from: resource.fileDescription.inputFilePath, to: inputFilePath });
55
+ }
56
+ }
57
+ }
58
+ }
59
+ export function createGraphFromResolvedBundle(bundle) {
60
+ const indexes = targetPathIndexes(bundle);
61
+ const graph = Object.assign(createDirectedGraph(), indexes);
62
+ addResourceNodes(graph, bundle);
63
+ connectDirectDependencies(graph, bundle);
64
+ return graph;
65
+ }
3
66
  //# sourceMappingURL=resource-graph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource-graph.js","sourceRoot":"","sources":["../../../../source/linker/resource-graph.ts"],"names":[],"mappings":"AACA,OAAsC,QAAQ,CAAC;AAK/C,OAAwD,4BAA4B,CAAC"}
1
+ {"version":3,"file":"resource-graph.js","sourceRoot":"","sources":["../../../../source/linker/resource-graph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAKvC,OAAO,EAAsB,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAkBrF,SAAS,2CAA2C,CAChD,QAAwB,EACxB,oBAA0C;IAE1C,OAAO,IAAI,CACP,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,EACzC,OAAO,CAAC,UAAU,UAAU;QACxB,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,SA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