pr-checkmate 3.0.3 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/dist/{cli.js → cjs/cli.js} +30 -30
  2. package/dist/{config → cjs/config}/index.d.ts +2 -2
  3. package/dist/{config → cjs/config}/index.js +8 -7
  4. package/dist/{config → cjs/config}/loader.d.ts +1 -1
  5. package/dist/{config → cjs/config}/loader.js +8 -8
  6. package/dist/{core → cjs/core}/checks/dependencies/banned-imports.d.ts +1 -1
  7. package/dist/{core → cjs/core}/checks/dependencies/banned-imports.js +10 -10
  8. package/dist/{core → cjs/core}/checks/dependencies/circular-deps.d.ts +1 -1
  9. package/dist/{core → cjs/core}/checks/dependencies/circular-deps.js +27 -27
  10. package/dist/{core → cjs/core}/checks/dependencies/dependency-check.d.ts +1 -1
  11. package/dist/{core → cjs/core}/checks/dependencies/dependency-check.js +17 -17
  12. package/dist/{core → cjs/core}/checks/dependencies/grype-scan.d.ts +1 -1
  13. package/dist/{core → cjs/core}/checks/dependencies/grype-scan.js +18 -18
  14. package/dist/{core → cjs/core}/checks/dependencies/license-check.d.ts +1 -1
  15. package/dist/{core → cjs/core}/checks/dependencies/license-check.js +12 -12
  16. package/dist/{core → cjs/core}/checks/dependencies/npm-audit.d.ts +1 -1
  17. package/dist/{core → cjs/core}/checks/dependencies/npm-audit.js +14 -14
  18. package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.d.ts +1 -1
  19. package/dist/{core → cjs/core}/checks/dependencies/outdated-deps.js +14 -14
  20. package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.d.ts +1 -1
  21. package/dist/{core → cjs/core}/checks/dependencies/vuln-scan.js +14 -14
  22. package/dist/{core → cjs/core}/checks/findings.d.ts +1 -1
  23. package/dist/{core → cjs/core}/checks/findings.js +16 -16
  24. package/dist/{core → cjs/core}/checks/git/custom-rules.d.ts +1 -1
  25. package/dist/{core → cjs/core}/checks/git/custom-rules.js +19 -19
  26. package/dist/{core → cjs/core}/checks/git/diff-smell.d.ts +2 -2
  27. package/dist/{core → cjs/core}/checks/git/diff-smell.js +13 -13
  28. package/dist/{core → cjs/core}/checks/git/large-files.d.ts +1 -1
  29. package/dist/{core → cjs/core}/checks/git/large-files.js +15 -15
  30. package/dist/{core → cjs/core}/checks/git/leftover-debug.d.ts +1 -1
  31. package/dist/{core → cjs/core}/checks/git/leftover-debug.js +13 -13
  32. package/dist/{core → cjs/core}/checks/git/lockfile-drift.d.ts +1 -1
  33. package/dist/{core → cjs/core}/checks/git/lockfile-drift.js +12 -12
  34. package/dist/{core → cjs/core}/checks/git/merge-conflict.d.ts +1 -1
  35. package/dist/{core → cjs/core}/checks/git/merge-conflict.js +15 -15
  36. package/dist/{core → cjs/core}/checks/git/missing-tests.d.ts +1 -1
  37. package/dist/{core → cjs/core}/checks/git/missing-tests.js +15 -15
  38. package/dist/{core → cjs/core}/checks/git/todo-fixme.d.ts +1 -1
  39. package/dist/{core → cjs/core}/checks/git/todo-fixme.js +11 -11
  40. package/dist/{core → cjs/core}/checks/languages/cpp-format.d.ts +1 -1
  41. package/dist/{core → cjs/core}/checks/languages/cpp-format.js +18 -18
  42. package/dist/{core → cjs/core}/checks/languages/external-checks.d.ts +9 -9
  43. package/dist/{core → cjs/core}/checks/languages/external-checks.js +10 -10
  44. package/dist/{core → cjs/core}/checks/languages/external-runner.d.ts +2 -2
  45. package/dist/{core → cjs/core}/checks/languages/external-runner.js +21 -21
  46. package/dist/{core → cjs/core}/checks/languages/go-format.d.ts +1 -1
  47. package/dist/cjs/core/checks/languages/go-format.js +202 -0
  48. package/dist/cjs/core/checks/languages/lint.d.ts +2 -0
  49. package/dist/{core → cjs/core}/checks/languages/lint.js +21 -21
  50. package/dist/{core → cjs/core}/checks/languages/prettier.d.ts +1 -1
  51. package/dist/{core → cjs/core}/checks/languages/prettier.js +18 -18
  52. package/dist/{core → cjs/core}/checks/languages/python-format.d.ts +1 -1
  53. package/dist/{core → cjs/core}/checks/languages/python-format.js +14 -14
  54. package/dist/{core → cjs/core}/checks/languages/python-lint.d.ts +1 -1
  55. package/dist/{core → cjs/core}/checks/languages/python-lint.js +13 -13
  56. package/dist/{core → cjs/core}/checks/languages/python-typecheck.d.ts +1 -1
  57. package/dist/{core → cjs/core}/checks/languages/python-typecheck.js +29 -29
  58. package/dist/{core → cjs/core}/checks/languages/typecheck.d.ts +1 -1
  59. package/dist/{core → cjs/core}/checks/languages/typecheck.js +13 -13
  60. package/dist/{core → cjs/core}/checks/pr/commitlint.d.ts +1 -1
  61. package/dist/{core → cjs/core}/checks/pr/commitlint.js +12 -12
  62. package/dist/{core → cjs/core}/checks/pr/pr-body.d.ts +1 -1
  63. package/dist/{core → cjs/core}/checks/pr/pr-body.js +8 -8
  64. package/dist/{core → cjs/core}/checks/pr/pr-size-check.d.ts +1 -1
  65. package/dist/{core → cjs/core}/checks/pr/pr-size-check.js +10 -10
  66. package/dist/{core → cjs/core}/checks/pr/pr-title-lint.d.ts +1 -1
  67. package/dist/{core → cjs/core}/checks/pr/pr-title-lint.js +8 -8
  68. package/dist/{core → cjs/core}/checks/quality/case-collision.d.ts +1 -1
  69. package/dist/{core → cjs/core}/checks/quality/case-collision.js +7 -7
  70. package/dist/{core → cjs/core}/checks/quality/config-validation.d.ts +1 -1
  71. package/dist/{core → cjs/core}/checks/quality/config-validation.js +9 -9
  72. package/dist/{core → cjs/core}/checks/quality/coverage.d.ts +1 -1
  73. package/dist/{core → cjs/core}/checks/quality/coverage.js +4 -4
  74. package/dist/{core → cjs/core}/checks/quality/dead-code.d.ts +1 -1
  75. package/dist/{core → cjs/core}/checks/quality/dead-code.js +23 -23
  76. package/dist/{core → cjs/core}/checks/quality/duplicate-check.d.ts +1 -1
  77. package/dist/{core → cjs/core}/checks/quality/duplicate-check.js +22 -22
  78. package/dist/{core → cjs/core}/checks/quality/license-header.d.ts +1 -1
  79. package/dist/{core → cjs/core}/checks/quality/license-header.js +16 -16
  80. package/dist/{core → cjs/core}/checks/quality/markdown-lint.d.ts +1 -1
  81. package/dist/{core → cjs/core}/checks/quality/markdown-lint.js +17 -17
  82. package/dist/{core → cjs/core}/checks/quality/package-size.d.ts +1 -1
  83. package/dist/{core → cjs/core}/checks/quality/package-size.js +12 -12
  84. package/dist/{core → cjs/core}/checks/quality/spellcheck.d.ts +2 -2
  85. package/dist/{core → cjs/core}/checks/quality/spellcheck.js +18 -18
  86. package/dist/{core → cjs/core}/checks/quality/symlinks.d.ts +1 -1
  87. package/dist/{core → cjs/core}/checks/quality/symlinks.js +8 -8
  88. package/dist/{core → cjs/core}/checks/quality/yaml-lint.d.ts +1 -1
  89. package/dist/{core → cjs/core}/checks/quality/yaml-lint.js +12 -12
  90. package/dist/{core → cjs/core}/checks/security/diff-security.d.ts +1 -1
  91. package/dist/{core → cjs/core}/checks/security/diff-security.js +15 -15
  92. package/dist/{core → cjs/core}/checks/security/dockerfile-security.d.ts +1 -1
  93. package/dist/{core → cjs/core}/checks/security/dockerfile-security.js +16 -16
  94. package/dist/{core → cjs/core}/checks/security/migration-safety.d.ts +1 -1
  95. package/dist/{core → cjs/core}/checks/security/migration-safety.js +17 -17
  96. package/dist/{core → cjs/core}/checks/security/security.d.ts +1 -1
  97. package/dist/{core → cjs/core}/checks/security/security.js +21 -21
  98. package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.d.ts +1 -1
  99. package/dist/{core → cjs/core}/checks/security/sensitive-file-guard.js +14 -14
  100. package/dist/{core → cjs/core}/checks/security/workflow-security.d.ts +2 -2
  101. package/dist/{core → cjs/core}/checks/security/workflow-security.js +14 -14
  102. package/dist/{core → cjs/core}/checks/tool-install.d.ts +1 -1
  103. package/dist/{core → cjs/core}/checks/tool-install.js +2 -2
  104. package/dist/{core → cjs/core}/context.d.ts +1 -1
  105. package/dist/{core → cjs/core}/context.js +16 -16
  106. package/dist/cjs/core/index.d.ts +4 -0
  107. package/dist/{core → cjs/core}/index.js +7 -7
  108. package/dist/{core → cjs/core}/install/cache.js +2 -2
  109. package/dist/{core → cjs/core}/install/doctor.d.ts +4 -4
  110. package/dist/{core → cjs/core}/install/doctor.js +34 -34
  111. package/dist/{core → cjs/core}/install/ensure.d.ts +2 -2
  112. package/dist/{core → cjs/core}/install/ensure.js +15 -14
  113. package/dist/{core → cjs/core}/install/lock.js +4 -4
  114. package/dist/{core → cjs/core}/install/prepare.d.ts +4 -4
  115. package/dist/{core → cjs/core}/install/prepare.js +13 -13
  116. package/dist/{core → cjs/core}/install/profiles.d.ts +2 -2
  117. package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
  118. package/dist/{core → cjs/core}/install/reuse.js +4 -4
  119. package/dist/{core → cjs/core}/registry.d.ts +1 -1
  120. package/dist/cjs/core/registry.js +112 -0
  121. package/dist/{core → cjs/core}/reporters.d.ts +1 -1
  122. package/dist/{core → cjs/core}/reporters.js +28 -28
  123. package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
  124. package/dist/{core → cjs/core}/run-checks.js +31 -31
  125. package/dist/{core → cjs/core}/targets.d.ts +1 -1
  126. package/dist/{core → cjs/core}/targets.js +20 -20
  127. package/dist/{core → cjs/core}/types.d.ts +3 -3
  128. package/dist/cjs/index.d.ts +12 -0
  129. package/dist/{index.js → cjs/index.js} +18 -18
  130. package/dist/{init.js → cjs/init.js} +68 -56
  131. package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
  132. package/dist/cjs/package.json +1 -0
  133. package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
  134. package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
  135. package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
  136. package/dist/{utils → cjs/utils}/detect-language.js +12 -12
  137. package/dist/cjs/utils/execa.js +46 -0
  138. package/dist/{utils → cjs/utils}/git.js +2 -2
  139. package/dist/{utils → cjs/utils}/http.js +2 -2
  140. package/dist/cjs/utils/index.d.ts +15 -0
  141. package/dist/{utils → cjs/utils}/index.js +13 -13
  142. package/dist/{utils → cjs/utils}/own-deps.d.ts +2 -0
  143. package/dist/{utils → cjs/utils}/own-deps.js +1 -0
  144. package/dist/{utils → cjs/utils}/package-version.js +2 -1
  145. package/dist/{utils → cjs/utils}/resolve-bin.js +2 -1
  146. package/dist/{utils → cjs/utils}/update-notifier.js +4 -4
  147. package/dist/esm/cli.d.ts +2 -0
  148. package/dist/esm/cli.js +137 -0
  149. package/dist/esm/config/constants.d.ts +153 -0
  150. package/dist/esm/config/constants.js +360 -0
  151. package/dist/esm/config/index.d.ts +40 -0
  152. package/dist/esm/config/index.js +60 -0
  153. package/dist/esm/config/loader.d.ts +6 -0
  154. package/dist/esm/config/loader.js +191 -0
  155. package/dist/esm/config/pr-checkmate-workflow-docker.yml +79 -0
  156. package/dist/esm/config/pr-checkmate-workflow.yml +92 -0
  157. package/dist/esm/core/checks/dependencies/banned-imports.d.ts +2 -0
  158. package/dist/esm/core/checks/dependencies/banned-imports.js +70 -0
  159. package/dist/esm/core/checks/dependencies/circular-deps.d.ts +2 -0
  160. package/dist/esm/core/checks/dependencies/circular-deps.js +155 -0
  161. package/dist/esm/core/checks/dependencies/dependency-check.d.ts +43 -0
  162. package/dist/esm/core/checks/dependencies/dependency-check.js +174 -0
  163. package/dist/esm/core/checks/dependencies/grype-scan.d.ts +22 -0
  164. package/dist/esm/core/checks/dependencies/grype-scan.js +112 -0
  165. package/dist/esm/core/checks/dependencies/license-check.d.ts +2 -0
  166. package/dist/esm/core/checks/dependencies/license-check.js +61 -0
  167. package/dist/esm/core/checks/dependencies/npm-audit.d.ts +6 -0
  168. package/dist/esm/core/checks/dependencies/npm-audit.js +80 -0
  169. package/dist/esm/core/checks/dependencies/outdated-deps.d.ts +2 -0
  170. package/dist/esm/core/checks/dependencies/outdated-deps.js +66 -0
  171. package/dist/esm/core/checks/dependencies/vuln-scan.d.ts +2 -0
  172. package/dist/esm/core/checks/dependencies/vuln-scan.js +54 -0
  173. package/dist/esm/core/checks/findings.d.ts +299 -0
  174. package/dist/esm/core/checks/findings.js +701 -0
  175. package/dist/esm/core/checks/git/custom-rules.d.ts +2 -0
  176. package/dist/esm/core/checks/git/custom-rules.js +106 -0
  177. package/dist/esm/core/checks/git/diff-smell.d.ts +19 -0
  178. package/dist/esm/core/checks/git/diff-smell.js +69 -0
  179. package/dist/esm/core/checks/git/large-files.d.ts +2 -0
  180. package/dist/esm/core/checks/git/large-files.js +112 -0
  181. package/dist/esm/core/checks/git/leftover-debug.d.ts +2 -0
  182. package/dist/esm/core/checks/git/leftover-debug.js +89 -0
  183. package/dist/esm/core/checks/git/lockfile-drift.d.ts +2 -0
  184. package/dist/esm/core/checks/git/lockfile-drift.js +114 -0
  185. package/dist/esm/core/checks/git/merge-conflict.d.ts +2 -0
  186. package/dist/esm/core/checks/git/merge-conflict.js +117 -0
  187. package/dist/esm/core/checks/git/missing-tests.d.ts +2 -0
  188. package/dist/esm/core/checks/git/missing-tests.js +105 -0
  189. package/dist/esm/core/checks/git/todo-fixme.d.ts +7 -0
  190. package/dist/esm/core/checks/git/todo-fixme.js +80 -0
  191. package/dist/esm/core/checks/languages/cpp-format.d.ts +7 -0
  192. package/dist/esm/core/checks/languages/cpp-format.js +91 -0
  193. package/dist/esm/core/checks/languages/external-checks.d.ts +77 -0
  194. package/dist/esm/core/checks/languages/external-checks.js +197 -0
  195. package/dist/esm/core/checks/languages/external-runner.d.ts +119 -0
  196. package/dist/esm/core/checks/languages/external-runner.js +138 -0
  197. package/dist/esm/core/checks/languages/go-format.d.ts +8 -0
  198. package/dist/{core → esm/core}/checks/languages/go-format.js +29 -35
  199. package/dist/esm/core/checks/languages/lint.d.ts +2 -0
  200. package/dist/esm/core/checks/languages/lint.js +92 -0
  201. package/dist/esm/core/checks/languages/prettier.d.ts +2 -0
  202. package/dist/esm/core/checks/languages/prettier.js +85 -0
  203. package/dist/esm/core/checks/languages/python-format.d.ts +7 -0
  204. package/dist/esm/core/checks/languages/python-format.js +61 -0
  205. package/dist/esm/core/checks/languages/python-lint.d.ts +9 -0
  206. package/dist/esm/core/checks/languages/python-lint.js +55 -0
  207. package/dist/esm/core/checks/languages/python-typecheck.d.ts +14 -0
  208. package/dist/esm/core/checks/languages/python-typecheck.js +184 -0
  209. package/dist/esm/core/checks/languages/ruff-shared.d.ts +10 -0
  210. package/dist/esm/core/checks/languages/ruff-shared.js +35 -0
  211. package/dist/esm/core/checks/languages/typecheck.d.ts +2 -0
  212. package/dist/esm/core/checks/languages/typecheck.js +61 -0
  213. package/dist/esm/core/checks/pr/commitlint.d.ts +2 -0
  214. package/dist/esm/core/checks/pr/commitlint.js +102 -0
  215. package/dist/esm/core/checks/pr/pr-body.d.ts +2 -0
  216. package/dist/esm/core/checks/pr/pr-body.js +43 -0
  217. package/dist/esm/core/checks/pr/pr-size-check.d.ts +2 -0
  218. package/dist/esm/core/checks/pr/pr-size-check.js +42 -0
  219. package/dist/esm/core/checks/pr/pr-title-lint.d.ts +2 -0
  220. package/dist/esm/core/checks/pr/pr-title-lint.js +31 -0
  221. package/dist/esm/core/checks/quality/case-collision.d.ts +8 -0
  222. package/dist/esm/core/checks/quality/case-collision.js +39 -0
  223. package/dist/esm/core/checks/quality/config-validation.d.ts +11 -0
  224. package/dist/esm/core/checks/quality/config-validation.js +188 -0
  225. package/dist/esm/core/checks/quality/coverage.d.ts +2 -0
  226. package/dist/esm/core/checks/quality/coverage.js +62 -0
  227. package/dist/esm/core/checks/quality/dead-code.d.ts +2 -0
  228. package/dist/esm/core/checks/quality/dead-code.js +124 -0
  229. package/dist/esm/core/checks/quality/duplicate-check.d.ts +2 -0
  230. package/dist/esm/core/checks/quality/duplicate-check.js +141 -0
  231. package/dist/esm/core/checks/quality/license-header.d.ts +7 -0
  232. package/dist/esm/core/checks/quality/license-header.js +81 -0
  233. package/dist/esm/core/checks/quality/markdown-lint.d.ts +2 -0
  234. package/dist/esm/core/checks/quality/markdown-lint.js +104 -0
  235. package/dist/esm/core/checks/quality/package-size.d.ts +36 -0
  236. package/dist/esm/core/checks/quality/package-size.js +196 -0
  237. package/dist/esm/core/checks/quality/spellcheck.d.ts +77 -0
  238. package/dist/esm/core/checks/quality/spellcheck.js +296 -0
  239. package/dist/esm/core/checks/quality/symlinks.d.ts +16 -0
  240. package/dist/esm/core/checks/quality/symlinks.js +57 -0
  241. package/dist/esm/core/checks/quality/yaml-lint.d.ts +20 -0
  242. package/dist/esm/core/checks/quality/yaml-lint.js +116 -0
  243. package/dist/esm/core/checks/security/diff-security.d.ts +2 -0
  244. package/dist/esm/core/checks/security/diff-security.js +354 -0
  245. package/dist/esm/core/checks/security/dockerfile-security.d.ts +2 -0
  246. package/dist/esm/core/checks/security/dockerfile-security.js +98 -0
  247. package/dist/esm/core/checks/security/migration-safety.d.ts +2 -0
  248. package/dist/esm/core/checks/security/migration-safety.js +137 -0
  249. package/dist/esm/core/checks/security/security.d.ts +63 -0
  250. package/dist/esm/core/checks/security/security.js +201 -0
  251. package/dist/esm/core/checks/security/sensitive-file-guard.d.ts +2 -0
  252. package/dist/esm/core/checks/security/sensitive-file-guard.js +160 -0
  253. package/dist/esm/core/checks/security/workflow-security.d.ts +12 -0
  254. package/dist/esm/core/checks/security/workflow-security.js +100 -0
  255. package/dist/esm/core/checks/tool-install.d.ts +102 -0
  256. package/dist/esm/core/checks/tool-install.js +66 -0
  257. package/dist/esm/core/commands.d.ts +27 -0
  258. package/dist/esm/core/commands.js +89 -0
  259. package/dist/esm/core/context.d.ts +62 -0
  260. package/dist/esm/core/context.js +241 -0
  261. package/dist/esm/core/index.d.ts +4 -0
  262. package/dist/esm/core/index.js +4 -0
  263. package/dist/esm/core/install/cache.d.ts +58 -0
  264. package/dist/esm/core/install/cache.js +142 -0
  265. package/dist/esm/core/install/doctor.d.ts +35 -0
  266. package/dist/esm/core/install/doctor.js +164 -0
  267. package/dist/esm/core/install/ensure.d.ts +77 -0
  268. package/dist/esm/core/install/ensure.js +269 -0
  269. package/dist/esm/core/install/lock.d.ts +34 -0
  270. package/dist/esm/core/install/lock.js +92 -0
  271. package/dist/esm/core/install/merge.d.ts +47 -0
  272. package/dist/esm/core/install/merge.js +85 -0
  273. package/dist/esm/core/install/prepare.d.ts +76 -0
  274. package/dist/esm/core/install/prepare.js +142 -0
  275. package/dist/esm/core/install/profiles.d.ts +78 -0
  276. package/dist/esm/core/install/profiles.js +192 -0
  277. package/dist/esm/core/install/reuse.d.ts +41 -0
  278. package/dist/esm/core/install/reuse.js +100 -0
  279. package/dist/esm/core/registry.d.ts +6 -0
  280. package/dist/esm/core/registry.js +109 -0
  281. package/dist/esm/core/reporters.d.ts +18 -0
  282. package/dist/esm/core/reporters.js +266 -0
  283. package/dist/esm/core/run-checks.d.ts +33 -0
  284. package/dist/esm/core/run-checks.js +293 -0
  285. package/dist/esm/core/targets.d.ts +140 -0
  286. package/dist/esm/core/targets.js +213 -0
  287. package/dist/esm/core/types.d.ts +195 -0
  288. package/dist/esm/core/types.js +38 -0
  289. package/dist/esm/index.d.ts +12 -0
  290. package/dist/esm/index.js +15 -0
  291. package/dist/esm/init.d.ts +38 -0
  292. package/dist/esm/init.js +421 -0
  293. package/dist/esm/interfaces/index.d.ts +432 -0
  294. package/dist/esm/interfaces/index.js +2 -0
  295. package/dist/esm/package.json +1 -0
  296. package/dist/esm/scripts/copy-configs.d.ts +1 -0
  297. package/dist/esm/scripts/copy-configs.js +64 -0
  298. package/dist/esm/scripts/generate-install-manifests.d.ts +39 -0
  299. package/dist/esm/scripts/generate-install-manifests.js +115 -0
  300. package/dist/esm/scripts/publish-github.d.ts +1 -0
  301. package/dist/esm/scripts/publish-github.js +45 -0
  302. package/dist/esm/utils/ci.d.ts +11 -0
  303. package/dist/esm/utils/ci.js +40 -0
  304. package/dist/esm/utils/detect-language.d.ts +48 -0
  305. package/dist/esm/utils/detect-language.js +234 -0
  306. package/dist/esm/utils/direct-deps.d.ts +21 -0
  307. package/dist/esm/utils/direct-deps.js +220 -0
  308. package/dist/esm/utils/execa.d.ts +22 -0
  309. package/dist/{utils → esm/utils}/execa.js +1 -4
  310. package/dist/esm/utils/git.d.ts +14 -0
  311. package/dist/esm/utils/git.js +21 -0
  312. package/dist/esm/utils/glob.d.ts +24 -0
  313. package/dist/esm/utils/glob.js +40 -0
  314. package/dist/esm/utils/http.d.ts +59 -0
  315. package/dist/esm/utils/http.js +115 -0
  316. package/dist/esm/utils/index.d.ts +15 -0
  317. package/dist/esm/utils/index.js +26 -0
  318. package/dist/esm/utils/logger.d.ts +65 -0
  319. package/dist/esm/utils/logger.js +157 -0
  320. package/dist/esm/utils/own-deps.d.ts +16 -0
  321. package/dist/esm/utils/own-deps.js +107 -0
  322. package/dist/esm/utils/package-version.d.ts +4 -0
  323. package/dist/esm/utils/package-version.js +38 -0
  324. package/dist/esm/utils/pool.d.ts +49 -0
  325. package/dist/esm/utils/pool.js +113 -0
  326. package/dist/esm/utils/resolve-bin.d.ts +67 -0
  327. package/dist/esm/utils/resolve-bin.js +156 -0
  328. package/dist/esm/utils/result-collector.d.ts +33 -0
  329. package/dist/esm/utils/result-collector.js +44 -0
  330. package/dist/esm/utils/update-notifier.d.ts +19 -0
  331. package/dist/esm/utils/update-notifier.js +108 -0
  332. package/install-manifests/core/package-lock.json +4 -4
  333. package/install-manifests/core/package.json +1 -1
  334. package/install-manifests/cpp/package-lock.json +4 -4
  335. package/install-manifests/cpp/package.json +1 -1
  336. package/package.json +16 -14
  337. package/dist/core/checks/languages/lint.d.ts +0 -2
  338. package/dist/core/index.d.ts +0 -4
  339. package/dist/core/registry.js +0 -112
  340. package/dist/index.d.ts +0 -12
  341. package/dist/utils/index.d.ts +0 -15
  342. /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
  343. /package/dist/{config → cjs/config}/constants.d.ts +0 -0
  344. /package/dist/{config → cjs/config}/constants.js +0 -0
  345. /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
  346. /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
  347. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
  348. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
  349. /package/dist/{core → cjs/core}/commands.d.ts +0 -0
  350. /package/dist/{core → cjs/core}/commands.js +0 -0
  351. /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
  352. /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
  353. /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
  354. /package/dist/{core → cjs/core}/install/merge.js +0 -0
  355. /package/dist/{core → cjs/core}/install/profiles.js +0 -0
  356. /package/dist/{core → cjs/core}/types.js +0 -0
  357. /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
  358. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  359. /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
  360. /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
  361. /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
  362. /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
  363. /package/dist/{utils → cjs/utils}/ci.js +0 -0
  364. /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
  365. /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
  366. /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
  367. /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
  368. /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
  369. /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
  370. /package/dist/{utils → cjs/utils}/glob.js +0 -0
  371. /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
  372. /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
  373. /package/dist/{utils → cjs/utils}/logger.js +0 -0
  374. /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
  375. /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
  376. /package/dist/{utils → cjs/utils}/pool.js +0 -0
  377. /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
  378. /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
  379. /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
  380. /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const core_1 = require("./core");
