pr-checkmate 3.0.4 → 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 (378) 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/package.json +15 -13
  335. package/dist/core/checks/languages/lint.d.ts +0 -2
  336. package/dist/core/index.d.ts +0 -4
  337. package/dist/core/registry.js +0 -112
  338. package/dist/index.d.ts +0 -12
  339. package/dist/utils/index.d.ts +0 -15
  340. /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
  341. /package/dist/{config → cjs/config}/constants.d.ts +0 -0
  342. /package/dist/{config → cjs/config}/constants.js +0 -0
  343. /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
  344. /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
  345. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
  346. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
  347. /package/dist/{core → cjs/core}/commands.d.ts +0 -0
  348. /package/dist/{core → cjs/core}/commands.js +0 -0
  349. /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
  350. /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
  351. /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
  352. /package/dist/{core → cjs/core}/install/merge.js +0 -0
  353. /package/dist/{core → cjs/core}/install/profiles.js +0 -0
  354. /package/dist/{core → cjs/core}/types.js +0 -0
  355. /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
  356. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  357. /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
  358. /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
  359. /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
  360. /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
  361. /package/dist/{utils → cjs/utils}/ci.js +0 -0
  362. /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
  363. /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
  364. /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
  365. /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
  366. /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
  367. /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
  368. /package/dist/{utils → cjs/utils}/glob.js +0 -0
  369. /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
  370. /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
  371. /package/dist/{utils → cjs/utils}/logger.js +0 -0
  372. /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
  373. /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
  374. /package/dist/{utils → cjs/utils}/pool.js +0 -0
  375. /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
  376. /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
  377. /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
  378. /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
@@ -11,11 +11,11 @@ exports.resolveImports = resolveImports;
11
11
  exports.dropMissingLanguages = dropMissingLanguages;
12
12
  const node_fs_1 = __importDefault(require("node:fs"));
13
13
  const node_path_1 = __importDefault(require("node:path"));
14
- const config_1 = require("../../../config");
15
- const utils_1 = require("../../../utils");
16
- const execa_1 = require("../../../utils/execa");
17
- const targets_1 = require("../../targets");
18
- const types_1 = require("../../types");
14
+ const index_js_1 = require("../../../config/index.js");
15
+ const execa_js_1 = require("../../../utils/execa.js");
16
+ const index_js_2 = require("../../../utils/index.js");
17
+ const targets_js_1 = require("../../targets.js");
18
+ const types_js_1 = require("../../types.js");
19
19
  function loadUserCspellConfig(cwd) {
20
20
  const configPath = node_path_1.default.join(cwd, 'pr-checkmate.json');
21
21
  if (!node_fs_1.default.existsSync(configPath))
@@ -24,7 +24,7 @@ function loadUserCspellConfig(cwd) {
24
24
  return JSON.parse(node_fs_1.default.readFileSync(configPath, 'utf-8')).cspell || {};
25
25
  }
26
26
  catch (err) {
27
- utils_1.logger.warn(`[Spellcheck]: ⚠️ Failed to read cspell config: ${err}`);
27
+ index_js_2.logger.warn(`[Spellcheck]: ⚠️ Failed to read cspell config: ${err}`);
28
28
  return {};
29
29
  }
30
30
  }
@@ -213,7 +213,7 @@ function resolveFrom(cwd) {
213
213
  };
214
214
  }
