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
@@ -1,4 +1,4 @@
1
- import { CheckOutcome } from '../types';
1
+ import { CheckOutcome } from '../types.js';
2
2
  /**
3
3
  * Where to get the external runners we deliberately do not ship.
4
4
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notInstalled = notInstalled;
4
- const types_1 = require("../types");
4
+ const types_js_1 = require("../types.js");
5
5
  /**
6
6
  * Where to get the external runners we deliberately do not ship.
7
7
  *
@@ -65,5 +65,5 @@ const INSTALL_HINTS = {
65
65
  function notInstalled(tool, label) {
66
66
  const { command, url } = INSTALL_HINTS[tool];
67
67
  const subject = label ? `${label} not installed` : 'not installed';
68
- return (0, types_1.skip)(command ? `${subject} — ${command} · ${url}` : `${subject} — ${url}`);
68
+ return (0, types_js_1.skip)(command ? `${subject} — ${command} · ${url}` : `${subject} — ${url}`);
69
69
  }
@@ -1,4 +1,4 @@
1
- import type { CheckContext, RunOptions } from './types';
1
+ import type { CheckContext, RunOptions } from './types.js';
2
2
  /**
3
3
  * What a run should look at, before any git call is made. Separated from
4
4
  * {@link resolveDiffRange} so the precedence rules are a pure function of the
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.planDiffRange = planDiffRange;
7
7
  exports.buildContext = buildContext;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
- const loader_1 = require("../config/loader");
10
- const utils_1 = require("../utils");
11
- const detect_language_1 = require("../utils/detect-language");
12
- const execa_1 = require("../utils/execa");
9
+ const loader_js_1 = require("../config/loader.js");
10
+ const detect_language_js_1 = require("../utils/detect-language.js");
11
+ const execa_js_1 = require("../utils/execa.js");
12
+ const index_js_1 = require("../utils/index.js");
13
13
  /**
14
14
  * Decide what to look at. Order matters and is the contract:
15
15
  *
@@ -52,7 +52,7 @@ function planDiffRange(opts, env = process.env) {
52
52
  reason: 'PR build',
53
53
  };
54
54
  }
55
- if ((0, utils_1.isCiEnvironment)(env))
55
+ if ((0, index_js_1.isCiEnvironment)(env))
56
56
  return { kind: 'ref', ref: 'HEAD^', reason: 'CI build, no PR context' };
57
57
  return { kind: 'branch' };
58
58
  }
@@ -83,8 +83,8 @@ async function resolveDiffRange(cwd, opts) {
83
83
  // diffs baseSha..headSha sees exactly the staged changes — no per-check code.
84
84
  if (plan.kind === 'staged') {
85
85
  try {
86
- const head = (await (0, execa_1.execa)('git', ['rev-parse', 'HEAD'], { cwd })).stdout.trim();
87
- const tree = (await (0, execa_1.execa)('git', ['write-tree'], { cwd })).stdout.trim();
86
+ const head = (await (0, execa_js_1.execa)('git', ['rev-parse', 'HEAD'], { cwd })).stdout.trim();
87
+ const tree = (await (0, execa_js_1.execa)('git', ['write-tree'], { cwd })).stdout.trim();
88
88
  return { baseSha: head, headSha: tree, scope: { kind: 'staged', degraded: false } };
89
89
  }
90
90
  catch {
@@ -100,7 +100,7 @@ async function resolveDiffRange(cwd, opts) {
100
100
  }
101
101
  let headSha;
102
102
  try {
103
- const { stdout } = await (0, execa_1.execa)('git', ['rev-parse', 'HEAD'], { cwd });
103
+ const { stdout } = await (0, execa_js_1.execa)('git', ['rev-parse', 'HEAD'], { cwd });
104
104
  headSha = stdout.trim();
105
105
  }
106
106
  catch {
@@ -115,7 +115,7 @@ async function resolveDiffRange(cwd, opts) {
115
115
  const eventBase = event?.pull_request?.base?.sha;
116
116
  // Only use it if the commit is actually present in this clone; otherwise
117
117
  // fall through so a shallow clone degrades to a full scan, not 0 files.
118
- const baseSha = eventBase ? await (0, utils_1.resolveGitRef)(cwd, eventBase) : undefined;
118
+ const baseSha = eventBase ? await (0, index_js_1.resolveGitRef)(cwd, eventBase) : undefined;
119
119
  if (baseSha) {
120
120
  return { baseSha, headSha, scope: { kind: 'delta', reason: 'PR event', degraded: false } };
121
121
  }
@@ -127,7 +127,7 @@ async function resolveDiffRange(cwd, opts) {
127
127
  }
128
128
  if (plan.kind === 'branch')
129
129
  return resolveBranchRange(cwd, headSha);
130
- const baseSha = await (0, utils_1.resolveGitRef)(cwd, plan.ref);
130
+ const baseSha = await (0, index_js_1.resolveGitRef)(cwd, plan.ref);
131
131
  if (!baseSha)
132
132
  return { headSha, scope: degraded(`${plan.ref} unresolvable`) };
133
133
  return {
@@ -151,11 +151,11 @@ async function findMergeBase(cwd, headSha) {
151
151
  for (const name of DEFAULT_BRANCHES)
152
152
  candidates.push(`origin/${name}`, name);
153
153
  for (const candidate of candidates) {
154
- const ref = await (0, utils_1.resolveGitRef)(cwd, candidate);
154
+ const ref = await (0, index_js_1.resolveGitRef)(cwd, candidate);
155
155
  // A candidate that resolves to HEAD is the branch we are on, not a base.
156
156
  if (!ref || ref === headSha)
157
157
  continue;
158
- const { stdout } = await (0, execa_1.execa)('git', ['merge-base', headSha, ref], { cwd, reject: false });
158
+ const { stdout } = await (0, execa_js_1.execa)('git', ['merge-base', headSha, ref], { cwd, reject: false });
159
159
  const base = stdout.trim();
160
160
  // An unrelated history has no merge base, and a base equal to HEAD means the
161
161
  // branch is behind rather than ahead — neither describes local changes.
@@ -187,7 +187,7 @@ async function resolveBranchRange(cwd, headSha) {
187
187
  */
