pr-checkmate 3.0.4 → 3.2.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 (384) 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/{core → cjs/core}/checks/languages/go-format.js +21 -21
  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/cjs/core/checks/quality/markdown-lint.js +147 -0
  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/profiles.js +1 -1
  118. package/dist/{core → cjs/core}/install/reuse.d.ts +1 -1
  119. package/dist/{core → cjs/core}/install/reuse.js +4 -4
  120. package/dist/{core → cjs/core}/registry.d.ts +1 -1
  121. package/dist/cjs/core/registry.js +112 -0
  122. package/dist/{core → cjs/core}/reporters.d.ts +1 -1
  123. package/dist/{core → cjs/core}/reporters.js +28 -28
  124. package/dist/{core → cjs/core}/run-checks.d.ts +2 -2
  125. package/dist/{core → cjs/core}/run-checks.js +31 -31
  126. package/dist/{core → cjs/core}/targets.d.ts +1 -1
  127. package/dist/{core → cjs/core}/targets.js +20 -20
  128. package/dist/{core → cjs/core}/types.d.ts +3 -3
  129. package/dist/cjs/index.d.ts +12 -0
  130. package/dist/{index.js → cjs/index.js} +18 -18
  131. package/dist/{init.js → cjs/init.js} +68 -56
  132. package/dist/{interfaces → cjs/interfaces}/index.d.ts +3 -3
  133. package/dist/cjs/package.json +1 -0
  134. package/dist/{scripts → cjs/scripts}/copy-configs.js +22 -7
  135. package/dist/{scripts → cjs/scripts}/generate-install-manifests.js +2 -2
  136. package/dist/{scripts → cjs/scripts}/publish-github.js +4 -4
  137. package/dist/{utils → cjs/utils}/detect-language.js +12 -12
  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/esm/core/checks/languages/go-format.js +163 -0
  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 +141 -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/esm/utils/execa.js +10 -0
  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/duplicate/package-lock.json +0 -12
  335. package/install-manifests/js/package-lock.json +17 -41
  336. package/install-manifests/js/package.json +1 -1
  337. package/install-manifests/markdown/package-lock.json +1 -492
  338. package/install-manifests/markdown/package.json +1 -1
  339. package/package.json +17 -15
  340. package/dist/core/checks/languages/lint.d.ts +0 -2
  341. package/dist/core/checks/quality/markdown-lint.js +0 -110
  342. package/dist/core/index.d.ts +0 -4
  343. package/dist/core/registry.js +0 -112
  344. package/dist/index.d.ts +0 -12
  345. package/dist/utils/index.d.ts +0 -15
  346. /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
  347. /package/dist/{config → cjs/config}/constants.d.ts +0 -0
  348. /package/dist/{config → cjs/config}/constants.js +0 -0
  349. /package/dist/{config → cjs/config}/pr-checkmate-workflow-docker.yml +0 -0
  350. /package/dist/{config → cjs/config}/pr-checkmate-workflow.yml +0 -0
  351. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.d.ts +0 -0
  352. /package/dist/{core → cjs/core}/checks/languages/ruff-shared.js +0 -0
  353. /package/dist/{core → cjs/core}/commands.d.ts +0 -0
  354. /package/dist/{core → cjs/core}/commands.js +0 -0
  355. /package/dist/{core → cjs/core}/install/cache.d.ts +0 -0
  356. /package/dist/{core → cjs/core}/install/lock.d.ts +0 -0
  357. /package/dist/{core → cjs/core}/install/merge.d.ts +0 -0
  358. /package/dist/{core → cjs/core}/install/merge.js +0 -0
  359. /package/dist/{core → cjs/core}/types.js +0 -0
  360. /package/dist/{init.d.ts → cjs/init.d.ts} +0 -0
  361. /package/dist/{interfaces → cjs/interfaces}/index.js +0 -0
  362. /package/dist/{scripts → cjs/scripts}/copy-configs.d.ts +0 -0
  363. /package/dist/{scripts → cjs/scripts}/generate-install-manifests.d.ts +0 -0
  364. /package/dist/{scripts → cjs/scripts}/publish-github.d.ts +0 -0
  365. /package/dist/{utils → cjs/utils}/ci.d.ts +0 -0
  366. /package/dist/{utils → cjs/utils}/ci.js +0 -0
  367. /package/dist/{utils → cjs/utils}/detect-language.d.ts +0 -0
  368. /package/dist/{utils → cjs/utils}/direct-deps.d.ts +0 -0
  369. /package/dist/{utils → cjs/utils}/direct-deps.js +0 -0
  370. /package/dist/{utils → cjs/utils}/execa.d.ts +0 -0
  371. /package/dist/{utils → cjs/utils}/execa.js +0 -0
  372. /package/dist/{utils → cjs/utils}/git.d.ts +0 -0
  373. /package/dist/{utils → cjs/utils}/glob.d.ts +0 -0
  374. /package/dist/{utils → cjs/utils}/glob.js +0 -0
  375. /package/dist/{utils → cjs/utils}/http.d.ts +0 -0
  376. /package/dist/{utils → cjs/utils}/logger.d.ts +0 -0
  377. /package/dist/{utils → cjs/utils}/logger.js +0 -0
  378. /package/dist/{utils → cjs/utils}/package-version.d.ts +0 -0
  379. /package/dist/{utils → cjs/utils}/pool.d.ts +0 -0
  380. /package/dist/{utils → cjs/utils}/pool.js +0 -0
  381. /package/dist/{utils → cjs/utils}/resolve-bin.d.ts +0 -0
  382. /package/dist/{utils → cjs/utils}/result-collector.d.ts +0 -0
  383. /package/dist/{utils → cjs/utils}/result-collector.js +0 -0
  384. /package/dist/{utils → cjs/utils}/update-notifier.d.ts +0 -0