215
215
  function createTempCspellConfig(cwd) {
216
- const packageConfigPath = (0, config_1.getPackageConfigPath)('cspell.json');
216
+ const packageConfigPath = (0, index_js_1.getPackageConfigPath)('cspell.json');
217
217
  const packageConfigDir = node_path_1.default.dirname(packageConfigPath);
218
218
  const defaultConfig = JSON.parse(node_fs_1.default.readFileSync(packageConfigPath, 'utf-8'));
219
219
  const userConfig = loadUserCspellConfig(cwd);
@@ -222,14 +222,14 @@ function createTempCspellConfig(cwd) {
222
222
  const { resolved, missing } = resolveImports(merged.import ?? [], packageConfigDir, resolve);
223
223
  const available = availableDictionaries(resolve);
224
224
  for (const { pkg } of missing) {
225
- utils_1.logger.info(`[Spellcheck]: dictionary ${pkg} is not installed and was skipped. Add it with \`npm i -D ${pkg}\`.`);
225
+ index_js_2.logger.info(`[Spellcheck]: dictionary ${pkg} is not installed and was skipped. Add it with \`npm i -D ${pkg}\`.`);
226
226
  }
227
227
  if (available.absent.length > 0) {
228
228
  // `info`, not `debug`. A client who installed a dictionary and saw no change
229
229
  // had nothing to read: the one line that would have explained it was behind a
230
230
  // flag. Which dictionaries are in play decides which findings appear, so it
231
231
  // belongs in the ordinary log (ticket 081).
232
- utils_1.logger.info(`[Spellcheck]: optional dictionaries not installed: ${available.absent.join(', ')}. ` +
232
+ index_js_2.logger.info(`[Spellcheck]: optional dictionaries not installed: ${available.absent.join(', ')}. ` +
233
233
  `Install any of them to spellcheck that language (\`npm i -D ${available.absent[0]}\`).`);
234
234
  }
235
235
  // A language the client asked for whose dictionary is absent is dropped rather
@@ -259,9 +259,9 @@ exports.spellcheckCheck = {
259
259
  return ctx.config.cspell?.enabled !== false && ctx.config.spellcheck?.enabled !== false;
260
260
  },
261
261
  async run(ctx) {
262
- const targets = await (0, targets_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx', '*.md', '*.mdx', '*.json'], (0, config_1.getSourcePaths)(ctx.cwd));
262
+ const targets = await (0, targets_js_1.resolveScopedTargetFiles)(ctx, ['*.ts', '*.tsx', '*.js', '*.jsx', '*.md', '*.mdx', '*.json'], (0, index_js_1.getSourcePaths)(ctx.cwd));
263
263
  if (targets === null)
264
- return (0, types_1.skip)('git unavailable');
264
+ return (0, types_js_1.skip)('git unavailable');
265
265
  // Committed build output and test reports are dropped here, in JS, against
266
266
  // repo-RELATIVE paths — a client cannot fix a typo in a generated file, so
267
267
  // reporting one is noise that buries the real findings. Neither cspell
@@ -272,12 +272,12 @@ exports.spellcheckCheck = {
272
272
  // rule for every repo. `ignoreDirs` already covers plain directory names via
273
273
  // `resolveTargetFiles`; this adds the composite globs it cannot express
274
274
  // (`**/cypress/videos/**`, `**/jest-html-reporters-*/**`).
275
- const files = targets.filter(f => !(0, utils_1.matchesAnyGlob)(f, config_1.IGNORE_PATTERNS));
275
+ const files = targets.filter(f => !(0, index_js_2.matchesAnyGlob)(f, index_js_1.IGNORE_PATTERNS));
276
276
  if (files.length === 0)
277
- return (0, types_1.pass)('no files to spellcheck');
278
- const hasLocal = (0, config_1.hasLocalConfig)(['cspell.json', '.cspell.json', 'cspell.config.json'], ctx.cwd);
277
+ return (0, types_js_1.pass)('no files to spellcheck');
278
+ const hasLocal = (0, index_js_1.hasLocalConfig)(['cspell.json', '.cspell.json', 'cspell.config.json'], ctx.cwd);
279
279
  let tempConfigPath = null;
280
- const cspellBin = (0, utils_1.resolvePackageBin)('cspell', 'bin.mjs');
280
+ const cspellBin = (0, index_js_2.resolvePackageBin)('cspell', 'bin.mjs');
281
281
  // `--no-must-find-files`: cspell exits 1 when it checked nothing, which the
282
282
  // exit-code mapping below would report as "spelling issues found" — a warning
283
283
  // about problems that do not exist. Every file being excluded is a pass, not a
@@ -292,16 +292,16 @@ exports.spellcheckCheck = {
292
292
  args = [...baseArgs, '--config', tempConfigPath];
293
293
  }
294
294
  try {
295
- const result = await (0, execa_1.execa)(process.execPath, [cspellBin, ...args], {
295
+ const result = await (0, execa_js_1.execa)(process.execPath, [cspellBin, ...args], {
296
296
  cwd: ctx.cwd,
297
297
  reject: false,
298
298
  stdio: 'inherit',
299
299
  });
300
- return result.exitCode === 0 ? (0, types_1.pass)() : (0, types_1.warn)('spelling issues found');
300
+ return result.exitCode === 0 ? (0, types_js_1.pass)() : (0, types_js_1.warn)('spelling issues found');
301
301
  }
302
302
  finally {
303
303
  if (tempConfigPath)
304
- (0, utils_1.cleanupTempFile)(tempConfigPath);
304
+ (0, index_js_2.cleanupTempFile)(tempConfigPath);
305
305
  }
306
306
  },
307
307
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /** True when `fullPath` is a symlink whose target does not exist. */
3
3
  export declare function isBrokenSymlink(fullPath: string): boolean;
4
4
  /**
@@ -7,10 +7,10 @@ exports.symlinksCheck = void 0;
7
7
  exports.isBrokenSymlink = isBrokenSymlink;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const utils_1 = require("../../../utils");
11
- const targets_1 = require("../../targets");
12
- const types_1 = require("../../types");
13
- const findings_1 = require("../findings");
10
+ const index_js_1 = require("../../../utils/index.js");
11
+ const targets_js_1 = require("../../targets.js");
12
+ const types_js_1 = require("../../types.js");
13
+ const findings_js_1 = require("../findings.js");
14
14
  /** True when `fullPath` is a symlink whose target does not exist. */
15
15
  function isBrokenSymlink(fullPath) {
16
16
  let stat;
@@ -41,7 +41,7 @@ exports.symlinksCheck = {
41
41
  return ctx.config.symlinks?.enabled !== false;
42
42
  },
43
43
  async run(ctx) {
44
- const files = await (0, targets_1.resolveTargets)(ctx, ['*'], {
44
+ const files = await (0, targets_js_1.resolveTargets)(ctx, ['*'], {
45
45
  wholeTree: true,
46
46
  onEmpty: { skip: 'no tracked files' },
47
47
  });
@@ -50,14 +50,14 @@ exports.symlinksCheck = {
50
50
  const ignore = ctx.config.symlinks?.ignore ?? [];
51
51
  const broken = [];
52
52
  for (const file of files) {
53
- if (ignore.length > 0 && (0, utils_1.matchesAnyGlob)(file, ignore))
53
+ if (ignore.length > 0 && (0, index_js_1.matchesAnyGlob)(file, ignore))
54
54
  continue;
55
55
  if (isBrokenSymlink(node_path_1.default.join(ctx.cwd, file)))
56
56
  broken.push(file);
57
57
  }
58
58
  if (broken.length === 0)
59
- return (0, types_1.pass)();
60
- const sev = (0, findings_1.severityEmitter)(ctx.config.symlinks?.severity, 'warn');
59
+ return (0, types_js_1.pass)();
60
+ const sev = (0, findings_js_1.severityEmitter)(ctx.config.symlinks?.severity, 'warn');
61
61
  broken.forEach(f => sev.log(`[Broken Symlinks]: ${sev.icon} ${f} — target does not exist`));
62
62
  return sev.emit(`${broken.length} broken symlink(s)`);
63
63
  },
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * True when a parser problem describes something actually wrong with the file —
4
4
  * a syntax error, a duplicate key, a tab used for indentation.
@@ -8,10 +8,10 @@ exports.isFileDefect = isFileDefect;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  const yaml_1 = require("yaml");
11
- const utils_1 = require("../../../utils");
12
- const targets_1 = require("../../targets");
13
- const types_1 = require("../../types");
14
- const findings_1 = require("../findings");
11
+ const index_js_1 = require("../../../utils/index.js");
12
+ const targets_js_1 = require("../../targets.js");
13
+ const types_js_1 = require("../../types.js");
14
+ const findings_js_1 = require("../findings.js");
15
15
  /** First line of a `yaml` error/warning message, stripped of its source excerpt. */
16
16
  function shortMessage(message) {
17
17
  return message.split('\n')[0].trim();
@@ -58,17 +58,17 @@ exports.yamlLintCheck = {
58
58
  async run(ctx) {
59
59
  // Keep the CI/workflow dirs that are globally ignored: they hold the very
60
60
  // YAML (GitHub Actions, GitLab CI, CircleCI) a YAML linter most needs to see.
61
- const allTargets = await (0, targets_1.resolveTargetFiles)(ctx, ['*.yml', '*.yaml'], {
61
+ const allTargets = await (0, targets_js_1.resolveTargetFiles)(ctx, ['*.yml', '*.yaml'], {
62
62
  keepDirs: ['.github', '.gitlab', '.circleci'],
63
63
  });
64
64
  if (allTargets === null)
65
- return (0, types_1.skip)('git unavailable');
65
+ return (0, types_js_1.skip)('git unavailable');
66
66
  if (allTargets.length === 0)
67
- return (0, types_1.skip)('no YAML files');
67
+ return (0, types_js_1.skip)('no YAML files');
68
68
  const ignore = ctx.config.yamlLint?.ignore ?? [];
69
- const targets = ignore.length > 0 ? allTargets.filter(f => !(0, utils_1.matchesAnyGlob)(f, ignore)) : allTargets;
69
+ const targets = ignore.length > 0 ? allTargets.filter(f => !(0, index_js_1.matchesAnyGlob)(f, ignore)) : allTargets;
70
70
  if (targets.length === 0)
71
- return (0, types_1.skip)('all YAML files ignored');
71
+ return (0, types_js_1.skip)('all YAML files ignored');
72
72
  const issues = [];
73
73
  for (const file of targets) {
74
74
  let source;
@@ -76,7 +76,7 @@ exports.yamlLintCheck = {
76
76
  source = node_fs_1.default.readFileSync(node_path_1.default.join(ctx.cwd, file), 'utf-8');
77
77
  }
78
78
  catch (err) {
79
- utils_1.logger.warn(`[YAML Lint]: ⚠️ Could not read ${file}: ${err}`);
79
+ index_js_1.logger.warn(`[YAML Lint]: ⚠️ Could not read ${file}: ${err}`);
80
80
  continue;
81
81
  }
82
82
  // parseAllDocuments never throws — it collects problems on each document,
@@ -100,7 +100,7 @@ exports.yamlLintCheck = {
100
100
  }
101
101
  }
102
102
  if (issues.length === 0)
103
- return (0, types_1.pass)();
103
+ return (0, types_js_1.pass)();
104
104
  // A file that does not parse blocks; a file that parses and merely worries
105
105
  // the parser does not. Treating both as blocking is what made this check
106
106
  // feel like an obstacle rather than a gate — and a check people switch off
@@ -109,7 +109,7 @@ exports.yamlLintCheck = {
109
109
  const broken = issues.filter(i => i.blocking);
110
110
  const questionable = issues.filter(i => !i.blocking);
111
111
  const describe = (i) => `${i.file}${i.line ? `:${i.line}${i.col ? `:${i.col}` : ''}` : ''} — ${i.message}`;
112
- const sev = (0, findings_1.severityEmitter)(configured, broken.length > 0 ? 'error' : 'warn');
112
+ const sev = (0, findings_js_1.severityEmitter)(configured, broken.length > 0 ? 'error' : 'warn');
113
113
  [...broken, ...questionable]
114
114
  .slice(0, 10)
115
115
  .forEach(i => sev.log(`[YAML Lint]: ${sev.icon} ${describe(i)}`));
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const diffSecurityCheck: Check;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.diffSecurityCheck = void 0;
4
- const config_1 = require("../../../config");
5
- const utils_1 = require("../../../utils");
6
- const types_1 = require("../../types");
7
- const findings_1 = require("../findings");
4
+ const index_js_1 = require("../../../config/index.js");
5
+ const index_js_2 = require("../../../utils/index.js");
6
+ const types_js_1 = require("../../types.js");
7
+ const findings_js_1 = require("../findings.js");
8
8
  const MD5_LABEL = 'MD5 (weak hash — use sha256 or stronger)';
9
9
  const SHA1_LABEL = 'SHA-1 (weak hash — use sha256 or stronger)';
10
10
  const SECURITY_PATTERNS = [
@@ -262,7 +262,7 @@ function compileExtraPatterns(ctx) {
262
262
  ];
263
263
  }
264
264
  catch (err) {
265
- utils_1.logger.warn(`[Diff Security]: ⚠️ ignoring extraPattern "${rule.label}" — invalid regex: ${err}`);
265
+ index_js_2.logger.warn(`[Diff Security]: ⚠️ ignoring extraPattern "${rule.label}" — invalid regex: ${err}`);
266
266
  return [];
267
267
  }
268
268
  });
@@ -290,21 +290,21 @@ exports.diffSecurityCheck = {
290
290
  async run(ctx) {
291
291
  try {
292
292
  const cfg = ctx.config.diffSecurity ?? {};
293
- const found = (0, findings_1.emptyBuckets)();
293
+ const found = (0, findings_js_1.emptyBuckets)();
294
294
  const scanOpts = {
295
295
  comments: cfg.commentHandling ?? 'language',
296
296
  // Setting `ignorePaths` REPLACES the test-path defaults rather than adding
297
297
  // to them, matching `duplicate.ignore` and `deadCode.ignoreFiles`. A client
298
298
  // who wants their tests scanned says so by listing something else here.
299
- ignorePaths: cfg.ignorePaths ?? config_1.DIFF_SECURITY_IGNORE_DEFAULTS,
299
+ ignorePaths: cfg.ignorePaths ?? index_js_1.DIFF_SECURITY_IGNORE_DEFAULTS,
300
300
  // This check owns the cross-line heuristic, so it is the one that turns it
301
301
  // on. `0` from the client switches it off.
302
- dataflowWindow: cfg.dataflowWindow ?? findings_1.DEFAULT_DATAFLOW_WINDOW,
302
+ dataflowWindow: cfg.dataflowWindow ?? findings_js_1.DEFAULT_DATAFLOW_WINDOW,
303
303
  };
304
304
  const extra = compileExtraPatterns(ctx);
305
305
  const disabled = cfg.disablePatterns ?? [];
306
306
  const scanInto = (stdout, patterns) => {
307
- (0, findings_1.mergeSeverityBuckets)(found, (0, findings_1.scanDiffPatterns)(stdout, activePatterns(patterns, disabled), scanOpts));
307
+ (0, findings_js_1.mergeSeverityBuckets)(found, (0, findings_js_1.scanDiffPatterns)(stdout, activePatterns(patterns, disabled), scanOpts));
308
308
  };
309
309
  /**
310
310
  * Feed one language's sources through the patterns, from the diff when
@@ -317,7 +317,7 @@ exports.diffSecurityCheck = {
317
317
  * distinction lived in two places, one of them a blocking security check
318
318
  * (ticket 079).
319
319
  */
320
- const review = (globs, patterns) => (0, findings_1.reviewLines)(ctx, globs, stdout => scanInto(stdout, patterns));
320
+ const review = (globs, patterns) => (0, findings_js_1.reviewLines)(ctx, globs, stdout => scanInto(stdout, patterns));
321
321
  // JS/TS patterns always run; language-specific sets scan their own globs
322
322
  // only when that language is present, so a Python repo gets Python rules.
323
323
  // Client `extraPatterns` run against every scanned language, since a
@@ -340,18 +340,18 @@ exports.diffSecurityCheck = {
340
340
  // here: three of five language sets scanned, reported as a pass, reads
341
341
  // as a clean repository (ticket 072).
342
342
  if (!(await review(globs, patterns)))
343
- return (0, types_1.skip)('git unavailable');
343
+ return (0, types_js_1.skip)('git unavailable');
344
344
  }
345
- return (0, findings_1.reportSeverityBuckets)(found.errors, found.warnings, {
345
+ return (0, findings_js_1.reportSeverityBuckets)(found.errors, found.warnings, {
346
346
  prefix: 'Diff Security',
347
347
  errorSummary: n => `${n} issue(s)`,
348
348
  warningSummary: n => `${n} warning(s)`,
349
- ...(0, findings_1.clientFindingOptions)(ctx, cfg),
349
+ ...(0, findings_js_1.clientFindingOptions)(ctx, cfg),
350
350
  });
351
351
  }
352
352
  catch (err) {
353
- utils_1.logger.warn(`[Diff Security]: ⚠️ Could not analyze diff\n${err}`);
354
- return (0, types_1.skip)('diff unavailable');
353
+ index_js_2.logger.warn(`[Diff Security]: ⚠️ Could not analyze diff\n${err}`);
354
+ return (0, types_js_1.skip)('diff unavailable');
355
355
  }
356
356
  },
357
357
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const dockerfileSecurityCheck: Check;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dockerfileSecurityCheck = void 0;
4
- const utils_1 = require("../../../utils");
5
- const execa_1 = require("../../../utils/execa");
6
- const targets_1 = require("../../targets");
7
- const types_1 = require("../../types");
8
- const findings_1 = require("../findings");
4
+ const execa_js_1 = require("../../../utils/execa.js");
5
+ const index_js_1 = require("../../../utils/index.js");
6
+ const targets_js_1 = require("../../targets.js");
7
+ const types_js_1 = require("../../types.js");
8
+ const findings_js_1 = require("../findings.js");
9
9
  const DOCKERFILE_GLOBS = ['**/Dockerfile', '**/Dockerfile.*', '**/*.Dockerfile'];
10
10
  /** Common Dockerfile security smells, matched on added diff lines. */
11
11
  const DOCKER_PATTERNS = [
@@ -60,42 +60,42 @@ exports.dockerfileSecurityCheck = {
60
60
  return ctx.config.dockerfileSecurity?.enabled !== false;
61
61
  },
62
62
  async run(ctx) {
63
- const files = await (0, targets_1.resolveTargetFiles)(ctx, ['*']);
63
+ const files = await (0, targets_js_1.resolveTargetFiles)(ctx, ['*']);
64
64
  if (files === null)
65
- return (0, types_1.skip)('git unavailable');
66
- const dockerfiles = files.filter(f => (0, utils_1.matchesAnyGlob)(f, DOCKERFILE_GLOBS));
65
+ return (0, types_js_1.skip)('git unavailable');
66
+ const dockerfiles = files.filter(f => (0, index_js_1.matchesAnyGlob)(f, DOCKERFILE_GLOBS));
67
67
  if (dockerfiles.length === 0)
68
- return (0, types_1.pass)();
68
+ return (0, types_js_1.pass)();
69
69
  try {
70
70
  const cfg = ctx.config.dockerfileSecurity ?? {};
71
71
  let stdout = '';
72
72
  if (ctx.baseSha) {
73
- stdout = (await (0, execa_1.execa)('git', ['diff', '--unified=0', ctx.baseSha, ctx.headSha ?? 'HEAD', '--', ...dockerfiles], { cwd: ctx.cwd })).stdout;
73
+ stdout = (await (0, execa_js_1.execa)('git', ['diff', '--unified=0', ctx.baseSha, ctx.headSha ?? 'HEAD', '--', ...dockerfiles], { cwd: ctx.cwd })).stdout;
74
74
  }
75
75
  else if (ctx.config.run?.fullScanBehaviour !== 'skip') {
76
- await (0, findings_1.scanTrackedFiles)(ctx, dockerfiles, asDiff => {
76
+ await (0, findings_js_1.scanTrackedFiles)(ctx, dockerfiles, asDiff => {
77
77
  stdout += `${asDiff}\n`;
78
78
  });
79
79
  }
80
80
  // This check runs `git diff` itself rather than going through
81
81
  // `diffAddedLines`, so the `pr-checkmate-ignore` opt-out is applied here.
82
- const { errors, warnings } = (0, findings_1.scanDiffPatterns)(stdout, DOCKER_PATTERNS, {
82
+ const { errors, warnings } = (0, findings_js_1.scanDiffPatterns)(stdout, DOCKER_PATTERNS, {
83
83
  skipIgnored: true,
84
84
  // Dockerfiles have no extension to key off, and `#` is their comment
85
85
  // marker — the `hash` reading, not the language-detected one.
86
86
  comments: 'legacy',
87
87
  ignorePaths: cfg.ignorePaths,
88
88
  });
89
- return (0, findings_1.reportSeverityBuckets)(errors, warnings, {
89
+ return (0, findings_js_1.reportSeverityBuckets)(errors, warnings, {
90
90
  prefix: 'Dockerfile Security',
91
91
  errorSummary: n => `${n} issue(s)`,
92
92
  warningSummary: n => `${n} warning(s)`,
93
- ...(0, findings_1.clientFindingOptions)(ctx, cfg),
93
+ ...(0, findings_js_1.clientFindingOptions)(ctx, cfg),
94
94
  });
95
95
  }
96
96
  catch (err) {
97
- utils_1.logger.warn(`[Dockerfile Security]: ⚠️ Could not analyze diff\n${err}`);
98
- return (0, types_1.skip)('diff unavailable');
97
+ index_js_1.logger.warn(`[Dockerfile Security]: ⚠️ Could not analyze diff\n${err}`);
98
+ return (0, types_js_1.skip)('diff unavailable');
99
99
  }
100
100
  },
101
101
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const migrationSafetyCheck: Check;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrationSafetyCheck = void 0;
4
- const utils_1 = require("../../../utils");
5
- const execa_1 = require("../../../utils/execa");
6
- const targets_1 = require("../../targets");
7
- const types_1 = require("../../types");
8
- const findings_1 = require("../findings");
4
+ const execa_js_1 = require("../../../utils/execa.js");
5
+ const index_js_1 = require("../../../utils/index.js");
6
+ const targets_js_1 = require("../../targets.js");
7
+ const types_js_1 = require("../../types.js");
8
+ const findings_js_1 = require("../findings.js");
9
9
  /**
10
10
  * Paths treated as database migrations. A client overrides via
11
11
  * `migrationSafety.paths` (REPLACES this list).
@@ -69,7 +69,7 @@ function withoutComment(line) {
69
69
  // after the `+`, where a boundary rule looking for whitespace or line-start
70
70
  // does not see it — which is exactly the shape a commented-out statement takes.
71
71
  const marker = line.startsWith('+') ? '+' : '';
72
- const body = (0, findings_1.stripInlineComment)(line.slice(marker.length), 'hash').replace(/(^|\s)--.*$/, '$1');
72
+ const body = (0, findings_js_1.stripInlineComment)(line.slice(marker.length), 'hash').replace(/(^|\s)--.*$/, '$1');
73
73
  return marker + body;
74
74
  }
75
75
  /** Bucket dangerous added lines by risk label, honouring the opt-out directive. */
@@ -102,28 +102,28 @@ exports.migrationSafetyCheck = {
102
102
  async run(ctx) {
103
103
  // Not sourcePath-scoped: migrations commonly live outside `src` (db/, alembic/).
104
104
  // ignoreDirs still applies via resolveTargetFiles.
105
- const files = await (0, targets_1.resolveTargetFiles)(ctx, ['*']);
105
+ const files = await (0, targets_js_1.resolveTargetFiles)(ctx, ['*']);
106
106
  if (files === null)
107
- return (0, types_1.skip)('git unavailable');
107
+ return (0, types_js_1.skip)('git unavailable');
108
108
  const globs = ctx.config.migrationSafety?.paths ?? DEFAULT_MIGRATION_GLOBS;
109
- const migrationFiles = files.filter(f => (0, utils_1.matchesAnyGlob)(f, globs));
109
+ const migrationFiles = files.filter(f => (0, index_js_1.matchesAnyGlob)(f, globs));
110
110
  if (migrationFiles.length === 0)
111
- return (0, types_1.pass)();
111
+ return (0, types_js_1.pass)();
112
112
  try {
113
113
  let stdout = '';
114
114
  if (ctx.baseSha) {
115
- stdout = (await (0, execa_1.execa)('git', ['diff', '--unified=0', ctx.baseSha, ctx.headSha ?? 'HEAD', '--', ...migrationFiles], { cwd: ctx.cwd })).stdout;
115
+ stdout = (await (0, execa_js_1.execa)('git', ['diff', '--unified=0', ctx.baseSha, ctx.headSha ?? 'HEAD', '--', ...migrationFiles], { cwd: ctx.cwd })).stdout;
116
116
  }
117
117
  else if (ctx.config.run?.fullScanBehaviour !== 'skip') {
118
- await (0, findings_1.scanTrackedFiles)(ctx, migrationFiles, asDiff => {
118
+ await (0, findings_js_1.scanTrackedFiles)(ctx, migrationFiles, asDiff => {
119
119
  stdout += `${asDiff}\n`;
120
120
  });
121
121
  }
122
122
  const findings = {};
123
123
  scan(stdout, findings);
124
- if ((0, findings_1.bucketTotal)(findings) === 0)
125
- return (0, types_1.pass)();
126
- return (0, findings_1.reportCountedFindings)(findings, ctx, {
124
+ if ((0, findings_js_1.bucketTotal)(findings) === 0)
125
+ return (0, types_js_1.pass)();
126
+ return (0, findings_js_1.reportCountedFindings)(findings, ctx, {
127
127
  prefix: 'Migration Safety',
128
128
  severity: ctx.config.migrationSafety?.severity,
129
129
  sampleLimit: ctx.config.log?.sampleLimit ?? 2,
@@ -133,8 +133,8 @@ exports.migrationSafetyCheck = {
133
133
  });
134
134
  }
135
135
  catch (err) {
136
- utils_1.logger.warn(`[Migration Safety]: ⚠️ Could not analyze diff\n${err}`);
137
- return (0, types_1.skip)('diff unavailable');
136
+ index_js_1.logger.warn(`[Migration Safety]: ⚠️ Could not analyze diff\n${err}`);
137
+ return (0, types_js_1.skip)('diff unavailable');
138
138
  }
139
139
  },
140
140
  };
@@ -1,4 +1,4 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  /**
3
3
  * A HOME the scanner can actually write to.
4
4
  *
@@ -10,10 +10,10 @@ exports.looksLikeCrash = looksLikeCrash;
10
10
  const node_fs_1 = __importDefault(require("node:fs"));
11
11
  const node_os_1 = __importDefault(require("node:os"));
12
12
  const node_path_1 = __importDefault(require("node:path"));
13
- const config_1 = require("../../../config");
14
- const utils_1 = require("../../../utils");
15
- const execa_1 = require("../../../utils/execa");
16
- const types_1 = require("../../types");
13
+ const index_js_1 = require("../../../config/index.js");
14
+ const execa_js_1 = require("../../../utils/execa.js");
15
+ const index_js_2 = require("../../../utils/index.js");
16
+ const types_js_1 = require("../../types.js");
17
17
  /**
18
18
  * A HOME the scanner can actually write to.
19
19
  *
@@ -79,7 +79,7 @@ function writableHome() {
79
79
  const fallback = node_os_1.default.tmpdir();
80
80
  try {
81
81
  node_fs_1.default.accessSync(fallback, node_fs_1.default.constants.W_OK);
82
- utils_1.logger.info(`[Security Scan]: HOME (${home}) is not writable — caching the scanner in ${fallback}`);
82
+ index_js_2.logger.info(`[Security Scan]: HOME (${home}) is not writable — caching the scanner in ${fallback}`);
83
83
  return fallback;
84
84
  }
85
85
  catch {
@@ -120,13 +120,13 @@ exports.securityCheck = {
120
120
  // tool (knip, license-checker) already skips here; this one did not.
121
121
  let gitleaksBin;
122
122
  try {
123
- gitleaksBin = (0, utils_1.resolvePackageBin)('gitleaks-secret-scanner-fixed', 'dist/bin/cli.js');
123
+ gitleaksBin = (0, index_js_2.resolvePackageBin)('gitleaks-secret-scanner-fixed', 'dist/bin/cli.js');
124
124
  }
125
125
  catch {
126
- utils_1.logger.warn('[Security Scan]: ⚠️ bundled gitleaks scanner could not be resolved — skipping');
127
- return (0, types_1.skip)('gitleaks unavailable');
126
+ index_js_2.logger.warn('[Security Scan]: ⚠️ bundled gitleaks scanner could not be resolved — skipping');
127
+ return (0, types_js_1.skip)('gitleaks unavailable');
128
128
  }
129
- const hasClientConfig = (0, config_1.hasLocalConfig)(['.gitleaks.toml', 'gitleaks.toml', '.gitleaks/config.toml'], ctx.cwd);
129
+ const hasClientConfig = (0, index_js_1.hasLocalConfig)(['.gitleaks.toml', 'gitleaks.toml', '.gitleaks/config.toml'], ctx.cwd);
130
130
  // Pin the gitleaks binary version so the scanner never reaches out to the
131
131
  // GitHub API for the "latest" version — that network call adds latency and
132
132
  // times out in locked-down/offline CI (the scanner already falls back to
@@ -145,15 +145,15 @@ exports.securityCheck = {
145
145
  // after printing `fatal: not a git repository` and "An unexpected error
146
146
  // occurred" — alarming output about the tool, for a directory it was never
147
147
  // able to review. Every other check skips when git is unusable; so does this.
148
- if (!isDelta && !(await (0, utils_1.resolveGitRef)(ctx.cwd, 'HEAD'))) {
149
- return (0, types_1.skip)('git history unavailable');
148
+ if (!isDelta && !(await (0, index_js_2.resolveGitRef)(ctx.cwd, 'HEAD'))) {
149
+ return (0, types_js_1.skip)('git history unavailable');
150
150
  }
151
151
  const args = isDelta
152
152
  ? ['--diff-mode', 'ci']
153
153
  : ['--diff-mode', 'history', ...(depth ? ['--depth', String(depth)] : [])];
154
154
  args.push('--gitleaks-version', gitleaksVersion);
155
155
  if (!hasClientConfig) {
156
- args.push('--config', (0, config_1.getPackageConfigPath)('gitleaks.toml'));
156
+ args.push('--config', (0, index_js_1.getPackageConfigPath)('gitleaks.toml'));
157
157
  }
158
158
  // A machine-readable copy of the findings, purely so the outcome can carry a
159
159
  // number. Written to a temp directory, never into the repository under review:
@@ -163,10 +163,10 @@ exports.securityCheck = {
163
163
  const reportDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'pr-checkmate-gitleaks-'));
164
164
  const reportPath = node_path_1.default.join(reportDir, 'findings.json');
165
165
  args.push('--report-format', 'json', '--report-path', reportPath);
166
- utils_1.logger.info(`[Security Scan]: scanning ${isDelta ? 'the diff range' : `full history${depth ? ` (last ${depth} commits)` : ''}`}`);
166
+ index_js_2.logger.info(`[Security Scan]: scanning ${isDelta ? 'the diff range' : `full history${depth ? ` (last ${depth} commits)` : ''}`}`);
167
167
  const home = writableHome();
168
168
  if (!home)
169
- return (0, types_1.skip)('no writable directory for the scanner cache');
169
+ return (0, types_js_1.skip)('no writable directory for the scanner cache');
170
170
  const env = {
171
171
  ...process.env,
172
172
  HOME: home,
@@ -176,7 +176,7 @@ exports.securityCheck = {
176
176
  // stdout stays inherited so the scanner's own report streams to the log as it
177
177
  // always has; stderr is captured because it is the only thing that separates
178
178
  // a crash from a finding — see `crashed`.
179
- const result = await (0, execa_1.execa)(process.execPath, [gitleaksBin, ...args], {
179
+ const result = await (0, execa_js_1.execa)(process.execPath, [gitleaksBin, ...args], {
180
180
  cwd: ctx.cwd,
181
181
  env,
182
182
  stdio: ['ignore', 'inherit', 'pipe'],
@@ -184,11 +184,11 @@ exports.securityCheck = {
184
184
  });
185
185
  const stderr = String(result.stderr ?? '');
186
186
  if (stderr.trim())
187
- utils_1.logger.warn(stderr.trimEnd());
187
+ index_js_2.logger.warn(stderr.trimEnd());
188
188
  const found = countFindings(reportPath);
189
189
  node_fs_1.default.rmSync(reportDir, { recursive: true, force: true });
190
190
  if (result.exitCode === 0)
191
- return (0, types_1.pass)();
191
+ return (0, types_js_1.pass)();
192
192
  // gitleaks exits 1 specifically when it finds secrets — but so does Node when
193
193
  // the wrapper around it throws. Only the second one leaves a stack trace.
194
194
  if (result.exitCode === 1 && !looksLikeCrash(stderr)) {
@@ -198,13 +198,13 @@ exports.securityCheck = {
198
198
  // nothing else, so a blocking check told the client to open something that
199
199
  // does not exist (ticket 085).
200
200
  const summary = secretsSummary(found);
201
- utils_1.logger.warn(`⚠️ gitleaks found ${summary} — see the findings above`);
202
- return (0, types_1.fail)(summary);
201
+ index_js_2.logger.warn(`⚠️ gitleaks found ${summary} — see the findings above`);
202
+ return (0, types_js_1.fail)(summary);
203
203
  }
204
204
  const detail = looksLikeCrash(stderr)
205
205
  ? 'scanner failed to start — nothing was scanned'
206
206
  : `scanner error (exit ${result.exitCode})`;
207
- utils_1.logger.warn(`[Security Scan]: ⚠️ ${detail}`);
208
- return (0, types_1.warn)(detail);
207
+ index_js_2.logger.warn(`[Security Scan]: ⚠️ ${detail}`);
208
+ return (0, types_js_1.warn)(detail);
209
209
  },
210
210
  };
@@ -1,2 +1,2 @@
1
- import { Check } from '../../types';
1
+ import { Check } from '../../types.js';
2
2
  export declare const sensitiveFileGuardCheck: Check;