5
- const commands_1 = require("./core/commands");
6
- const doctor_1 = require("./core/install/doctor");
7
- const init_1 = require("./init");
8
- const utils_1 = require("./utils");
4
+ const commands_js_1 = require("./core/commands.js");
5
+ const index_js_1 = require("./core/index.js");
6
+ const doctor_js_1 = require("./core/install/doctor.js");
7
+ const init_js_1 = require("./init.js");
8
+ const index_js_2 = require("./utils/index.js");
9
9
  const argv = process.argv.slice(2);
10
10
  /**
11
11
  * Flags are separated from positional arguments so they compose with every command
@@ -21,13 +21,13 @@ const cmd = args[0];
21
21
  * diff and print a green summary.
22
22
  */
23
23
  function rejectUnknownFlags() {
24
- const unknown = flags.filter(flag => !commands_1.FLAGS[flag]);
24
+ const unknown = flags.filter(flag => !commands_js_1.FLAGS[flag]);
25
25
  if (unknown.length === 0)
26
26
  return;
27
- const known = Object.entries(commands_1.FLAGS)
27
+ const known = Object.entries(commands_js_1.FLAGS)
28
28
  .map(([flag, help]) => `${flag} (${help})`)
29
29
  .join(', ');
30
- utils_1.logger.error(`[cli]: Unknown flag(s) "${unknown.join('", "')}". Available: ${known}`);
30
+ index_js_2.logger.error(`[cli]: Unknown flag(s) "${unknown.join('", "')}". Available: ${known}`);
31
31
  process.exit(1);
32
32
  }
