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
@@ -10,11 +10,11 @@ exports.resolveTargets = resolveTargets;
10
10
  exports.listTrackedFiles = listTrackedFiles;
11
11
  const node_fs_1 = __importDefault(require("node:fs"));
12
12
  const node_path_1 = __importDefault(require("node:path"));
13
- const config_1 = require("../config");
14
- const loader_1 = require("../config/loader");
15
- const utils_1 = require("../utils");
16
- const execa_1 = require("../utils/execa");
17
- const types_1 = require("./types");
13
+ const index_js_1 = require("../config/index.js");
14
+ const loader_js_1 = require("../config/loader.js");
15
+ const execa_js_1 = require("../utils/execa.js");
16
+ const index_js_2 = require("../utils/index.js");
17
+ const types_js_1 = require("./types.js");
18
18
  /**
19
19
  * Drop files that live under any excluded directory (client `ignoreDirs` or the
20
20
  * curated default), matched on any path segment so nesting depth doesn't matter.
@@ -44,21 +44,21 @@ const types_1 = require("./types");
44
44
  function excludeClientPaths(files, cwd) {
45
45
  let patterns = [];
46
46
  try {
47
- patterns = (0, loader_1.loadProjectConfig)(cwd).excludePaths ?? [];
47
+ patterns = (0, loader_js_1.loadProjectConfig)(cwd).excludePaths ?? [];
48
48
  }
49
49
  catch {
50
50
  // A config that cannot be read is the loader's problem to report, not a
51
51
  // reason to scan nothing.
52
52
  }
53
- return patterns.length > 0 ? files.filter(f => !(0, utils_1.matchesAnyGlob)(f, patterns)) : files;
53
+ return patterns.length > 0 ? files.filter(f => !(0, index_js_2.matchesAnyGlob)(f, patterns)) : files;
54
54
  }
55
55
  function excludeIgnoredDirs(files, cwd, keepDirs = []) {
56
- const ignored = new Set((0, config_1.getIgnoredDirs)(cwd));
56
+ const ignored = new Set((0, index_js_1.getIgnoredDirs)(cwd));
57
57
  for (const dir of keepDirs)
58
58
  ignored.delete(dir);
59
59
  if (ignored.size === 0)
60
60
  return files;
61
- return files.filter(f => !(0, utils_1.isUnderIgnoredDir)(f, ignored));
61
+ return files.filter(f => !(0, index_js_2.isUnderIgnoredDir)(f, ignored));
62
62
  }
63
63
  /**
64
64
  * Lists the files a language check should operate on, matched by pathspec `globs`
@@ -99,9 +99,9 @@ async function resolveTargetFiles(ctx, globs, opts = {}) {
99
99
  //
100
100
  // A pathspec that matches nothing still exits 0, so the ordinary empty
101
101
  // result cannot be swallowed here.
102
- const result = await (0, execa_1.execa)('git', args, { cwd: ctx.cwd, reject: false });
102
+ const result = await (0, execa_js_1.execa)('git', args, { cwd: ctx.cwd, reject: false });
103
103
  if (result.exitCode !== 0) {
104
- utils_1.logger.warn(`[targets]: ⚠️ git could not list files (exit ${result.exitCode})`);
104
+ index_js_2.logger.warn(`[targets]: ⚠️ git could not list files (exit ${result.exitCode})`);
105
105
  return null;
106
106
  }
107
107
  stdout = result.stdout;
@@ -123,13 +123,13 @@ async function resolveTargetFiles(ctx, globs, opts = {}) {
123
123
  // hide a real difference, so it moves to `debug` instead of disappearing.
124
124
  const line = `[targets]: ${ctx.baseSha ? '📂 Delta' : 'Full scan'}: ${files.length} file(s) for ${globs.join(', ')}`;
125
125
  if (fromCache)
126
- utils_1.logger.debug(`${line} (cached)`);
126
+ index_js_2.logger.debug(`${line} (cached)`);
127
127
  else
128
- utils_1.logger.info(line);
128
+ index_js_2.logger.info(line);
129
129
  return files;
130
130
  }
131
131
  catch (err) {
132
- utils_1.logger.warn(`[targets]: ⚠️ Could not list files\n${err}`);
132
+ index_js_2.logger.warn(`[targets]: ⚠️ Could not list files\n${err}`);
133
133
  return null;
134
134
  }
135
135
  }
@@ -168,16 +168,16 @@ async function resolveTargets(ctx, globs, opts) {
168
168
  // Read once, and only when something will use it. A whole-tree walk is always
169
169
  // scoped — that is what `listTrackedFiles` promises its callers — while a delta
170
170
  // walk is scoped only on request.
171
- const sourcePaths = opts.wholeTree || opts.scoped ? (0, config_1.getSourcePaths)(ctx.cwd) : [];
171
+ const sourcePaths = opts.wholeTree || opts.scoped ? (0, index_js_1.getSourcePaths)(ctx.cwd) : [];
172
172
  const files = opts.wholeTree
173
173
  ? await listTrackedFiles(ctx, globs, sourcePaths, listOpts)
174
174
  : await resolveTargetFiles(ctx, globs, listOpts);
175
175
  if (files === null)
176
- return (0, types_1.skip)('git unavailable');
176
+ return (0, types_js_1.skip)('git unavailable');
177
177
  const scoped = opts.wholeTree ? files : scopeToSourcePaths(files, sourcePaths);
178
178
  if (scoped.length > 0)
179
179
  return scoped;
180
- return 'pass' in opts.onEmpty ? (0, types_1.pass)(opts.onEmpty.pass) : (0, types_1.skip)(opts.onEmpty.skip);
180
+ return 'pass' in opts.onEmpty ? (0, types_js_1.pass)(opts.onEmpty.pass) : (0, types_js_1.skip)(opts.onEmpty.skip);
181
181
  }
182
182
  /**
183
183
  * List ALL tracked files matching `globs` (never delta), scoped to
@@ -205,9 +205,9 @@ async function resolveTargets(ctx, globs, opts) {
205
205
  */