188
188
  async function buildContext(opts = {}) {
189
189
  const cwd = opts.cwd ?? process.cwd();
190
- const config = opts.config ?? (0, loader_1.loadProjectConfig)();
190
+ const config = opts.config ?? (0, loader_js_1.loadProjectConfig)();
191
191
  // Detection reads the client's `ignoreDirs` from the config already loaded here,
192
192
  // rather than calling getIgnoredDirs() — that one resolves against process.cwd(),
193
193
  // which is not necessarily the `cwd` under review.
@@ -198,13 +198,13 @@ async function buildContext(opts = {}) {
198
198
  // enough to download a toolchain — see `detectLanguageUsage`.
199
199
  const usage = opts.languages
200
200
  ? opts.languages.map(lang => ({ lang, files: 1, marker: true }))
201
- : await (0, detect_language_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect);
201
+ : await (0, detect_language_js_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect);
202
202
  const languages = usage.map(u => u.lang);
203
203
  const { baseSha, headSha, scope } = await resolveDiffRange(cwd, opts);
204
204
  // `scope` is logged because it decides what the whole run looks at, and getting
205
205
  // it wrong is invisible in the results: a run that reviewed one commit and one
206
206
  // that reviewed the repository both just print passes.
207
- utils_1.logger.info(`[buildContext]: cwd=${cwd} languages=[${languages.join(', ') || 'none'}] write=${opts.write ?? false} scope=${describeScope(scope)}`);
207
+ index_js_1.logger.info(`[buildContext]: cwd=${cwd} languages=[${languages.join(', ') || 'none'}] write=${opts.write ?? false} scope=${describeScope(scope)}`);
208
208
  return {
209
209
  cwd,
210
210
  languages,
@@ -238,7 +238,7 @@ function applyLogConfig(config) {
238
238
  const log = config.log ?? {};
239
239
  const level = process.env.PR_CHECKMATE_LOG_LEVEL ?? log.level;
240
240
  const format = process.env.PR_CHECKMATE_LOG_FORMAT ?? log.format;
241
- utils_1.logger.configure({
241
+ index_js_1.logger.configure({
242
242
  ...(level ? { level } : {}),
243
243
  ...(format ? { format } : {}),
244
244
  ...(log.color ? { color: log.color } : {}),
@@ -0,0 +1,4 @@
1
+ export { runChecks } from './run-checks.js';
2
+ export { buildContext } from './context.js';
3
+ export { REGISTRY } from './registry.js';
4
+ export * from './types.js';
@@ -15,10 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.REGISTRY = exports.buildContext = exports.runChecks = void 0;
18
- var run_checks_1 = require("./run-checks");
19
- Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return run_checks_1.runChecks; } });
20
- var context_1 = require("./context");
21
- Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return context_1.buildContext; } });
22
- var registry_1 = require("./registry");
23
- Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return registry_1.REGISTRY; } });
24
- __exportStar(require("./types"), exports);
18
+ var run_checks_js_1 = require("./run-checks.js");
19
+ Object.defineProperty(exports, "runChecks", { enumerable: true, get: function () { return run_checks_js_1.runChecks; } });
20
+ var context_js_1 = require("./context.js");
21
+ Object.defineProperty(exports, "buildContext", { enumerable: true, get: function () { return context_js_1.buildContext; } });
22
+ var registry_js_1 = require("./registry.js");
23
+ Object.defineProperty(exports, "REGISTRY", { enumerable: true, get: function () { return registry_js_1.REGISTRY; } });
24
+ __exportStar(require("./types.js"), exports);
@@ -11,7 +11,7 @@ exports.stalePaths = stalePaths;
11
11
  const node_fs_1 = __importDefault(require("node:fs"));