33
33
  /**
@@ -38,22 +38,22 @@ function rejectUnknownFlags() {
38
38
  */
39
39
  function rejectConflictingScope() {
40
40
  if (cmd === 'precommit' && flags.includes('--full')) {
41
- utils_1.logger.error('[cli]: "precommit --full" is contradictory — precommit reviews the staged changes. Run "pr-checkmate all --full" for a whole-repo review.');
41
+ index_js_2.logger.error('[cli]: "precommit --full" is contradictory — precommit reviews the staged changes. Run "pr-checkmate all --full" for a whole-repo review.');
42
42
  process.exit(1);
43
43
  }
44
44
  if (cmd === 'init' && flags.length > 0) {
45
- utils_1.logger.error(`[cli]: "init" takes no flags, got: ${flags.join(', ')}.`);
45
+ index_js_2.logger.error(`[cli]: "init" takes no flags, got: ${flags.join(', ')}.`);
46
46
  process.exit(1);
47
47
  }
48
48
  // `--all` belongs to `install` alone. Accepting it elsewhere would look like a
49
49
  // scope flag and quietly do nothing, which is the failure mode
50
50
  // `rejectUnknownFlags` exists to prevent.
51
51
  if (flags.includes('--all') && cmd !== 'install') {
52
- utils_1.logger.error('[cli]: "--all" applies only to "install". Did you mean "--full"?');
52
+ index_js_2.logger.error('[cli]: "--all" applies only to "install". Did you mean "--full"?');
53
53
  process.exit(1);
54
54
  }
55
- if (flags.includes('--full') && commands_1.TOOLING_COMMANDS.includes(cmd ?? '')) {
56
- utils_1.logger.error(`[cli]: "${cmd}" manages tooling and reviews nothing, so "--full" has no meaning.`);
55
+ if (flags.includes('--full') && commands_js_1.TOOLING_COMMANDS.includes(cmd ?? '')) {
56
+ index_js_2.logger.error(`[cli]: "${cmd}" manages tooling and reviews nothing, so "--full" has no meaning.`);
57
57
  process.exit(1);
58
58
  }
59
59
  }
@@ -68,9 +68,9 @@ const full = flags.includes('--full');
68
68
  * added to the list but not to the branch.
69
69
  */
70
70
  function rejectExtraArgs() {
71
- if (!cmd || !commands_1.STANDALONE_COMMANDS.includes(cmd) || args.length <= 1)
71
+ if (!cmd || !commands_js_1.STANDALONE_COMMANDS.includes(cmd) || args.length <= 1)
72
72
  return;
73
- utils_1.logger.error(`[cli]: "${cmd}" takes no other arguments, got: ${args.slice(1).join(', ')}. Run them as a separate command.`);
73
+ index_js_2.logger.error(`[cli]: "${cmd}" takes no other arguments, got: ${args.slice(1).join(', ')}. Run them as a separate command.`);
74
74
  process.exit(1);
75
75
  }
76
76
  void (async () => {
@@ -79,25 +79,25 @@ void (async () => {
79
79
  rejectConflictingScope();
80
80
  rejectExtraArgs();
81
81
  if (cmd === 'init') {
82
- await (0, init_1.init)();
82
+ await (0, init_js_1.init)();
83
83
  process.exit(0);
84
84
  }
85
85
  // Tooling management. These run no checks — they prepare, inspect or clean
86
86
  // up what the checks need, so they never touch the diff or the reporter.
87
87
  if (cmd === 'install') {
88
- const results = await (0, doctor_1.installProfiles)(process.cwd(), flags.includes('--all'));
88
+ const results = await (0, doctor_js_1.installProfiles)(process.cwd(), flags.includes('--all'));
89
89
  const failed = results.filter(r => r.status === 'failed');
90
90
  for (const result of failed) {
91
- utils_1.logger.error(`[install]: ❌ ${result.profiles.join(', ') || 'tooling'}: ${result.reason}`);
91
+ index_js_2.logger.error(`[install]: ❌ ${result.profiles.join(', ') || 'tooling'}: ${result.reason}`);
92
92
  }
93
93
  process.exit(failed.length > 0 ? 1 : 0);
94
94
  }
95
95
  if (cmd === 'doctor') {
96
- await (0, doctor_1.runDoctor)();
96
+ await (0, doctor_js_1.runDoctor)();
97
97
  process.exit(0);
98
98
  }
99
99
  if (cmd === 'cache-prune') {
100
- (0, doctor_1.pruneCache)();
100
+ (0, doctor_js_1.pruneCache)();
101
101
  process.exit(0);
102
102
  }
103
103
  // Full run: auto-detect the CI platform (GitHub/GitLab/Bitbucket), post the
@@ -105,35 +105,35 @@ void (async () => {
105
105
  if (!cmd || cmd === 'all') {
106
106
  // Fetch the update notice concurrently (best-effort, never blocks/affects
107
107
  // the exit code), but print it LAST — after the summary — so it's noticeable.
108
- const noticePromise = (0, utils_1.getUpdateNotice)();
109
- const report = await (0, core_1.runChecks)({ reporter: 'auto', write: true, full });
108
+ const noticePromise = (0, index_js_2.getUpdateNotice)();
109
+ const report = await (0, index_js_1.runChecks)({ reporter: 'auto', write: true, full });
110
110
  const notice = await noticePromise.catch(() => null);
111
111
  if (notice) {
112
- utils_1.logger.info('');
113
- notice.forEach(line => utils_1.logger.info(line));
112
+ index_js_2.logger.info('');
113
+ notice.forEach(line => index_js_2.logger.info(line));
114
114
  }
115
115
  process.exit(report.ok ? 0 : 1);
116
116
  }
117
117
  // Local pre-commit: check the staged changes (index vs HEAD), print to
118
118
  // stdout, never modify files. Exits non-zero on failure to block the commit.
119
119
  if (cmd === 'precommit') {
120
- const report = await (0, core_1.runChecks)({ staged: true, reporter: 'stdout', write: false });
120
+ const report = await (0, index_js_1.runChecks)({ staged: true, reporter: 'stdout', write: false });
121
121
  process.exit(report.ok ? 0 : 1);
122
122
  }
123
123
  // Every remaining argument is a check name, so `pr-checkmate lint spellcheck`
124
124
  // runs both in one pass. Unknown names abort the whole run — a typo must never
125
125
  // shrink the requested check set silently.
126
- const unknown = args.filter(arg => !commands_1.COMMAND_TO_CHECK[arg]);
126
+ const unknown = args.filter(arg => !commands_js_1.COMMAND_TO_CHECK[arg]);
127
127
  if (unknown.length > 0) {
128
- utils_1.logger.error(`[cli]: Unknown command(s) "${unknown.join('", "')}". Available: ${commands_1.STANDALONE_COMMANDS.join(', ')}, ${Object.keys(commands_1.COMMAND_TO_CHECK).join(', ')}`);
128
+ index_js_2.logger.error(`[cli]: Unknown command(s) "${unknown.join('", "')}". Available: ${commands_js_1.STANDALONE_COMMANDS.join(', ')}, ${Object.keys(commands_js_1.COMMAND_TO_CHECK).join(', ')}`);
129
129
  process.exit(1);
130
130
  }
131
- const checkNames = [...new Set(args.map(arg => commands_1.COMMAND_TO_CHECK[arg]))];
132
- const report = await (0, core_1.runChecks)({ only: checkNames, reporter: 'stdout', write: true, full });
131
+ const checkNames = [...new Set(args.map(arg => commands_js_1.COMMAND_TO_CHECK[arg]))];
132
+ const report = await (0, index_js_1.runChecks)({ only: checkNames, reporter: 'stdout', write: true, full });
133
133
  process.exit(report.ok ? 0 : 1);
134
134
  }
135
135
  catch (err) {
136
- utils_1.logger.error(`❌ CLI failed: ${err}`);
136
+ index_js_2.logger.error(`❌ CLI failed: ${err}`);
137
137
  process.exit(1);
138
138
  }
139
139
  })();
@@ -1,5 +1,5 @@
1
- export * from './constants';
2
- export { loadProjectConfig } from '../config/loader';
1
+ export * from './constants.js';
2
+ export { loadProjectConfig } from '../config/loader.js';
3
3
  /**
4
4
  * The configured source path(s), normalised to a list.
5
5
  *
@@ -25,10 +25,11 @@ exports.getPackageConfigPath = getPackageConfigPath;
25
25
  exports.hasLocalConfig = hasLocalConfig;
26
26
  const node_fs_1 = __importDefault(require("node:fs"));
27
27
  const node_path_1 = __importDefault(require("node:path"));
28
- const loader_1 = require("../config/loader");
29
- __exportStar(require("./constants"), exports);
30
- var loader_2 = require("../config/loader");
31
- Object.defineProperty(exports, "loadProjectConfig", { enumerable: true, get: function () { return loader_2.loadProjectConfig; } });
28
+ const loader_js_1 = require("../config/loader.js");
29
+ const own_deps_js_1 = require("../utils/own-deps.js");
30
+ __exportStar(require("./constants.js"), exports);
31
+ var loader_js_2 = require("../config/loader.js");
32
+ Object.defineProperty(exports, "loadProjectConfig", { enumerable: true, get: function () { return loader_js_2.loadProjectConfig; } });
32
33
  /**
33
34
  * The configured source path(s), normalised to a list.
34
35
  *
@@ -49,7 +50,7 @@ Object.defineProperty(exports, "loadProjectConfig", { enumerable: true, get: fun
49
50
  * defaults. One reader is now the only reader.
50
51
  */
51
52
  function getSourcePaths(cwd = process.cwd()) {
52
- const { sourcePath } = (0, loader_1.loadProjectConfig)(cwd);
53
+ const { sourcePath } = (0, loader_js_1.loadProjectConfig)(cwd);
53
54
  const paths = (Array.isArray(sourcePath) ? sourcePath : [sourcePath]).filter((p) => typeof p === 'string' && p.trim().length > 0);
54
55
  return paths.length > 0 ? paths : ['.'];
55
56
  }
@@ -65,13 +66,13 @@ function getSourcePath(cwd) {
65
66
  * (client `ignoreDirs` in pr-checkmate.json, or the curated default).
66
67
  */
67
68
  function getIgnoredDirs(cwd) {
68
- return (0, loader_1.loadProjectConfig)(cwd).ignoreDirs ?? [];
69
+ return (0, loader_js_1.loadProjectConfig)(cwd).ignoreDirs ?? [];
69
70
  }
70
71
  /**
71
72
  * Get path to package config files
72
73
  */
73
74
  function getPackageConfigPath(fileName) {
74
- const packageRoot = node_path_1.default.resolve(__dirname, '../..');
75
+ const packageRoot = (0, own_deps_js_1.findOwnPackageRoot)() ?? node_path_1.default.resolve(__dirname, '../../..');
75
76
  return node_path_1.default.join(packageRoot, fileName);
76
77
  }
77
78
  /**
@@ -1,4 +1,4 @@
1
- import { PRCheckMateConfig } from '../interfaces';
1
+ import { PRCheckMateConfig } from '../interfaces/index.js';
2
2
  /**
3
3
  * Load project configuration from pr-checkmate.json
4
4
  * Falls back to defaults if not found
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.loadProjectConfig = loadProjectConfig;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- const utils_1 = require("../utils");
10
- const constants_1 = require("./constants");
9
+ const index_js_1 = require("../utils/index.js");
10
+ const constants_js_1 = require("./constants.js");
11
11
  /**
12
12
  * Load project configuration from pr-checkmate.json
13
13
  * Falls back to defaults if not found
@@ -21,7 +21,7 @@ function loadProjectConfig(cwd = process.cwd()) {
21
21
  return mergeWithDefaults(config);
22
22
  }
23
23
  catch (err) {
24
- utils_1.logger.warn(`[loadProjectConfig]: ⚠️ Failed to parse pr-checkmate.json: ${err}`);
24
+ index_js_1.logger.warn(`[loadProjectConfig]: ⚠️ Failed to parse pr-checkmate.json: ${err}`);
25
25
  }
26
26
  }
27
27
  return getDefaultConfig();
@@ -103,7 +103,7 @@ function mergeWithDefaults(userConfig) {
103
103
  function getDefaultConfig() {
104
104
  return {
105
105
  sourcePath: '.',
106
- ignoreDirs: [...constants_1.IGNORED_DIRS],
106
+ ignoreDirs: [...constants_js_1.IGNORED_DIRS],
107
107
  lint: {
108
108
  rules: {
109
109
  'no-console': 'warn',
@@ -163,12 +163,12 @@ function getDefaultConfig() {
163
163
  enabled: true,
164
164
  minLines: 5,
165
165
  minTokens: 50,
166
- ignore: constants_1.DUPLICATE_IGNORE_DEFAULTS,
167
- formats: constants_1.DUPLICATE_CODE_FORMATS,
166
+ ignore: constants_js_1.DUPLICATE_IGNORE_DEFAULTS,
167
+ formats: constants_js_1.DUPLICATE_CODE_FORMATS,
168
168
  },
169
169
  dependency: { enabled: true, ignore: [] },
170
170
  outdatedDeps: { enabled: true, ignore: [] },
171
- deadCode: { enabled: true, ignoreFiles: constants_1.DEAD_CODE_IGNORE_DEFAULTS },
171
+ deadCode: { enabled: true, ignoreFiles: constants_js_1.DEAD_CODE_IGNORE_DEFAULTS },
172
172
  commitlint: {
173
173
  enabled: true,
174
174
  types: [
@@ -190,7 +190,7 @@ function getDefaultConfig() {
190
190
  ignores: ['^Release\\b', '^chore\\(release\\):'],
191
191
  },
192
192
  licenseCheck: {
193
- allowPackages: [...constants_1.DEFAULT_ALLOW_PACKAGES],
193
+ allowPackages: [...constants_js_1.DEFAULT_ALLOW_PACKAGES],
194
194
  allowLicenses: [],
195
195
  },
196
196
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const bannedImportsCheck: Check;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bannedImportsCheck = void 0;
4
- const utils_1 = require("../../../utils");
5
- const types_1 = require("../../types");
6
- const findings_1 = require("../findings");
4
+ const index_js_1 = require("../../../utils/index.js");
5
+ const types_js_1 = require("../../types.js");
6
+ const findings_js_1 = require("../findings.js");
7
7
  const PREFIX = 'Banned Imports';
8
8
  const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
9
9
  /**
@@ -35,11 +35,11 @@ exports.bannedImportsCheck = {
35
35
  async run(ctx) {
36
36
  const bans = compileBans(ctx);
37
37
  if (bans.length === 0)
38
- return (0, types_1.pass)('no banned imports configured');
38
+ return (0, types_js_1.pass)('no banned imports configured');
39
39
  try {
40
40
  const errors = {};
41
41
  const warnings = {};
42
- const reviewed = await (0, findings_1.reviewLines)(ctx, ['*'], stdout => {
42
+ const reviewed = await (0, findings_js_1.reviewLines)(ctx, ['*'], stdout => {
43
43
  var _a;
44
44
  for (const raw of stdout.split('\n')) {
45
45
  if (!raw.startsWith('+') || raw.startsWith('+++'))
@@ -55,19 +55,19 @@ exports.bannedImportsCheck = {
55
55
  });
56
56
  // An unreadable file list is not "no banned imports" (ticket 072).
57
57
  if (!reviewed)
58
- return (0, types_1.skip)('git unavailable');
58
+ return (0, types_js_1.skip)('git unavailable');
59
59
  // A ban configured as "error" blocks the run, regardless of phase — that
60
60
  // is the default `failOn`, and the client can still relax it per repo.
61
- return (0, findings_1.reportSeverityBuckets)(errors, warnings, {
61
+ return (0, findings_js_1.reportSeverityBuckets)(errors, warnings, {
62
62
  prefix: PREFIX,
63
63
  errorSummary: n => `${n} banned (error)`,
64
64
  warningSummary: n => `${n} banned (warn)`,
65
- ...(0, findings_1.clientFindingOptions)(ctx),
65
+ ...(0, findings_js_1.clientFindingOptions)(ctx),
66
66
  });
67
67
  }
68
68
  catch (err) {
69
- utils_1.logger.warn(`[Banned Imports]: ⚠️ Could not analyze diff\n${err}`);
70
- return (0, types_1.skip)('diff unavailable');
69
+ index_js_1.logger.warn(`[Banned Imports]: ⚠️ Could not analyze diff\n${err}`);
70
+ return (0, types_js_1.skip)('diff unavailable');
71
71
  }
72
72
  },
73
73
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const circularDepsCheck: Check;
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.circularDepsCheck = void 0;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- const config_1 = require("../../../config");
10
- const utils_1 = require("../../../utils");
11
- const execa_1 = require("../../../utils/execa");
12
- const reuse_1 = require("../../install/reuse");
13
- const targets_1 = require("../../targets");
14
- const types_1 = require("../../types");
15
- const findings_1 = require("../findings");
9
+ const index_js_1 = require("../../../config/index.js");
10
+ const execa_js_1 = require("../../../utils/execa.js");
11
+ const index_js_2 = require("../../../utils/index.js");
12
+ const reuse_js_1 = require("../../install/reuse.js");
13
+ const targets_js_1 = require("../../targets.js");
14
+ const types_js_1 = require("../../types.js");
15
+ const findings_js_1 = require("../findings.js");
16
16
  /**
17
17
  * Cap for the analysis. dpdm builds the whole module graph, which on a large repo
18
18
  * is the slowest part of a run — an uncapped analysis looks like a hung commit.
@@ -40,9 +40,9 @@ const SOURCE_GLOBS = ['*.ts', '*.tsx', '*.js', '*.jsx'];
40
40
  function resolveDpdm(ctx) {
41
41
  // No configuration of its own — dpdm reads the module graph — so the version
42
42
  // check is the right question here and `clientOwnsConfig` stays off.
43
- for (const options of [{ paths: (0, reuse_1.clientToolPaths)('dpdm', ctx) }, undefined]) {
43
+ for (const options of [{ paths: (0, reuse_js_1.clientToolPaths)('dpdm', ctx) }, undefined]) {
44
44
  try {
45
- return (0, utils_1.resolvePackageBin)('dpdm', 'lib/bin/dpdm.js', options);
45
+ return (0, index_js_2.resolvePackageBin)('dpdm', 'lib/bin/dpdm.js', options);
46
46
  }
47
47
  catch {
48
48
  // Try the next location; both failing is a skip, handled by the caller.
@@ -61,7 +61,7 @@ function toFileArgs(files, sourcePaths) {
61
61
  return files;
62
62
  const roots = sourcePaths.length > 0 ? sourcePaths : ['.'];
63
63
  const globs = roots.flatMap(root => SOURCE_GLOBS.map(ext => `${root.replace(/\/+$/, '')}/**/${ext}`));
64
- utils_1.logger.info(`[Circular Deps]: ${files.length} files exceed the argument limit — analyzing via globs (${globs.join(', ')})`);
64
+ index_js_2.logger.info(`[Circular Deps]: ${files.length} files exceed the argument limit — analyzing via globs (${globs.join(', ')})`);
65
65
  return globs;
66
66
  }
67
67
  /** Read dpdm's report file; null when it is absent or unparseable. */
@@ -83,26 +83,26 @@ exports.circularDepsCheck = {
83
83
  return ctx.languages.includes('typescript') || ctx.languages.includes('javascript');
84
84
  },
85
85
  async run(ctx) {
86
- const allFiles = await (0, targets_1.listTrackedFiles)(ctx, SOURCE_GLOBS, (0, config_1.getSourcePaths)(ctx.cwd));
86
+ const allFiles = await (0, targets_js_1.listTrackedFiles)(ctx, SOURCE_GLOBS, (0, index_js_1.getSourcePaths)(ctx.cwd));
87
87
  // A cycle detector needs the WHOLE graph, so an unreadable file list is the
88
88
  // one case where passing would be worst: half a graph produces confident
89
89
  // nonsense, and no graph reported as `pass` says the repository is acyclic
90
90
  // when nobody looked (ticket 072).
91
91
  if (allFiles === null)
92
- return (0, types_1.skip)('git unavailable');
92
+ return (0, types_js_1.skip)('git unavailable');
93
93
  if (allFiles.length === 0)
94
- return (0, types_1.pass)();
94
+ return (0, types_js_1.pass)();
95
95
  // Files the client exempted (generated code, vendored bundles) are dropped
96
96
  // before analysis — and again from the cycles below, since the graph can reach
97
97
  // an ignored file by following imports from one that is analyzed.
98
98
  const ignore = ctx.config.circularDeps?.ignore ?? [];
99
- const files = ignore.length > 0 ? allFiles.filter(f => !(0, utils_1.matchesAnyGlob)(f, ignore)) : allFiles;
99
+ const files = ignore.length > 0 ? allFiles.filter(f => !(0, index_js_2.matchesAnyGlob)(f, ignore)) : allFiles;
100
100
  if (files.length === 0)
101
- return (0, types_1.skip)('all files ignored');
101
+ return (0, types_js_1.skip)('all files ignored');
102
102
  const dpdmBin = resolveDpdm(ctx);
103
103
  if (!dpdmBin) {
104
- utils_1.logger.warn('[Circular Deps]: ⚠️ dpdm could not be resolved — skipping');
105
- return (0, types_1.skip)('dpdm unavailable');
104
+ index_js_2.logger.warn('[Circular Deps]: ⚠️ dpdm could not be resolved — skipping');
105
+ return (0, types_js_1.skip)('dpdm unavailable');
106
106
  }
107
107
  const timeout = ctx.config.circularDeps?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
108
108
  const reportPath = node_path_1.default.join(ctx.cwd, '.dpdm.temp.json');
@@ -114,7 +114,7 @@ exports.circularDepsCheck = {
114
114
  // including one built solely out of a cycle. `--exit-code circular:1` gives
115
115
  // the same answer independently: dpdm otherwise exits 0 even when it finds
116
116
  // cycles, so the exit code alone cannot tell a clean repo from a broken run.
117
- const result = await (0, execa_1.execa)(process.execPath, [
117
+ const result = await (0, execa_js_1.execa)(process.execPath, [
118
118
  dpdmBin,
119
119
  '--no-warning',
120
120
  '--no-tree',
@@ -123,11 +123,11 @@ exports.circularDepsCheck = {
123
123
  'circular:1',
124
124
  '-o',
125
125
  reportPath,
126
- ...toFileArgs(files, (0, config_1.getSourcePaths)(ctx.cwd)),
126
+ ...toFileArgs(files, (0, index_js_1.getSourcePaths)(ctx.cwd)),
127
127
  ], { cwd: ctx.cwd, reject: false, timeout });
128
128
  if (result.timedOut) {
129
- utils_1.logger.warn(`[Circular Deps]: ⚠️ dpdm timed out after ${timeout}ms — skipping`);
130
- return (0, types_1.skip)('dpdm timed out');
129
+ index_js_2.logger.warn(`[Circular Deps]: ⚠️ dpdm timed out after ${timeout}ms — skipping`);
130
+ return (0, types_js_1.skip)('dpdm timed out');
131
131
  }
132
132
  const report = readReport(reportPath);
133
133
  // No report means dpdm never got far enough to write one (a tsconfig it
@@ -136,18 +136,18 @@ exports.circularDepsCheck = {
136
136
  // blocks a PR that may have no cycle at all.
137
137
  if (!report) {
138
138
  const output = [result.stdout, result.stderr].filter(Boolean).join('\n').trim();
139
- utils_1.logger.warn(`[Circular Deps]: ⚠️ dpdm wrote no report (exit ${result.exitCode ?? 'killed'})${output ? `:\n${output}` : ''}`);
140
- return (0, types_1.skip)(`dpdm failed to run (exit ${result.exitCode ?? 'killed'})`);
139
+ index_js_2.logger.warn(`[Circular Deps]: ⚠️ dpdm wrote no report (exit ${result.exitCode ?? 'killed'})${output ? `:\n${output}` : ''}`);
140
+ return (0, types_js_1.skip)(`dpdm failed to run (exit ${result.exitCode ?? 'killed'})`);
141
141
  }
142
- const cycles = (report.circulars ?? []).filter(cycle => ignore.length === 0 || !cycle.some(file => (0, utils_1.matchesAnyGlob)(file, ignore)));
142
+ const cycles = (report.circulars ?? []).filter(cycle => ignore.length === 0 || !cycle.some(file => (0, index_js_2.matchesAnyGlob)(file, ignore)));
143
143
  if (cycles.length === 0)
144
- return (0, types_1.pass)();
144
+ return (0, types_js_1.pass)();
145
145
  // Advisory by default. This check reported nothing for its whole existence
146
146
  // (see the note above), so switching it on turns every long-standing cycle
147
147
  // in every client repo into a finding at once — barrel files alone account
148
148
  // for most of them. Warning first lets a repo see its cycles before they
149
149
  // gate anything; promote with `circularDeps.severity: "error"`.
150
- const sev = (0, findings_1.severityEmitter)(ctx.config.circularDeps?.severity, 'warn');
150
+ const sev = (0, findings_js_1.severityEmitter)(ctx.config.circularDeps?.severity, 'warn');
151
151
  sev.log(`[Circular Deps]: ${sev.icon} ${cycles.length} circular dependency(ies):`);
152
152
  cycles.slice(0, 10).forEach((cycle, i) => sev.log(` ${i + 1}) ${cycle.join(' -> ')}`));
153
153
  if (cycles.length > 10)
@@ -155,7 +155,7 @@ exports.circularDepsCheck = {
155
155
  return sev.emit(`${cycles.length} circular dependency(ies) found`);
156
156
  }
157
157
  finally {
158
- (0, utils_1.cleanupTempFile)(reportPath);
158
+ (0, index_js_2.cleanupTempFile)(reportPath);
159
159
  }
160
160
  },
161
161
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /** One entry of knip's JSON reporter — a file plus the issues found for it. */
3
3
  interface KnipIssue {
4
4
  file: string;
@@ -8,10 +8,10 @@ exports.toKnipIgnorePattern = toKnipIgnorePattern;
8
8
  exports.parseKnipReport = parseKnipReport;
9
9
  const node_fs_1 = __importDefault(require("node:fs"));
10
10
  const node_path_1 = __importDefault(require("node:path"));
11
- const config_1 = require("../../../config");
12
- const utils_1 = require("../../../utils");
13
- const execa_1 = require("../../../utils/execa");
14
- const types_1 = require("../../types");
11
+ const index_js_1 = require("../../../config/index.js");
12
+ const execa_js_1 = require("../../../utils/execa.js");
13
+ const index_js_2 = require("../../../utils/index.js");
14
+ const types_js_1 = require("../../types.js");
15
15
  /**
16
16
  * Config files knip discovers on its own. When a client ships one, it is the source
17
17
  * of truth and pr-checkmate passes no config of its own — the same rule spellcheck
@@ -106,27 +106,27 @@ exports.dependencyCheck = {
106
106
  applies(ctx) {
107
107
  if (ctx.config.dependency?.enabled === false)
108
108
  return false;
109
- return (0, types_1.isNpmProject)(ctx);
109
+ return (0, types_js_1.isNpmProject)(ctx);
110
110
  },
111
111
  async run(ctx) {
112
112
  // Resolve the bundled knip binary and run it via the current node — never
113
113
  // shell out to `npx`, which fails (exit 127) when knip isn't on the path.
114
114
  let knipBin;
115
115
  try {
116
- knipBin = (0, utils_1.resolvePackageBin)('knip', 'bin/knip.js');
116
+ knipBin = (0, index_js_2.resolvePackageBin)('knip', 'bin/knip.js');
117
117
  }
118
118
  catch {
119
- return (0, types_1.skip)('knip unavailable');
119
+ return (0, types_js_1.skip)('knip unavailable');
120
120
  }
121
121
  // Dependency names to skip, configured in pr-checkmate.json. knip takes these
122
122
  // from a config file only, so they go into a temp one — but a client's own knip
123
123
  // config wins outright, exactly as it does for cspell.
124
124
  const ignore = ctx.config.dependency?.ignore ?? [];
125
- const clientOwnsConfig = (0, config_1.hasLocalConfig)(KNIP_CONFIG_FILES, ctx.cwd) || hasPackageJsonConfig(ctx.cwd);
125
+ const clientOwnsConfig = (0, index_js_1.hasLocalConfig)(KNIP_CONFIG_FILES, ctx.cwd) || hasPackageJsonConfig(ctx.cwd);
126
126
  let tempConfigPath = null;
127
127
  if (ignore.length > 0 && clientOwnsConfig) {
128
128
  // Say so out loud: a silently ignored `ignore` list looks like a broken check.
129
- utils_1.logger.info(`[Dependencies]: ℹ️ this repo has its own knip config, so dependency.ignore (${ignore.join(', ')}) is not applied — add those names to knip's ignoreDependencies instead.`);
129
+ index_js_2.logger.info(`[Dependencies]: ℹ️ this repo has its own knip config, so dependency.ignore (${ignore.join(', ')}) is not applied — add those names to knip's ignoreDependencies instead.`);
130
130
  }
131
131
  if (ignore.length > 0 && !clientOwnsConfig) {
132
132
  tempConfigPath = node_path_1.default.join(ctx.cwd, '.knip.temp.json');
@@ -151,7 +151,7 @@ exports.dependencyCheck = {
151
151
  try {
152
152
  // reject:false — knip can still exit non-zero (e.g. config hints) while
153
153
  // writing a perfectly good report to stdout.
154
- const { stdout } = await (0, execa_1.execa)(process.execPath, args, {
154
+ const { stdout } = await (0, execa_js_1.execa)(process.execPath, args, {
155
155
  cwd: ctx.cwd,
156
156
  reject: false,
157
157
  });
@@ -160,23 +160,23 @@ exports.dependencyCheck = {
160
160
  // fail the client's PR. Never fail here: a check that blocks a PR because a
161
161
  // tool misbehaved reports our problem as the client's.
162
162
  if (!result)
163
- return (0, types_1.skip)('knip produced no report');
163
+ return (0, types_js_1.skip)('knip produced no report');
164
164
  const issues = result.issues ?? [];
165
165
  const unused = collectNames(issues, 'dependencies');
166
166
  const missing = collectNames(issues, 'unlisted');
167
167
  if (missing.length > 0) {
168
- missing.forEach(dep => utils_1.logger.error(`[Dependencies]: ❌ missing ${dep} (used in: ${filesUsing(issues, dep).join(', ')})`));
169
- return (0, types_1.fail)(`missing: ${missing.join(', ')}`);
168
+ missing.forEach(dep => index_js_2.logger.error(`[Dependencies]: ❌ missing ${dep} (used in: ${filesUsing(issues, dep).join(', ')})`));
169
+ return (0, types_js_1.fail)(`missing: ${missing.join(', ')}`);
170
170
  }
171
171
  if (unused.length > 0) {
172
- unused.forEach(dep => utils_1.logger.warn(`[Dependencies]: ⚠️ unused ${dep}`));
173
- return (0, types_1.warn)(`${unused.length} unused dependency(ies)`);
172
+ unused.forEach(dep => index_js_2.logger.warn(`[Dependencies]: ⚠️ unused ${dep}`));
173
+ return (0, types_js_1.warn)(`${unused.length} unused dependency(ies)`);
174
174
  }
175
- return (0, types_1.pass)();
175
+ return (0, types_js_1.pass)();
176
176
  }
177
177
  finally {
178
178
  if (tempConfigPath)
179
- (0, utils_1.cleanupTempFile)(tempConfigPath);
179
+ (0, index_js_2.cleanupTempFile)(tempConfigPath);
180
180
  }
181
181
  },
182
182
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * Dependency vulnerability scan via Anchore's `grype`. Non-blocking and ON by
4
4
  * default — runs unless `grypeScan.enabled` is explicitly `false`. grype is a