@@ -0,0 +1,195 @@
1
+ import type { PRCheckMateConfig, ReporterConfig } from '../interfaces/index.js';
2
+ import type { Language, LanguageUsage } from '../utils/detect-language.js';
3
+ import type { CheckResult, CheckStatus } from '../utils/result-collector.js';
4
+ export type { CheckResult, CheckStatus, Language, LanguageUsage };
5
+ /**
6
+ * Execution phases, run strictly in order. Within a phase checks run in parallel.
7
+ * `format` runs last because formatters (prettier) may write files.
8
+ */
9
+ export type Phase = 'blocking' | 'informational' | 'format';
10
+ export declare const PHASES: readonly Phase[];
11
+ /**
12
+ * What this run is looking at, and whether that is what was asked for.
13
+ *
14
+ * `degraded` is the field that earns this its own type: a full scan requested by
15
+ * a human and a full scan we fell back to because the PR base was missing are
16
+ * indistinguishable in the results — both just omit every delta-only check — but
17
+ * only one of them is a problem worth telling anyone about.
18
+ */
19
+ export interface RunScope {
20
+ kind: 'delta' | 'full' | 'staged';
21
+ /** Short explanation for the log line, e.g. `PR base unavailable`. */
22
+ reason?: string;
23
+ /** True when a diff range was wanted but could not be built. */
24
+ degraded: boolean;
25
+ }
26
+ /**
27
+ * Everything a check needs to run. Assembled once by `buildContext` and shared
28
+ * across all checks — no check reads `process.cwd()` or `process.env` directly.
29
+ */
30
+ export interface CheckContext {
31
+ /** Repository root the checks operate on. */
32
+ cwd: string;
33
+ /** Languages detected (or supplied) for this repo — drives `applies` gating. */
34
+ languages: Language[];
35
+ /**
36
+ * The same detection with its evidence — file counts per language. Read by the
37
+ * install layer, which must not confuse "this language is here" with "this
38
+ * language is worth a toolchain download". Absent on hand-built contexts.
39
+ */
40
+ usage?: LanguageUsage[];
41
+ /** Merged pr-checkmate.json + defaults. */
42
+ config: PRCheckMateConfig;
43
+ /** When false, checks that would modify files (prettier, --fix) run read-only or skip the write. */
44
+ write: boolean;
45
+ /** Diff range for delta-aware checks; undefined → full-repo scan. */
46
+ baseSha?: string;
47
+ headSha?: string;
48
+ /** What this run is looking at, and why. Optional so hand-built contexts stay terse. */
49
+ scope?: RunScope;
50
+ /**
51
+ * Display names of the checks in this run, for the one check that reasons about
52
+ * the others (Config Validation, verifying `severity` keys).
53
+ *
54
+ * Passed down rather than imported: a check importing the registry would close
55
+ * the loop registry → check → registry, and it also lets custom checks supplied
56
+ * through `RunOptions.checks` be validated like built-in ones.
57
+ */
58
+ checkNames?: string[];
59
+ /**
60
+ * Per-run memoization cache for identical git invocations (many checks diff
61
+ * the same range). Created once per `runChecks`; safe because git state is
62
+ * stable within a run. Keyed by the git args.
63
+ */
64
+ cache?: Map<string, string>;
65
+ }
66
+ /** Outcome of a single check — the name is attached by the orchestrator. */
67
+ export interface CheckOutcome {
68
+ status: CheckStatus;
69
+ details?: string;
70
+ }
71
+ /**
72
+ * A single quality gate. `applies` decides relevance (language/marker gating);
73
+ * `run` performs the check and returns an outcome. `run` must NOT throw for
74
+ * violations — return `fail`/`warn` instead. Thrown errors are caught by the
75
+ * orchestrator and recorded as `fail`.
76
+ */
77
+ export interface Check {
78
+ name: string;
79
+ phase: Phase;
80
+ /**
81
+ * The check reviews a diff and has nothing to say without one. Declared here
82
+ * rather than folded into `applies` so the orchestrator can tell the two kinds
83
+ * of "not applicable" apart:
84
+ *
85
+ * - a check that does not apply (SwiftLint in a Python repo) is noise, and is
86
+ * left out of the report entirely;
87
+ * - a check that *would* have applied but had no diff range is a gap in
88
+ * coverage, and is reported as a skip with the reason.
89
+ *
90
+ * Before this existed, both simply vanished — so a shallow clone removed most
91
+ * of the security surface and still printed a clean, complete-looking report.
92
+ */
93
+ requiresDiff?: boolean;
94
+ /**
95
+ * The check spawns something expensive — a whole-project analyser like knip,
96
+ * jscpd, dpdm, tsc or grype. The orchestrator admits only a couple of these at
97
+ * once, independently of the overall concurrency limit: four regex scans in
98
+ * parallel are free, four project-wide analysers are not.
99
+ */
100
+ weight?: 'heavy';
101
+ applies(ctx: CheckContext): boolean | Promise<boolean>;
102
+ run(ctx: CheckContext): Promise<CheckOutcome>;
103
+ }
104
+ export type ReporterKind = 'none' | 'stdout' | 'github' | 'gitlab' | 'bitbucket' | 'auto';
105
+ /** Custom reporter: receives the final report to emit however the consumer wants. */
106
+ export type ReporterFn = (report: CheckReport) => void | Promise<void>;
107
+ export type { ReporterConfig };
108
+ export interface RunOptions {
109
+ cwd?: string;
110
+ /** Override language detection (e.g. PRValidator passes its already-detected type). */
111
+ languages?: Language[];
112
+ /** Whitelist of check names — when set, only these run. */
113
+ only?: string[];
114
+ /** Blacklist of check names — always excluded. */
115
+ skip?: string[];
116
+ /**
117
+ * Extra checks to run. Combined with the built-in registry per `extendRegistry`.
118
+ * Lets consumers (e.g. PRValidator) plug their own `Check`s into the same pipeline.
119
+ */
120
+ checks?: Check[];
121
+ /**
122
+ * How `checks` combines with the built-in registry:
123
+ * - `true` (default when `checks` is set): append; a custom check overrides a
124
+ * built-in one with the same name.
125
+ * - `false`: run ONLY the provided `checks`, ignoring the built-in registry.
126
+ */
127
+ extendRegistry?: boolean;
128
+ /**
129
+ * Where the report goes:
130
+ * - `'none'`: nothing (just return the report)
131
+ * - `'stdout'`: print the summary table
132
+ * - `'github'`: print + upsert a PR comment
133
+ * - a function: receives the `CheckReport` (e.g. forward to Slack).
134
+ */
135
+ reporter?: ReporterKind | ReporterFn;
136
+ /** Allow file-modifying checks to write. Default false. */
137
+ write?: boolean;
138
+ config?: PRCheckMateConfig;
139
+ baseSha?: string;
140
+ headSha?: string;
141
+ /**
142
+ * Pre-commit / local mode: check the staged changes (index vs HEAD) instead of
143
+ * a PR range. Implemented by diffing HEAD against the index tree
144
+ * (`git write-tree`), so every delta-aware check works unchanged.
145
+ */
146
+ staged?: boolean;
147
+ /**
148
+ * Review every tracked file instead of a diff (`--full` on the CLI, and the
149
+ * default when no CI environment is detected). Takes precedence over every other
150
+ * range source, including CI variables — see `planDiffRange`. The 16 checks that
151
+ * are about a diff by definition (PR Size, Diff Security, Merge Conflict, …) gate
152
+ * their own `applies` on `baseSha`, so they drop out of the report rather than
153
+ * misreporting.
154
+ */
155
+ full?: boolean;
156
+ }
157
+ export interface CheckReport {
158
+ results: CheckResult[];
159
+ summary: {
160
+ passed: number;
161
+ warned: number;
162
+ failed: number;
163
+ skipped: number;
164
+ };
165
+ /** True when no check failed (warnings/skips do not affect it). */
166
+ ok: boolean;
167
+ }
168
+ /** Outcome constructors — keep check bodies terse. */
169
+ export declare const pass: (details?: string) => CheckOutcome;
170
+ export declare const warn: (details: string) => CheckOutcome;
171
+ export declare const fail: (details: string) => CheckOutcome;
172
+ export declare const skip: (details: string) => CheckOutcome;
173
+ /**
174
+ * Whether this repository is an npm project — the gate for every check that reads
175
+ * the npm dependency tree (NPM Audit, Dependencies, License Check, Outdated Deps).
176
+ *
177
+ * A `package.json` on its own is not the answer, and this is the one predicate
178
+ * where that matters most: installing pr-checkmate as a devDependency *creates*
179
+ * that file. Gate on it alone and a Python service gets four rows auditing the
180
+ * dependency tree of the tool auditing it — `npm audit` over our own transitive
181
+ * packages, licences of our own `node_modules`, "outdated" versions of tooling
182
+ * the team never chose. All four are unactionable by construction: nothing in the
183
+ * repository's own code can change any of them.
184
+ *
185
+ * So both halves must hold — a manifest to read, and JavaScript or TypeScript
186
+ * actually written here. A polyglot repository (a Django backend with a JS
187
+ * frontend) satisfies both and keeps every check; a Python repository whose only
188
+ * `package.json` is the one that installed us satisfies neither.
189
+ */
190
+ export declare function isNpmProject(ctx: CheckContext): boolean;
191
+ /**
192
+ * Identity helper for authoring a `Check` with full type inference and checking.
193
+ * Purely ergonomic — `defineCheck({ ... })` is equivalent to `{ ... } satisfies Check`.
194
+ */
195
+ export declare const defineCheck: (check: Check) => Check;
@@ -0,0 +1,38 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ export const PHASES = ['blocking', 'informational', 'format'];
4
+ /** Outcome constructors — keep check bodies terse. */
5
+ export const pass = (details) => ({
6
+ status: 'pass',
7
+ ...(details ? { details } : {}),
8
+ });
9
+ export const warn = (details) => ({ status: 'warn', details });
10
+ export const fail = (details) => ({ status: 'fail', details });
11
+ export const skip = (details) => ({ status: 'skip', details });
12
+ /**
13
+ * Whether this repository is an npm project — the gate for every check that reads
14
+ * the npm dependency tree (NPM Audit, Dependencies, License Check, Outdated Deps).
15
+ *
16
+ * A `package.json` on its own is not the answer, and this is the one predicate
17
+ * where that matters most: installing pr-checkmate as a devDependency *creates*
18
+ * that file. Gate on it alone and a Python service gets four rows auditing the
19
+ * dependency tree of the tool auditing it — `npm audit` over our own transitive
20
+ * packages, licences of our own `node_modules`, "outdated" versions of tooling
21
+ * the team never chose. All four are unactionable by construction: nothing in the
22
+ * repository's own code can change any of them.
23
+ *
24
+ * So both halves must hold — a manifest to read, and JavaScript or TypeScript
25
+ * actually written here. A polyglot repository (a Django backend with a JS
26
+ * frontend) satisfies both and keeps every check; a Python repository whose only
27
+ * `package.json` is the one that installed us satisfies neither.
28
+ */
29
+ export function isNpmProject(ctx) {
30
+ if (!ctx.languages.includes('javascript') && !ctx.languages.includes('typescript'))
31
+ return false;
32
+ return fs.existsSync(path.join(ctx.cwd, 'package.json'));
33
+ }
34
+ /**
35
+ * Identity helper for authoring a `Check` with full type inference and checking.
36
+ * Purely ergonomic — `defineCheck({ ... })` is equivalent to `{ ... } satisfies Check`.
37
+ */
38
+ export const defineCheck = (check) => check;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * PR CheckMate — automated PR quality checks.
3
+ *
4
+ * @module pr-checkmate
5
+ */
6
+ export { runChecks, buildContext, REGISTRY } from './core/index.js';
7
+ export { pass, warn, fail, skip, defineCheck } from './core/index.js';
8
+ export type { Check, CheckContext, CheckOutcome, CheckReport, CheckResult, CheckStatus, Language, Phase, ReporterFn, ReporterKind, RunOptions, } from './core/index.js';
9
+ export { getSourcePath, getSourcePaths, getIgnoredDirs, getPackageConfigPath, hasLocalConfig, } from './config/index.js';
10
+ export type { PRCheckMateConfig } from './interfaces/index.js';
11
+ export { Logger } from './utils/logger.js';
12
+ export type { LogLevel } from './utils/logger.js';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * PR CheckMate — automated PR quality checks.
3
+ *
4
+ * @module pr-checkmate
5
+ */
6
+ // Primary programmatic API: run checks and receive a structured report.
7
+ // Never throws for violations, never calls process.exit — the caller decides.
8
+ export { runChecks, buildContext, REGISTRY } from './core/index.js';
9
+ // Authoring helpers for consumers writing their own checks (plugins).
10
+ export { pass, warn, fail, skip, defineCheck } from './core/index.js';
11
+ // Config helpers for consumers embedding pr-checkmate.
12
+ export { getSourcePath, getSourcePaths, getIgnoredDirs, getPackageConfigPath, hasLocalConfig, } from './config/index.js';
13
+ // Standalone logging utility. Consumers instantiate their own Logger so their
14
+ // log level and buffer stay independent from pr-checkmate's internal logger.
15
+ export { Logger } from './utils/logger.js';
@@ -0,0 +1,38 @@
1
+ /** How strictly the generated workflow treats a failed run. */
2
+ type GateMode = 'strict' | 'advisory';
3
+ /**
4
+ * Write the bundled GitHub Actions workflow into the consumer repo.
5
+ *
6
+ * Never overwrites an existing file. `init` is not a one-time command — the
7
+ * update notice asks people to re-run it after every upgrade — so clobbering
8
+ * would quietly discard whatever they had tuned, including the gate setting they
9
+ * were just asked about.
10
+ */
11
+ export declare function setupWorkflow(root: string, mode: GateMode): void;
12
+ /**
13
+ * Every check that fails the run out of the box, written into the generated
14
+ * config at its real default.
15
+ *
16
+ * Not a copy of a default for its own sake — this one is the gate's teeth, and
17
+ * the client is entitled to see which checks can stop their merge without
18
+ * reading our source or discovering it from a red pipeline. Written as `"error"`
19
+ * so the edit is in place: change the value, or delete the line to inherit
20
+ * whatever we ship next.
21
+ *
22
+ * Two things are deliberately absent. `Custom Rules` and `Banned Imports` can
23
+ * block too, but only for rules the client writes themselves, so listing them
24
+ * would suggest a gate that is inert until they act. And `Dockerfile Security`
25
+ * looks like it belongs here and does not: every one of its patterns is rated
26
+ * `warn`, so it never fails on its own.
27
+ *
28
+ * Keep in step with the checks' own defaults — `blocking-checks.test.ts` pins
29
+ * every name here to the registry, which catches a rename but not a change of
30
+ * heart about what should block.
31
+ */
32
+ export declare const BLOCKING_BY_DEFAULT: readonly ["Security Scan", "Sensitive Files", "Diff Security", "Workflow Security", "Merge Conflict", "NPM Audit", "License Check", "Dependencies", "TypeScript", "ESLint", "YAML Lint"];
33
+ export declare function buildInitialConfig(sourcePath: string, languages: string[]): Record<string, unknown>;
34
+ /**
35
+ * Initialize (or refresh) pr-checkmate configuration in the current project.
36
+ */
37
+ export declare function init(): Promise<void>;
38
+ export {};