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 +1 @@
1
- {"version":3,"file":"max-bundle-size.js","sourceRoot":"","sources":["../../../../../source/checks/rules/max-bundle-size.ts"],"names":[],"mappings":"AAAA,OAAkB,UAAU,CAAC"}
1
+ {"version":3,"file":"max-bundle-size.js","sourceRoot":"","sources":["../../../../../source/checks/rules/max-bundle-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAI7B,SAAS,QAAQ;IACb,OAAO,eAAe,CAAC;AAC3B,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAMnE,SAAS,YAAY;IACjB,OAAO,CAAC,CAAC,YAAY,CAAC;QAClB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;KACrC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,gBAAgB;IACrB,OAAO,CAAC,CAAC,YAAY,CAAC;QAClB,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;KACrC,CAAC,CAAC;AACP,CAAC;AAID,SAAS,eAAe,CAAC,MAAsB;IAC3C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrC,KAAK,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,WAAW,CAAC,MAAsB,EAAE,SAA6B;IACtE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,CAAE,YAAY,MAAM,CAAC,IAAI,sCAAsC,IAAI,kBAAkB,SAAS,SAAS,CAAE,CAAC;AACrH,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,KAAe;IAC9B,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC;IACnD,IAAI,YAAY,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,MAAM;QACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC;QACjF,OAAO,WAAW,CAAC,MAAM,EAAE,QAAQ,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAkE;IAC5F,IAAI,IAAI;QACJ,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,YAAY,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,gBAAgB;QAChB,OAAO,gBAAgB,EAAE,CAAC;IAC9B,CAAC;IACD,GAAG;CACN,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { z } from 'zod/mini';
2
+ import { type CheckRuleDefinition, emptyPerPackageSchema, enabledOnlyGlobalSchema } from '../rule.ts';
3
+ declare function ruleName(): 'noDevDependencyImports';
4
+ declare function globalSchema(): typeof enabledOnlyGlobalSchema;
5
+ declare function perPackageSchema(): typeof emptyPerPackageSchema;
6
+ type RuleName = ReturnType<typeof ruleName>;
7
+ type GlobalConfig = Readonly<z.infer<ReturnType<typeof globalSchema>>>;
8
+ type PerPackageConfig = Readonly<z.infer<ReturnType<typeof perPackageSchema>>>;
9
+ export declare const noDevDependencyImportsRule: CheckRuleDefinition<RuleName, GlobalConfig, PerPackageConfig>;
10
+ export {};
11
+ //# sourceMappingURL=no-dev-dependency-imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-dev-dependency-imports.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/no-dev-dependency-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EACH,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,uBAAuB,EAG1B,MAAM,YAAY,CAAC;AAEpB,iBAAS,QAAQ,IAAI,wBAAwB,CAE5C;AAED,iBAAS,YAAY,IAAI,OAAO,uBAAuB,CAEtD;AAED,iBAAS,gBAAgB,IAAI,OAAO,qBAAqB,CAExD;AAED,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;AACvE,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAuC/E,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAWpG,CAAC"}
@@ -1,2 +1,52 @@
1
- import "../rule.js";
1
+ import { emptyPerPackageSchema, enabledOnlyGlobalSchema } from "../rule.js";
2
+ function ruleName() {
3
+ return 'noDevDependencyImports';
4
+ }
5
+ function globalSchema() {
6
+ return enabledOnlyGlobalSchema;
7
+ }
8
+ function perPackageSchema() {
9
+ return emptyPerPackageSchema;
10
+ }
11
+ function findLeakedDevDependencies(bundle, packageConfig) {
12
+ const mainPackageJson = packageConfig?.mainPackageJson;
13
+ if (mainPackageJson === undefined) {
14
+ return [];
15
+ }
16
+ const runtimeDependencyNames = new Set([
17
+ ...Object.keys(mainPackageJson.dependencies ?? {}),
18
+ ...Object.keys(mainPackageJson.peerDependencies ?? {})
19
+ ]);
20
+ const devDependencyNames = new Set(Object.keys(mainPackageJson.devDependencies ?? {}));
21
+ return Array
22
+ .from(bundle.externalDependencies.keys())
23
+ .filter(function (name) {
24
+ return devDependencyNames.has(name) && !runtimeDependencyNames.has(name);
25
+ })
26
+ .map(function (name) {
27
+ const reason = 'is only declared in devDependencies of the main package.json';
28
+ return `Package "${bundle.name}" imports "${name}" which ${reason}`;
29
+ });
30
+ }
31
+ async function run(input) {
32
+ const globalConfig = input.settings?.noDevDependencyImports;
33
+ if (globalConfig?.enabled !== true) {
34
+ return [];
35
+ }
36
+ return input.bundles.flatMap(function (bundle) {
37
+ return findLeakedDevDependencies(bundle, input.packageConfigs?.[bundle.name]);
38
+ });
39
+ }
40
+ export const noDevDependencyImportsRule = {
41
+ get name() {
42
+ return ruleName();
43
+ },
44
+ get globalSchema() {
45
+ return globalSchema();
46
+ },
47
+ get perPackageSchema() {
48
+ return perPackageSchema();
49
+ },
50
+ run
51
+ };
2
52
  //# sourceMappingURL=no-dev-dependency-imports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-dev-dependency-imports.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-dev-dependency-imports.ts"],"names":[],"mappings":"AAEA,OAMO,YAAY,CAAC"}
1
+ {"version":3,"file":"no-dev-dependency-imports.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-dev-dependency-imports.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,qBAAqB,EACrB,uBAAuB,EAG1B,MAAM,YAAY,CAAC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AAC;QACjC,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,MAAM;QACzC,OAAO,yBAAyB,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAkE;IACrG,IAAI,IAAI;QACJ,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,YAAY,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,gBAAgB;QAChB,OAAO,gBAAgB,EAAE,CAAC;IAC9B,CAAC;IACD,GAAG;CACN,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { z } from 'zod/mini';
2
+ import { type CheckRuleDefinition, pathAllowListGlobalSchema, pathAllowListPerPackageSchema } from '../rule.ts';
3
+ declare function ruleName(): 'noDuplicatedFiles';
4
+ declare function globalSchema(): typeof pathAllowListGlobalSchema;
5
+ declare function perPackageSchema(): typeof pathAllowListPerPackageSchema;
6
+ type RuleName = ReturnType<typeof ruleName>;
7
+ type GlobalConfig = Readonly<z.infer<ReturnType<typeof globalSchema>>>;
8
+ type PerPackageConfig = Readonly<z.infer<ReturnType<typeof perPackageSchema>>>;
9
+ export declare const noDuplicatedFilesRule: CheckRuleDefinition<RuleName, GlobalConfig, PerPackageConfig>;
10
+ export {};
11
+ //# sourceMappingURL=no-duplicated-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-duplicated-files.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/no-duplicated-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EACH,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,6BAA6B,EAEhC,MAAM,YAAY,CAAC;AAIpB,iBAAS,QAAQ,IAAI,mBAAmB,CAEvC;AAED,iBAAS,YAAY,IAAI,OAAO,yBAAyB,CAExD;AAED,iBAAS,gBAAgB,IAAI,OAAO,6BAA6B,CAEhE;AAED,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;AACvE,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;AA2C/E,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAW/F,CAAC"}
@@ -1,4 +1,54 @@
1
- import "../rule.js";
2
- import "./duplicate-detection.js";
3
- import "./file-ownership.js";
1
+ import { pathAllowListGlobalSchema, pathAllowListPerPackageSchema } from "../rule.js";
2
+ import { duplicateMessage, hasMultipleOwners } from "./duplicate-detection.js";
3
+ import { collectFileOwnership } from "./file-ownership.js";
4
+ function ruleName() {
5
+ return 'noDuplicatedFiles';
6
+ }
7
+ function globalSchema() {
8
+ return pathAllowListGlobalSchema;
9
+ }
10
+ function perPackageSchema() {
11
+ return pathAllowListPerPackageSchema;
12
+ }
13
+ function everyOwnerConsents(filePath, owners, perPackageSettings) {
14
+ return owners.every(function (owner) {
15
+ const allowList = perPackageSettings.get(owner.bundleName)?.noDuplicatedFiles?.allowList;
16
+ return allowList?.includes(filePath) ?? false;
17
+ });
18
+ }
19
+ function findDuplicateIssues(bundles, perPackageSettings, globalConfig) {
20
+ const globallyAllowed = new Set(globalConfig.allowList);
21
+ return Array.from(collectFileOwnership(bundles)).flatMap(function ([filePath, owners]) {
22
+ if (!hasMultipleOwners(owners)) {
23
+ return [];
24
+ }
25
+ const message = duplicateMessage(filePath, owners);
26
+ if (message === undefined) {
27
+ return [];
28
+ }
29
+ if (globallyAllowed.has(filePath) || everyOwnerConsents(filePath, owners, perPackageSettings)) {
30
+ return [];
31
+ }
32
+ return [message];
33
+ });
34
+ }
35
+ async function run(input) {
36
+ const globalConfig = input.settings?.noDuplicatedFiles;
37
+ if (globalConfig?.enabled !== true) {
38
+ return [];
39
+ }
40
+ return findDuplicateIssues(input.bundles, input.perPackageSettings, globalConfig);
41
+ }
42
+ export const noDuplicatedFilesRule = {
43
+ get name() {
44
+ return ruleName();
45
+ },
46
+ get globalSchema() {
47
+ return globalSchema();
48
+ },
49
+ get perPackageSchema() {
50
+ return perPackageSchema();
51
+ },
52
+ run
53
+ };
4
54
  //# sourceMappingURL=no-duplicated-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-duplicated-files.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-duplicated-files.ts"],"names":[],"mappings":"AAEA,OAKO,YAAY,CAAC;AACpB,OAAoD,0BAA0B,CAAC;AAC/E,OAAqD,qBAAqB,CAAC"}
1
+ {"version":3,"file":"no-duplicated-files.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-duplicated-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,yBAAyB,EACzB,6BAA6B,EAEhC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAkB,MAAM,qBAAqB,CAAC;AAE3E,SAAS,QAAQ;IACb,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAED,SAAS,YAAY;IACjB,OAAO,yBAAyB,CAAC;AACrC,CAAC;AAED,SAAS,gBAAgB;IACrB,OAAO,6BAA6B,CAAC;AACzC,CAAC;AAOD,SAAS,kBAAkB,CACvB,QAAgB,EAChB,MAA4B,EAC5B,kBAAkD;IAElD,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK;QAC/B,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAA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AI;QACJ,OAAO,QAAQ,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,YAAY,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,gBAAgB;QAChB,OAAO,gBAAgB,EAAE,CAAC;IAC9B,CAAC;IACD,GAAG;CACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { z } from 'zod/mini';
2
+ import { type CheckRuleDefinition } from '../rule.ts';
3
+ declare const ruleName = "noSideEffects";
4
+ declare const globalSchema: z.ZodMiniObject<{
5
+ allowList: z.ZodMiniOptional<z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniString<string>>>>;
6
+ enabled: z.ZodMiniBoolean<boolean>;
7
+ }, z.core.$strict>;
8
+ declare const perPackageSchema: z.ZodMiniObject<{
9
+ allowList: z.ZodMiniOptional<z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniString<string>>>>;
10
+ }, z.core.$strict>;
11
+ type GlobalConfig = Readonly<z.infer<typeof globalSchema>>;
12
+ type PerPackageConfig = Readonly<z.infer<typeof perPackageSchema>>;
13
+ export declare const noSideEffectsRule: CheckRuleDefinition<typeof ruleName, GlobalConfig, PerPackageConfig>;
14
+ export {};
15
+ //# sourceMappingURL=no-side-effects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-side-effects.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/no-side-effects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAGH,KAAK,mBAAmB,EAE3B,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,QAAQ,kBAAkB,CAAC;AAEjC,QAAA,MAAM,YAAY;;;kBAA4B,CAAC;AAC/C,QAAA,MAAM,gBAAgB;;kBAAgC,CAAC;AAEvD,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAC3D,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AA8DnE,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAKlG,CAAC"}
@@ -1,2 +1,51 @@
1
- import "../rule.js";
1
+ import { pathAllowListGlobalSchema, pathAllowListPerPackageSchema } from "../rule.js";
2
+ const ruleName = 'noSideEffects';
3
+ const globalSchema = pathAllowListGlobalSchema;
4
+ const perPackageSchema = pathAllowListPerPackageSchema;
5
+ function formatStatement(statement) {
6
+ return `line ${statement.line}: ${statement.kind}`;
7
+ }
8
+ function isAllowedFor(inputFilePath, bundleName, globalAllowList, perPackageSettings) {
9
+ if (globalAllowList.has(inputFilePath)) {
10
+ return true;
11
+ }
12
+ const packageAllowList = perPackageSettings.get(bundleName)?.noSideEffects?.allowList;
13
+ return packageAllowList?.includes(inputFilePath) ?? false;
14
+ }
15
+ function reportResource(bundleName, resource) {
16
+ const sourcePath = resource.fileDescription.inputFilePath;
17
+ const lines = resource.analysis.sideEffectStatements.map(function (statement) {
18
+ return ` - ${formatStatement(statement)}`;
19
+ });
20
+ const header = `File "${sourcePath}" in package "${bundleName}" has top-level side effects:`;
21
+ const footer = 'Side effects prevent downstream tree-shaking.';
22
+ return [header, ...lines, footer].join('\n');
23
+ }
24
+ function findSideEffectsInBundle(bundle, globalAllowList, perPackageSettings) {
25
+ return bundle.contents.flatMap(function (resource) {
26
+ if (resource.analysis.sideEffectStatements.length === 0) {
27
+ return [];
28
+ }
29
+ if (isAllowedFor(resource.fileDescription.inputFilePath, bundle.name, globalAllowList, perPackageSettings)) {
30
+ return [];
31
+ }
32
+ return [reportResource(bundle.name, resource)];
33
+ });
34
+ }
35
+ async function run(input) {
36
+ const globalConfig = input.settings?.noSideEffects;
37
+ if (globalConfig?.enabled !== true) {
38
+ return [];
39
+ }
40
+ const globalAllowList = new Set(globalConfig.allowList);
41
+ return input.bundles.flatMap(function (bundle) {
42
+ return findSideEffectsInBundle(bundle, globalAllowList, input.perPackageSettings);
43
+ });
44
+ }
45
+ export const noSideEffectsRule = {
46
+ name: ruleName,
47
+ globalSchema,
48
+ perPackageSchema,
49
+ run
50
+ };
2
51
  //# sourceMappingURL=no-side-effects.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-side-effects.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-side-effects.ts"],"names":[],"mappings":"AAEA,OAKO,YAAY,CAAC"}
1
+ {"version":3,"file":"no-side-effects.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-side-effects.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,6BAA6B,EAGhC,MAAM,YAAY,CAAC;AAEpB,MAAM,QAAQ,GAAG,eAAe,CAAC;AAEjC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAC/C,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAWvD,SAAS,eAAe,CAAC,SAA8B;IACnD,OAAO,QAAQ,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,YAAY,CACjB,aAAqB,EACrB,UAAkB,EAClB,eAAoC,EACpC,kBAA+D;IAE/D,IAAI,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC;IACtF,OAAO,gBAAgB,EAAE,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC;AAC9D,CAAC;AAED,SAAS,cAAc,CAAC,UAAkB,EAAE,QAAgC;IACxE,MAAM,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,aAAa,CAAC;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAA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tF,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAyE;IACnG,IAAI,EAAE,QAAQ;IACd,YAAY;IACZ,gBAAgB;IAChB,GAAG;CACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { z } from 'zod/mini';
2
+ import { emptyPerPackageSchema, enabledOnlyGlobalSchema, type CheckRuleDefinition } from '../rule.ts';
3
+ declare const ruleName = "noUnexposedExecutables";
4
+ type GlobalConfig = Readonly<z.infer<typeof enabledOnlyGlobalSchema>>;
5
+ type PerPackageConfig = Readonly<z.infer<typeof emptyPerPackageSchema>>;
6
+ export declare const noUnexposedExecutablesRule: CheckRuleDefinition<typeof ruleName, GlobalConfig, PerPackageConfig>;
7
+ export {};
8
+ //# sourceMappingURL=no-unexposed-executables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unexposed-executables.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/no-unexposed-executables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAMlC,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,mBAAmB,EAE3B,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,QAAQ,2BAA2B,CAAC;AAE1C,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC;AACtE,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AA8CxE,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,CAAC,OAAO,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAK3G,CAAC"}
@@ -1,3 +1,44 @@
1
- import "../../published-package/published-package.js";
2
- import "../rule.js";
1
+ import { explicitBinTargetPaths } from "../../published-package/published-package.js";
2
+ import { emptyPerPackageSchema, enabledOnlyGlobalSchema } from "../rule.js";
3
+ const ruleName = 'noUnexposedExecutables';
4
+ function reportExecutable(bundleName, resource) {
5
+ const { inputFilePath, targetFilePath } = resource.fileDescription;
6
+ return `Package "${bundleName}" ships executable file "${targetFilePath}" from "${inputFilePath}" ` +
7
+ 'that is not exposed through bin';
8
+ }
9
+ function findUnexposedExecutables(bundle, publishedPackage) {
10
+ const binTargets = explicitBinTargetPaths(publishedPackage);
11
+ return bundle.contents.flatMap(function (resource) {
12
+ if (!resource.fileDescription.isExecutable) {
13
+ return [];
14
+ }
15
+ if (binTargets.has(resource.fileDescription.targetFilePath)) {
16
+ return [];
17
+ }
18
+ return [reportExecutable(bundle.name, resource)];
19
+ });
20
+ }
21
+ async function run(input) {
22
+ const globalConfig = input.settings?.noUnexposedExecutables;
23
+ if (globalConfig?.enabled !== true) {
24
+ return [];
25
+ }
26
+ const { publishedPackages } = input;
27
+ if (publishedPackages === undefined) {
28
+ throw new Error('Published packages missing for unexposed executable checks');
29
+ }
30
+ return input.bundles.flatMap(function (bundle) {
31
+ const publishedPackage = publishedPackages.get(bundle.name);
32
+ if (publishedPackage === undefined) {
33
+ throw new Error(`Published package missing for "${bundle.name}"`);
34
+ }
35
+ return findUnexposedExecutables(bundle, publishedPackage);
36
+ });
37
+ }
38
+ export const noUnexposedExecutablesRule = {
39
+ name: ruleName,
40
+ globalSchema: enabledOnlyGlobalSchema,
41
+ perPackageSchema: emptyPerPackageSchema,
42
+ run
43
+ };
3
44
  //# sourceMappingURL=no-unexposed-executables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-unexposed-executables.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-unexposed-executables.ts"],"names":[],"mappings":"AAEA,OAGO,8CAA8C,CAAC;AACtD,OAKO,YAAY,CAAC"}
1
+ {"version":3,"file":"no-unexposed-executables.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-unexposed-executables.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,sBAAsB,EAEzB,MAAM,8CAA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U,MAAM;QACzC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAyE;IAC5G,IAAI,EAAE,QAAQ;IACd,YAAY,EAAE,uBAAuB;IACrC,gBAAgB,EAAE,qBAAqB;IACvC,GAAG;CACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { z } from 'zod/mini';
2
+ import { emptyPerPackageSchema, enabledOnlyGlobalSchema, type CheckRuleDefinition } from '../rule.ts';
3
+ declare const ruleName = "noUnusedBundleDependencies";
4
+ type GlobalConfig = Readonly<z.infer<typeof enabledOnlyGlobalSchema>>;
5
+ type PerPackageConfig = Readonly<z.infer<typeof emptyPerPackageSchema>>;
6
+ export declare const noUnusedBundleDependenciesRule: CheckRuleDefinition<typeof ruleName, GlobalConfig, PerPackageConfig>;
7
+ export {};
8
+ //# sourceMappingURL=no-unused-bundle-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unused-bundle-dependencies.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/no-unused-bundle-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EACH,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,mBAAmB,EAG3B,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,QAAQ,+BAA+B,CAAC;AAE9C,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC;AACtE,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;AA8BxE,eAAO,MAAM,8BAA8B,EAAE,mBAAmB,CAAC,OAAO,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAK/G,CAAC"}
@@ -1,3 +1,31 @@
1
- import "../../common/bundled-dependency-groups.js";
2
- import "../rule.js";
1
+ import { bundledDependencyGroups } from "../../common/bundled-dependency-groups.js";
2
+ import { emptyPerPackageSchema, enabledOnlyGlobalSchema } from "../rule.js";
3
+ const ruleName = 'noUnusedBundleDependencies';
4
+ function checkBundle(bundle, packageConfig) {
5
+ const issues = [];
6
+ for (const group of bundledDependencyGroups()) {
7
+ const declaredDependencies = packageConfig?.[group.propertyName] ?? [];
8
+ for (const dependencyName of declaredDependencies) {
9
+ if (!bundle.linkedBundleDependencies.has(dependencyName)) {
10
+ issues.push(`Unused ${group.unusedLabel} dependency "${dependencyName}" declared by package "${bundle.name}"`);
11
+ }
12
+ }
13
+ }
14
+ return issues;
15
+ }
16
+ async function run(input) {
17
+ const globalConfig = input.settings?.noUnusedBundleDependencies;
18
+ if (globalConfig?.enabled !== true) {
19
+ return [];
20
+ }
21
+ return input.bundles.flatMap(function (bundle) {
22
+ return checkBundle(bundle, input.packageConfigs?.[bundle.name]);
23
+ });
24
+ }
25
+ export const noUnusedBundleDependenciesRule = {
26
+ name: ruleName,
27
+ globalSchema: enabledOnlyGlobalSchema,
28
+ perPackageSchema: emptyPerPackageSchema,
29
+ run
30
+ };
3
31
  //# sourceMappingURL=no-unused-bundle-dependencies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-unused-bundle-dependencies.js","sourceRoot":"","sources":["../../../../../source/checks/rules/no-unused-bundle-dependencies.ts"],"names":[],"mappings":"AACA,OAAwC,2CAA2C,CAAC;AAEpF,OAMO,YAAY,CAAC"}
1
+ {"version":3,"file":"no-unused-bundle-dependencies.js","sourceRoot":"","sources":["../../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B,EAAE,qBAAqB;IACvC,GAAG;CACN,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { maxBundleSizeRule } from './max-bundle-size.ts';
2
+ import { noDevDependencyImportsRule } from './no-dev-dependency-imports.ts';
3
+ import { noDuplicatedFilesRule } from './no-duplicated-files.ts';
4
+ import { noSideEffectsRule } from './no-side-effects.ts';
5
+ import { noUnexposedExecutablesRule } from './no-unexposed-executables.ts';
6
+ import { noUnusedBundleDependenciesRule } from './no-unused-bundle-dependencies.ts';
7
+ import { requiredFilesRule } from './required-files.ts';
8
+ import { type TypeScriptIntegrityDependencies, type TypeScriptIntegrityRule } from './type-script-integrity.ts';
9
+ import { uniqueTargetPathsRule } from './unique-target-paths.ts';
10
+ export type CheckRuleDependencies = TypeScriptIntegrityDependencies;
11
+ export type AllCheckRules = readonly [
12
+ TypeScriptIntegrityRule,
13
+ typeof noDuplicatedFilesRule,
14
+ typeof requiredFilesRule,
15
+ typeof maxBundleSizeRule,
16
+ typeof noUnusedBundleDependenciesRule,
17
+ typeof noDevDependencyImportsRule,
18
+ typeof uniqueTargetPathsRule,
19
+ typeof noSideEffectsRule,
20
+ typeof noUnexposedExecutablesRule
21
+ ];
22
+ export declare function createAllRules(dependencies: CheckRuleDependencies): AllCheckRules;
23
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAEH,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,EAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,SAAS;IACjC,uBAAuB;IACvB,OAAO,qBAAqB;IAC5B,OAAO,iBAAiB;IACxB,OAAO,iBAAiB;IACxB,OAAO,8BAA8B;IACrC,OAAO,0BAA0B;IACjC,OAAO,qBAAqB;IAC5B,OAAO,iBAAiB;IACxB,OAAO,0BAA0B;CACpC,CAAC;AAEF,wBAAgB,cAAc,CAAC,YAAY,EAAE,qBAAqB,GAAG,aAAa,CAYjF"}
@@ -1,10 +1,23 @@
1
- import "./max-bundle-size.js";
2
- import "./no-dev-dependency-imports.js";
3
- import "./no-duplicated-files.js";
4
- import "./no-side-effects.js";
5
- import "./no-unexposed-executables.js";
6
- import "./no-unused-bundle-dependencies.js";
7
- import "./required-files.js";
8
- import "./type-script-integrity.js";
9
- import "./unique-target-paths.js";
1
+ import { maxBundleSizeRule } from "./max-bundle-size.js";
2
+ import { noDevDependencyImportsRule } from "./no-dev-dependency-imports.js";
3
+ import { noDuplicatedFilesRule } from "./no-duplicated-files.js";
4
+ import { noSideEffectsRule } from "./no-side-effects.js";
5
+ import { noUnexposedExecutablesRule } from "./no-unexposed-executables.js";
6
+ import { noUnusedBundleDependenciesRule } from "./no-unused-bundle-dependencies.js";
7
+ import { requiredFilesRule } from "./required-files.js";
8
+ import { createTypeScriptIntegrityRule } from "./type-script-integrity.js";
9
+ import { uniqueTargetPathsRule } from "./unique-target-paths.js";
10
+ export function createAllRules(dependencies) {
11
+ return [
12
+ createTypeScriptIntegrityRule(dependencies),
13
+ noDuplicatedFilesRule,
14
+ requiredFilesRule,
15
+ maxBundleSizeRule,
16
+ noUnusedBundleDependenciesRule,
17
+ noDevDependencyImportsRule,
18
+ uniqueTargetPathsRule,
19
+ noSideEffectsRule,
20
+ noUnexposedExecutablesRule
21
+ ];
22
+ }
10
23
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../source/checks/rules/registry.ts"],"names":[],"mappings":"AAAA,OAAkC,sBAAsB,CAAC;AACzD,OAA2C,gCAAgC,CAAC;AAC5E,OAAsC,0BAA0B,CAAC;AACjE,OAAkC,sBAAsB,CAAC;AACzD,OAA2C,+BAA+B,CAAC;AAC3E,OAA+C,oCAAoC,CAAC;AACpF,OAAkC,qBAAqB,CAAC;AACxD,OAIO,4BAA4B,CAAC;AACpC,OAAsC,0BAA0B,CAAC"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../source/checks/rules/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACH,6BAA6B,EAGhC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAgBjE,MAAM,UAAU,cAAc,CAAC,YAAmC;IAC9D,OAAO;QACH,6BAA6B,CAAC,YAAY,CAAC;QAC3C,qBAAqB;QACrB,iBAAiB;QACjB,iBAAiB;QACjB,8BAA8B;QAC9B,0BAA0B;QAC1B,qBAAqB;QACrB,iBAAiB;QACjB,0BAA0B;KAC7B,CAAC;AACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod/mini';
2
+ import type { CheckRuleDefinition } from '../rule.ts';
3
+ declare const ruleName = "requiredFiles";
4
+ declare const globalSchema: z.ZodMiniObject<{
5
+ enabled: z.ZodMiniBoolean<boolean>;
6
+ files: z.ZodMiniOptional<z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniString<string>>>>;
7
+ }, z.core.$strict>;
8
+ declare const perPackageSchema: z.ZodMiniObject<{
9
+ files: z.ZodMiniOptional<z.ZodMiniReadonly<z.ZodMiniArray<z.ZodMiniString<string>>>>;
10
+ }, z.core.$strict>;
11
+ type GlobalConfig = Readonly<z.infer<typeof globalSchema>>;
12
+ type PerPackageConfig = Readonly<z.infer<typeof perPackageSchema>>;
13
+ export declare const requiredFilesRule: CheckRuleDefinition<typeof ruleName, GlobalConfig, PerPackageConfig>;
14
+ export {};
15
+ //# sourceMappingURL=required-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-files.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/required-files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAG7B,OAAO,KAAK,EAAE,mBAAmB,EAAgB,MAAM,YAAY,CAAC;AAEpE,QAAA,MAAM,QAAQ,kBAAkB,CAAC;AAIjC,QAAA,MAAM,YAAY;;;kBAGhB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;kBAEpB,CAAC;AAEH,KAAK,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAC3D,KAAK,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC;AAsCnE,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAKlG,CAAC"}
@@ -1,4 +1,42 @@
1
- import 'remeda';
2
- import 'zod/mini';
3
- import "../../config/base-validations.js";
1
+ import { unique } from 'remeda';
2
+ import { z } from 'zod/mini';
3
+ import { nonEmptyStringSchema } from "../../config/base-validations.js";
4
+ const ruleName = 'requiredFiles';
5
+ const fileListSchema = z.readonly(z.array(nonEmptyStringSchema));
6
+ const globalSchema = z.strictObject({
7
+ enabled: z.boolean(),
8
+ files: z.optional(fileListSchema)
9
+ });
10
+ const perPackageSchema = z.strictObject({
11
+ files: z.optional(fileListSchema)
12
+ });
13
+ function effectiveRequiredFiles(globalConfig, perPackageConfig) {
14
+ return unique([...globalConfig.files ?? [], ...perPackageConfig?.files ?? []]);
15
+ }
16
+ function findMissingFiles(bundle, requiredFiles) {
17
+ const presentTargets = new Set(bundle.contents.map(function (resource) {
18
+ return resource.fileDescription.targetFilePath;
19
+ }));
20
+ return requiredFiles.filter(function (file) {
21
+ return !presentTargets.has(file);
22
+ });
23
+ }
24
+ async function run(input) {
25
+ const globalConfig = input.settings?.requiredFiles;
26
+ if (globalConfig?.enabled !== true) {
27
+ return [];
28
+ }
29
+ return input.bundles.flatMap(function (bundle) {
30
+ const requiredFiles = effectiveRequiredFiles(globalConfig, input.perPackageSettings.get(bundle.name)?.requiredFiles);
31
+ return findMissingFiles(bundle, requiredFiles).map(function (file) {
32
+ return `Package "${bundle.name}" is missing required file "${file}"`;
33
+ });
34
+ });
35
+ }
36
+ export const requiredFilesRule = {
37
+ name: ruleName,
38
+ globalSchema,
39
+ perPackageSchema,
40
+ run
41
+ };
4
42
  //# sourceMappingURL=required-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"required-files.js","sourceRoot":"","sources":["../../../../../source/checks/rules/required-files.ts"],"names":[],"mappings":"AAAA,OAAuB,QAAQ,CAAC;AAChC,OAAkB,UAAU,CAAC;AAE7B,OAAqC,kCAAkC,CAAC"}
1
+ {"version":3,"file":"required-files.js","sourceRoot":"","sources":["../../../../../source/checks/rules/required-files.ts"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,aAAa,CAAC;IACnD,IAAI,YAAY,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,MAAM;QACzC,MAAM,aAAa,GAAG,sBAAsB,CACxC,YAAY,EACZ,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,CAC3D,CAAC;QACF,OAAO,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI;YAC7D,OAAO,YAAY,MAAM,CAAC,IAAI,+BAA+B,IAAI,GAAG,CAAC;QACzE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAyE;IACnG,IAAI,EAAE,QAAQ;IACd,YAAY;IACZ,gBAAgB;IAChB,GAAG;CACN,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PublishedPackageWithManifest } from '../../published-package/published-package.ts';
2
+ import type { DeclarationProjectsFactory } from './type-script-declaration-project.ts';
3
+ export type DeclarationMode = 'all' | 'exports-graph';
4
+ export type DeclarationIntegritySummarizer = (packageName: string, publishedPackage: Readonly<PublishedPackageWithManifest>, declarationMode: DeclarationMode, resolutionPackages: ReadonlyMap<string, PublishedPackageWithManifest>) => readonly string[];
5
+ export type DeclarationIntegrityDependencies = {
6
+ readonly createDeclarationProjects: DeclarationProjectsFactory;
7
+ };
8
+ export declare function createDeclarationIntegritySummarizer(dependencies: DeclarationIntegrityDependencies): DeclarationIntegritySummarizer;
9
+ //# sourceMappingURL=type-script-declaration-integrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-script-declaration-integrity.d.ts","sourceRoot":"","sources":["../../../../../source/checks/rules/type-script-declaration-integrity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAEjG,OAAO,KAAK,EAGR,0BAA0B,EAG7B,MAAM,sCAAsC,CAAC;AAI9C,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,eAAe,CAAC;AAEtD,MAAM,MAAM,8BAA8B,GAAG,CACzC,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,QAAQ,CAAC,4BAA4B,CAAC,EACxD,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,4BAA4B,CAAC,KACpE,SAAS,MAAM,EAAE,CAAC;AAEvB,MAAM,MAAM,gCAAgC,GAAG;IAC3C,QAAQ,CAAC,yBAAyB,EAAE,0BAA0B,CAAC;CAClE,CAAC;AA+EF,wBAAgB,oCAAoC,CAChD,YAAY,EAAE,gCAAgC,GAC/C,8BAA8B,CA2BhC"}
@@ -1,4 +1,82 @@
1
- import "./type-script-declaration-paths.js";
2
- import "./type-script-declaration-reachability.js";
3
- import "./type-script-declaration-roots.js";
1
+ import { isDeclarationPath } from "./type-script-declaration-paths.js";
2
+ import { reachableDeclarationPaths } from "./type-script-declaration-reachability.js";
3
+ import { declarationRootsFromManifest } from "./type-script-declaration-roots.js";
4
+ function collectPackageFiles(publishedPackage) {
5
+ return [
6
+ {
7
+ filePath: publishedPackage.manifestFile.filePath,
8
+ content: publishedPackage.manifestFile.content
9
+ },
10
+ ...publishedPackage.contents.map(function (entry) {
11
+ return {
12
+ filePath: entry.fileDescription.targetFilePath,
13
+ content: entry.fileDescription.content
14
+ };
15
+ })
16
+ ];
17
+ }
18
+ function collectDeclarationPaths(packageFiles) {
19
+ return new Set(packageFiles
20
+ .map(function (packageFile) {
21
+ return packageFile.filePath;
22
+ })
23
+ .filter(isDeclarationPath));
24
+ }
25
+ function collectResolutionPackageFiles(packageName, publishedPackages) {
26
+ return Array
27
+ .from(publishedPackages)
28
+ .filter(function ([candidateName]) {
29
+ return candidateName !== packageName;
30
+ })
31
+ .map(function ([candidateName, publishedPackage]) {
32
+ return {
33
+ packageName: candidateName,
34
+ packageFiles: collectPackageFiles(publishedPackage)
35
+ };
36
+ });
37
+ }
38
+ function checkedDeclarationPaths(input) {
39
+ const { project, declarationPaths, rootPaths, declarationMode } = input;
40
+ const { publicEntrypointPaths } = project;
41
+ if (declarationMode === 'all') {
42
+ return new Set([...declarationPaths, ...publicEntrypointPaths]);
43
+ }
44
+ return new Set([
45
+ ...reachableDeclarationPaths({
46
+ declarationPaths,
47
+ rootPaths,
48
+ moduleSpecifiersOf: project.moduleSpecifiersOf
49
+ }),
50
+ ...publicEntrypointPaths
51
+ ]);
52
+ }
53
+ function formatDeclarationDiagnostic(packageName, modeLabel, diagnostic) {
54
+ return (`Package "${packageName}" failed TypeScript integrity in ${modeLabel}: ` +
55
+ `${diagnostic.declarationPath}:${diagnostic.line} TS${diagnostic.code}: ${diagnostic.message}`);
56
+ }
57
+ export function createDeclarationIntegritySummarizer(dependencies) {
58
+ const { createDeclarationProjects } = dependencies;
59
+ return function summarizeDeclarationIntegrity(packageName, publishedPackage, declarationMode, resolutionPackages) {
60
+ const packageFiles = collectPackageFiles(publishedPackage);
61
+ const declarationPaths = collectDeclarationPaths(packageFiles);
62
+ const rootPaths = declarationRootsFromManifest(publishedPackage.manifestFile.content);
63
+ const resolutionPackageFiles = collectResolutionPackageFiles(packageName, resolutionPackages);
64
+ return createDeclarationProjects(packageName, packageFiles, resolutionPackageFiles).flatMap(function (project) {
65
+ const checkedPaths = checkedDeclarationPaths({
66
+ project,
67
+ declarationPaths,
68
+ rootPaths,
69
+ declarationMode
70
+ });
71
+ return project
72
+ .listDiagnostics()
73
+ .filter(function (diagnostic) {
74
+ return checkedPaths.has(diagnostic.declarationPath);
75
+ })
76
+ .map(function (diagnostic) {
77
+ return formatDeclarationDiagnostic(packageName, project.modeLabel, diagnostic);
78
+ });
79
+ });
80
+ };
81
+ }
4
82
  //# sourceMappingURL=type-script-declaration-integrity.js.map