206
206
  async function listTrackedFiles(ctx, globs, sourcePaths, opts = {}) {
207
207
  try {
208
- const result = await (0, execa_1.execa)('git', ['ls-files', ...globs], { cwd: ctx.cwd, reject: false });
208
+ const result = await (0, execa_js_1.execa)('git', ['ls-files', ...globs], { cwd: ctx.cwd, reject: false });
209
209
  if (result.exitCode !== 0) {
210
- utils_1.logger.warn(`[targets]: ⚠️ git could not list tracked files (exit ${result.exitCode})`);
210
+ index_js_2.logger.warn(`[targets]: ⚠️ git could not list tracked files (exit ${result.exitCode})`);
211
211
  return null;
212
212
  }
213
213
  const files = excludeClientPaths(excludeIgnoredDirs(result.stdout
@@ -217,7 +217,7 @@ async function listTrackedFiles(ctx, globs, sourcePaths, opts = {}) {
217
217
  return scopeToSourcePaths(files, sourcePaths);
218
218
  }
219
219
  catch (err) {
220
- utils_1.logger.warn(`[targets]: ⚠️ Could not list tracked files\n${err}`);
220
+ index_js_2.logger.warn(`[targets]: ⚠️ Could not list tracked files\n${err}`);
221
221
  return null;
222
222
  }
223
223
  }
@@ -1,6 +1,6 @@
1
- import type { PRCheckMateConfig, ReporterConfig } from '../interfaces';
2
- import type { Language, LanguageUsage } from '../utils/detect-language';
3
- import type { CheckResult, CheckStatus } from '../utils/result-collector';
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
4
  export type { CheckResult, CheckStatus, Language, LanguageUsage };
5
5
  /**
6
6
  * Execution phases, run strictly in order. Within a phase checks run in parallel.
@@ -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';
@@ -8,25 +8,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Logger = exports.hasLocalConfig = exports.getPackageConfigPath = exports.getIgnoredDirs = exports.getSourcePaths = exports.getSourcePath = exports.defineCheck = exports.skip = exports.fail = exports.warn = exports.pass = exports.REGISTRY = exports.buildContext = exports.runChecks = void 0;
9
9
  // Primary programmatic API: run checks and receive a structured report.
10
10
  // Never throws for violations, never calls process.exit — the caller decides.
11
- var core_1 = require("./core");
12
- Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return core_1.runChecks; } });
13
- Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return core_1.buildContext; } });
14
- Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return core_1.REGISTRY; } });
11
+ var index_js_1 = require("./core/index.js");
12
+ Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return index_js_1.runChecks; } });
13
+ Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return index_js_1.buildContext; } });
14
+ Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return index_js_1.REGISTRY; } });
15
15
  // Authoring helpers for consumers writing their own checks (plugins).
16
- var core_2 = require("./core");
17
- Object.defineProperty(exports, "pass", { enumerable: true, get: function () { return core_2.pass; } });
18
- Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return core_2.warn; } });
19
- Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return core_2.fail; } });
20
- Object.defineProperty(exports, "skip", { enumerable: true, get: function () { return core_2.skip; } });
21
- Object.defineProperty(exports, "defineCheck", { enumerable: true, get: function () { return core_2.defineCheck; } });
16
+ var index_js_2 = require("./core/index.js");
17
+ Object.defineProperty(exports, "pass", { enumerable: true, get: function () { return index_js_2.pass; } });
18
+ Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return index_js_2.warn; } });
19
+ Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return index_js_2.fail; } });
20
+ Object.defineProperty(exports, "skip", { enumerable: true, get: function () { return index_js_2.skip; } });
21
+ Object.defineProperty(exports, "defineCheck", { enumerable: true, get: function () { return index_js_2.defineCheck; } });
22
22
  // Config helpers for consumers embedding pr-checkmate.
23
- var config_1 = require("./config");
24
- Object.defineProperty(exports, "getSourcePath", { enumerable: true, get: function () { return config_1.getSourcePath; } });
25
- Object.defineProperty(exports, "getSourcePaths", { enumerable: true, get: function () { return config_1.getSourcePaths; } });
26
- Object.defineProperty(exports, "getIgnoredDirs", { enumerable: true, get: function () { return config_1.getIgnoredDirs; } });
27
- Object.defineProperty(exports, "getPackageConfigPath", { enumerable: true, get: function () { return config_1.getPackageConfigPath; } });
28
- Object.defineProperty(exports, "hasLocalConfig", { enumerable: true, get: function () { return config_1.hasLocalConfig; } });
23
+ var index_js_3 = require("./config/index.js");
24
+ Object.defineProperty(exports, "getSourcePath", { enumerable: true, get: function () { return index_js_3.getSourcePath; } });
25
+ Object.defineProperty(exports, "getSourcePaths", { enumerable: true, get: function () { return index_js_3.getSourcePaths; } });
26
+ Object.defineProperty(exports, "getIgnoredDirs", { enumerable: true, get: function () { return index_js_3.getIgnoredDirs; } });
27
+ Object.defineProperty(exports, "getPackageConfigPath", { enumerable: true, get: function () { return index_js_3.getPackageConfigPath; } });
28
+ Object.defineProperty(exports, "hasLocalConfig", { enumerable: true, get: function () { return index_js_3.hasLocalConfig; } });
29
29
  // Standalone logging utility. Consumers instantiate their own Logger so their
30
30
  // log level and buffer stay independent from pr-checkmate's internal logger.
31
- var logger_1 = require("./utils/logger");
32
- Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
31
+ var logger_js_1 = require("./utils/logger.js");
32
+ Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_js_1.Logger; } });
@@ -10,9 +10,9 @@ exports.init = init;
10
10
  const fs_1 = __importDefault(require("fs"));
11
11
  const path_1 = __importDefault(require("path"));
12
12
  const inquirer_1 = __importDefault(require("inquirer"));
13
- const config_1 = require("./config");
14
- const findings_1 = require("./core/checks/findings");
15
- const utils_1 = require("./utils");
13
+ const index_js_1 = require("./config/index.js");
14
+ const findings_js_1 = require("./core/checks/findings.js");
15
+ const index_js_2 = require("./utils/index.js");
16
16
  const CONFIG_FILE = path_1.default.resolve(process.cwd(), 'pr-checkmate.json');
17
17
  /**
18
18
  * Points editors at the bundled JSON schema. With the generated config reduced
@@ -92,40 +92,52 @@ const ADVISORY_FLAG = ' continue-on-error: true';
92
92
  * were just asked about.
93
93
  */
94
94
  function setupWorkflow(root, mode) {
95
- // Which template a repository gets is decided by whether it actually installs
96
- // us. Both are correct for their own case and wrong for the other:
95
+ // We can't know for sure whether a repo will end up depending on the npm
96
+ // package by the time this workflow first runs (that's a decision the client
97
+ // makes after `init`, e.g. by running `npm install pr-checkmate`), so instead
98
+ // of guessing we scaffold both variants and let them keep the one that
99
+ // matches, deleting the other:
97
100
  //
98
- // - a dependency means `npx pr-checkmate` runs the copy the lockfile pins,
99
- // which is fast and reproducible;
100
- // - no dependency means `npx` resolves to the newest release and downloads it
101
- // on every job — 547 MB, about five minutes, and a major version can land
102
- // without anyone changing a line.
103
- //
104
- // Asking the client to notice that difference in a comment is asking them to
105
- // read a file they scaffolded precisely so they would not have to.
106
- const source = installsPackage(root)
107
- ? 'pr-checkmate-workflow.yml'
108
- : 'pr-checkmate-workflow-docker.yml';
109
- const workflowSource = path_1.default.join(__dirname, 'config', source);
101
+ // - the npm variant: `npx pr-checkmate` runs the copy the lockfile pins,
102
+ // which is fast and reproducible, but assumes the install happens;
103
+ // - the docker variant: works with no install, but `npx` (nothing to run
104
+ // locally) resolves to the newest release and downloads it on every job —
105
+ // 547 MB, about five minutes, and a major version can land without anyone
106
+ // changing a line.
107
+ const candidates = [
108
+ { source: 'pr-checkmate-workflow.yml', dest: 'pr-checkmate.yml', label: 'npm package' },
109
+ {
110
+ source: 'pr-checkmate-workflow-docker.yml',
111
+ dest: 'pr-checkmate-docker.yml',
112
+ label: 'Docker image',
113
+ },
114
+ ];
110
115
  const workflowDir = path_1.default.join(root, '.github', 'workflows');
111
- const workflowDest = path_1.default.join(workflowDir, 'pr-checkmate.yml');
112
- if (!fs_1.default.existsSync(workflowSource)) {
113
- utils_1.logger.warn('[init]: ⚠️ Workflow template not found, skipping workflow setup');
114
- return;
115
- }
116
- if (fs_1.default.existsSync(workflowDest)) {
117
- utils_1.logger.info('[init]: ⏭️ .github/workflows/pr-checkmate.yml already exists — left untouched');
118
- return;
119
- }
120
- if (!fs_1.default.existsSync(workflowDir)) {
121
- fs_1.default.mkdirSync(workflowDir, { recursive: true });
116
+ const recommended = installsPackage(root) ? candidates[0] : candidates[1];
117
+ for (const { source, dest, label } of candidates) {
118
+ const workflowSource = path_1.default.join(__dirname, 'config', source);
119
+ const workflowDest = path_1.default.join(workflowDir, dest);
120
+ if (!fs_1.default.existsSync(workflowSource)) {
121
+ index_js_2.logger.warn(`[init]: ⚠️ Workflow template ${source} not found, skipping`);
122
+ continue;
123
+ }
124
+ if (fs_1.default.existsSync(workflowDest)) {
125
+ index_js_2.logger.info(`[init]: ⏭️ .github/workflows/${dest} already exists — left untouched`);
126
+ continue;
127
+ }
128
+ if (!fs_1.default.existsSync(workflowDir)) {
129
+ fs_1.default.mkdirSync(workflowDir, { recursive: true });
130
+ }
131
+ const template = fs_1.default.readFileSync(workflowSource, 'utf-8').replace(/__IMAGE_TAG__/g, imageTag());
132
+ const workflow = mode === 'advisory'
133
+ ? template.replace(RUN_STEP_ANCHOR, `${ADVISORY_NOTICE}\n${RUN_STEP_ANCHOR}\n${ADVISORY_FLAG}`)
134
+ : template;
135
+ fs_1.default.writeFileSync(workflowDest, workflow);
136
+ const recommendedNote = dest === recommended.dest ? ', recommended for this repo' : '';
137
+ index_js_2.logger.info(`[init]: ✅ Created .github/workflows/${dest} (${label}${recommendedNote})`);
122
138
  }
123
- const template = fs_1.default.readFileSync(workflowSource, 'utf-8').replace(/__IMAGE_TAG__/g, imageTag());
124
- const workflow = mode === 'advisory'
125
- ? template.replace(RUN_STEP_ANCHOR, `${ADVISORY_NOTICE}\n${RUN_STEP_ANCHOR}\n${ADVISORY_FLAG}`)
126
- : template;
127
- fs_1.default.writeFileSync(workflowDest, workflow);
128
- utils_1.logger.info(`[init]: ✅ Created .github/workflows/pr-checkmate.yml (${mode === 'strict' ? 'blocking' : 'advisory'})`);
139
+ index_js_2.logger.info('[init]: ℹ️ Both workflow variants were created — keep the one that fits and delete the other, ' +
140
+ 'otherwise checks run twice on every PR.');
129
141
  }
130
142
  /**
131
143
  * Whether this repository installs pr-checkmate rather than reaching for it on
@@ -152,7 +164,7 @@ function installsPackage(root) {
152
164
  */
153
165
  function imageTag() {
154
166
  try {
155
- const manifest = path_1.default.resolve(__dirname, '..', 'package.json');
167
+ const manifest = path_1.default.join((0, index_js_2.findOwnPackageRoot)() ?? path_1.default.resolve(__dirname, '..'), 'package.json');
156
168
  const version = JSON.parse(fs_1.default.readFileSync(manifest, 'utf-8')).version;
157
169
  return version.split('.')[0] || 'latest';
158
170
  }
@@ -185,7 +197,7 @@ function setupTsConfig(root, sourcePath) {
185
197
  exclude: ['node_modules', 'dist'],
186
198
  };
187
199
  fs_1.default.writeFileSync(tsconfigPath, JSON.stringify(newTsConfig, null, 2));
188
- utils_1.logger.info('[init]: ✅ Created tsconfig.json using your sourcePath');
200
+ index_js_2.logger.info('[init]: ✅ Created tsconfig.json using your sourcePath');
189
201
  }
190
202
  /**
191
203
  * The file `init` writes for a new project — the client's decisions, nothing else.
@@ -255,14 +267,14 @@ const HOW_TO = [
255
267
  'Make everything advisory while adopting: "severityDefaults": { "failOn": "warn" }',
256
268
  'Skip a file or folder: "excludePaths": ["src/generated/**", "vendor/legacy.ts"]',
257
269
  'Check names are the ones printed in the report.',
258
- `Every option, annotated, with its default: ${config_1.FULL_CONFIG_URL}`,
259
- `Docs: ${config_1.DOCS_URL}`,
270
+ `Every option, annotated, with its default: ${index_js_1.FULL_CONFIG_URL}`,
271
+ `Docs: ${index_js_1.DOCS_URL}`,
260
272
  ].join(' ');
261
273
  function buildInitialConfig(sourcePath, languages) {
262
274
  return {
263
275
  $schema: SCHEMA_PATH,
264
276
  '// how-to': HOW_TO,
265
- commands: config_1.DEFAULT_COMMANDS,
277
+ commands: index_js_1.DEFAULT_COMMANDS,
266
278
  '// reporting': REPORTING_HINT,
267
279
  sourcePath,
268
280
  // Which checks can stop a merge — named, but NOT written as values.
@@ -298,11 +310,11 @@ function buildInitialConfig(sourcePath, languages) {
298
310
  excludePaths: [],
299
311
  // REPLACES the default. Copied out so the list is editable in place —
300
312
  // note that ESLint does not read it; ESLint honours `eslint.ignorePatterns`.
301
- ignoreDirs: [...config_1.IGNORED_DIRS],
313
+ ignoreDirs: [...index_js_1.IGNORED_DIRS],
302
314
  // Spelling: `words` and `ignorePaths` are both APPENDED to the bundled lists,
303
315
  // so both stay empty. What the bundled list already skips is spelled out in
304
316
  // the sibling comment rather than duplicated here.
305
- '// cspell': `Already skipped by default: ${config_1.GENERATED_DOC_FILES.join(', ')}, test and mock paths, lockfiles, minified bundles, and every directory in "ignoreDirs". Anything listed below is ADDED to that.`,
317
+ '// cspell': `Already skipped by default: ${index_js_1.GENERATED_DOC_FILES.join(', ')}, test and mock paths, lockfiles, minified bundles, and every directory in "ignoreDirs". Anything listed below is ADDED to that.`,
306
318
  cspell: { words: [], ignorePaths: [] },
307
319
  // `max-len` is written out at its default rather than left implicit: it is
308
320
  // the rule people hit first and tune first, and a line limit is a house
@@ -318,8 +330,8 @@ function buildInitialConfig(sourcePath, languages) {
318
330
  // repeat their setup, the runner is the only consumer of what they export,
319
331
  // and a security test's whole job may be to call the dangerous function.
320
332
  // Delete an entry to have that check start reporting on tests again.
321
- duplicate: { ignore: [...config_1.DUPLICATE_IGNORE_DEFAULTS] },
322
- deadCode: { ignoreFiles: [...config_1.DEAD_CODE_IGNORE_DEFAULTS] },
333
+ duplicate: { ignore: [...index_js_1.DUPLICATE_IGNORE_DEFAULTS] },
334
+ deadCode: { ignoreFiles: [...index_js_1.DEAD_CODE_IGNORE_DEFAULTS] },
323
335
  // `dataflowWindow` is written out at its default for the same reason as
324
336
  // `max-len`: it is a number people will want to change, and a number nobody
325
337
  // can see is a number nobody can change. It is also the one finding in this
@@ -337,10 +349,10 @@ function buildInitialConfig(sourcePath, languages) {
337
349
  'gate and does not want the heuristic blocking should set dataflowWindow to 0.',
338
350
  ].join(' '),
339
351
  diffSecurity: {
340
- dataflowWindow: findings_1.DEFAULT_DATAFLOW_WINDOW,
341
- ignorePaths: [...config_1.DIFF_SECURITY_IGNORE_DEFAULTS],
352
+ dataflowWindow: findings_js_1.DEFAULT_DATAFLOW_WINDOW,
353
+ ignorePaths: [...index_js_1.DIFF_SECURITY_IGNORE_DEFAULTS],
342
354
  },
343
- documentation: config_1.documentation,
355
+ documentation: index_js_1.documentation,
344
356
  languages,
345
357
  };
346
358
  }
@@ -348,12 +360,12 @@ function buildInitialConfig(sourcePath, languages) {
348
360
  async function createConfig(root) {
349
361
  const sourcePath = await promptSourcePath();
350
362
  const gateMode = await promptGateMode();
351
- const languages = await (0, utils_1.detectLanguages)(root);
352
- utils_1.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
363
+ const languages = await (0, index_js_2.detectLanguages)(root);
364
+ index_js_2.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
353
365
  const config = buildInitialConfig(sourcePath, languages);
354
366
  fs_1.default.writeFileSync(CONFIG_FILE, `${JSON.stringify(config, null, 2)}\n`);
355
- utils_1.logger.info(`[init]: ✅ Created pr-checkmate.json with sourcePath: ${sourcePath}`);
356
- utils_1.logger.info(`[init]: 💡 You can now customize ESLint rules, Prettier settings,
367
+ index_js_2.logger.info(`[init]: ✅ Created pr-checkmate.json with sourcePath: ${sourcePath}`);
368
+ index_js_2.logger.info(`[init]: 💡 You can now customize ESLint rules, Prettier settings,
357
369
  and cspell words in pr-checkmate.json`);
358
370
  setupWorkflow(root, gateMode);
359
371
  setupTsConfig(root, sourcePath);
@@ -366,7 +378,7 @@ async function createConfig(root) {
366
378
  * now apply when the config is loaded, so there is nothing to top up.
367
379
  */
368
380
  async function updateConfig(root) {
369
- utils_1.logger.info('[init]: pr-checkmate.json already exists — updating it.');
381
+ index_js_2.logger.info('[init]: pr-checkmate.json already exists — updating it.');
370
382
  try {
371
383
  const raw = fs_1.default.readFileSync(CONFIG_FILE, 'utf-8');
372
384
  const json = JSON.parse(raw);
@@ -374,8 +386,8 @@ async function updateConfig(root) {
374
386
  // tuned `detect` (or `ignoreDirs`) precisely because detection was wrong
375
387
  // would otherwise get the wrong answer written back over the right one on
376
388
  // the next `init`.
377
- const languages = await (0, utils_1.detectLanguages)(root, json.ignoreDirs, json.detect);
378
- utils_1.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
389
+ const languages = await (0, index_js_2.detectLanguages)(root, json.ignoreDirs, json.detect);
390
+ index_js_2.logger.info(`[init]: 🔍 Detected languages: ${languages.length ? languages.join(', ') : 'none'}`);
379
391
  // The client's file is left exactly as they wrote it. Defaults are no longer
380
392
  // copied into it, because they never needed to be: they are merged in when
381
393
  // the config is loaded, so a new default reaches every repository on upgrade
@@ -394,11 +406,11 @@ async function updateConfig(root) {
394
406
  languages,
395
407
  };
396
408
  fs_1.default.writeFileSync(CONFIG_FILE, `${JSON.stringify(updated, null, 2)}\n`);
397
- utils_1.logger.info('[init]: 🔧 Refreshed the detected languages in pr-checkmate.json.');
398
- utils_1.logger.info(`[init]: 💡 Everything else is left as you wrote it — defaults apply on their own. Options: ${config_1.DOCS_URL}`);
409
+ index_js_2.logger.info('[init]: 🔧 Refreshed the detected languages in pr-checkmate.json.');
410
+ index_js_2.logger.info(`[init]: 💡 Everything else is left as you wrote it — defaults apply on their own. Options: ${index_js_1.DOCS_URL}`);
399
411
  }
400
412
  catch (e) {
401
- utils_1.logger.error(`[init]: ❌ Failed to update pr-checkmate.json: ${e}`);
413
+ index_js_2.logger.error(`[init]: ❌ Failed to update pr-checkmate.json: ${e}`);
402
414
  }
403
415
  }
404
416
  /**
@@ -1,4 +1,4 @@
1
- import type { Language } from '../utils/detect-language';
1
+ import type { Language } from '../utils/detect-language.js';
2
2
  export interface ConfigFile {
3
3
  source: string;
4
4
  dest: string;
@@ -428,5 +428,5 @@ export interface PRCheckMateConfig {
428
428
  allowLicenses?: string[];
429
429
  };
430
430
  }
431
- export type { CheckStatus, CheckResult } from '../utils/result-collector';
432
- export type { Language } from '../utils/detect-language';
431
+ export type { CheckStatus, CheckResult } from '../utils/result-collector.js';
432
+ export type { Language } from '../utils/detect-language.js';
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const node_fs_1 = __importDefault(require("node:fs"));
7
7
  const node_path_1 = __importDefault(require("node:path"));
8
- const utils_1 = require("../utils");
8
+ const index_js_1 = require("../utils/index.js");
9
9
  const configFiles = [
10
10
  // Source is named so ESLint's auto-discovery does NOT treat it as a nested
11
11
  // config for files under src/config/ — it ships to the package root as the
@@ -16,10 +16,25 @@ const configFiles = [
16
16
  { source: 'src/config/.prettierrc', dest: '.prettierrc' },
17
17
  { source: 'src/config/cspell.json', dest: 'cspell.json' },
18
18
  { source: 'tsconfig.json', dest: 'tsconfig.json' },
19
- { source: 'src/config/pr-checkmate-workflow.yml', dest: 'dist/config/pr-checkmate-workflow.yml' },
19
+ // `init.ts` reads these as a sibling of its own compiled location
20
+ // (`__dirname/config/...`), which means they must exist under both build
21
+ // outputs — dist/cjs and dist/esm are no longer siblings of a single
22
+ // shared dist/config the way the old flat dist/ layout was.
23
+ {
24
+ source: 'src/config/pr-checkmate-workflow.yml',
25
+ dest: 'dist/cjs/config/pr-checkmate-workflow.yml',
26
+ },
27
+ {
28
+ source: 'src/config/pr-checkmate-workflow.yml',
29
+ dest: 'dist/esm/config/pr-checkmate-workflow.yml',
30
+ },
31
+ {
32
+ source: 'src/config/pr-checkmate-workflow-docker.yml',
33
+ dest: 'dist/cjs/config/pr-checkmate-workflow-docker.yml',
34
+ },
20
35
  {
21
36
  source: 'src/config/pr-checkmate-workflow-docker.yml',
22
- dest: 'dist/config/pr-checkmate-workflow-docker.yml',
37
+ dest: 'dist/esm/config/pr-checkmate-workflow-docker.yml',
23
38
  },
24
39
  { source: 'src/config/pr-checkmate.schema.json', dest: 'pr-checkmate.schema.json' },
25
40
  ];
@@ -28,12 +43,12 @@ const configFiles = [
28
43
  */
29
44
  function copyConfigs() {
30
45
  const root = node_path_1.default.resolve(__dirname, '../..');
31
- utils_1.logger.log('[copyConfigs]: Copying config files to package root...\n');
46
+ index_js_1.logger.log('[copyConfigs]: Copying config files to package root...\n');
32
47
  configFiles.forEach(({ source, dest }) => {
33
48
  const srcPath = node_path_1.default.join(root, source);
34
49
  const destPath = node_path_1.default.join(root, dest);
35
50
  if (!node_fs_1.default.existsSync(srcPath)) {
36
- utils_1.logger.warn(`[copyConfigs]: ⚠️ Source not found: ${source}`);
51
+ index_js_1.logger.warn(`[copyConfigs]: ⚠️ Source not found: ${source}`);
37
52
  return;
38
53
  }
39
54
  // Create destination directory if it doesn't exist
@@ -42,9 +57,9 @@ function copyConfigs() {
42
57
  node_fs_1.default.mkdirSync(destDir, { recursive: true });
43
58
  }
44
59
  node_fs_1.default.copyFileSync(srcPath, destPath);
45
- utils_1.logger.log(`[copyConfigs]: ✅ Copied ${dest}`);
60
+ index_js_1.logger.log(`[copyConfigs]: ✅ Copied ${dest}`);
46
61
  });
47
- utils_1.logger.info('\n[copyConfigs]: ✨ Configs successfully copied to root!\n');
62
+ index_js_1.logger.info('\n[copyConfigs]: ✨ Configs successfully copied to root!\n');
48
63
  }
49
64
  if (require.main === module) {
50
65
  copyConfigs();
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.buildManifest = buildManifest;
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- const profiles_1 = require("../core/install/profiles");
9
+ const profiles_js_1 = require("../core/install/profiles.js");
10
10
  /**
11
11
  * Find the entry npm would resolve `name` to from inside `fromPath`.
12
12
  *
@@ -107,7 +107,7 @@ function main() {
107
107
  const manifest = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(root, 'package.json'), 'utf-8'));
108
108
  const outDir = node_path_1.default.join(root, 'install-manifests');
109
109
  node_fs_1.default.rmSync(outDir, { recursive: true, force: true });
110
- for (const profile of profiles_1.PROFILES) {
110
+ for (const profile of profiles_js_1.PROFILES) {
111
111
  const { pkg, lockfile } = buildManifest(lock, profile.name, profile.packages, manifest.overrides);
112
112
  const dir = node_path_1.default.join(outDir, profile.name);
113
113
  node_fs_1.default.mkdirSync(dir, { recursive: true });
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const child_process_1 = require("child_process");
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const utils_1 = require("../utils");
9
+ const index_js_1 = require("../utils/index.js");
10
10
  function publishToGithub() {
11
11
  const root = process.cwd();
12
12
  const pkgPath = path_1.default.join(root, 'package.json');
@@ -29,10 +29,10 @@ function publishToGithub() {
29
29
  fs_1.default.renameSync(pkgPath, backupPath);
30
30
  fs_1.default.renameSync(tempPath, pkgPath);
31
31
  (0, child_process_1.execSync)('npm publish --registry=https://npm.pkg.github.com', { stdio: 'inherit' });
32
- utils_1.logger.log('[publishToGithub]: ✅ Published to GitHub Packages');
32
+ index_js_1.logger.log('[publishToGithub]: ✅ Published to GitHub Packages');
33
33
  }
34
34
  catch (err) {
35
- utils_1.logger.error(`[publishToGithub]: ${err}`);
35
+ index_js_1.logger.error(`[publishToGithub]: ${err}`);
36
36
  }
37
37
  finally {
38
38
  // The backup only exists if the first rename succeeded; restoring is
@@ -42,7 +42,7 @@ function publishToGithub() {
42
42
  fs_1.default.renameSync(backupPath, pkgPath);
43
43
  }
44
44
  catch (err) {
45
- utils_1.logger.error(`[publishToGithub]: could not restore package.json: ${err}`);
45
+ index_js_1.logger.error(`[publishToGithub]: could not restore package.json: ${err}`);
46
46
  }
47
47
  }
48
48
  }
@@ -7,10 +7,10 @@ exports.detectLanguageUsage = detectLanguageUsage;
7
7
  exports.detectLanguages = detectLanguages;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const constants_1 = require("../config/constants");
11
- const execa_1 = require("./execa");
12
- const glob_1 = require("./glob");
13
- const logger_1 = require("./logger");
10
+ const constants_js_1 = require("../config/constants.js");
11
+ const execa_js_1 = require("./execa.js");
12
+ const glob_js_1 = require("./glob.js");
13
+ const logger_js_1 = require("./logger.js");
14
14
  /**
15
15
  * Marker files that unambiguously indicate a language's presence, independent of
16
16
  * how many source files are tracked. Presence of any marker forces detection even
@@ -98,7 +98,7 @@ function hasMarker(root, lang) {
98
98
  return node_fs_1.default.existsSync(node_path_1.default.join(root, name));
99
99
  // Glob marker (e.g. `*.csproj`): match against root-directory entries.
100
100
  try {
101
- const re = (0, glob_1.globToRegExp)(name);
101
+ const re = (0, glob_js_1.globToRegExp)(name);
102
102
  return node_fs_1.default.readdirSync(root).some(entry => re.test(entry));
103
103
  }
104
104
  catch {
@@ -154,7 +154,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
154
154
  php: 0,
155
155
  };
156
156
  try {
157
- const { stdout } = await (0, execa_1.execa)('git', ['ls-files'], { cwd: root });
157
+ const { stdout } = await (0, execa_js_1.execa)('git', ['ls-files'], { cwd: root });
158
158
  const files = stdout.split('\n').map(f => f.trim());
159
159
  const ignored = new Set(ignoreDirs);
160
160
  const markers = markerFilenames();
@@ -167,10 +167,10 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
167
167
  // languages absent from the source. Detection has to describe the repo's own
168
168
  // code, since it decides which checks run at all — the same exclusion every
169
169
  // check's file list already applies via `excludeIgnoredDirs`.
170
- if ((0, glob_1.isUnderIgnoredDir)(file, ignored))
170
+ if ((0, glob_js_1.isUnderIgnoredDir)(file, ignored))
171
171
  continue;
172
172
  // Generated reports and vendored bootstrap scripts are not the repo's code.
173
- if ((0, glob_1.matchesAnyGlob)(file, excludePaths))
173
+ if ((0, glob_js_1.matchesAnyGlob)(file, excludePaths))
174
174
  continue;
175
175
  // A manifest that happens to be source-shaped (`Package.swift`) declares a
176
176
  // language; it is not a line of it.
@@ -182,7 +182,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
182
182
  }
183
183
  }
184
184
  catch {
185
- logger_1.logger.debug('[detectLanguages]: git ls-files unavailable, using marker files only');
185
+ logger_js_1.logger.debug('[detectLanguages]: git ls-files unavailable, using marker files only');
186
186
  }
187
187
  return counts;
188
188
  }
@@ -209,7 +209,7 @@ async function countTrackedFiles(root, ignoreDirs, excludePaths) {
209
209
  * @returns languages ordered by tracked file count (most-used first). `.h` headers
210
210
  * are intentionally excluded from the C++ count since they are ambiguous with C.
211
211
  */
212
- async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_1.IGNORED_DIRS, detect = {}) {
212
+ async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_js_1.IGNORED_DIRS, detect = {}) {
213
213
  const excludePaths = [...DEFAULT_DETECT_EXCLUDES, ...(detect.excludePaths ?? [])];
214
214
  const counts = await countTrackedFiles(root, ignoreDirs, excludePaths);
215
215
  // 1 by default: with the causes of the false positives fixed above, a single
@@ -228,7 +228,7 @@ async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_
228
228
  detected.sort((a, b) => b.files - a.files);
229
229
  const countStr = Object.keys(counts).map(l => `${l}=${counts[l]}`).join(', ');
230
230
  const names = detected.map(u => u.lang).join(', ');
231
- logger_1.logger.info(`[detectLanguages]: Detected ${names || 'none'} (counts: ${countStr})`);
231
+ logger_js_1.logger.info(`[detectLanguages]: Detected ${names || 'none'} (counts: ${countStr})`);
232
232
  return detected;
233
233
  }
234
234
  /**
@@ -236,6 +236,6 @@ async function detectLanguageUsage(root = process.cwd(), ignoreDirs = constants_
236
236
  * should run". See {@link detectLanguageUsage} when the file counts matter, as
237
237
  * they do for deciding what to download.
238
238
  */
239
- async function detectLanguages(root = process.cwd(), ignoreDirs = constants_1.IGNORED_DIRS, detect = {}) {
239
+ async function detectLanguages(root = process.cwd(), ignoreDirs = constants_js_1.IGNORED_DIRS, detect = {}) {
240
240
  return (await detectLanguageUsage(root, ignoreDirs, detect)).map(u => u.lang);
241
241
  }