12
12
  const node_os_1 = __importDefault(require("node:os"));
13
13
  const node_path_1 = __importDefault(require("node:path"));
14
- const logger_1 = require("../../utils/logger");
14
+ const logger_js_1 = require("../../utils/logger.js");
15
15
  /**
16
16
  * Expand a leading `~`.
17
17
  *
@@ -88,7 +88,7 @@ function resolveCacheDir(version, configured, env = process.env) {
88
88
  const dir = node_path_1.default.join(candidate.dir, version);
89
89
  if (writable(dir)) {
90
90
  if (index > 0) {
91
- logger_1.logger.warn(`[install]: ⚠️ cache directory "${candidates[0].dir}" is not writable — using ${candidate.reason} (${dir}). Fetched tooling will not survive a container rebuild.`);
91
+ logger_js_1.logger.warn(`[install]: ⚠️ cache directory "${candidates[0].dir}" is not writable — using ${candidate.reason} (${dir}). Fetched tooling will not survive a container rebuild.`);
92
92
  }
93
93
  return { dir, preferred: index === 0, reason: candidate.reason };
94
94
  }
@@ -1,7 +1,7 @@
1
- import { type LanguageUsage } from '../../utils/detect-language';
2
- import { packageVersion } from '../../utils/package-version';
3
- import { type EnsureResult } from './ensure';
4
- import { type ProfileDecision } from './profiles';
1
+ import { type LanguageUsage } from '../../utils/detect-language.js';
2
+ import { packageVersion } from '../../utils/package-version.js';
3
+ import { type EnsureResult } from './ensure.js';
4
+ import { type ProfileDecision } from './profiles.js';
5
5
  export { packageVersion };
6
6
  /**
7
7
  * Everything the install layer knows about this repository, in one shot.
@@ -9,15 +9,15 @@ exports.installProfiles = installProfiles;
9
9
  exports.runDoctor = runDoctor;
10
10
  exports.pruneCache = pruneCache;
11
11
  const node_fs_1 = __importDefault(require("node:fs"));
12
- const loader_1 = require("../../config/loader");
13
- const detect_language_1 = require("../../utils/detect-language");
14
- const logger_1 = require("../../utils/logger");
15
- const package_version_1 = require("../../utils/package-version");
16
- Object.defineProperty(exports, "packageVersion", { enumerable: true, get: function () { return package_version_1.packageVersion; } });
17
- const cache_1 = require("./cache");
18
- const ensure_1 = require("./ensure");
19
- const prepare_1 = require("./prepare");
20
- const profiles_1 = require("./profiles");
12
+ const loader_js_1 = require("../../config/loader.js");
13
+ const detect_language_js_1 = require("../../utils/detect-language.js");
14
+ const logger_js_1 = require("../../utils/logger.js");
15
+ const package_version_js_1 = require("../../utils/package-version.js");
16
+ Object.defineProperty(exports, "packageVersion", { enumerable: true, get: function () { return package_version_js_1.packageVersion; } });
17
+ const cache_js_1 = require("./cache.js");
18
+ const ensure_js_1 = require("./ensure.js");
19
+ const prepare_js_1 = require("./prepare.js");
20
+ const profiles_js_1 = require("./profiles.js");
21
21
  /**
22
22
  * Everything the install layer knows about this repository, in one shot.
23
23
  *
@@ -26,10 +26,10 @@ const profiles_1 = require("./profiles");
26
26
  * log two contradictory-looking detection lines for one command.
27
27
  */
28
28
  async function planInstall(cwd = process.cwd(), usage) {
29
- const config = (0, loader_1.loadProjectConfig)();
30
- const detected = usage ?? (await (0, detect_language_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect));
31
- const location = (0, cache_1.resolveCacheDir)((0, package_version_1.packageVersion)(), config.install?.cacheDir);
32
- return { decisions: (0, profiles_1.planProfiles)(detected, config), cacheDir: location?.dir ?? null };
29
+ const config = (0, loader_js_1.loadProjectConfig)();
30
+ const detected = usage ?? (await (0, detect_language_js_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect));
31
+ const location = (0, cache_js_1.resolveCacheDir)((0, package_version_js_1.packageVersion)(), config.install?.cacheDir);
32
+ return { decisions: (0, profiles_js_1.planProfiles)(detected, config), cacheDir: location?.dir ?? null };
33
33
  }
34
34
  /**
35
35
  * Which profiles are usable right now, and why — fetched, or shipped with us.
@@ -47,12 +47,12 @@ async function planInstall(cwd = process.cwd(), usage) {
47
47
  */
