packtory 0.0.91 → 0.0.93

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 (650) hide show
  1. package/artifacts/artifacts-builder.js +4 -37
  2. package/artifacts/artifacts-builder.js.map +1 -1
  3. package/artifacts/content-collection.js +2 -59
  4. package/artifacts/content-collection.js.map +1 -1
  5. package/artifacts/folder-writer.js +2 -25
  6. package/artifacts/folder-writer.js.map +1 -1
  7. package/bundle-emitter/emitter.d.ts +0 -8
  8. package/bundle-emitter/emitter.d.ts.map +1 -1
  9. package/bundle-emitter/emitter.js +6 -106
  10. package/bundle-emitter/emitter.js.map +1 -1
  11. package/bundle-emitter/extract-package-tarball.js +2 -13
  12. package/bundle-emitter/extract-package-tarball.js.map +1 -1
  13. package/bundle-emitter/fetch-published-artifacts.js +2 -16
  14. package/bundle-emitter/fetch-published-artifacts.js.map +1 -1
  15. package/bundle-emitter/publication-outcome.d.ts +0 -3
  16. package/bundle-emitter/publication-outcome.d.ts.map +1 -1
  17. package/bundle-emitter/publication-outcome.js +0 -5
  18. package/bundle-emitter/publication-outcome.js.map +1 -1
  19. package/bundle-emitter/publish-error/auto-mode-error-matching.js +2 -28
  20. package/bundle-emitter/publish-error/auto-mode-error-matching.js.map +1 -1
  21. package/bundle-emitter/publish-error/error-shape-helpers.js +0 -9
  22. package/bundle-emitter/publish-error/error-shape-helpers.js.map +1 -1
  23. package/bundle-emitter/publish-error/file-mode-error-matching.js +2 -33
  24. package/bundle-emitter/publish-error/file-mode-error-matching.js.map +1 -1
  25. package/bundle-emitter/publish-error/publish-error-messages.js +0 -24
  26. package/bundle-emitter/publish-error/publish-error-messages.js.map +1 -1
  27. package/bundle-emitter/registry/metadata-auth-retry.js +1 -24
  28. package/bundle-emitter/registry/metadata-auth-retry.js.map +1 -1
  29. package/bundle-emitter/registry/oidc-token-exchange.js +3 -68
  30. package/bundle-emitter/registry/oidc-token-exchange.js.map +1 -1
  31. package/bundle-emitter/registry/package-metadata-fetcher.d.ts +0 -13
  32. package/bundle-emitter/registry/package-metadata-fetcher.d.ts.map +1 -1
  33. package/bundle-emitter/registry/package-metadata-fetcher.js +7 -186
  34. package/bundle-emitter/registry/package-metadata-fetcher.js.map +1 -1
  35. package/bundle-emitter/registry/publish-settings-bridge.js +3 -34
  36. package/bundle-emitter/registry/publish-settings-bridge.js.map +1 -1
  37. package/bundle-emitter/registry/registry-auth-config.js +0 -106
  38. package/bundle-emitter/registry/registry-auth-config.js.map +1 -1
  39. package/bundle-emitter/registry/registry-client.d.ts +1 -13
  40. package/bundle-emitter/registry/registry-client.d.ts.map +1 -1
  41. package/bundle-emitter/registry/registry-client.js +4 -71
  42. package/bundle-emitter/registry/registry-client.js.map +1 -1
  43. package/bundle-emitter/registry/registry-package-path.js +0 -3
  44. package/bundle-emitter/registry/registry-package-path.js.map +1 -1
  45. package/bundle-emitter/registry/registry-response-schemas.js +2 -50
  46. package/bundle-emitter/registry/registry-response-schemas.js.map +1 -1
  47. package/bundle-emitter/registry/tarball-integrity.d.ts +0 -1
  48. package/bundle-emitter/registry/tarball-integrity.d.ts.map +1 -1
  49. package/bundle-emitter/registry/tarball-integrity.js +1 -31
  50. package/bundle-emitter/registry/tarball-integrity.js.map +1 -1
  51. package/bundle-emitter/registry/validate-tarball-host.js +1 -26
  52. package/bundle-emitter/registry/validate-tarball-host.js.map +1 -1
  53. package/bundle-emitter/release-artifact-canonicalizer.js +5 -31
  54. package/bundle-emitter/release-artifact-canonicalizer.js.map +1 -1
  55. package/checks/check-runner.js +0 -8
  56. package/checks/check-runner.js.map +1 -1
  57. package/checks/rule.js +2 -12
  58. package/checks/rule.js.map +1 -1
  59. package/checks/rules/duplicate-detection.js +1 -23
  60. package/checks/rules/duplicate-detection.js.map +1 -1
  61. package/checks/rules/duplicate-messages.js +0 -22
  62. package/checks/rules/duplicate-messages.js.map +1 -1
  63. package/checks/rules/file-ownership.js +0 -15
  64. package/checks/rules/file-ownership.js.map +1 -1
  65. package/checks/rules/max-bundle-size.js +1 -55
  66. package/checks/rules/max-bundle-size.js.map +1 -1
  67. package/checks/rules/no-dev-dependency-imports.js +1 -51
  68. package/checks/rules/no-dev-dependency-imports.js.map +1 -1
  69. package/checks/rules/no-duplicated-files.js +3 -53
  70. package/checks/rules/no-duplicated-files.js.map +1 -1
  71. package/checks/rules/no-side-effects.js +1 -50
  72. package/checks/rules/no-side-effects.js.map +1 -1
  73. package/checks/rules/no-unexposed-executables.js +2 -43
  74. package/checks/rules/no-unexposed-executables.js.map +1 -1
  75. package/checks/rules/no-unused-bundle-dependencies.js +2 -30
  76. package/checks/rules/no-unused-bundle-dependencies.js.map +1 -1
  77. package/checks/rules/registry.js +9 -22
  78. package/checks/rules/registry.js.map +1 -1
  79. package/checks/rules/required-files.js +3 -41
  80. package/checks/rules/required-files.js.map +1 -1
  81. package/checks/rules/type-script-declaration-integrity.js +3 -81
  82. package/checks/rules/type-script-declaration-integrity.js.map +1 -1
  83. package/checks/rules/type-script-declaration-paths.js +1 -55
  84. package/checks/rules/type-script-declaration-paths.js.map +1 -1
  85. package/checks/rules/type-script-declaration-project.js +3 -202
  86. package/checks/rules/type-script-declaration-project.js.map +1 -1
  87. package/checks/rules/type-script-declaration-reachability.js +2 -38
  88. package/checks/rules/type-script-declaration-reachability.js.map +1 -1
  89. package/checks/rules/type-script-declaration-roots.js +0 -29
  90. package/checks/rules/type-script-declaration-roots.js.map +1 -1
  91. package/checks/rules/type-script-integrity.js +2 -72
  92. package/checks/rules/type-script-integrity.js.map +1 -1
  93. package/checks/rules/type-script-package-resolution.js +1 -42
  94. package/checks/rules/type-script-package-resolution.js.map +1 -1
  95. package/checks/rules/type-script-resolution-summary.js +0 -53
  96. package/checks/rules/type-script-resolution-summary.js.map +1 -1
  97. package/checks/rules/unique-target-paths.js +2 -34
  98. package/checks/rules/unique-target-paths.js.map +1 -1
  99. package/common/bundled-dependency-groups.js +0 -27
  100. package/common/bundled-dependency-groups.js.map +1 -1
  101. package/common/code-files.js +0 -28
  102. package/common/code-files.js.map +1 -1
  103. package/common/declaration-companion-paths.js +0 -24
  104. package/common/declaration-companion-paths.js.map +1 -1
  105. package/common/package-name-map.js +0 -7
  106. package/common/package-name-map.js.map +1 -1
  107. package/common/stable-json.js +2 -42
  108. package/common/stable-json.js.map +1 -1
  109. package/common/worklist.js +0 -22
  110. package/common/worklist.js.map +1 -1
  111. package/config/additional-files.js +2 -6
  112. package/config/additional-files.js.map +1 -1
  113. package/config/additional-package-json-attributes-schema.js +2 -6
  114. package/config/additional-package-json-attributes-schema.js.map +1 -1
  115. package/config/automatic-versioning-settings.js +2 -6
  116. package/config/automatic-versioning-settings.js.map +1 -1
  117. package/config/changelog-settings.d.ts +0 -44
  118. package/config/changelog-settings.d.ts.map +1 -1
  119. package/config/changelog-settings.js +3 -120
  120. package/config/changelog-settings.js.map +1 -1
  121. package/config/common-package-settings-schemas.js +3 -19
  122. package/config/common-package-settings-schemas.js.map +1 -1
  123. package/config/config.d.ts +1 -6
  124. package/config/config.d.ts.map +1 -1
  125. package/config/config.js +1 -3
  126. package/config/config.js.map +1 -1
  127. package/config/cross-package-validation.js +0 -17
  128. package/config/cross-package-validation.js.map +1 -1
  129. package/config/dead-code-elimination-settings.d.ts +0 -1
  130. package/config/dead-code-elimination-settings.d.ts.map +1 -1
  131. package/config/dead-code-elimination-settings.js +2 -36
  132. package/config/dead-code-elimination-settings.js.map +1 -1
  133. package/config/dependency-existence-validation.js +1 -19
  134. package/config/dependency-existence-validation.js.map +1 -1
  135. package/config/dependency-policy.js +2 -5
  136. package/config/dependency-policy.js.map +1 -1
  137. package/config/main-package-json-schema.js +2 -13
  138. package/config/main-package-json-schema.js.map +1 -1
  139. package/config/manual-versioning-settings.d.ts +0 -12
  140. package/config/manual-versioning-settings.d.ts.map +1 -1
  141. package/config/manual-versioning-settings.js +2 -29
  142. package/config/manual-versioning-settings.js.map +1 -1
  143. package/config/optional-package-settings-schema.js +7 -16
  144. package/config/optional-package-settings-schema.js.map +1 -1
  145. package/config/package-config.d.ts +0 -4
  146. package/config/package-config.d.ts.map +1 -1
  147. package/config/package-config.js +1 -2
  148. package/config/package-config.js.map +1 -1
  149. package/config/package-graph-builder.js +2 -14
  150. package/config/package-graph-builder.js.map +1 -1
  151. package/config/package-interface.js +2 -25
  152. package/config/package-interface.js.map +1 -1
  153. package/config/package-json.d.ts +0 -2
  154. package/config/package-json.d.ts.map +1 -1
  155. package/config/package-json.js +0 -16
  156. package/config/package-json.js.map +1 -1
  157. package/config/packtory-config-without-registry-schema.js +0 -6
  158. package/config/packtory-config-without-registry-schema.js.map +1 -1
  159. package/config/per-package-settings-schema.js +6 -22
  160. package/config/per-package-settings-schema.js.map +1 -1
  161. package/config/pre-graph-validation.js +5 -20
  162. package/config/pre-graph-validation.js.map +1 -1
  163. package/config/publish-settings.d.ts +0 -3
  164. package/config/publish-settings.d.ts.map +1 -1
  165. package/config/publish-settings.js +3 -25
  166. package/config/publish-settings.js.map +1 -1
  167. package/config/publish-settings.report.js +1 -17
  168. package/config/publish-settings.report.js.map +1 -1
  169. package/config/registry-settings.d.ts +0 -41
  170. package/config/registry-settings.d.ts.map +1 -1
  171. package/config/registry-settings.js +2 -40
  172. package/config/registry-settings.js.map +1 -1
  173. package/config/registry-settings.report.js +0 -46
  174. package/config/registry-settings.report.js.map +1 -1
  175. package/config/root-config-validation.js +0 -141
  176. package/config/root-config-validation.js.map +1 -1
  177. package/config/root.js +2 -6
  178. package/config/root.js.map +1 -1
  179. package/config/sbom-settings.js +1 -4
  180. package/config/sbom-settings.js.map +1 -1
  181. package/config/settings-validation.js +0 -28
  182. package/config/settings-validation.js.map +1 -1
  183. package/config/versioning-settings.d.ts +1 -18
  184. package/config/versioning-settings.d.ts.map +1 -1
  185. package/config/versioning-settings.js +3 -10
  186. package/config/versioning-settings.js.map +1 -1
  187. package/dead-code-eliminator/analyzed-bundle.d.ts +0 -11
  188. package/dead-code-eliminator/analyzed-bundle.d.ts.map +1 -1
  189. package/dead-code-eliminator/analyzed-bundle.js +0 -7
  190. package/dead-code-eliminator/analyzed-bundle.js.map +1 -1
  191. package/dead-code-eliminator/class-purity.js +2 -48
  192. package/dead-code-eliminator/class-purity.js.map +1 -1
  193. package/dead-code-eliminator/code-file-analyzer.js +4 -62
  194. package/dead-code-eliminator/code-file-analyzer.js.map +1 -1
  195. package/dead-code-eliminator/cross-bundle/bundle-index.js +1 -27
  196. package/dead-code-eliminator/cross-bundle/bundle-index.js.map +1 -1
  197. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js +3 -18
  198. package/dead-code-eliminator/cross-bundle/cross-bundle-seeds.js.map +1 -1
  199. package/dead-code-eliminator/cross-bundle/import-export-walker.js +4 -75
  200. package/dead-code-eliminator/cross-bundle/import-export-walker.js.map +1 -1
  201. package/dead-code-eliminator/cross-bundle/seed-store.js +1 -22
  202. package/dead-code-eliminator/cross-bundle/seed-store.js.map +1 -1
  203. package/dead-code-eliminator/dependency-metadata.js +3 -205
  204. package/dead-code-eliminator/dependency-metadata.js.map +1 -1
  205. package/dead-code-eliminator/elimination-emitter.js +0 -52
  206. package/dead-code-eliminator/elimination-emitter.js.map +1 -1
  207. package/dead-code-eliminator/eliminator.js +8 -64
  208. package/dead-code-eliminator/eliminator.js.map +1 -1
  209. package/dead-code-eliminator/expression-unwrapping.js +1 -16
  210. package/dead-code-eliminator/expression-unwrapping.js.map +1 -1
  211. package/dead-code-eliminator/imported-expression-origin.js +2 -101
  212. package/dead-code-eliminator/imported-expression-origin.js.map +1 -1
  213. package/dead-code-eliminator/liveness/asset-side-effects.js +1 -9
  214. package/dead-code-eliminator/liveness/asset-side-effects.js.map +1 -1
  215. package/dead-code-eliminator/liveness/boolean-facts.js +2 -98
  216. package/dead-code-eliminator/liveness/boolean-facts.js.map +1 -1
  217. package/dead-code-eliminator/liveness/external-module-resolution.js +2 -172
  218. package/dead-code-eliminator/liveness/external-module-resolution.js.map +1 -1
  219. package/dead-code-eliminator/liveness/external-purity-summary.js +3 -294
  220. package/dead-code-eliminator/liveness/external-purity-summary.js.map +1 -1
  221. package/dead-code-eliminator/liveness/external-purity.js +3 -39
  222. package/dead-code-eliminator/liveness/external-purity.js.map +1 -1
  223. package/dead-code-eliminator/liveness/module-analysis.js +2 -27
  224. package/dead-code-eliminator/liveness/module-analysis.js.map +1 -1
  225. package/dead-code-eliminator/liveness/resource-retention.js +1 -78
  226. package/dead-code-eliminator/liveness/resource-retention.js.map +1 -1
  227. package/dead-code-eliminator/liveness/runtime-code.js +1 -15
  228. package/dead-code-eliminator/liveness/runtime-code.js.map +1 -1
  229. package/dead-code-eliminator/load-bundle.js +5 -70
  230. package/dead-code-eliminator/load-bundle.js.map +1 -1
  231. package/dead-code-eliminator/pure-expression.js +5 -178
  232. package/dead-code-eliminator/pure-expression.js.map +1 -1
  233. package/dead-code-eliminator/reachability/bfs-closure.js +0 -50
  234. package/dead-code-eliminator/reachability/bfs-closure.js.map +1 -1
  235. package/dead-code-eliminator/reachability/binding-extractor.js +2 -100
  236. package/dead-code-eliminator/reachability/binding-extractor.js.map +1 -1
  237. package/dead-code-eliminator/reachability/binding-id.js +1 -32
  238. package/dead-code-eliminator/reachability/binding-id.js.map +1 -1
  239. package/dead-code-eliminator/reachability/identifier-target-collector.js +2 -39
  240. package/dead-code-eliminator/reachability/identifier-target-collector.js.map +1 -1
  241. package/dead-code-eliminator/reachability/impure-statements.js +2 -11
  242. package/dead-code-eliminator/reachability/impure-statements.js.map +1 -1
  243. package/dead-code-eliminator/reachability/local-seed-gathering.js +4 -43
  244. package/dead-code-eliminator/reachability/local-seed-gathering.js.map +1 -1
  245. package/dead-code-eliminator/reachability/reachability.js +4 -38
  246. package/dead-code-eliminator/reachability/reachability.js.map +1 -1
  247. package/dead-code-eliminator/side-effect-classifier.js +4 -39
  248. package/dead-code-eliminator/side-effect-classifier.js.map +1 -1
  249. package/dead-code-eliminator/side-effects-field.js +1 -23
  250. package/dead-code-eliminator/side-effects-field.js.map +1 -1
  251. package/dead-code-eliminator/source-map-recomposition.js +2 -29
  252. package/dead-code-eliminator/source-map-recomposition.js.map +1 -1
  253. package/dead-code-eliminator/statement-classifiers.js +4 -94
  254. package/dead-code-eliminator/statement-classifiers.js.map +1 -1
  255. package/dead-code-eliminator/syntax-kind-sets.js +0 -16
  256. package/dead-code-eliminator/syntax-kind-sets.js.map +1 -1
  257. package/dead-code-eliminator/transform/atom-translator.d.ts +0 -8
  258. package/dead-code-eliminator/transform/atom-translator.d.ts.map +1 -1
  259. package/dead-code-eliminator/transform/atom-translator.js +2 -57
  260. package/dead-code-eliminator/transform/atom-translator.js.map +1 -1
  261. package/dead-code-eliminator/transform/declaration-removal.js +4 -135
  262. package/dead-code-eliminator/transform/declaration-removal.js.map +1 -1
  263. package/dead-code-eliminator/transform/declaration-remover.js +2 -17
  264. package/dead-code-eliminator/transform/declaration-remover.js.map +1 -1
  265. package/dead-code-eliminator/transform/line-index.d.ts +0 -7
  266. package/dead-code-eliminator/transform/line-index.d.ts.map +1 -1
  267. package/dead-code-eliminator/transform/line-index.js +0 -20
  268. package/dead-code-eliminator/transform/line-index.js.map +1 -1
  269. package/dead-code-eliminator/transform/named-declaration-kinds.js +0 -3
  270. package/dead-code-eliminator/transform/named-declaration-kinds.js.map +1 -1
  271. package/dead-code-eliminator/transform/source-map-composer.js +3 -84
  272. package/dead-code-eliminator/transform/source-map-composer.js.map +1 -1
  273. package/dead-code-eliminator/variable-declaration-bindings.js +1 -25
  274. package/dead-code-eliminator/variable-declaration-bindings.js.map +1 -1
  275. package/dependency-scanner/dependency-graph.js +3 -74
  276. package/dependency-scanner/dependency-graph.js.map +1 -1
  277. package/dependency-scanner/external-dependencies.d.ts +0 -9
  278. package/dependency-scanner/external-dependencies.d.ts.map +1 -1
  279. package/dependency-scanner/external-dependencies.js +1 -55
  280. package/dependency-scanner/external-dependencies.js.map +1 -1
  281. package/dependency-scanner/file-host-predicates.js +0 -9
  282. package/dependency-scanner/file-host-predicates.js.map +1 -1
  283. package/dependency-scanner/host-method-binding.js +0 -18
  284. package/dependency-scanner/host-method-binding.js.map +1 -1
  285. package/dependency-scanner/injected-dynamic-imports.js +1 -232
  286. package/dependency-scanner/injected-dynamic-imports.js.map +1 -1
  287. package/dependency-scanner/node-modules-manifest-synthesizer.js +4 -52
  288. package/dependency-scanner/node-modules-manifest-synthesizer.js.map +1 -1
  289. package/dependency-scanner/package-owned-asset-file-path.js +1 -9
  290. package/dependency-scanner/package-owned-asset-file-path.js.map +1 -1
  291. package/dependency-scanner/scanner.js +4 -102
  292. package/dependency-scanner/scanner.js.map +1 -1
  293. package/dependency-scanner/source-file-references.js +6 -174
  294. package/dependency-scanner/source-file-references.js.map +1 -1
  295. package/dependency-scanner/source-map-file-locator.js +2 -66
  296. package/dependency-scanner/source-map-file-locator.js.map +1 -1
  297. package/dependency-scanner/typescript-compiler-options.js +1 -21
  298. package/dependency-scanner/typescript-compiler-options.js.map +1 -1
  299. package/dependency-scanner/typescript-file-host.js +5 -49
  300. package/dependency-scanner/typescript-file-host.js.map +1 -1
  301. package/dependency-scanner/typescript-project-analyzer.js +3 -35
  302. package/dependency-scanner/typescript-project-analyzer.js.map +1 -1
  303. package/dependency-scanner/virtual-package-json-host.js +4 -45
  304. package/dependency-scanner/virtual-package-json-host.js.map +1 -1
  305. package/directed-graph/graph.d.ts +0 -1
  306. package/directed-graph/graph.d.ts.map +1 -1
  307. package/directed-graph/graph.js +1 -240
  308. package/directed-graph/graph.js.map +1 -1
  309. package/file-manager/compare.js +2 -23
  310. package/file-manager/compare.js.map +1 -1
  311. package/file-manager/equal.js +0 -5
  312. package/file-manager/equal.js.map +1 -1
  313. package/file-manager/file-description.d.ts +0 -1
  314. package/file-manager/file-description.d.ts.map +1 -1
  315. package/file-manager/file-description.js +0 -3
  316. package/file-manager/file-description.js.map +1 -1
  317. package/file-manager/permissions.js +1 -28
  318. package/file-manager/permissions.js.map +1 -1
  319. package/git/current-git-head.js +0 -24
  320. package/git/current-git-head.js.map +1 -1
  321. package/git/git-command.js +1 -49
  322. package/git/git-command.js.map +1 -1
  323. package/linker/linked-bundle.d.ts +0 -8
  324. package/linker/linked-bundle.d.ts.map +1 -1
  325. package/linker/linked-bundle.js +0 -5
  326. package/linker/linked-bundle.js.map +1 -1
  327. package/linker/linker.js +5 -51
  328. package/linker/linker.js.map +1 -1
  329. package/linker/replacement-lookup.js +8 -295
  330. package/linker/replacement-lookup.js.map +1 -1
  331. package/linker/resource-graph.js +2 -44
  332. package/linker/resource-graph.js.map +1 -1
  333. package/linker/source-modifier/import-paths.js +3 -76
  334. package/linker/source-modifier/import-paths.js.map +1 -1
  335. package/linker/substitute-bundles.js +3 -140
  336. package/linker/substitute-bundles.js.map +1 -1
  337. package/linker/substituted-resource-graph.js +2 -99
  338. package/linker/substituted-resource-graph.js.map +1 -1
  339. package/npm-oidc-id-token-resolver.js +0 -82
  340. package/npm-oidc-id-token-resolver.js.map +1 -1
  341. package/pack-emitter/pack-emitter.d.ts +0 -20
  342. package/pack-emitter/pack-emitter.d.ts.map +1 -1
  343. package/pack-emitter/pack-emitter.js +0 -27
  344. package/pack-emitter/pack-emitter.js.map +1 -1
  345. package/package-surface/bin-field.js +2 -8
  346. package/package-surface/bin-field.js.map +1 -1
  347. package/package-surface/explicit-bin.js +2 -24
  348. package/package-surface/explicit-bin.js.map +1 -1
  349. package/package-surface/explicit-exports.js +3 -26
  350. package/package-surface/explicit-exports.js.map +1 -1
  351. package/package-surface/export-map.js +2 -9
  352. package/package-surface/export-map.js.map +1 -1
  353. package/package-surface/implicit-bin.js +1 -25
  354. package/package-surface/implicit-bin.js.map +1 -1
  355. package/package-surface/implicit-exports.js +3 -10
  356. package/package-surface/implicit-exports.js.map +1 -1
  357. package/package-surface/implicit-root-exports.js +2 -13
  358. package/package-surface/implicit-root-exports.js.map +1 -1
  359. package/package-surface/package-json-export.js +0 -9
  360. package/package-surface/package-json-export.js.map +1 -1
  361. package/package-surface/package-shape.js +1 -10
  362. package/package-surface/package-shape.js.map +1 -1
  363. package/package-surface/package-surface-index.js +3 -165
  364. package/package-surface/package-surface-index.js.map +1 -1
  365. package/package-surface/public-module-usage.js +3 -46
  366. package/package-surface/public-module-usage.js.map +1 -1
  367. package/package-surface/public-specifiers.js +1 -7
  368. package/package-surface/public-specifiers.js.map +1 -1
  369. package/package-surface/root-registry.js +0 -26
  370. package/package-surface/root-registry.js.map +1 -1
  371. package/package-surface/specifier-syntax.js +0 -4
  372. package/package-surface/specifier-syntax.js.map +1 -1
  373. package/package-surface/substitution-exports.js +3 -101
  374. package/package-surface/substitution-exports.js.map +1 -1
  375. package/package-surface/surface.d.ts +0 -2
  376. package/package-surface/surface.d.ts.map +1 -1
  377. package/package-surface/surface.js +0 -12
  378. package/package-surface/surface.js.map +1 -1
  379. package/package.json +2 -2
  380. package/packages/package-processor.composition.d.ts +0 -22
  381. package/packages/package-processor.composition.d.ts.map +1 -1
  382. package/packages/package-processor.composition.js +34 -160
  383. package/packages/package-processor.composition.js.map +1 -1
  384. package/packtory/map-config.d.ts +3 -22
  385. package/packtory/map-config.d.ts.map +1 -1
  386. package/packtory/map-config.js +4 -35
  387. package/packtory/map-config.js.map +1 -1
  388. package/packtory/normalize-paths.js +1 -25
  389. package/packtory/normalize-paths.js.map +1 -1
  390. package/packtory/options/bundle-dependency-resolution.js +1 -17
  391. package/packtory/options/bundle-dependency-resolution.js.map +1 -1
  392. package/packtory/options/dead-code-elimination-resolution.js +1 -10
  393. package/packtory/options/dead-code-elimination-resolution.js.map +1 -1
  394. package/packtory/options/prepare-package-options.d.ts +0 -14
  395. package/packtory/options/prepare-package-options.d.ts.map +1 -1
  396. package/packtory/options/prepare-package-options.js +5 -46
  397. package/packtory/options/prepare-package-options.js.map +1 -1
  398. package/packtory/options/required-value-helpers.js +0 -17
  399. package/packtory/options/required-value-helpers.js.map +1 -1
  400. package/packtory/options/setting-resolvers.d.ts +0 -18
  401. package/packtory/options/setting-resolvers.d.ts.map +1 -1
  402. package/packtory/options/setting-resolvers.js +3 -47
  403. package/packtory/options/setting-resolvers.js.map +1 -1
  404. package/packtory/options/surface-resolution.js +2 -15
  405. package/packtory/options/surface-resolution.js.map +1 -1
  406. package/packtory/options/version-provider-context.js +2 -24
  407. package/packtory/options/version-provider-context.js.map +1 -1
  408. package/packtory/options/version-trigger.js +2 -39
  409. package/packtory/options/version-trigger.js.map +1 -1
  410. package/packtory/pack-output-preflight.js +3 -60
  411. package/packtory/pack-output-preflight.js.map +1 -1
  412. package/packtory/package-processor-build.js +3 -97
  413. package/packtory/package-processor-build.js.map +1 -1
  414. package/packtory/package-processor-publish.d.ts +0 -13
  415. package/packtory/package-processor-publish.d.ts.map +1 -1
  416. package/packtory/package-processor-publish.js +5 -293
  417. package/packtory/package-processor-publish.js.map +1 -1
  418. package/packtory/package-processor.d.ts +1 -34
  419. package/packtory/package-processor.d.ts.map +1 -1
  420. package/packtory/package-processor.js +2 -10
  421. package/packtory/package-processor.js.map +1 -1
  422. package/packtory/packtory-pack.js +10 -298
  423. package/packtory/packtory-pack.js.map +1 -1
  424. package/packtory/packtory-package-dependencies.js +7 -135
  425. package/packtory/packtory-package-dependencies.js.map +1 -1
  426. package/packtory/packtory-package-tree.js +4 -43
  427. package/packtory/packtory-package-tree.js.map +1 -1
  428. package/packtory/packtory-publish.js +4 -17
  429. package/packtory/packtory-publish.js.map +1 -1
  430. package/packtory/packtory-release-analysis.js +6 -64
  431. package/packtory/packtory-release-analysis.js.map +1 -1
  432. package/packtory/packtory-release-diff.js +5 -48
  433. package/packtory/packtory-release-diff.js.map +1 -1
  434. package/packtory/packtory-release-plan.js +6 -87
  435. package/packtory/packtory-release-plan.js.map +1 -1
  436. package/packtory/packtory-resolve.js +5 -16
  437. package/packtory/packtory-resolve.js.map +1 -1
  438. package/packtory/packtory.d.ts +1 -28
  439. package/packtory/packtory.d.ts.map +1 -1
  440. package/packtory/packtory.js +12 -225
  441. package/packtory/packtory.js.map +1 -1
  442. package/packtory/publish-failure-mapping.js +0 -6
  443. package/packtory/publish-failure-mapping.js.map +1 -1
  444. package/packtory/published-release-state.d.ts +0 -19
  445. package/packtory/published-release-state.d.ts.map +1 -1
  446. package/packtory/published-release-state.js +0 -11
  447. package/packtory/published-release-state.js.map +1 -1
  448. package/packtory/release-analysis.js +5 -153
  449. package/packtory/release-analysis.js.map +1 -1
  450. package/packtory/release-diff-failure-mapping.js +0 -6
  451. package/packtory/release-diff-failure-mapping.js.map +1 -1
  452. package/packtory/release-plan.js +7 -135
  453. package/packtory/release-plan.js.map +1 -1
  454. package/packtory/report-attachment.js +2 -35
  455. package/packtory/report-attachment.js.map +1 -1
  456. package/packtory/resolved-package.d.ts +0 -11
  457. package/packtory/resolved-package.d.ts.map +1 -1
  458. package/packtory/resolved-package.js +3 -97
  459. package/packtory/resolved-package.js.map +1 -1
  460. package/packtory/scheduler.d.ts +0 -47
  461. package/packtory/scheduler.d.ts.map +1 -1
  462. package/packtory/scheduler.js +1 -99
  463. package/packtory/scheduler.js.map +1 -1
  464. package/packtory/stages/package-analysis-stage.js +2 -50
  465. package/packtory/stages/package-analysis-stage.js.map +1 -1
  466. package/packtory/stages/package-resolution-stage.js +5 -80
  467. package/packtory/stages/package-resolution-stage.js.map +1 -1
  468. package/packtory/stages/publish-stage.js +3 -54
  469. package/packtory/stages/publish-stage.js.map +1 -1
  470. package/packtory/stages/release-diff-stage.js +5 -84
  471. package/packtory/stages/release-diff-stage.js.map +1 -1
  472. package/progress/progress-broadcaster.d.ts +0 -1
  473. package/progress/progress-broadcaster.d.ts.map +1 -1
  474. package/progress/progress-broadcaster.js +0 -45
  475. package/progress/progress-broadcaster.js.map +1 -1
  476. package/published-package/published-package.d.ts +0 -2
  477. package/published-package/published-package.d.ts.map +1 -1
  478. package/published-package/published-package.js +1 -12
  479. package/published-package/published-package.js.map +1 -1
  480. package/report/aggregator/artifact-entry-merger.js +0 -20
  481. package/report/aggregator/artifact-entry-merger.js.map +1 -1
  482. package/report/aggregator/package-report-materialization.js +2 -75
  483. package/report/aggregator/package-report-materialization.js.map +1 -1
  484. package/report/aggregator/report-aggregator.js +2 -37
  485. package/report/aggregator/report-aggregator.js.map +1 -1
  486. package/report/aggregator/report-event-handlers.js +2 -141
  487. package/report/aggregator/report-event-handlers.js.map +1 -1
  488. package/report/aggregator/report-types.d.ts +0 -21
  489. package/report/aggregator/report-types.d.ts.map +1 -1
  490. package/report/aggregator/report-types.js +0 -3
  491. package/report/aggregator/report-types.js.map +1 -1
  492. package/report/config-redactor.js +3 -29
  493. package/report/config-redactor.js.map +1 -1
  494. package/report/decorators.js +0 -76
  495. package/report/decorators.js.map +1 -1
  496. package/report/inspectors/inspect-artifact-sizes.js +1 -34
  497. package/report/inspectors/inspect-artifact-sizes.js.map +1 -1
  498. package/report/inspectors/inspect-linker-rewrites.js +1 -14
  499. package/report/inspectors/inspect-linker-rewrites.js.map +1 -1
  500. package/report/inspectors/inspect-package-json-provenance.js +0 -15
  501. package/report/inspectors/inspect-package-json-provenance.js.map +1 -1
  502. package/report/inspectors/inspect-scan-results.js +0 -15
  503. package/report/inspectors/inspect-scan-results.js.map +1 -1
  504. package/report/release-diff/release-version-transition.js +0 -18
  505. package/report/release-diff/release-version-transition.js.map +1 -1
  506. package/resource-resolver/bundle-resource-lookup.js +0 -25
  507. package/resource-resolver/bundle-resource-lookup.js.map +1 -1
  508. package/resource-resolver/content.js +3 -81
  509. package/resource-resolver/content.js.map +1 -1
  510. package/resource-resolver/dependency-resolution-walker.js +2 -73
  511. package/resource-resolver/dependency-resolution-walker.js.map +1 -1
  512. package/resource-resolver/resolved-bundle.d.ts +0 -17
  513. package/resource-resolver/resolved-bundle.d.ts.map +1 -1
  514. package/resource-resolver/resolved-bundle.js +0 -3
  515. package/resource-resolver/resolved-bundle.js.map +1 -1
  516. package/resource-resolver/resource-resolve-options.d.ts +0 -5
  517. package/resource-resolver/resource-resolve-options.d.ts.map +1 -1
  518. package/resource-resolver/resource-resolve-options.js +1 -13
  519. package/resource-resolver/resource-resolve-options.js.map +1 -1
  520. package/resource-resolver/resource-resolver.js +5 -83
  521. package/resource-resolver/resource-resolver.js.map +1 -1
  522. package/sbom/extract-license.js +1 -11
  523. package/sbom/extract-license.js.map +1 -1
  524. package/sbom/license-resolver.js +2 -23
  525. package/sbom/license-resolver.js.map +1 -1
  526. package/sbom/sbom-builder.js +2 -57
  527. package/sbom/sbom-builder.js.map +1 -1
  528. package/sbom/sbom-canonicalizer.js +3 -45
  529. package/sbom/sbom-canonicalizer.js.map +1 -1
  530. package/sbom/sbom-file.d.ts +0 -10
  531. package/sbom/sbom-file.d.ts.map +1 -1
  532. package/sbom/sbom-file.js +5 -54
  533. package/sbom/sbom-file.js.map +1 -1
  534. package/sbom/sbom-serializer.js +1 -14
  535. package/sbom/sbom-serializer.js.map +1 -1
  536. package/sbom/tool-version.js +1 -49
  537. package/sbom/tool-version.js.map +1 -1
  538. package/sbom.cdx.json +10 -10
  539. package/tar/extract-tar.js +3 -83
  540. package/tar/extract-tar.js.map +1 -1
  541. package/tar/gzipped-pack.js +0 -20
  542. package/tar/gzipped-pack.js.map +1 -1
  543. package/tar/tarball-builder.js +4 -44
  544. package/tar/tarball-builder.js.map +1 -1
  545. package/vendor-materializer/vendor-entry.js +1 -20
  546. package/vendor-materializer/vendor-entry.js.map +1 -1
  547. package/vendor-materializer/vendor-materializer.js +8 -240
  548. package/vendor-materializer/vendor-materializer.js.map +1 -1
  549. package/version-manager/dependencies/bundle-dependency-grouping.js +2 -32
  550. package/version-manager/dependencies/bundle-dependency-grouping.js.map +1 -1
  551. package/version-manager/dependencies/dependency-groups.js +1 -11
  552. package/version-manager/dependencies/dependency-groups.js.map +1 -1
  553. package/version-manager/dependencies/external-dependency-classification.js +3 -82
  554. package/version-manager/dependencies/external-dependency-classification.js.map +1 -1
  555. package/version-manager/dependencies/versioned-bundle-dependencies.js +3 -8
  556. package/version-manager/dependencies/versioned-bundle-dependencies.js.map +1 -1
  557. package/version-manager/imports/hash-import-scanner.js +2 -20
  558. package/version-manager/imports/hash-import-scanner.js.map +1 -1
  559. package/version-manager/imports/imports-key-matcher.js +0 -22
  560. package/version-manager/imports/imports-key-matcher.js.map +1 -1
  561. package/version-manager/imports/versioned-bundle-imports.js +2 -44
  562. package/version-manager/imports/versioned-bundle-imports.js.map +1 -1
  563. package/version-manager/manager.d.ts +0 -5
  564. package/version-manager/manager.d.ts.map +1 -1
  565. package/version-manager/manager.js +6 -46
  566. package/version-manager/manager.js.map +1 -1
  567. package/version-manager/manifest/builder.js +1 -51
  568. package/version-manager/manifest/builder.js.map +1 -1
  569. package/version-manager/manifest/serialize.js +1 -8
  570. package/version-manager/manifest/serialize.js.map +1 -1
  571. package/version-manager/optional-bundle-fields.js +1 -5
  572. package/version-manager/optional-bundle-fields.js.map +1 -1
  573. package/version-manager/representative-root.js +1 -9
  574. package/version-manager/representative-root.js.map +1 -1
  575. package/version-manager/specifier-classifier.js +2 -42
  576. package/version-manager/specifier-classifier.js.map +1 -1
  577. package/version-manager/specifier-errors.js +0 -58
  578. package/version-manager/specifier-errors.js.map +1 -1
  579. package/version-manager/versioned-bundle.d.ts +1 -3
  580. package/version-manager/versioned-bundle.d.ts.map +1 -1
  581. package/version-manager/versioned-bundle.js +6 -31
  582. package/version-manager/versioned-bundle.js.map +1 -1
  583. package/zip/zip-builder.js +2 -81
  584. package/zip/zip-builder.js.map +1 -1
  585. package/artifacts/artifacts-builder.d.ts +0 -28
  586. package/artifacts/artifacts-builder.d.ts.map +0 -1
  587. package/bundle-emitter/registry/registry-auth-config.d.ts +0 -17
  588. package/bundle-emitter/registry/registry-auth-config.d.ts.map +0 -1
  589. package/checks/check-runner.d.ts +0 -18
  590. package/checks/check-runner.d.ts.map +0 -1
  591. package/checks/rule.d.ts +0 -42
  592. package/checks/rule.d.ts.map +0 -1
  593. package/checks/rules/max-bundle-size.d.ts +0 -13
  594. package/checks/rules/max-bundle-size.d.ts.map +0 -1
  595. package/checks/rules/no-dev-dependency-imports.d.ts +0 -11
  596. package/checks/rules/no-dev-dependency-imports.d.ts.map +0 -1
  597. package/checks/rules/no-duplicated-files.d.ts +0 -11
  598. package/checks/rules/no-duplicated-files.d.ts.map +0 -1
  599. package/checks/rules/no-side-effects.d.ts +0 -15
  600. package/checks/rules/no-side-effects.d.ts.map +0 -1
  601. package/checks/rules/no-unexposed-executables.d.ts +0 -8
  602. package/checks/rules/no-unexposed-executables.d.ts.map +0 -1
  603. package/checks/rules/no-unused-bundle-dependencies.d.ts +0 -8
  604. package/checks/rules/no-unused-bundle-dependencies.d.ts.map +0 -1
  605. package/checks/rules/registry.d.ts +0 -23
  606. package/checks/rules/registry.d.ts.map +0 -1
  607. package/checks/rules/required-files.d.ts +0 -15
  608. package/checks/rules/required-files.d.ts.map +0 -1
  609. package/checks/rules/type-script-declaration-integrity.d.ts +0 -9
  610. package/checks/rules/type-script-declaration-integrity.d.ts.map +0 -1
  611. package/checks/rules/type-script-declaration-project.d.ts +0 -29
  612. package/checks/rules/type-script-declaration-project.d.ts.map +0 -1
  613. package/checks/rules/type-script-integrity.d.ts +0 -24
  614. package/checks/rules/type-script-integrity.d.ts.map +0 -1
  615. package/checks/rules/type-script-package-resolution.d.ts +0 -29
  616. package/checks/rules/type-script-package-resolution.d.ts.map +0 -1
  617. package/checks/rules/unique-target-paths.d.ts +0 -8
  618. package/checks/rules/unique-target-paths.d.ts.map +0 -1
  619. package/dependency-scanner/dependency-graph.d.ts +0 -38
  620. package/dependency-scanner/dependency-graph.d.ts.map +0 -1
  621. package/dependency-scanner/scanner.d.ts +0 -20
  622. package/dependency-scanner/scanner.d.ts.map +0 -1
  623. package/dependency-scanner/source-file-references.d.ts +0 -30
  624. package/dependency-scanner/source-file-references.d.ts.map +0 -1
  625. package/dependency-scanner/source-map-file-locator.d.ts +0 -10
  626. package/dependency-scanner/source-map-file-locator.d.ts.map +0 -1
  627. package/dependency-scanner/typescript-compiler-options.d.ts +0 -8
  628. package/dependency-scanner/typescript-compiler-options.d.ts.map +0 -1
  629. package/dependency-scanner/typescript-file-host.d.ts +0 -12
  630. package/dependency-scanner/typescript-file-host.d.ts.map +0 -1
  631. package/dependency-scanner/typescript-project-analyzer.d.ts +0 -19
  632. package/dependency-scanner/typescript-project-analyzer.d.ts.map +0 -1
  633. package/git/current-git-head.d.ts +0 -12
  634. package/git/current-git-head.d.ts.map +0 -1
  635. package/linker/linker.d.ts +0 -13
  636. package/linker/linker.d.ts.map +0 -1
  637. package/resource-resolver/resource-resolver.d.ts +0 -15
  638. package/resource-resolver/resource-resolver.d.ts.map +0 -1
  639. package/sbom/license-resolver.d.ts +0 -14
  640. package/sbom/license-resolver.d.ts.map +0 -1
  641. package/sbom/sbom-serializer.d.ts +0 -8
  642. package/sbom/sbom-serializer.d.ts.map +0 -1
  643. package/tar/tarball-builder.d.ts +0 -14
  644. package/tar/tarball-builder.d.ts.map +0 -1
  645. package/vendor-materializer/vendor-entry.d.ts +0 -12
  646. package/vendor-materializer/vendor-entry.d.ts.map +0 -1
  647. package/vendor-materializer/vendor-materializer.d.ts +0 -55
  648. package/vendor-materializer/vendor-materializer.d.ts.map +0 -1
  649. package/zip/zip-builder.d.ts +0 -22
  650. package/zip/zip-builder.d.ts.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import type { Except } from 'type-fest';