48
48
  function installedProfiles(cacheDir) {
49
49
  const present = new Map();
50
- for (const profile of profiles_1.PROFILES) {
51
- if ((0, prepare_1.profileSatisfiedLocally)(profile))
50
+ for (const profile of profiles_js_1.PROFILES) {
51
+ if ((0, prepare_js_1.profileSatisfiedLocally)(profile))
52
52
  present.set(profile.name, 'ships with the package');
53
53
  }
54
54
  if (cacheDir) {
55
- for (const name of (0, ensure_1.cachedProfiles)(cacheDir))
55
+ for (const name of (0, ensure_js_1.cachedProfiles)(cacheDir))
56
56
  present.set(name, 'fetched');
57
57
  }
58
58
  return present;
@@ -66,32 +66,32 @@ function installedProfiles(cacheDir) {
66
66
  * happens to contain.
67
67
  */
68
68
  async function installProfiles(cwd = process.cwd(), all = false) {
69
- const config = (0, loader_1.loadProjectConfig)();
69
+ const config = (0, loader_js_1.loadProjectConfig)();
70
70
  const install = config.install ?? {};
71
71
  const { decisions } = await planInstall(cwd);
72
72
  const denied = new Set(install.deny ?? []);
73
- const wanted = (all ? profiles_1.PROFILES.map(p => p.name) : decisions.filter(d => d.required).map(d => d.profile)).filter(name => {
74
- const profile = profiles_1.PROFILES.find(p => p.name === name);
73
+ const wanted = (all ? profiles_js_1.PROFILES.map(p => p.name) : decisions.filter(d => d.required).map(d => d.profile)).filter(name => {
74
+ const profile = profiles_js_1.PROFILES.find(p => p.name === name);
75
75
  // Nothing to fetch for a profile whose packages already ship with us, and
76
76
  // fetching it anyway is not merely wasted: `--all` downloaded a second copy
77
77
  // of every bundled profile — some 800 packages — beside the ones already in
78
78
  // `node_modules`. On a container build that lands in the image (ticket 083).
79
- if (profile && (0, prepare_1.profileSatisfiedLocally)(profile)) {
80
- logger_1.logger.info(`[install]: profile "${name}" already ships with the package`);
79
+ if (profile && (0, prepare_js_1.profileSatisfiedLocally)(profile)) {
80
+ logger_js_1.logger.info(`[install]: profile "${name}" already ships with the package`);
81
81
  return false;
82
82
  }
83
83
  const blocked = profile?.packages.filter(pkg => denied.has(pkg)) ?? [];
84
84
  if (blocked.length === 0)
85
85
  return true;
86
- logger_1.logger.info(`[install]: profile "${name}" skipped — install.deny lists ${blocked.join(', ')}`);
86
+ logger_js_1.logger.info(`[install]: profile "${name}" skipped — install.deny lists ${blocked.join(', ')}`);
87
87
  return false;
88
88
  });
89
89
  // One install for the whole set. Profiles that share hundreds of packages used
90
90
  // to be fetched into a tree each, which fought over npm's cache and downloaded
91
91
  // the shared half once per profile (ticket 087).
92
- const result = await (0, ensure_1.ensureTooling)(wanted, {
92
+ const result = await (0, ensure_js_1.ensureTooling)(wanted, {
93
93
  cwd,
94
- version: (0, package_version_1.packageVersion)(),
94
+ version: (0, package_version_js_1.packageVersion)(),
95
95
  install,
96
96
  });
97
97
  return [result];
@@ -104,14 +104,14 @@ async function installProfiles(cwd = process.cwd(), all = false) {
104
104
  * reading of our source.
105
105
  */
106
106
  async function runDoctor(cwd = process.cwd()) {
107
- const config = (0, loader_1.loadProjectConfig)();
108
- const usage = await (0, detect_language_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect);
107
+ const config = (0, loader_js_1.loadProjectConfig)();
108
+ const usage = await (0, detect_language_js_1.detectLanguageUsage)(cwd, config.ignoreDirs, config.detect);
109
109
  const { decisions, cacheDir } = await planInstall(cwd, usage);
110
110
  const present = installedProfiles(cacheDir);
111
111
  const lines = [];
112
112
  lines.push('PR CheckMate — install doctor');
113
113
  lines.push('');
114
- lines.push(` version ${(0, package_version_1.packageVersion)()}`);
114
+ lines.push(` version ${(0, package_version_js_1.packageVersion)()}`);
115
115
  lines.push(` repository ${cwd}`);
116
116
  lines.push(` cache ${cacheDir ?? 'unavailable (no writable directory)'}`);
117
117
  lines.push(` strategy ${config.install?.strategy ?? 'adaptive'}`);
@@ -142,30 +142,30 @@ async function runDoctor(cwd = process.cwd()) {
142
142
  lines.push(` ${missing.length} profile(s) not installed yet. They are fetched on the next`);
143
143
  lines.push(' run, or now with: npx pr-checkmate install');
144
144
  }
145
- const stale = (0, cache_1.stalePaths)((0, package_version_1.packageVersion)(), config.install?.cacheDir);
145
+ const stale = (0, cache_js_1.stalePaths)((0, package_version_js_1.packageVersion)(), config.install?.cacheDir);
146
146
  if (stale.length > 0) {
147
147
  lines.push('');
148
148
  lines.push(` ${stale.length} directory(ies) from other versions: npx pr-checkmate cache-prune`);
149
149
  }
150
- logger_1.logger.print(lines.join('\n'));
150
+ logger_js_1.logger.print(lines.join('\n'));
151
151
  }
152
152
  /** Remove cached tooling belonging to other versions of pr-checkmate. */
153
153
  function pruneCache() {
154
- const config = (0, loader_1.loadProjectConfig)();
155
- const stale = (0, cache_1.stalePaths)((0, package_version_1.packageVersion)(), config.install?.cacheDir);
154
+ const config = (0, loader_js_1.loadProjectConfig)();
155
+ const stale = (0, cache_js_1.stalePaths)((0, package_version_js_1.packageVersion)(), config.install?.cacheDir);
156
156
  if (stale.length === 0) {
157
- logger_1.logger.print('Nothing to prune — no tooling from other versions is cached.');
157
+ logger_js_1.logger.print('Nothing to prune — no tooling from other versions is cached.');
158
158
  return;
159
159
  }
160
160
  for (const dir of stale) {
161
161
  try {
162
162
  node_fs_1.default.rmSync(dir, { recursive: true, force: true });
163
- logger_1.logger.print(`removed ${dir}`);
163
+ logger_js_1.logger.print(`removed ${dir}`);
164
164
  }
165
165
  catch (err) {
166
166
  // Another version may be running right now; refusing to delete its
167
167
  // tooling is the correct outcome, not an error worth failing on.
168
- logger_1.logger.warn(`[cache-prune]: could not remove ${dir}: ${err.message}`);
168
+ logger_js_1.logger.warn(`[cache-prune]: could not remove ${dir}: ${err.message}`);
169
169
  }
170
170
  }
171
171
  }
@@ -1,5 +1,5 @@
1
- import type { InstallConfig } from '../../interfaces';
2
- import type { ProfileName } from './profiles';
1
+ import type { InstallConfig } from '../../interfaces/index.js';
2
+ import type { ProfileName } from './profiles.js';
3
3
  /**
4
4
  * What happened to the tooling cache, in the words the report and `doctor` use.
5
5
  *
@@ -9,14 +9,15 @@ exports.ensureTooling = ensureTooling;
9
9
  const node_crypto_1 = __importDefault(require("node:crypto"));
10
10
  const node_fs_1 = __importDefault(require("node:fs"));
11
11
  const node_path_1 = __importDefault(require("node:path"));
12
- const execa_1 = require("../../utils/execa");
13
- const logger_1 = require("../../utils/logger");
14
- const cache_1 = require("./cache");
15
- const lock_1 = require("./lock");
16
- const merge_1 = require("./merge");
12
+ const execa_js_1 = require("../../utils/execa.js");
13
+ const logger_js_1 = require("../../utils/logger.js");
14
+ const own_deps_js_1 = require("../../utils/own-deps.js");
15
+ const cache_js_1 = require("./cache.js");
16
+ const lock_js_1 = require("./lock.js");
17
+ const merge_js_1 = require("./merge.js");
17
18
  /** Where the shipped manifests live inside the installed package. */
18
19
  function manifestDir(profile) {
19
- return node_path_1.default.resolve(__dirname, '../../..', 'install-manifests', profile);
20
+ return node_path_1.default.join((0, own_deps_js_1.findOwnPackageRoot)() ?? node_path_1.default.resolve(__dirname, '../../..'), 'install-manifests', profile);
20
21
  }
21
22
  const stampPath = (dir) => node_path_1.default.join(dir, '.pr-checkmate-installed');
22
23
  const MANIFEST = 'package.json';
@@ -33,7 +34,7 @@ function manifestFor(profiles) {
33
34
  const dirs = profiles.map(name => ({ name, dir: manifestDir(name) }));
34
35
  if (dirs.some(d => !node_fs_1.default.existsSync(node_path_1.default.join(d.dir, LOCKFILE))))
35
36
  return null;
36
- return (0, merge_1.mergeManifests)(dirs);
37
+ return (0, merge_js_1.mergeManifests)(dirs);
37
38
  }
38
39
  /**
39
40
  * A fingerprint of the manifest a tooling directory was installed from.
@@ -94,7 +95,7 @@ const normalise = (profiles) => [...new Set(profiles)].sort();
94
95
  * readable from the directory layout.
95
96
  */
96
97
  function cachedProfiles(cacheDir) {
97
- const dir = (0, cache_1.toolingDir)(cacheDir);
98
+ const dir = (0, cache_js_1.toolingDir)(cacheDir);
98
99
  if (!node_fs_1.default.existsSync(node_path_1.default.join(dir, 'node_modules')))
99
100
  return [];
100
101
  return readStamp(dir)?.profiles ?? [];
@@ -128,7 +129,7 @@ async function ensureTooling(wanted, opts) {
128
129
  if (needed.length === 0) {
129
130
  return { status: 'cached', reason: 'nothing to fetch', profiles: [] };
130
131
  }
131
- const location = (0, cache_1.resolveCacheDir)(opts.version, install.cacheDir);
132
+ const location = (0, cache_js_1.resolveCacheDir)(opts.version, install.cacheDir);
132
133
  if (!location) {
133
134
  return {
134
135
  status: 'failed',
@@ -136,7 +137,7 @@ async function ensureTooling(wanted, opts) {
136
137
  profiles: [],
137
138
  };
138
139
  }
139
- const dir = (0, cache_1.toolingDir)(location.dir);
140
+ const dir = (0, cache_js_1.toolingDir)(location.dir);
140
141
  const stamp = readStamp(dir);
141
142
  if (holdsAll(dir, stamp, needed)) {
142
143
  return { status: 'cached', reason: 'already installed', dir, profiles: stamp?.profiles ?? [] };
@@ -203,7 +204,7 @@ async function ensureTooling(wanted, opts) {
203
204
  profiles: [],
204
205
  };
205
206
  }
206
- const release = await (0, lock_1.withLock)(dir, install.waitTimeoutMs ?? 120000);
207
+ const release = await (0, lock_js_1.withLock)(dir, install.waitTimeoutMs ?? 120000);
207
208
  if (!release) {
208
209
  return { status: 'failed', reason: `cannot write to ${dir}`, dir, profiles: [] };
209
210
  }
@@ -233,7 +234,7 @@ async function ensureTooling(wanted, opts) {
233
234
  * `--ignore-scripts` is not negotiable in a supply-chain tool.
234
235
  */
235
236
  async function npmCi(dir, opts) {
236
- const result = await (0, execa_1.execa)('npm', ['ci', '--prefix', dir, '--ignore-scripts', '--no-audit', '--no-fund', '--loglevel', 'error'], { cwd: opts.cwd, reject: false, timeout: opts.install.installTimeoutMs ?? 300000 });
237
+ const result = await (0, execa_js_1.execa)('npm', ['ci', '--prefix', dir, '--ignore-scripts', '--no-audit', '--no-fund', '--loglevel', 'error'], { cwd: opts.cwd, reject: false, timeout: opts.install.installTimeoutMs ?? 300000 });
237
238
  if (result.exitCode === 0)
238
239
  return { ok: true };
239
240
  const detail = (result.stderr || result.stdout || '').split('\n').slice(-3).join(' ').trim();
@@ -247,7 +248,7 @@ async function runInstall(profiles, manifest, dir, opts) {
247
248
  const count = Object.keys(manifest.lockfile.packages).length - 1;
248
249
  // Always logged, never behind --debug: this is a security tool downloading
249
250
  // code at run time, and that must be visible in every CI log by default.
250
- logger_1.logger.info(`[install]: 📦 fetching tooling for ${named} (${count} packages) → ${dir}`);
251
+ logger_js_1.logger.info(`[install]: 📦 fetching tooling for ${named} (${count} packages) → ${dir}`);
251
252
  try {
252
253
  const install = opts.installer ?? ((target) => npmCi(target, opts));
253
254
  const result = await install(dir);
@@ -257,7 +258,7 @@ async function runInstall(profiles, manifest, dir, opts) {
257
258
  const stamp = { hash: hashOf(manifest), profiles };
258
259
  node_fs_1.default.writeFileSync(stampPath(dir), JSON.stringify(stamp));
259
260
  const durationMs = Date.now() - started;
260
- logger_1.logger.info(`[install]: ✅ tooling ready in ${(durationMs / 1000).toFixed(1)}s (${named})`);
261
+ logger_js_1.logger.info(`[install]: ✅ tooling ready in ${(durationMs / 1000).toFixed(1)}s (${named})`);
261
262
  return { status: 'installed', reason: `${count} packages`, dir, profiles, durationMs };
262
263
  }
263
264
  catch (err) {
@@ -7,7 +7,7 @@ exports.processAlive = processAlive;
7
7
  exports.withLock = withLock;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const logger_1 = require("../../utils/logger");
10
+ const logger_js_1 = require("../../utils/logger.js");
11
11
  const lockPath = (dir) => node_path_1.default.join(dir, '.pr-checkmate-install.lock');
12
12
  function readLock(file) {
13
13
  try {
@@ -63,7 +63,7 @@ async function withLock(dir, timeoutMs, deps = {}) {
63
63
  // would otherwise block every later run forever. Breaking it needs to be
64
64
  // loud: it is the one case where two installs could genuinely overlap.
65
65
  if (held && !alive(held.pid)) {
66
- logger_1.logger.warn(`[install]: ⚠️ removing a stale lock left by process ${held.pid}, which is no longer running.`);
66
+ logger_js_1.logger.warn(`[install]: ⚠️ removing a stale lock left by process ${held.pid}, which is no longer running.`);
67
67
  try {
68
68
  node_fs_1.default.unlinkSync(file);
69
69
  }
@@ -79,7 +79,7 @@ async function withLock(dir, timeoutMs, deps = {}) {
79
79
  continue;
80
80
  }
81
81
  if (now() >= deadline) {
82
- logger_1.logger.warn(`[install]: ⚠️ waited ${Math.round(timeoutMs / 1000)}s for another process to finish installing — taking over.`);
82
+ logger_js_1.logger.warn(`[install]: ⚠️ waited ${Math.round(timeoutMs / 1000)}s for another process to finish installing — taking over.`);
83
83
  try {
84
84
  node_fs_1.default.unlinkSync(file);
85
85
  }
@@ -91,7 +91,7 @@ async function withLock(dir, timeoutMs, deps = {}) {
91
91
  }
92
92
  if (!announced) {
93
93
  const age = held ? Math.round((now() - held.startedAt) / 1000) : 0;
94
- logger_1.logger.info(`[install]: ⏳ another process is installing into ${node_path_1.default.basename(dir)} (started ${age}s ago) — waiting up to ${Math.round(timeoutMs / 1000)}s`);
94
+ logger_js_1.logger.info(`[install]: ⏳ another process is installing into ${node_path_1.default.basename(dir)} (started ${age}s ago) — waiting up to ${Math.round(timeoutMs / 1000)}s`);
95
95
  announced = true;
96
96
  }
97
97
  await sleep(500);
@@ -1,7 +1,7 @@
1
- import type { PRCheckMateConfig } from '../../interfaces';
2
- import type { LanguageUsage } from '../../utils/detect-language';
3
- import { type EnsureOptions } from './ensure';
4
- import { type Profile } from './profiles';
1
+ import type { PRCheckMateConfig } from '../../interfaces/index.js';
2
+ import type { LanguageUsage } from '../../utils/detect-language.js';
3
+ import { type EnsureOptions } from './ensure.js';
4
+ import { type Profile } from './profiles.js';
5
5
  /**
6
6
  * Whether a profile needs fetching at all, or already ships inside the package.
7
7
  *
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.profileSatisfiedLocally = profileSatisfiedLocally;
4
4
  exports.prepareTooling = prepareTooling;
5
5
  exports.noTooling = noTooling;
6
- const logger_1 = require("../../utils/logger");
7
- const resolve_bin_1 = require("../../utils/resolve-bin");
8
- const ensure_1 = require("./ensure");
9
- const profiles_1 = require("./profiles");
6
+ const logger_js_1 = require("../../utils/logger.js");
7
+ const resolve_bin_js_1 = require("../../utils/resolve-bin.js");
8
+ const ensure_js_1 = require("./ensure.js");
9
+ const profiles_js_1 = require("./profiles.js");
10
10
  /**
11
11
  * Whether a profile needs fetching at all, or already ships inside the package.
12
12
  *
@@ -23,7 +23,7 @@ const profiles_1 = require("./profiles");
23
23
  * rather than another change to this logic.
24
24
  */
25
25
  function profileSatisfiedLocally(profile) {
26
- return profile.packages.every(pkg => (0, resolve_bin_1.packagePresent)(pkg));
26
+ return profile.packages.every(pkg => (0, resolve_bin_js_1.packagePresent)(pkg));
27
27
  }
28
28
  /** Profiles blocked outright by `install.deny`, with a line saying so. */
29
29
  function denied(profile, deny) {
@@ -50,7 +50,7 @@ async function prepareTooling(opts) {
50
50
  // than once in one process, and a directory registered by a previous run — for
51
51
  // a different repository, with a different profile set — must not still be on
52
52
  // the search path for this one.
53
- (0, resolve_bin_1.clearToolPaths)();
53
+ (0, resolve_bin_js_1.clearToolPaths)();
54
54
  const install = opts.config.install ?? {};
55
55
  const strategy = process.env.PR_CHECKMATE_INSTALL_STRATEGY ?? install.strategy ?? 'adaptive';
56
56
  const onMissing = install.onMissingTool ?? 'auto';
@@ -58,14 +58,14 @@ async function prepareTooling(opts) {
58
58
  // Which profiles this repository needs: languages by file count, universal
59
59
  // profiles by whether their check survived config. `install.profiles` and
60
60
  // `excludeProfiles` have already had their say inside `planProfiles`.
61
- const required = new Set((0, profiles_1.planProfiles)(opts.usage, opts.config)
61
+ const required = new Set((0, profiles_js_1.planProfiles)(opts.usage, opts.config)
62
62
  .filter(decision => decision.required)
63
63
  .map(decision => decision.profile));
64
64
  // A profile nobody in this run would use is not worth a thought, let alone a
65
65
  // download. `eager` opts out of that reasoning by definition: it exists so a
66
66
  // container build or an air-gapped mirror can hold everything up front.
67
67
  const chosen = opts.selected.length > 0 ? new Set(opts.selected) : null;
68
- const wanted = (opts.profiles ?? profiles_1.PROFILES).filter(profile => {
68
+ const wanted = (opts.profiles ?? profiles_js_1.PROFILES).filter(profile => {
69
69
  if (strategy === 'eager')
70
70
  return true;
71
71
  if (!required.has(profile.name))
@@ -108,7 +108,7 @@ async function prepareTooling(opts) {
108
108
  // creates the directory and warns when the configured path is unwritable, and a
109
109
  // container with a read-only home would print that on every single run.
110
110
  if (toFetch.length > 0) {
111
- const result = await (0, ensure_1.ensureTooling)(toFetch.map(profile => profile.name), {
111
+ const result = await (0, ensure_js_1.ensureTooling)(toFetch.map(profile => profile.name), {
112
112
  cwd: opts.cwd,
113
113
  version: opts.version,
114
114
  install,
@@ -126,15 +126,15 @@ async function prepareTooling(opts) {
126
126
  // Always logged, never behind --debug. A check that did not run is the
127
127
  // failure mode this whole layer exists to make loud.
128
128
  const names = [...new Set(unavailable.keys())].join(', ');
129
- logger_1.logger.warn(`[install]: ⚠️ tooling unavailable — these checks cannot run: ${names}`);
129
+ logger_js_1.logger.warn(`[install]: ⚠️ tooling unavailable — these checks cannot run: ${names}`);
130
130
  if (onMissing === 'error') {
131
- logger_1.logger.error('[install]: ❌ install.onMissingTool is "error" — the affected checks fail');
131
+ logger_js_1.logger.error('[install]: ❌ install.onMissingTool is "error" — the affected checks fail');
132
132
  }
133
133
  else {
134
- logger_1.logger.info('[install]: Pre-warm the cache with: npx pr-checkmate install --all');
134
+ logger_js_1.logger.info('[install]: Pre-warm the cache with: npx pr-checkmate install --all');
135
135
  }
136
136
  }
137
- (0, resolve_bin_1.registerToolPaths)(dirs);
137
+ (0, resolve_bin_js_1.registerToolPaths)(dirs);
138
138
  return { unavailable, dirs, fatal: onMissing === 'error' && unavailable.size > 0 };
139
139
  }
140
140
  /**
@@ -1,5 +1,5 @@
1
- import type { PRCheckMateConfig } from '../../interfaces';
2
- import type { Language, LanguageUsage } from '../../utils/detect-language';
1
+ import type { PRCheckMateConfig } from '../../interfaces/index.js';
2
+ import type { Language, LanguageUsage } from '../../utils/detect-language.js';
3
3
  /**
4
4
  * A named bundle of tooling, and the checks that stop working without it.
5
5
  *
@@ -91,7 +91,7 @@ exports.PROFILES = [
91
91
  },
92
92
  {
93
93
  name: 'markdown',
94
- packages: ['markdownlint-cli2'],
94
+ packages: ['markdownlint'],
95
95
  checks: ['Markdown'],
96
96
  },
97
97
  {
@@ -1,4 +1,4 @@
1
- import type { CheckContext } from '../types';
1
+ import type { CheckContext } from '../types.js';
2
2
  /** One reuse decision, with the sentence that explains it. */
3
3
  interface ReuseDecision {
4
4
  /** Search roots to prefer, or `undefined` to use our own copy. */
@@ -7,8 +7,8 @@ exports.reuseDecision = reuseDecision;
7
7
  exports.clientToolPaths = clientToolPaths;
8
8
  const node_fs_1 = __importDefault(require("node:fs"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
- const logger_1 = require("../../utils/logger");
11
- const resolve_bin_1 = require("../../utils/resolve-bin");
10
+ const logger_js_1 = require("../../utils/logger.js");
11
+ const resolve_bin_js_1 = require("../../utils/resolve-bin.js");
12
12
  /**
13
13
  * The major version we declare for a tool, from our own manifest.
14
14
  *
@@ -18,7 +18,7 @@ const resolve_bin_1 = require("../../utils/resolve-bin");
18
18
  */
19
19
  function ownMajor(pkgName) {
20
20
  try {
21
- const manifest = node_path_1.default.join((0, resolve_bin_1.ownPackageRoot)(), 'package.json');
21
+ const manifest = node_path_1.default.join((0, resolve_bin_js_1.ownPackageRoot)(), 'package.json');
22
22
  const deps = JSON.parse(node_fs_1.default.readFileSync(manifest, 'utf-8')).dependencies;
23
23
  const range = deps?.[pkgName];
24
24
  if (!range)
@@ -102,6 +102,6 @@ function reuseDecision(pkgName, ctx, opts = {}) {
102
102
  */
103
103
  function clientToolPaths(pkgName, ctx, opts = {}) {
104
104
  const decision = reuseDecision(pkgName, ctx, opts);
105
- logger_1.logger.debug(`[reuseLocal]: ${decision.reason}`);
105
+ logger_js_1.logger.debug(`[reuseLocal]: ${decision.reason}`);
106
106
  return decision.paths;
107
107
  }