2
- import type { DeadCodeEliminationSettings } from '../config/dead-code-elimination-settings.ts';
3
2
  import type { LinkedBundle, LinkedBundleResource } from '../linker/linked-bundle.ts';
4
3
  export type SideEffectStatement = {
5
4
  readonly line: number;
@@ -17,14 +16,4 @@ export type AnalyzedBundle = Except<LinkedBundle, 'contents'> & {
17
16
  readonly contents: readonly AnalyzedBundleResource[];
18
17
  readonly sideEffectsField: readonly string[] | false | undefined;
19
18
  };
20
- export type EliminationInput = {
21
- readonly bundle: LinkedBundle;
22
- readonly transformationsEnabled: boolean;
23
- readonly substitutionPublicModuleSourceFilePaths: ReadonlySet<string>;
24
- readonly deadCodeElimination?: DeadCodeEliminationSettings | undefined;
25
- };
26
- export type DeadCodeEliminator = {
27
- eliminate: (inputs: readonly EliminationInput[]) => Promise<readonly AnalyzedBundle[]>;
28
- };
29
- export declare function createEmptyFileAnalysis(): FileAnalysis;
30
19
  //# sourceMappingURL=analyzed-bundle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyzed-bundle.d.ts","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/analyzed-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAErF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,oBAAoB,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,GAAG;IACxD,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG;IAC5D,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACrD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,GAAG,SAAS,CAAC;CACpE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,uCAAuC,EAAE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 +1 @@
1
- export function createEmptyFileAnalysis() {
2
- return {
3
- survivingBindings: new Set(),
4
- sideEffectStatements: [],
5
- sideEffectImports: new Set()
6
- };
7
- }
8
1
  //# sourceMappingURL=analyzed-bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyzed-bundle.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/analyzed-bundle.ts"],"names":[],"mappings":"AAmCA,MAAM,UAAU,uBAAuB;IACnC,OAAO;QACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;QACpC,oBAAoB,EAAE,EAAE;QACxB,iBAAiB,EAAE,IAAI,GAAG,EAAU;KACvC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"analyzed-bundle.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/analyzed-bundle.ts"],"names":[],"mappings":""}
@@ -1,49 +1,3 @@
1
- import { Node as TsMorphNode } from 'ts-morph';
2
- import { isPureExpression } from "./pure-expression.js";
3
- function memberHasDecorators(member) {
4
- if (TsMorphNode.isMethodDeclaration(member) ||
5
- TsMorphNode.isPropertyDeclaration(member) ||
6
- TsMorphNode.isGetAccessorDeclaration(member) ||
7
- TsMorphNode.isSetAccessorDeclaration(member)) {
8
- return member.getDecorators().length > 0;
9
- }
10
- return false;
11
- }
12
- function memberHasImpureStaticInit(member, settings) {
13
- if (!TsMorphNode.isPropertyDeclaration(member) || !member.isStatic()) {
14
- return false;
15
- }
16
- const initializer = member.getInitializer();
17
- return initializer !== undefined && !isPureExpression(initializer, settings);
18
- }
19
- function memberHasImpureComputedName(member, settings) {
20
- if (!TsMorphNode.isMethodDeclaration(member) &&
21
- !TsMorphNode.isPropertyDeclaration(member) &&
22
- !TsMorphNode.isGetAccessorDeclaration(member) &&
23
- !TsMorphNode.isSetAccessorDeclaration(member)) {
24
- return false;
25
- }
26
- const name = member.getNameNode();
27
- return TsMorphNode.isComputedPropertyName(name) && !isPureExpression(name.getExpression(), settings);
28
- }
29
- function classMemberIsImpure(member, settings) {
30
- if (TsMorphNode.isClassStaticBlockDeclaration(member)) {
31
- return true;
32
- }
33
- return memberHasDecorators(member) ||
34
- memberHasImpureComputedName(member, settings) ||
35
- memberHasImpureStaticInit(member, settings);
36
- }
37
- export function hasClassImpurity(classDeclaration, settings) {
38
- if (classDeclaration.getDecorators().length > 0) {
39
- return true;
40
- }
41
- const extendsExpression = classDeclaration.getExtends()?.getExpression();
42
- if (extendsExpression !== undefined && !isPureExpression(extendsExpression, settings)) {
43
- return true;
44
- }
45
- return classDeclaration.getMembers().some(function (member) {
46
- return classMemberIsImpure(member, settings);
47
- });
48
- }
1
+ import 'ts-morph';
2
+ import "./pure-expression.js";
49
3
  //# sourceMappingURL=class-purity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-purity.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/class-purity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAyB,MAAM,UAAU,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,SAAS,mBAAmB,CAAC,MAAmB;IAC5C,IACI,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC;QACvC,WAAW,CAAC,qBAAqB,CAAC,MAAM,CAAC;QACzC,WAAW,CAAC,wBAAwB,CAAC,MAAM,CAAC;QAC5C,WAAW,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAC9C,CAAC;QACC,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAmB,EAAE,QAAiD;IACrG,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;QACnE,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,C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AAC;QACpF,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,gBAAgB,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAU,MAAM;QACtD,OAAO,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"class-purity.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/class-purity.ts"],"names":[],"mappings":"AAAA,OAA2D,UAAU,CAAC;AAEtE,OAAiC,sBAAsB,CAAC"}
@@ -1,63 +1,5 @@
1
- import { createEmptyFileAnalysis } from "./analyzed-bundle.js";
2
- import { buildModuleAnalysis } from "./liveness/module-analysis.js";
3
- import { bindingId } from "./reachability/binding-id.js";
4
- import { applyRemovalPlan } from "./transform/declaration-remover.js";
5
- const noTransforms = [];
6
- function allBindingNamesFor(loaded) {
7
- const names = new Set();
8
- for (const binding of loaded.bindings) {
9
- names.add(binding.name);
10
- }
11
- return names;
12
- }
13
- function reachableBindingsFor(loaded, reachable) {
14
- const { sourceFilePath } = loaded.resource.fileDescription;
15
- return new Set(loaded.bindings.flatMap(function (binding) {
16
- return reachable.has(bindingId(sourceFilePath, binding.name)) ? [binding.name] : [];
17
- }));
18
- }
19
- function transformSourceFile(sourceFile, surviving) {
20
- const result = applyRemovalPlan(sourceFile, { survivingNames: surviving });
21
- return { transformedCode: sourceFile.getFullText(), atoms: result.atoms };
22
- }
23
- function analyzeCodeFile(loaded, context) {
24
- const moduleAnalysis = buildModuleAnalysis({
25
- sourceFilePath: loaded.resource.fileDescription.sourceFilePath,
26
- targetFilePath: loaded.resource.fileDescription.targetFilePath,
27
- sourceFile: loaded.sourceFile,
28
- bindings: loaded.bindings,
29
- deadCodeElimination: context.deadCodeElimination
30
- });
31
- const sideEffectStatements = moduleAnalysis.effects;
32
- const reachableBindings = reachableBindingsFor(loaded, context.reachable);
33
- const shouldTransform = context.transformationsEnabled;
34
- const survivingBindings = shouldTransform ? reachableBindings : allBindingNamesFor(loaded);
35
- return {
36
- analysis: { survivingBindings, sideEffectStatements, sideEffectImports: new Set() },
37
- reachableBindings,
38
- shouldTransform
39
- };
40
- }
41
- export function buildAnalyzedResource(loaded, context) {
42
- if (loaded.sourceFile === undefined) {
43
- return { resource: { ...loaded.resource, analysis: createEmptyFileAnalysis() }, transforms: noTransforms };
44
- }
45
- const { analysis, reachableBindings, shouldTransform } = analyzeCodeFile(loaded, context);
46
- if (!shouldTransform) {
47
- return { resource: { ...loaded.resource, analysis }, transforms: noTransforms };
48
- }
49
- const originalCode = loaded.resource.fileDescription.content;
50
- const { transformedCode, atoms } = transformSourceFile(loaded.sourceFile, reachableBindings);
51
- if (transformedCode === originalCode) {
52
- return { resource: { ...loaded.resource, analysis }, transforms: noTransforms };
53
- }
54
- return {
55
- resource: {
56
- ...loaded.resource,
57
- fileDescription: { ...loaded.resource.fileDescription, content: transformedCode },
58
- analysis
59
- },
60
- transforms: [{ textTransform: { originalCode, transformedCode, atoms } }]
61
- };
62
- }
1
+ import "./analyzed-bundle.js";
2
+ import "./liveness/module-analysis.js";
3
+ import "./reachability/binding-id.js";
4
+ import "./transform/declaration-remover.js";
63
5
  //# sourceMappingURL=code-file-analyzer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-file-analyzer.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/code-file-analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAkD,MAAM,sBAAsB,CAAC;AAE/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAsBtE,MAAM,YAAY,GAA+B,EAAE,CAAC;AAEpD,SAAS,kBAAkB,CAAC,MAA0B;IAClD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,OAAO,IA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CAAC;IACpF,CAAC;IACD,OAAO;QACH,QAAQ,EAAE;YACN,GAAG,MAAM,CAAC,QAAQ;YAClB,eAAe,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE;YACjF,QAAQ;SACX;QACD,UAAU,EAAE,CAAE,EAAE,aAAa,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,CAAE;KAC9E,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"code-file-analyzer.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/code-file-analyzer.ts"],"names":[],"mappings":"AAEA,OAAwF,sBAAsB,CAAC;AAE/G,OAAoC,+BAA+B,CAAC;AACpE,OAA0B,8BAA8B,CAAC;AAEzD,OAAiC,oCAAoC,CAAC"}
@@ -1,28 +1,2 @@
1
- import { resolvePublicModuleSourceFilePath } from "../../package-surface/public-specifiers.js";
2
- export function indexBundles(inputs) {
3
- const map = new Map();
4
- for (const input of inputs) {
5
- const bindingsByFilePath = new Map(input.fileBindings.map(function (file) {
6
- return [file.sourceFilePath, file];
7
- }));
8
- map.set(input.bundle.name, { bundle: input.bundle, bindingsByFilePath });
9
- }
10
- return map;
11
- }
12
- function tryResolveAgainstBundle(indexedBundle, specifier) {
13
- const sourceFilePath = resolvePublicModuleSourceFilePath(indexedBundle.bundle, specifier);
14
- if (sourceFilePath === undefined) {
15
- return undefined;
16
- }
17
- return { bundleName: indexedBundle.bundle.name, sourceFilePath, indexedBundle };
18
- }
19
- export function resolveCrossBundleTarget(specifier, indexed) {
20
- for (const info of indexed.values()) {
21
- const resolved = tryResolveAgainstBundle(info, specifier);
22
- if (resolved !== undefined) {
23
- return resolved;
24
- }
25
- }
26
- return undefined;
27
- }
1
+ import "../../package-surface/public-specifiers.js";
28
2
  //# sourceMappingURL=bundle-index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-index.js","sourceRoot":"","sources":["../../../../../source/dead-code-eli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":3,"file":"bundle-index.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/bundle-index.ts"],"names":[],"mappings":"AACA,OAAkD,4CAA4C,CAAC"}
@@ -1,19 +1,4 @@
1
- import { indexBundles } from "./bundle-index.js";
2
- import { walkCrossBundleStatements } from "./import-export-walker.js";
3
- import { createSeedStore } from "./seed-store.js";
4
- export function buildCrossBundleSeeds(inputs) {
5
- const indexed = indexBundles(inputs);
6
- let seeds = createSeedStore();
7
- for (const input of inputs) {
8
- for (const sourceFile of input.sourceFiles) {
9
- seeds = walkCrossBundleStatements(sourceFile, {
10
- indexed,
11
- seeds,
12
- sourceFilePath: sourceFile.getFilePath(),
13
- localReachable: input.localReachable
14
- });
15
- }
16
- }
17
- return seeds;
18
- }
1
+ import "./bundle-index.js";
2
+ import "./import-export-walker.js";
3
+ import "./seed-store.js";
19
4
  //# sourceMappingURL=cross-bundle-seeds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cross-bundle-seeds.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/cross-bundle-seeds.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAgB,MAAM,iBAAiB,CAAC;AAShE,MAAM,UAAU,qBAAqB,CAAC,MAAmC;IACrE,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,KAAK,GAAG,eAAe,EAAE,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACzB,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACzC,KAAK,GAAG,yBAAyB,CAAC,UAAU,EAAE;gBAC1C,OAAO;gBACP,KAAK;gBACL,cAAc,EAAE,UAAU,CAAC,WAAW,EAAE;gBACxC,cAAc,EAAE,KAAK,CAAC,cAAc;aACvC,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"cross-bundle-seeds.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/cross-bundle-seeds.ts"],"names":[],"mappings":"AAGA,OAA6B,mBAAmB,CAAC;AACjD,OAA0C,2BAA2B,CAAC;AACtE,OAA8C,iBAAiB,CAAC"}
@@ -1,76 +1,5 @@
1
- import { Node as TsMorphNode } from 'ts-morph';
2
- import { bindingId } from "../reachability/binding-id.js";
3
- import { resolveCrossBundleTarget } from "./bundle-index.js";
4
- import { recordSeed, seedAllBindings } from "./seed-store.js";
5
- function localNameOfNamedImport(namedImport) {
6
- const aliasNode = namedImport.getAliasNode();
7
- return aliasNode === undefined ? namedImport.getName() : aliasNode.getText();
8
- }
9
- function isLocalBindingReachable(context, localName) {
10
- return context.localReachable.has(bindingId(context.sourceFilePath, localName));
11
- }
12
- function recordDefaultImportSeed(importDeclaration, target, context) {
13
- const defaultImport = importDeclaration.getDefaultImport();
14
- if (defaultImport === undefined) {
15
- return context.seeds;
16
- }
17
- if (!isLocalBindingReachable(context, defaultImport.getText())) {
18
- return context.seeds;
19
- }
20
- return recordSeed(context.seeds, target.bundleName, bindingId(target.sourceFilePath, 'default'));
21
- }
22
- function recordNamedImportSeeds(importDeclaration, target, context) {
23
- let { seeds } = context;
24
- for (const namedImport of importDeclaration.getNamedImports()) {
25
- if (isLocalBindingReachable(context, localNameOfNamedImport(namedImport))) {
26
- seeds = recordSeed(seeds, target.bundleName, bindingId(target.sourceFilePath, namedImport.getName()));
27
- }
28
- }
29
- return seeds;
30
- }
31
- function processImportDeclaration(importDeclaration, context) {
32
- const target = resolveCrossBundleTarget(importDeclaration.getModuleSpecifierValue(), context.indexed);
33
- if (target === undefined) {
34
- return context.seeds;
35
- }
36
- const namespaceImport = importDeclaration.getNamespaceImport();
37
- if (namespaceImport !== undefined) {
38
- if (isLocalBindingReachable(context, namespaceImport.getText())) {
39
- return seedAllBindings(context.seeds, target);
40
- }
41
- return context.seeds;
42
- }
43
- const seeds = recordDefaultImportSeed(importDeclaration, target, context);
44
- return recordNamedImportSeeds(importDeclaration, target, { ...context, seeds });
45
- }
46
- function recordNamedReExportSeeds(exportDeclaration, target, seeds) {
47
- let nextSeeds = seeds;
48
- for (const namedExport of exportDeclaration.getNamedExports()) {
49
- nextSeeds = recordSeed(nextSeeds, target.bundleName, bindingId(target.sourceFilePath, namedExport.getName()));
50
- }
51
- return nextSeeds;
52
- }
53
- function processExportDeclaration(exportDeclaration, context) {
54
- const specifier = exportDeclaration.getModuleSpecifierValue() ?? context.sourceFilePath;
55
- const target = resolveCrossBundleTarget(specifier, context.indexed);
56
- if (target === undefined) {
57
- return context.seeds;
58
- }
59
- if (exportDeclaration.isNamespaceExport()) {
60
- return seedAllBindings(context.seeds, target);
61
- }
62
- return recordNamedReExportSeeds(exportDeclaration, target, context.seeds);
63
- }
64
- export function walkCrossBundleStatements(sourceFile, context) {
65
- let { seeds } = context;
66
- for (const statement of sourceFile.getStatements()) {
67
- if (TsMorphNode.isImportDeclaration(statement)) {
68
- seeds = processImportDeclaration(statement, { ...context, seeds });
69
- }
70
- else if (TsMorphNode.isExportDeclaration(statement)) {
71
- seeds = processExportDeclaration(statement, { ...context, seeds });
72
- }
73
- }
74
- return seeds;
75
- }
1
+ import 'ts-morph';
2
+ import "../reachability/binding-id.js";
3
+ import "./bundle-index.js";
4
+ import "./seed-store.js";
76
5
  //# sourceMappingURL=import-export-walker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-export-walker.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/import-export-walker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAmE,MAAM,UAAU,CAAC;AAChH,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAA2C,MAA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,CAAC,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,wBAAwB,CAAC,iBAAoC,EAAE,OAAoB;IACxF,MAAM,SAAS,GAAG,iBAAiB,CAAC,uBAAuB,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC;IACxF,MAAM,MAAM,GAAG,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC,KAAK,CAAC;IACzB,CAAC;IACD,IAAI,iBAAiB,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACxC,OAAO,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,wBAAwB,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,UAAgC,EAAE,OAAoB;IAC5F,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACxB,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC;QACjD,IAAI,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7C,KAAK,GAAG,wBAAwB,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QACvE,CAAC;aAAM,IAAI,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,CAAC;YACpD,KAAK,GAAG,wBAAwB,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QACvE,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"import-export-walker.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/import-export-walker.ts"],"names":[],"mappings":"AAAA,OAAqG,UAAU,CAAC;AAChH,OAA0B,+BAA+B,CAAC;AAC1D,OAAkF,mBAAmB,CAAC;AACtG,OAA0D,iBAAiB,CAAC"}
@@ -1,23 +1,2 @@
1
- import { bindingId } from "../reachability/binding-id.js";
2
- export function createSeedStore() {
3
- return new Map();
4
- }
5
- export function recordSeed(seeds, bundleName, seed) {
6
- const nextSeeds = new Map(seeds);
7
- const existing = new Set(nextSeeds.get(bundleName));
8
- existing.add(seed);
9
- nextSeeds.set(bundleName, existing);
10
- return nextSeeds;
11
- }
12
- export function seedAllBindings(seeds, target) {
13
- const fileBindings = target.indexedBundle.bindingsByFilePath.get(target.sourceFilePath);
14
- if (fileBindings === undefined) {
15
- return seeds;
16
- }
17
- let nextSeeds = seeds;
18
- for (const binding of fileBindings.bindings) {
19
- nextSeeds = recordSeed(nextSeeds, target.bundleName, bindingId(target.sourceFilePath, binding.name));
20
- }
21
- return nextSeeds;
22
- }
1
+ import "../reachability/binding-id.js";
23
2
  //# sourceMappingURL=seed-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seed-store.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/seed-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAK1D,MAAM,UAAU,eAAe;IAC3B,OAAO,IAAI,GAAG,EAA+B,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc,EAAE,UAAkB,EAAE,IAAY;IACvE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnB,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACpC,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc,EAAE,MAAsB;IAClE,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACxF,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,KAAK,MAAM,OAAO,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1C,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACzG,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"seed-store.js","sourceRoot":"","sources":["../../../../../source/dead-code-eliminator/cross-bundle/seed-store.ts"],"names":[],"mappings":"AAAA,OAA0B,+BAA+B,CAAC"}
@@ -1,206 +1,4 @@
1
- import path from 'node:path';
2
- import { getModuleReferenceLiterals } from "../dependency-scanner/source-file-references.js";
3
- import { isCodeTargetPath } from "./liveness/runtime-code.js";
4
- const scopedPackageSegmentCount = 2;
5
- function packageNameFromSpecifier(specifier) {
6
- if (!specifier.startsWith('@')) {
7
- return specifier.split('/', 1)[0] ?? specifier;
8
- }
9
- const [scope, name] = specifier.split('/', scopedPackageSegmentCount);
10
- if (name === undefined) {
11
- throw new Error(`Invalid package specifier "${specifier}"`);
12
- }
13
- return `${scope}/${name}`;
14
- }
15
- function isRelativeOrAbsoluteSpecifier(specifier) {
16
- return specifier.startsWith('.') || path.isAbsolute(specifier);
17
- }
18
- function isPackageSpecifier(specifier) {
19
- return !isRelativeOrAbsoluteSpecifier(specifier) && !specifier.startsWith('#');
20
- }
21
- function collectImportSpecifiers(sourceFile) {
22
- return getModuleReferenceLiterals(sourceFile)
23
- .map(function (literal) {
24
- return literal.getLiteralValue();
25
- });
26
- }
27
- function addPackageSpecifier(specifiersByName, specifier) {
28
- const name = packageNameFromSpecifier(specifier);
29
- const specifiers = new Set(specifiersByName.get(name));
30
- specifiers.add(specifier);
31
- const next = new Map(specifiersByName);
32
- next.set(name, specifiers);
33
- return next;
34
- }
35
- function packageSpecifiersFor(resource, sourceFilesByPath) {
36
- let specifiersByName = new Map();
37
- const sourceFile = sourceFilesByPath.get(resource.fileDescription.sourceFilePath);
38
- if (sourceFile === undefined) {
39
- return specifiersByName;
40
- }
41
- for (const specifier of collectImportSpecifiers(sourceFile)) {
42
- if (isPackageSpecifier(specifier)) {
43
- specifiersByName = addPackageSpecifier(specifiersByName, specifier);
44
- }
45
- }
46
- return specifiersByName;
47
- }
48
- function localCandidates(sourceFilePath, specifier) {
49
- const resolved = path.resolve(path.dirname(sourceFilePath), specifier);
50
- const candidates = [resolved];
51
- if (sourceFilePath.endsWith('.d.ts')) {
52
- candidates.push(resolved.replace(/\.js$/u, '.d.ts'));
53
- }
54
- candidates.push(`${resolved}.js`, `${resolved}.jsx`, `${resolved}.ts`, `${resolved}.tsx`, `${resolved}.json`);
55
- return candidates;
56
- }
57
- function survivingLocalPaths(resource, sourceFilesByPath) {
58
- const paths = new Set();
59
- for (const [sourceFilePath, sourceFile] of sourceFilesByPath) {
60
- if (sourceFilePath === resource.fileDescription.sourceFilePath) {
61
- for (const specifier of collectImportSpecifiers(sourceFile)) {
62
- if (isRelativeOrAbsoluteSpecifier(specifier)) {
63
- for (const candidate of localCandidates(resource.fileDescription.sourceFilePath, specifier)) {
64
- paths.add(candidate);
65
- }
66
- }
67
- }
68
- }
69
- }
70
- return paths;
71
- }
72
- function recomputeDirectDependencies(resource, sourceFilesByPath) {
73
- if (!isCodeTargetPath(resource.fileDescription.targetFilePath)) {
74
- return resource;
75
- }
76
- const survivingPaths = survivingLocalPaths(resource, sourceFilesByPath);
77
- return {
78
- ...resource,
79
- directDependencies: new Set(Array.from(resource.directDependencies).filter(function (dependency) {
80
- return survivingPaths.has(dependency) || dependency.endsWith('.map');
81
- }))
82
- };
83
- }
84
- function referencedPackagesByPath(contents, sourceFilesByPath) {
85
- return new Map(contents.map(function (resource) {
86
- return [resource.fileDescription.sourceFilePath, packageSpecifiersFor(resource, sourceFilesByPath)];
87
- }));
88
- }
89
- function legacyDependencyReference(dependency, sourceFilePath) {
90
- return {
91
- sourceFilePath,
92
- sourceSpecifier: dependency.name,
93
- emittedSpecifier: dependency.name
94
- };
95
- }
96
- function legacyDependencyReferences(dependency) {
97
- const [sourceFilePath, ...rest] = dependency.referencedFrom;
98
- return [
99
- legacyDependencyReference(dependency, sourceFilePath),
100
- ...rest.map(function (filePath) {
101
- return legacyDependencyReference(dependency, filePath);
102
- })
103
- ];
104
- }
105
- function dependencyReferences(dependency) {
106
- return dependency.references ?? legacyDependencyReferences(dependency);
107
- }
108
- function isSameDependencyReference(left, right) {
109
- return left.sourceFilePath === right.sourceFilePath &&
110
- left.sourceSpecifier === right.sourceSpecifier &&
111
- left.emittedSpecifier === right.emittedSpecifier;
112
- }
113
- function uniqueDependencyReferences(references) {
114
- const [firstReference, ...rest] = references;
115
- const unique = [firstReference];
116
- for (const reference of rest) {
117
- const isNewReference = unique.every(function (value) {
118
- return !isSameDependencyReference(value, reference);
119
- });
120
- if (isNewReference) {
121
- unique.push(reference);
122
- }
123
- }
124
- return unique;
125
- }
126
- function mergeDependencySourcePaths(dependency, reference) {
127
- const sourcePaths = new Set([...dependency.referencedFrom, reference.sourceFilePath]);
128
- sourcePaths.delete(dependency.referencedFrom[0]);
129
- return [dependency.referencedFrom[0], ...sourcePaths];
130
- }
131
- function mergeDependencyReferences(dependency, reference) {
132
- const [firstReference, ...rest] = dependencyReferences(dependency);
133
- return uniqueDependencyReferences([firstReference, ...rest, reference]);
134
- }
135
- function addReference(dependencies, dependencyName, reference) {
136
- const dependency = dependencies.get(dependencyName);
137
- if (dependency === undefined) {
138
- dependencies.set(dependencyName, {
139
- name: dependencyName,
140
- referencedFrom: [reference.sourceFilePath],
141
- references: [reference]
142
- });
143
- return;
144
- }
145
- dependencies.set(dependencyName, {
146
- name: dependencyName,
147
- referencedFrom: mergeDependencySourcePaths(dependency, reference),
148
- references: mergeDependencyReferences(dependency, reference)
149
- });
150
- }
151
- function shouldPreserveDependencyReference(dependency, reference, packagesByPath, preservedReferencePaths) {
152
- if (preservedReferencePaths.has(reference.sourceFilePath)) {
153
- return true;
154
- }
155
- const emittedSpecifiers = packagesByPath.get(reference.sourceFilePath)?.get(dependency.name);
156
- if (emittedSpecifiers === undefined) {
157
- return false;
158
- }
159
- return dependency.references === undefined ||
160
- emittedSpecifiers.has(reference.emittedSpecifier);
161
- }
162
- function recomputeDependencies(dependencies, packagesByPath, preservedReferencePaths) {
163
- const recomputed = new Map();
164
- for (const dependency of dependencies.values()) {
165
- for (const reference of dependencyReferences(dependency)) {
166
- if (shouldPreserveDependencyReference(dependency, reference, packagesByPath, preservedReferencePaths)) {
167
- addReference(recomputed, dependency.name, reference);
168
- }
169
- }
170
- }
171
- return recomputed;
172
- }
173
- function declarationSourcePaths(contents) {
174
- const paths = new Set();
175
- for (const resource of contents) {
176
- if (resource.fileDescription.targetFilePath.endsWith('.d.ts')) {
177
- paths.add(resource.fileDescription.sourceFilePath);
178
- }
179
- }
180
- return paths;
181
- }
182
- function filterSubstitutedSourcePaths(substitutedSourceFilePathsByPackageName, linkedBundleDependencies) {
183
- return new Map(Array.from(substitutedSourceFilePathsByPackageName).filter(function ([packageName]) {
184
- return linkedBundleDependencies.has(packageName);
185
- }));
186
- }
187
- export function indexSourceFiles(loaded) {
188
- return new Map(loaded.fileBindings.map(function (binding) {
189
- return [binding.sourceFilePath, binding.sourceFile];
190
- }));
191
- }
192
- export function recomputeDependencyMetadata(bundle, contents, sourceFileIndex) {
193
- const recomputedContents = contents.map(function (resource) {
194
- return recomputeDirectDependencies(resource, sourceFileIndex);
195
- });
196
- const packagesByPath = referencedPackagesByPath(recomputedContents, sourceFileIndex);
197
- const preservedReferencePaths = declarationSourcePaths(recomputedContents);
198
- const linkedBundleDependencies = recomputeDependencies(bundle.linkedBundleDependencies, packagesByPath, preservedReferencePaths);
199
- return {
200
- contents: recomputedContents,
201
- externalDependencies: recomputeDependencies(bundle.externalDependencies, packagesByPath, preservedReferencePaths),
202
- linkedBundleDependencies,
203
- substitutedSourceFilePathsByPackageName: filterSubstitutedSourcePaths(bundle.substitutedSourceFilePathsByPackageName, linkedBundleDependencies)
204
- };
205
- }
1
+ import 'node:path';
2
+ import "../dependency-scanner/source-file-references.js";
3
+ import "./liveness/runtime-code.js";
206
4
  //# sourceMappingURL=dependency-metadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-metadata.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/dependency-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAG7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAqC9D,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,SAAS,wBAAwB,CAAC,SAAiB;IAC/C,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;IACnD,CAAC;IACD,MAAM,CAAE,KAAK,EAAE,IAAI,CAAE,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;IACxE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,SAAS,GAAG,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,6BAA6B,CAAC,SAAiB;IACpD,OAAO,SAAS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BAAgB,CAAC,MAAoB;IACjD,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,OAAO;QACpD,OAAO,CAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAE,CAAC;IAC1D,CAAC,CAAC,CAAC,CAAC;AACR,CAAC;AAED,MAAM,UAAU,2BAA2B,CACvC,MAAsB,EACtB,QAA2C,EAC3C,eAAiC;IAEjC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,QAAQ;QACtD,OAAO,2BAA2B,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,wBAAwB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;IACrF,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;IAC3E,MAAM,wBAAwB,GAAG,qBAAqB,CAClD,MAAM,CAAC,wBAAwB,EAC/B,cAAc,EACd,uBAAuB,CAC1B,CAAC;IACF,OAAO;QACH,QAAQ,EAAE,kBAAkB;QAC5B,oBAAoB,EAAE,qBAAqB,CACvC,MAAM,CAAC,oBAAoB,EAC3B,cAAc,EACd,uBAAuB,CAC1B;QACD,wBAAwB;QACxB,uCAAuC,EAAE,4BAA4B,CACjE,MAAM,CAAC,uCAAuC,EAC9C,wBAAwB,CAC3B;KACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"dependency-metadata.js","sourceRoot":"","sources":["../../../../source/dead-code-eliminator/dependency-metadata.ts"],"names":[],"mappings":"AAAA,OAAiB,WAAW,CAAC;AAC7B,OAA2C,iDAAiD,CAAC;AAG7F,OAAiC,4BAA4B,CAAC"}