skuba 11.1.0-jest30-20250620003740 → 12.0.0-enforce-file-extensions-20250618112549

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 (421) hide show
  1. package/jest/moduleNameMapper.js +4 -1
  2. package/jest/transform.js +15 -1
  3. package/jest-preset.js +7 -4
  4. package/lib/api/buildkite/annotate.js +2 -2
  5. package/lib/api/buildkite/annotate.js.map +1 -1
  6. package/lib/api/buildkite/index.d.ts +3 -3
  7. package/lib/api/buildkite/index.js +2 -2
  8. package/lib/api/buildkite/index.js.map +1 -1
  9. package/lib/api/git/commitAllChanges.d.ts +2 -2
  10. package/lib/api/git/commitAllChanges.js +3 -3
  11. package/lib/api/git/commitAllChanges.js.map +1 -1
  12. package/lib/api/git/getChangedFiles.js +1 -1
  13. package/lib/api/git/getChangedFiles.js.map +1 -1
  14. package/lib/api/git/index.d.ts +12 -12
  15. package/lib/api/git/index.js +11 -11
  16. package/lib/api/git/index.js.map +1 -1
  17. package/lib/api/git/pull.js +2 -2
  18. package/lib/api/git/pull.js.map +1 -1
  19. package/lib/api/git/push.js +2 -2
  20. package/lib/api/git/push.js.map +1 -1
  21. package/lib/api/git/reset.js +1 -1
  22. package/lib/api/git/reset.js.map +1 -1
  23. package/lib/api/github/checkRun.js +4 -4
  24. package/lib/api/github/checkRun.js.map +1 -1
  25. package/lib/api/github/environment.js +1 -1
  26. package/lib/api/github/environment.js.map +1 -1
  27. package/lib/api/github/index.d.ts +7 -7
  28. package/lib/api/github/index.js +6 -6
  29. package/lib/api/github/index.js.map +1 -1
  30. package/lib/api/github/issueComment.js +4 -4
  31. package/lib/api/github/issueComment.js.map +1 -1
  32. package/lib/api/github/pullRequest.js +3 -3
  33. package/lib/api/github/pullRequest.js.map +1 -1
  34. package/lib/api/github/push.d.ts +1 -1
  35. package/lib/api/github/push.js +3 -3
  36. package/lib/api/github/push.js.map +1 -1
  37. package/lib/api/jest/index.js +2 -2
  38. package/lib/api/jest/index.js.map +1 -1
  39. package/lib/api/net/compose.js +1 -1
  40. package/lib/api/net/compose.js.map +1 -1
  41. package/lib/api/net/index.d.ts +1 -1
  42. package/lib/api/net/index.js +1 -1
  43. package/lib/api/net/index.js.map +1 -1
  44. package/lib/api/net/waitFor.d.ts +1 -1
  45. package/lib/api/net/waitFor.js +2 -2
  46. package/lib/api/net/waitFor.js.map +1 -1
  47. package/lib/cli/adapter/eslint.d.ts +1 -1
  48. package/lib/cli/adapter/eslint.js +1 -1
  49. package/lib/cli/adapter/eslint.js.map +1 -1
  50. package/lib/cli/adapter/prettier.d.ts +1 -1
  51. package/lib/cli/adapter/prettier.js +4 -4
  52. package/lib/cli/adapter/prettier.js.map +2 -2
  53. package/lib/cli/build/assets.d.ts +1 -1
  54. package/lib/cli/build/assets.js +4 -4
  55. package/lib/cli/build/assets.js.map +1 -1
  56. package/lib/cli/build/esbuild.js +3 -3
  57. package/lib/cli/build/esbuild.js.map +1 -1
  58. package/lib/cli/build/index.js +6 -6
  59. package/lib/cli/build/index.js.map +1 -1
  60. package/lib/cli/build/tsc.d.ts +1 -1
  61. package/lib/cli/build/tsc.js +2 -2
  62. package/lib/cli/build/tsc.js.map +1 -1
  63. package/lib/cli/buildPackage/index.js +3 -3
  64. package/lib/cli/buildPackage/index.js.map +1 -1
  65. package/lib/cli/configure/analyseConfiguration.d.ts +2 -2
  66. package/lib/cli/configure/analyseConfiguration.js +2 -2
  67. package/lib/cli/configure/analyseConfiguration.js.map +1 -1
  68. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  69. package/lib/cli/configure/analyseDependencies.js +6 -6
  70. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  71. package/lib/cli/configure/analysis/files.js +1 -1
  72. package/lib/cli/configure/analysis/files.js.map +1 -1
  73. package/lib/cli/configure/analysis/git.js +2 -2
  74. package/lib/cli/configure/analysis/git.js.map +1 -1
  75. package/lib/cli/configure/analysis/package.d.ts +1 -1
  76. package/lib/cli/configure/analysis/package.js +2 -2
  77. package/lib/cli/configure/analysis/package.js.map +1 -1
  78. package/lib/cli/configure/analysis/project.d.ts +1 -1
  79. package/lib/cli/configure/analysis/project.js +4 -4
  80. package/lib/cli/configure/analysis/project.js.map +2 -2
  81. package/lib/cli/configure/dependencies/index.d.ts +5 -5
  82. package/lib/cli/configure/dependencies/index.js +5 -5
  83. package/lib/cli/configure/dependencies/index.js.map +1 -1
  84. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -2
  85. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +1 -1
  86. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  87. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -2
  88. package/lib/cli/configure/dependencies/seekKoala.js +1 -1
  89. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  90. package/lib/cli/configure/dependencies/skuba.d.ts +2 -2
  91. package/lib/cli/configure/dependencies/skuba.js +1 -1
  92. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  93. package/lib/cli/configure/dependencies/skubaDeps.d.ts +1 -1
  94. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  95. package/lib/cli/configure/dependencies/skubaDive.d.ts +2 -2
  96. package/lib/cli/configure/dependencies/skubaDive.js +1 -1
  97. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  98. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  99. package/lib/cli/configure/ensureTemplateCompletion.js +6 -6
  100. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  101. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  102. package/lib/cli/configure/getEntryPoint.js +3 -3
  103. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  104. package/lib/cli/configure/getProjectType.d.ts +2 -2
  105. package/lib/cli/configure/getProjectType.js +3 -3
  106. package/lib/cli/configure/getProjectType.js.map +1 -1
  107. package/lib/cli/configure/index.js +14 -14
  108. package/lib/cli/configure/index.js.map +1 -1
  109. package/lib/cli/configure/modules/eslint.d.ts +1 -1
  110. package/lib/cli/configure/modules/eslint.js +4 -4
  111. package/lib/cli/configure/modules/eslint.js.map +1 -1
  112. package/lib/cli/configure/modules/ignore.d.ts +1 -1
  113. package/lib/cli/configure/modules/ignore.js +2 -2
  114. package/lib/cli/configure/modules/ignore.js.map +1 -1
  115. package/lib/cli/configure/modules/index.d.ts +1 -1
  116. package/lib/cli/configure/modules/index.js +10 -10
  117. package/lib/cli/configure/modules/index.js.map +1 -1
  118. package/lib/cli/configure/modules/jest.d.ts +1 -1
  119. package/lib/cli/configure/modules/jest.js +4 -4
  120. package/lib/cli/configure/modules/jest.js.map +1 -1
  121. package/lib/cli/configure/modules/nodemon.d.ts +1 -1
  122. package/lib/cli/configure/modules/nodemon.js +1 -1
  123. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  124. package/lib/cli/configure/modules/package.d.ts +1 -1
  125. package/lib/cli/configure/modules/package.js +4 -4
  126. package/lib/cli/configure/modules/package.js.map +1 -1
  127. package/lib/cli/configure/modules/prettier.d.ts +1 -1
  128. package/lib/cli/configure/modules/prettier.js +4 -4
  129. package/lib/cli/configure/modules/prettier.js.map +1 -1
  130. package/lib/cli/configure/modules/renovate.d.ts +1 -1
  131. package/lib/cli/configure/modules/renovate.js +5 -5
  132. package/lib/cli/configure/modules/renovate.js.map +1 -1
  133. package/lib/cli/configure/modules/serverless.d.ts +1 -1
  134. package/lib/cli/configure/modules/serverless.js.map +1 -1
  135. package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
  136. package/lib/cli/configure/modules/skubaDive.js +4 -4
  137. package/lib/cli/configure/modules/skubaDive.js.map +1 -1
  138. package/lib/cli/configure/modules/tslint.d.ts +1 -1
  139. package/lib/cli/configure/modules/tslint.js +1 -1
  140. package/lib/cli/configure/modules/tslint.js.map +1 -1
  141. package/lib/cli/configure/processing/deleteFiles.d.ts +1 -1
  142. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  143. package/lib/cli/configure/processing/json.js +2 -2
  144. package/lib/cli/configure/processing/json.js.map +1 -1
  145. package/lib/cli/configure/processing/loadFiles.d.ts +1 -1
  146. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  147. package/lib/cli/configure/processing/module.d.ts +1 -1
  148. package/lib/cli/configure/processing/module.js +1 -1
  149. package/lib/cli/configure/processing/module.js.map +1 -1
  150. package/lib/cli/configure/processing/package.d.ts +1 -1
  151. package/lib/cli/configure/processing/package.js +2 -2
  152. package/lib/cli/configure/processing/package.js.map +1 -1
  153. package/lib/cli/configure/processing/prettier.d.ts +1 -1
  154. package/lib/cli/configure/processing/prettier.js +6 -8
  155. package/lib/cli/configure/processing/prettier.js.map +3 -3
  156. package/lib/cli/configure/processing/typescript.js +1 -1
  157. package/lib/cli/configure/processing/typescript.js.map +1 -1
  158. package/lib/cli/configure/types.d.ts +2 -2
  159. package/lib/cli/configure/types.js.map +1 -1
  160. package/lib/cli/format/index.js +5 -5
  161. package/lib/cli/format/index.js.map +1 -1
  162. package/lib/cli/help/index.js +2 -2
  163. package/lib/cli/help/index.js.map +1 -1
  164. package/lib/cli/init/getConfig.d.ts +3 -3
  165. package/lib/cli/init/getConfig.js +9 -9
  166. package/lib/cli/init/getConfig.js.map +1 -1
  167. package/lib/cli/init/git.js +2 -2
  168. package/lib/cli/init/git.js.map +1 -1
  169. package/lib/cli/init/index.js +15 -15
  170. package/lib/cli/init/index.js.map +1 -1
  171. package/lib/cli/init/prompts.d.ts +1 -1
  172. package/lib/cli/init/prompts.js +2 -2
  173. package/lib/cli/init/prompts.js.map +1 -1
  174. package/lib/cli/init/types.js +2 -2
  175. package/lib/cli/init/types.js.map +1 -1
  176. package/lib/cli/init/writePackageJson.d.ts +1 -1
  177. package/lib/cli/init/writePackageJson.js +2 -2
  178. package/lib/cli/init/writePackageJson.js.map +1 -1
  179. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
  180. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  181. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  182. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -4
  183. package/lib/cli/lint/annotate/buildkite/index.js +5 -5
  184. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  185. package/lib/cli/lint/annotate/buildkite/internal.d.ts +1 -1
  186. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  187. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  188. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
  189. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  190. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  191. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
  192. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  193. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  194. package/lib/cli/lint/annotate/github/eslint.d.ts +2 -2
  195. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  196. package/lib/cli/lint/annotate/github/index.d.ts +4 -4
  197. package/lib/cli/lint/annotate/github/index.js +6 -6
  198. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  199. package/lib/cli/lint/annotate/github/internal.d.ts +2 -2
  200. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  201. package/lib/cli/lint/annotate/github/prettier.d.ts +2 -2
  202. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  203. package/lib/cli/lint/annotate/github/tsc.d.ts +2 -2
  204. package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
  205. package/lib/cli/lint/annotate/index.d.ts +4 -4
  206. package/lib/cli/lint/annotate/index.js +2 -2
  207. package/lib/cli/lint/annotate/index.js.map +1 -1
  208. package/lib/cli/lint/autofix.d.ts +2 -2
  209. package/lib/cli/lint/autofix.js +11 -11
  210. package/lib/cli/lint/autofix.js.map +1 -1
  211. package/lib/cli/lint/eslint.d.ts +2 -2
  212. package/lib/cli/lint/eslint.js +3 -3
  213. package/lib/cli/lint/eslint.js.map +1 -1
  214. package/lib/cli/lint/external.d.ts +3 -3
  215. package/lib/cli/lint/external.js +3 -3
  216. package/lib/cli/lint/external.js.map +1 -1
  217. package/lib/cli/lint/index.js +8 -8
  218. package/lib/cli/lint/index.js.map +1 -1
  219. package/lib/cli/lint/internal.d.ts +1 -1
  220. package/lib/cli/lint/internal.js +5 -5
  221. package/lib/cli/lint/internal.js.map +1 -1
  222. package/lib/cli/lint/internalLints/detectBadCodeowners.d.ts +2 -2
  223. package/lib/cli/lint/internalLints/detectBadCodeowners.js +2 -2
  224. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  225. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +2 -2
  226. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +2 -2
  227. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +1 -1
  228. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +2 -2
  229. package/lib/cli/lint/internalLints/patchRenovateConfig.js +5 -5
  230. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
  231. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +3 -3
  232. package/lib/cli/lint/internalLints/refreshConfigFiles.js +7 -7
  233. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/index.d.ts +3 -3
  235. package/lib/cli/lint/internalLints/upgrade/index.js +4 -4
  236. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +1 -1
  239. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  240. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +1 -1
  241. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +1 -1
  242. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  243. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +1 -1
  244. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +2 -2
  245. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  246. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +1 -1
  247. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +4 -4
  248. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  249. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +1 -1
  250. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +1 -1
  251. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  252. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +1 -1
  253. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +4 -4
  254. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  255. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +1 -1
  256. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +4 -4
  257. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +2 -2
  258. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +1 -1
  259. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +2 -2
  260. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  261. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +1 -1
  262. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +3 -3
  263. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  264. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +1 -1
  265. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +1 -1
  266. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  267. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +1 -1
  268. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +1 -1
  269. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  270. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +1 -1
  271. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +1 -1
  272. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  273. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +1 -1
  274. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +5 -5
  275. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  276. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +1 -1
  277. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +1 -1
  278. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  279. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +1 -1
  280. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +1 -1
  281. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  282. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +1 -1
  283. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +1 -1
  284. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  285. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +1 -1
  286. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +5 -5
  287. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  288. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +1 -1
  289. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +1 -1
  290. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  291. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +1 -1
  292. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +1 -1
  293. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  294. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +1 -1
  295. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +1 -1
  296. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  297. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +1 -1
  298. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +2 -2
  299. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +2 -2
  300. package/lib/cli/lint/prettier.d.ts +2 -2
  301. package/lib/cli/lint/prettier.js +3 -3
  302. package/lib/cli/lint/prettier.js.map +1 -1
  303. package/lib/cli/lint/tsc.d.ts +1 -1
  304. package/lib/cli/lint/tsc.js +1 -1
  305. package/lib/cli/lint/tsc.js.map +1 -1
  306. package/lib/cli/migrate/index.js +2 -2
  307. package/lib/cli/migrate/index.js.map +1 -1
  308. package/lib/cli/migrate/nodeVersion/checks.js +1 -1
  309. package/lib/cli/migrate/nodeVersion/checks.js.map +1 -1
  310. package/lib/cli/migrate/nodeVersion/index.js +3 -3
  311. package/lib/cli/migrate/nodeVersion/index.js.map +1 -1
  312. package/lib/cli/node/index.js +3 -3
  313. package/lib/cli/node/index.js.map +1 -1
  314. package/lib/cli/release/index.js +1 -1
  315. package/lib/cli/release/index.js.map +1 -1
  316. package/lib/cli/start/index.js +4 -4
  317. package/lib/cli/start/index.js.map +1 -1
  318. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  319. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  320. package/lib/cli/test/reporters/github/index.js +5 -5
  321. package/lib/cli/test/reporters/github/index.js.map +2 -2
  322. package/lib/cli/test/reporters/prettier/index.d.ts +4 -0
  323. package/lib/cli/test/reporters/prettier/index.js +67 -0
  324. package/lib/cli/test/reporters/prettier/index.js.map +7 -0
  325. package/lib/cli/version/index.js +2 -2
  326. package/lib/cli/version/index.js.map +1 -1
  327. package/lib/index.d.ts +5 -5
  328. package/lib/index.js +5 -5
  329. package/lib/index.js.map +1 -1
  330. package/lib/skuba.js +8 -8
  331. package/lib/skuba.js.map +1 -1
  332. package/lib/utils/args.js +1 -1
  333. package/lib/utils/args.js.map +1 -1
  334. package/lib/utils/copy.js +2 -2
  335. package/lib/utils/copy.js.map +1 -1
  336. package/lib/utils/dir.js +2 -2
  337. package/lib/utils/dir.js.map +1 -1
  338. package/lib/utils/error.js +2 -2
  339. package/lib/utils/error.js.map +1 -1
  340. package/lib/utils/exec.d.ts +1 -1
  341. package/lib/utils/exec.js +2 -2
  342. package/lib/utils/exec.js.map +1 -1
  343. package/lib/utils/help.js +2 -2
  344. package/lib/utils/help.js.map +1 -1
  345. package/lib/utils/logo.js +3 -3
  346. package/lib/utils/logo.js.map +1 -1
  347. package/lib/utils/manifest.js +1 -1
  348. package/lib/utils/manifest.js.map +1 -1
  349. package/lib/utils/packageManager.js +1 -1
  350. package/lib/utils/packageManager.js.map +1 -1
  351. package/lib/utils/template.js +2 -2
  352. package/lib/utils/template.js.map +1 -1
  353. package/lib/utils/version.js +2 -2
  354. package/lib/utils/version.js.map +1 -1
  355. package/lib/utils/wait.js +2 -2
  356. package/lib/utils/wait.js.map +1 -1
  357. package/lib/utils/worker.d.ts +3 -3
  358. package/lib/utils/worker.js +1 -1
  359. package/lib/utils/worker.js.map +1 -1
  360. package/lib/wrapper/functionHandler.js +3 -3
  361. package/lib/wrapper/functionHandler.js.map +1 -1
  362. package/lib/wrapper/http.js +1 -1
  363. package/lib/wrapper/http.js.map +1 -1
  364. package/lib/wrapper/index.js +3 -3
  365. package/lib/wrapper/index.js.map +1 -1
  366. package/lib/wrapper/main.js +2 -2
  367. package/lib/wrapper/main.js.map +1 -1
  368. package/lib/wrapper/requestListener.js +2 -2
  369. package/lib/wrapper/requestListener.js.map +1 -1
  370. package/package.json +12 -12
  371. package/template/express-rest-api/src/app.test.ts +1 -1
  372. package/template/express-rest-api/src/app.ts +3 -3
  373. package/template/express-rest-api/src/framework/logging.ts +1 -1
  374. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  375. package/template/express-rest-api/src/listen.ts +4 -4
  376. package/template/greeter/package.json +1 -1
  377. package/template/greeter/src/app.test.ts +1 -1
  378. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  379. package/template/koa-rest-api/src/api/index.ts +3 -3
  380. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  381. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  382. package/template/koa-rest-api/src/api/jobs/index.ts +3 -3
  383. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -3
  384. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  385. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  386. package/template/koa-rest-api/src/app.test.ts +2 -2
  387. package/template/koa-rest-api/src/app.ts +3 -3
  388. package/template/koa-rest-api/src/framework/logging.ts +1 -1
  389. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  390. package/template/koa-rest-api/src/framework/server.test.ts +5 -5
  391. package/template/koa-rest-api/src/framework/server.ts +3 -3
  392. package/template/koa-rest-api/src/framework/validation.test.ts +4 -4
  393. package/template/koa-rest-api/src/framework/validation.ts +1 -1
  394. package/template/koa-rest-api/src/listen.ts +4 -4
  395. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  396. package/template/koa-rest-api/src/testing/logging.ts +1 -1
  397. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  398. package/template/koa-rest-api/src/testing/server.ts +1 -1
  399. package/template/koa-rest-api/src/testing/types.ts +1 -1
  400. package/template/koa-rest-api/tsconfig.json +18 -0
  401. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
  402. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  403. package/template/lambda-sqs-worker-cdk/package.json +1 -1
  404. package/template/lambda-sqs-worker-cdk/src/app.test.ts +6 -6
  405. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -7
  406. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +4 -4
  407. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  408. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +1 -1
  409. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  410. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +2 -2
  411. package/template/lambda-sqs-worker-cdk/src/mapping/jobScorer.ts +2 -2
  412. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  413. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +3 -3
  414. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  415. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  416. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +1 -1
  417. package/template/lambda-sqs-worker-cdk/src/testing/logging.ts +1 -1
  418. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  419. package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
  420. package/template/oss-npm-package/src/index.test.ts +1 -1
  421. package/template/private-npm-package/src/index.test.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/buildkite/prettier.ts"],
4
- "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): string[] =>\n !prettier.ok\n ? [\n '**Prettier**',\n Buildkite.md.terminal(\n prettier.result.errored\n .map(({ err, filepath }) =>\n [\n filepath,\n ...(typeof err === 'string' || err instanceof Error\n ? [String(err)]\n : []),\n ].join(' '),\n )\n .join('\\n'),\n ),\n ]\n : [];\n"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite/index.js';\nimport type { PrettierOutput } from '../../../adapter/prettier.js';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): string[] =>\n !prettier.ok\n ? [\n '**Prettier**',\n Buildkite.md.terminal(\n prettier.result.errored\n .map(({ err, filepath }) =>\n [\n filepath,\n ...(typeof err === 'string' || err instanceof Error\n ? [String(err)]\n : []),\n ].join(' '),\n )\n .join('\\n'),\n ),\n ]\n : [];\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CACvC,aAEA,CAAC,SAAS,KACN;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,OAAO,QACb;AAAA,MAAI,CAAC,EAAE,KAAK,SAAS,MACpB;AAAA,QACE;AAAA,QACA,GAAI,OAAO,QAAQ,YAAY,eAAe,QAC1C,CAAC,OAAO,GAAG,CAAC,IACZ,CAAC;AAAA,MACP,EAAE,KAAK,GAAG;AAAA,IACZ,EACC,KAAK,IAAI;AAAA,EACd;AACF,IACA,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { StreamInterceptor } from '../../../lint/external';
1
+ import type { StreamInterceptor } from '../../../lint/external.js';
2
2
  export declare const createTscAnnotations: (tscOk: boolean, tscOutputStream: StreamInterceptor) => string[];
@@ -31,7 +31,7 @@ __export(tsc_exports, {
31
31
  createTscAnnotations: () => createTscAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(tsc_exports);
34
- var Buildkite = __toESM(require("../../../../api/buildkite"));
34
+ var Buildkite = __toESM(require("../../../../api/buildkite/index.js"));
35
35
  const createTscAnnotations = (tscOk, tscOutputStream) => !tscOk ? [
36
36
  "**tsc**",
37
37
  Buildkite.md.terminal(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/buildkite/tsc.ts"],
4
- "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { StreamInterceptor } from '../../../lint/external';\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): string[] =>\n !tscOk\n ? [\n '**tsc**',\n Buildkite.md.terminal(\n tscOutputStream\n .output()\n .split('\\n')\n .filter(Boolean)\n .filter((line) => !line.startsWith('TSFILE: '))\n .join('\\n')\n .trim(),\n ),\n ]\n : [];\n"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite/index.js';\nimport type { StreamInterceptor } from '../../../lint/external.js';\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): string[] =>\n !tscOk\n ? [\n '**tsc**',\n Buildkite.md.terminal(\n tscOutputStream\n .output()\n .split('\\n')\n .filter(Boolean)\n .filter((line) => !line.startsWith('TSFILE: '))\n .join('\\n')\n .trim(),\n ),\n ]\n : [];\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,uBAAuB,CAClC,OACA,oBAEA,CAAC,QACG;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,gBACG,OAAO,EACP,MAAM,IAAI,EACV,OAAO,OAAO,EACd,OAAO,CAAC,SAAS,CAAC,KAAK,WAAW,UAAU,CAAC,EAC7C,KAAK,IAAI,EACT,KAAK;AAAA,EACV;AACF,IACA,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- import type * as GitHub from '../../../../api/github';
2
- import type { ESLintOutput } from '../../../adapter/eslint';
1
+ import type * as GitHub from '../../../../api/github/index.js';
2
+ import type { ESLintOutput } from '../../../adapter/eslint.js';
3
3
  export declare const createEslintAnnotations: (eslint: ESLintOutput) => GitHub.Annotation[];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/github/eslint.ts"],
4
- "sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { ESLintOutput } from '../../../adapter/eslint';\n\nexport const createEslintAnnotations = (\n eslint: ESLintOutput,\n): GitHub.Annotation[] =>\n [...eslint.errors, ...eslint.warnings].flatMap<GitHub.Annotation>((result) =>\n result.messages.map((message): GitHub.Annotation => {\n // Annotations only support start_column and end_column on the same line.\n const isSameLine = message.line === message.endLine;\n const startColumn = isSameLine && message.column;\n const endColumn = (isSameLine && message.endColumn) || startColumn;\n\n return {\n annotation_level: message.severity === 2 ? 'failure' : 'warning',\n start_line: message.line ?? 1,\n end_line: message.endLine ?? message.line ?? 1,\n ...(startColumn && { start_column: startColumn }),\n ...(endColumn && { end_column: endColumn }),\n message: message.message,\n path: result.filePath,\n title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ''}`,\n };\n }),\n );\n"],
4
+ "sourcesContent": ["import type * as GitHub from '../../../../api/github/index.js';\nimport type { ESLintOutput } from '../../../adapter/eslint.js';\n\nexport const createEslintAnnotations = (\n eslint: ESLintOutput,\n): GitHub.Annotation[] =>\n [...eslint.errors, ...eslint.warnings].flatMap<GitHub.Annotation>((result) =>\n result.messages.map((message): GitHub.Annotation => {\n // Annotations only support start_column and end_column on the same line.\n const isSameLine = message.line === message.endLine;\n const startColumn = isSameLine && message.column;\n const endColumn = (isSameLine && message.endColumn) || startColumn;\n\n return {\n annotation_level: message.severity === 2 ? 'failure' : 'warning',\n start_line: message.line ?? 1,\n end_line: message.endLine ?? message.line ?? 1,\n ...(startColumn && { start_column: startColumn }),\n ...(endColumn && { end_column: endColumn }),\n message: message.message,\n path: result.filePath,\n title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ''}`,\n };\n }),\n );\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,CACrC,WAEA,CAAC,GAAG,OAAO,QAAQ,GAAG,OAAO,QAAQ,EAAE;AAAA,EAA2B,CAAC,WACjE,OAAO,SAAS,IAAI,CAAC,YAA+B;AAElD,UAAM,aAAa,QAAQ,SAAS,QAAQ;AAC5C,UAAM,cAAc,cAAc,QAAQ;AAC1C,UAAM,YAAa,cAAc,QAAQ,aAAc;AAEvD,WAAO;AAAA,MACL,kBAAkB,QAAQ,aAAa,IAAI,YAAY;AAAA,MACvD,YAAY,QAAQ,QAAQ;AAAA,MAC5B,UAAU,QAAQ,WAAW,QAAQ,QAAQ;AAAA,MAC7C,GAAI,eAAe,EAAE,cAAc,YAAY;AAAA,MAC/C,GAAI,aAAa,EAAE,YAAY,UAAU;AAAA,MACzC,SAAS,QAAQ;AAAA,MACjB,MAAM,OAAO;AAAA,MACb,OAAO,SAAS,QAAQ,SAAS,KAAK,QAAQ,MAAM,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { ESLintOutput } from '../../../adapter/eslint';
2
- import type { PrettierOutput } from '../../../adapter/prettier';
3
- import type { StreamInterceptor } from '../../../lint/external';
4
- import type { InternalLintResult } from '../../internal';
1
+ import type { ESLintOutput } from '../../../adapter/eslint.js';
2
+ import type { PrettierOutput } from '../../../adapter/prettier.js';
3
+ import type { StreamInterceptor } from '../../../lint/external.js';
4
+ import type { InternalLintResult } from '../../internal.js';
5
5
  export declare const createGitHubAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
@@ -31,12 +31,12 @@ __export(github_exports, {
31
31
  createGitHubAnnotations: () => createGitHubAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(github_exports);
34
- var GitHub = __toESM(require("../../../../api/github"));
35
- var import_environment = require("../../../../api/github/environment");
36
- var import_eslint = require("./eslint");
37
- var import_internal = require("./internal");
38
- var import_prettier = require("./prettier");
39
- var import_tsc = require("./tsc");
34
+ var import_environment = require("../../../../api/github/environment.js");
35
+ var GitHub = __toESM(require("../../../../api/github/index.js"));
36
+ var import_eslint = require("./eslint.js");
37
+ var import_internal = require("./internal.js");
38
+ var import_prettier = require("./prettier.js");
39
+ var import_tsc = require("./tsc.js");
40
40
  const createGitHubAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
41
41
  if (!(0, import_environment.enabledFromEnvironment)()) {
42
42
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/github/index.ts"],
4
- "sourcesContent": ["import * as GitHub from '../../../../api/github';\nimport {\n buildNameFromEnvironment,\n enabledFromEnvironment,\n} from '../../../../api/github/environment';\nimport type { ESLintOutput } from '../../../adapter/eslint';\nimport type { PrettierOutput } from '../../../adapter/prettier';\nimport type { StreamInterceptor } from '../../../lint/external';\nimport type { InternalLintResult } from '../../internal';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createInternalAnnotations } from './internal';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createGitHubAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n) => {\n if (!enabledFromEnvironment()) {\n return;\n }\n\n const annotations: GitHub.Annotation[] = [\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ];\n\n const isOk = eslint.ok && prettier.ok && internal.ok && tscOk;\n\n const summary = isOk\n ? '`skuba lint` passed.'\n : '`skuba lint` found issues that require triage.';\n\n const build = buildNameFromEnvironment();\n\n await GitHub.createCheckRun({\n name: 'skuba/lint',\n summary,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n });\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,yBAGO;AAMP,oBAAwC;AACxC,sBAA0C;AAC1C,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,0BAA0B,OACrC,UACA,QACA,UACA,OACA,oBACG;AACH,MAAI,KAAC,2CAAuB,GAAG;AAC7B;AAAA,EACF;AAEA,QAAM,cAAmC;AAAA,IACvC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD;AAEA,QAAM,OAAO,OAAO,MAAM,SAAS,MAAM,SAAS,MAAM;AAExD,QAAM,UAAU,OACZ,yBACA;AAEJ,QAAM,YAAQ,6CAAyB;AAEvC,QAAM,OAAO,eAAe;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,YAAY,OAAO,YAAY;AAAA,IAC/B,OAAO,GAAG,KAAK,IAAI,OAAO,WAAW,QAAQ;AAAA,EAC/C,CAAC;AACH;",
4
+ "sourcesContent": ["import {\n buildNameFromEnvironment,\n enabledFromEnvironment,\n} from '../../../../api/github/environment.js';\nimport * as GitHub from '../../../../api/github/index.js';\nimport type { ESLintOutput } from '../../../adapter/eslint.js';\nimport type { PrettierOutput } from '../../../adapter/prettier.js';\nimport type { StreamInterceptor } from '../../../lint/external.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nimport { createEslintAnnotations } from './eslint.js';\nimport { createInternalAnnotations } from './internal.js';\nimport { createPrettierAnnotations } from './prettier.js';\nimport { createTscAnnotations } from './tsc.js';\n\nexport const createGitHubAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n) => {\n if (!enabledFromEnvironment()) {\n return;\n }\n\n const annotations: GitHub.Annotation[] = [\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ];\n\n const isOk = eslint.ok && prettier.ok && internal.ok && tscOk;\n\n const summary = isOk\n ? '`skuba lint` passed.'\n : '`skuba lint` found issues that require triage.';\n\n const build = buildNameFromEnvironment();\n\n await GitHub.createCheckRun({\n name: 'skuba/lint',\n summary,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAGO;AACP,aAAwB;AAMxB,oBAAwC;AACxC,sBAA0C;AAC1C,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,0BAA0B,OACrC,UACA,QACA,UACA,OACA,oBACG;AACH,MAAI,KAAC,2CAAuB,GAAG;AAC7B;AAAA,EACF;AAEA,QAAM,cAAmC;AAAA,IACvC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD;AAEA,QAAM,OAAO,OAAO,MAAM,SAAS,MAAM,SAAS,MAAM;AAExD,QAAM,UAAU,OACZ,yBACA;AAEJ,QAAM,YAAQ,6CAAyB;AAEvC,QAAM,OAAO,eAAe;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,YAAY,OAAO,YAAY;AAAA,IAC/B,OAAO,GAAG,KAAK,IAAI,OAAO,WAAW,QAAQ;AAAA,EAC/C,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- import type * as GitHub from '../../../../api/github';
2
- import type { InternalLintResult } from '../../internal';
1
+ import type * as GitHub from '../../../../api/github/index.js';
2
+ import type { InternalLintResult } from '../../internal.js';
3
3
  export declare const createInternalAnnotations: (internal: InternalLintResult) => GitHub.Annotation[];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/github/internal.ts"],
4
- "sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { InternalLintResult } from '../../internal';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): GitHub.Annotation[] =>\n (internal.annotations ?? []).map((annotation) => ({\n annotation_level: 'failure',\n start_line: annotation.start_line ?? 1,\n end_line: annotation.end_line ?? annotation.start_line ?? 1,\n path: annotation.path,\n message: annotation.message,\n title: 'skuba lint',\n }));\n"],
4
+ "sourcesContent": ["import type * as GitHub from '../../../../api/github/index.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): GitHub.Annotation[] =>\n (internal.annotations ?? []).map((annotation) => ({\n annotation_level: 'failure',\n start_line: annotation.start_line ?? 1,\n end_line: annotation.end_line ?? annotation.start_line ?? 1,\n path: annotation.path,\n message: annotation.message,\n title: 'skuba lint',\n }));\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,cAEC,SAAS,eAAe,CAAC,GAAG,IAAI,CAAC,gBAAgB;AAAA,EAChD,kBAAkB;AAAA,EAClB,YAAY,WAAW,cAAc;AAAA,EACrC,UAAU,WAAW,YAAY,WAAW,cAAc;AAAA,EAC1D,MAAM,WAAW;AAAA,EACjB,SAAS,WAAW;AAAA,EACpB,OAAO;AACT,EAAE;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- import type * as GitHub from '../../../../api/github';
2
- import type { PrettierOutput } from '../../../adapter/prettier';
1
+ import type * as GitHub from '../../../../api/github/index.js';
2
+ import type { PrettierOutput } from '../../../adapter/prettier.js';
3
3
  export declare const createPrettierAnnotations: (prettier: PrettierOutput) => GitHub.Annotation[];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/github/prettier.ts"],
4
- "sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { PrettierOutput } from '../../../adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): GitHub.Annotation[] =>\n prettier.result.errored.map((result) => {\n const message =\n result.err instanceof Error ? result.err.message : result.err;\n\n return {\n annotation_level: 'failure',\n start_line: 1,\n end_line: 1,\n path: result.filepath,\n message:\n typeof message === 'string' || message instanceof Error\n ? String(message)\n : 'This file has not been formatted.',\n title: 'Prettier',\n };\n });\n"],
4
+ "sourcesContent": ["import type * as GitHub from '../../../../api/github/index.js';\nimport type { PrettierOutput } from '../../../adapter/prettier.js';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): GitHub.Annotation[] =>\n prettier.result.errored.map((result) => {\n const message =\n result.err instanceof Error ? result.err.message : result.err;\n\n return {\n annotation_level: 'failure',\n start_line: 1,\n end_line: 1,\n path: result.filepath,\n message:\n typeof message === 'string' || message instanceof Error\n ? String(message)\n : 'This file has not been formatted.',\n title: 'Prettier',\n };\n });\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,aAEA,SAAS,OAAO,QAAQ,IAAI,CAAC,WAAW;AACtC,QAAM,UACJ,OAAO,eAAe,QAAQ,OAAO,IAAI,UAAU,OAAO;AAE5D,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,OAAO;AAAA,IACb,SACE,OAAO,YAAY,YAAY,mBAAmB,QAC9C,OAAO,OAAO,IACd;AAAA,IACN,OAAO;AAAA,EACT;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- import type * as GitHub from '../../../../api/github';
2
- import type { StreamInterceptor } from '../../../lint/external';
1
+ import type * as GitHub from '../../../../api/github/index.js';
2
+ import type { StreamInterceptor } from '../../../lint/external.js';
3
3
  export declare const createTscAnnotations: (tscOk: boolean, tscOutputStream: StreamInterceptor) => GitHub.Annotation[];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/github/tsc.ts"],
4
- "sourcesContent": ["import { stripVTControlCharacters as stripAnsi } from 'util';\n\nimport type * as GitHub from '../../../../api/github';\nimport type { StreamInterceptor } from '../../../lint/external';\n\ntype TscLevel = 'error' | 'warning' | 'info';\n\n/**\n * Matches the `tsc \u2502` prefix on each `tsc` log.\n */\n\n/**\n * Matches regular and pretty `tsc` output.\n *\n * For example, given the following input string:\n *\n * ```console\n * src/skuba.ts:43:7 - error TS2769: No overload matches this call.\n * Overload 1 of 2, '(obj: LogContext, msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'LogContext'.\n * Overload 2 of 2, '(msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'string | undefined'.\n * Type 'unknown' is not assignable to type 'string'.\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. src/skuba.ts\n * 2. 43\n * 3. 7\n * 4. error\n * 5. 2769\n * 6. No overload matches this call [...] not assignable to type 'string'.\n */\nconst tscOutputRegex =\n /([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*([\\s\\S]*?)(?=\\n\\S)(?=\\n\\D)/g;\n\nconst annotationLevelMap: Record<\n TscLevel,\n GitHub.Annotation['annotation_level']\n> = {\n error: 'failure',\n warning: 'warning',\n info: 'notice',\n};\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): GitHub.Annotation[] => {\n if (tscOk) {\n return [];\n }\n\n const matches = stripAnsi(tscOutputStream.output()).matchAll(tscOutputRegex);\n return Array.from(matches).flatMap<GitHub.Annotation>((match) =>\n match?.length === 7 && match[1] && match[4] && match[5] && match[6]\n ? {\n annotation_level: annotationLevelMap[match[4] as TscLevel],\n path: match[1],\n start_line: Number(match[2]),\n end_line: Number(match[2]),\n start_column: Number(match[3]),\n end_column: Number(match[3]),\n message: match[6].trim(),\n title: `tsc (TS${match[5]})`,\n }\n : [],\n );\n};\n"],
4
+ "sourcesContent": ["import { stripVTControlCharacters as stripAnsi } from 'util';\n\nimport type * as GitHub from '../../../../api/github/index.js';\nimport type { StreamInterceptor } from '../../../lint/external.js';\n\ntype TscLevel = 'error' | 'warning' | 'info';\n\n/**\n * Matches the `tsc \u2502` prefix on each `tsc` log.\n */\n\n/**\n * Matches regular and pretty `tsc` output.\n *\n * For example, given the following input string:\n *\n * ```console\n * src/skuba.ts:43:7 - error TS2769: No overload matches this call.\n * Overload 1 of 2, '(obj: LogContext, msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'LogContext'.\n * Overload 2 of 2, '(msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'string | undefined'.\n * Type 'unknown' is not assignable to type 'string'.\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. src/skuba.ts\n * 2. 43\n * 3. 7\n * 4. error\n * 5. 2769\n * 6. No overload matches this call [...] not assignable to type 'string'.\n */\nconst tscOutputRegex =\n /([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*([\\s\\S]*?)(?=\\n\\S)(?=\\n\\D)/g;\n\nconst annotationLevelMap: Record<\n TscLevel,\n GitHub.Annotation['annotation_level']\n> = {\n error: 'failure',\n warning: 'warning',\n info: 'notice',\n};\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): GitHub.Annotation[] => {\n if (tscOk) {\n return [];\n }\n\n const matches = stripAnsi(tscOutputStream.output()).matchAll(tscOutputRegex);\n return Array.from(matches).flatMap<GitHub.Annotation>((match) =>\n match?.length === 7 && match[1] && match[4] && match[5] && match[6]\n ? {\n annotation_level: annotationLevelMap[match[4] as TscLevel],\n path: match[1],\n start_line: Number(match[2]),\n end_line: Number(match[2]),\n start_column: Number(match[3]),\n end_column: Number(match[3]),\n message: match[6].trim(),\n title: `tsc (TS${match[5]})`,\n }\n : [],\n );\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsD;AAkCtD,MAAM,iBACJ;AAEF,MAAM,qBAGF;AAAA,EACF,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,uBAAuB,CAClC,OACA,oBACwB;AACxB,MAAI,OAAO;AACT,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,cAAU,YAAAA,0BAAU,gBAAgB,OAAO,CAAC,EAAE,SAAS,cAAc;AAC3E,SAAO,MAAM,KAAK,OAAO,EAAE;AAAA,IAA2B,CAAC,UACrD,OAAO,WAAW,KAAK,MAAM,CAAC,KAAK,MAAM,CAAC,KAAK,MAAM,CAAC,KAAK,MAAM,CAAC,IAC9D;AAAA,MACE,kBAAkB,mBAAmB,MAAM,CAAC,CAAa;AAAA,MACzD,MAAM,MAAM,CAAC;AAAA,MACb,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,MAC3B,UAAU,OAAO,MAAM,CAAC,CAAC;AAAA,MACzB,cAAc,OAAO,MAAM,CAAC,CAAC;AAAA,MAC7B,YAAY,OAAO,MAAM,CAAC,CAAC;AAAA,MAC3B,SAAS,MAAM,CAAC,EAAE,KAAK;AAAA,MACvB,OAAO,UAAU,MAAM,CAAC,CAAC;AAAA,IAC3B,IACA,CAAC;AAAA,EACP;AACF;",
6
6
  "names": ["stripAnsi"]
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { ESLintOutput } from '../../../cli/adapter/eslint';
2
- import type { PrettierOutput } from '../../../cli/adapter/prettier';
3
- import type { StreamInterceptor } from '../external';
4
- import type { InternalLintResult } from '../internal';
1
+ import type { ESLintOutput } from '../../../cli/adapter/eslint.js';
2
+ import type { PrettierOutput } from '../../../cli/adapter/prettier.js';
3
+ import type { StreamInterceptor } from '../external.js';
4
+ import type { InternalLintResult } from '../internal.js';
5
5
  export declare const createAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
@@ -21,8 +21,8 @@ __export(annotate_exports, {
21
21
  createAnnotations: () => createAnnotations
22
22
  });
23
23
  module.exports = __toCommonJS(annotate_exports);
24
- var import_buildkite = require("./buildkite");
25
- var import_github = require("./github");
24
+ var import_buildkite = require("./buildkite/index.js");
25
+ var import_github = require("./github/index.js");
26
26
  const createAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
27
27
  await Promise.all([
28
28
  (0, import_github.createGitHubAnnotations)(internal, eslint, prettier, tscOk, tscOutputStream),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/lint/annotate/index.ts"],
4
- "sourcesContent": ["import type { ESLintOutput } from '../../../cli/adapter/eslint';\nimport type { PrettierOutput } from '../../../cli/adapter/prettier';\nimport type { StreamInterceptor } from '../external';\nimport type { InternalLintResult } from '../internal';\n\nimport { createBuildkiteAnnotations } from './buildkite';\nimport { createGitHubAnnotations } from './github';\n\nexport const createAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n await Promise.all([\n createGitHubAnnotations(internal, eslint, prettier, tscOk, tscOutputStream),\n createBuildkiteAnnotations(\n internal,\n eslint,\n prettier,\n tscOk,\n tscOutputStream,\n ),\n ]);\n};\n"],
4
+ "sourcesContent": ["import type { ESLintOutput } from '../../../cli/adapter/eslint.js';\nimport type { PrettierOutput } from '../../../cli/adapter/prettier.js';\nimport type { StreamInterceptor } from '../external.js';\nimport type { InternalLintResult } from '../internal.js';\n\nimport { createBuildkiteAnnotations } from './buildkite/index.js';\nimport { createGitHubAnnotations } from './github/index.js';\n\nexport const createAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n await Promise.all([\n createGitHubAnnotations(internal, eslint, prettier, tscOk, tscOutputStream),\n createBuildkiteAnnotations(\n internal,\n eslint,\n prettier,\n tscOk,\n tscOutputStream,\n ),\n ]);\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAA2C;AAC3C,oBAAwC;AAEjC,MAAM,oBAAoB,OAC/B,UACA,QACA,UACA,OACA,oBACkB;AAClB,QAAM,QAAQ,IAAI;AAAA,QAChB,uCAAwB,UAAU,QAAQ,UAAU,OAAO,eAAe;AAAA,QAC1E;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import * as Git from '../../api/git';
2
- import type { Input } from './types';
1
+ import * as Git from '../../api/git/index.js';
2
+ import type { Input } from './types.js';
3
3
  export declare const AUTOFIX_IGNORE_FILES_BASE: Git.ChangedFile[];
4
4
  export declare const AUTOFIX_IGNORE_FILES_NPMRC: Git.ChangedFile[];
5
5
  interface AutofixParameters {
@@ -35,17 +35,17 @@ __export(autofix_exports, {
35
35
  module.exports = __toCommonJS(autofix_exports);
36
36
  var import_util = require("util");
37
37
  var import_simple_git = __toESM(require("simple-git"));
38
- var Buildkite = __toESM(require("../../api/buildkite"));
39
- var Git = __toESM(require("../../api/git"));
40
- var GitHub = __toESM(require("../../api/github"));
41
- var import_env = require("../../utils/env");
42
- var import_logging = require("../../utils/logging");
43
- var import_npmrc = require("../../utils/npmrc");
44
- var import_wait = require("../../utils/wait");
45
- var import_eslint = require("../adapter/eslint");
46
- var import_prettier = require("../adapter/prettier");
47
- var import_project = require("../configure/analysis/project");
48
- var import_internal = require("./internal");
38
+ var Buildkite = __toESM(require("../../api/buildkite/index.js"));
39
+ var Git = __toESM(require("../../api/git/index.js"));
40
+ var GitHub = __toESM(require("../../api/github/index.js"));
41
+ var import_env = require("../../utils/env.js");
42
+ var import_logging = require("../../utils/logging.js");
43
+ var import_npmrc = require("../../utils/npmrc.js");
44
+ var import_wait = require("../../utils/wait.js");
45
+ var import_eslint = require("../adapter/eslint.js");
46
+ var import_prettier = require("../adapter/prettier.js");
47
+ var import_project = require("../configure/analysis/project.js");
48
+ var import_internal = require("./internal.js");
49
49
  const RENOVATE_DEFAULT_PREFIX = "renovate";
50
50
  const AUTOFIX_COMMIT_MESSAGE = "Run `skuba format`";
51
51
  const AUTOFIX_IGNORE_FILES_BASE = [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/autofix.ts"],
4
- "sourcesContent": ["import { inspect } from 'util';\n\nimport simpleGit from 'simple-git';\n\nimport * as Buildkite from '../../api/buildkite';\nimport * as Git from '../../api/git';\nimport * as GitHub from '../../api/github';\nimport { isCiEnv } from '../../utils/env';\nimport { createLogger, log } from '../../utils/logging';\nimport { hasNpmrcSecret } from '../../utils/npmrc';\nimport { throwOnTimeout } from '../../utils/wait';\nimport { runESLint } from '../adapter/eslint';\nimport { runPrettier } from '../adapter/prettier';\nimport { createDestinationFileReader } from '../configure/analysis/project';\n\nimport { internalLint } from './internal';\nimport type { Input } from './types';\n\nconst RENOVATE_DEFAULT_PREFIX = 'renovate';\n\nconst AUTOFIX_COMMIT_MESSAGE = 'Run `skuba format`';\n\nexport const AUTOFIX_IGNORE_FILES_BASE: Git.ChangedFile[] = [\n {\n path: 'Dockerfile-incunabulum',\n state: 'added',\n },\n];\n\nexport const AUTOFIX_IGNORE_FILES_NPMRC: Git.ChangedFile[] = [\n {\n path: '.npmrc',\n state: 'added',\n },\n {\n path: '.npmrc',\n state: 'modified',\n },\n];\n\nconst shouldPush = async ({\n currentBranch,\n dir,\n}: {\n currentBranch?: string;\n dir: string;\n}) => {\n if (!isCiEnv()) {\n // We're not running in a CI environment so we don't need to push autofixes.\n // Ideally we'd drive this off of repository write permissions, but that is\n // non-trivial to infer without attempting an actual write.\n return false;\n }\n\n const isDefaultBuildkiteBranch =\n currentBranch &&\n [process.env.BUILDKITE_PIPELINE_DEFAULT_BRANCH, 'master', 'main'].includes(\n currentBranch,\n );\n\n const isProtectedGitHubBranch = process.env.GITHUB_REF_PROTECTED === 'true';\n\n if (isDefaultBuildkiteBranch || isProtectedGitHubBranch) {\n // The current branch is a protected branch.\n // We respect GitHub Flow; avoid pushing directly to the default branch.\n return false;\n }\n\n if (currentBranch?.startsWith(RENOVATE_DEFAULT_PREFIX)) {\n try {\n await GitHub.getPullRequestNumber();\n } catch {\n const warning =\n 'An autofix is available, but it was not pushed because an open pull request for this Renovate branch could not be found. If a pull request has since been created, retry the lint step to push the fix.';\n log.warn(warning);\n try {\n await Buildkite.annotate(Buildkite.md.terminal(warning));\n } catch {}\n\n return false;\n }\n }\n\n let headCommitMessage;\n try {\n headCommitMessage = await Git.getHeadCommitMessage({ dir });\n } catch {}\n\n if (headCommitMessage?.startsWith(AUTOFIX_COMMIT_MESSAGE)) {\n // Short circuit when the head commit appears to be one of our autofixes.\n // Repeating the same operation is unlikely to correct outstanding issues.\n return false;\n }\n\n // Allow the push attempt to go ahead if our guards have been cleared.\n return true;\n};\n\nconst getIgnores = async (dir: string): Promise<Git.ChangedFile[]> => {\n const contents = await createDestinationFileReader(dir)('.npmrc');\n\n // If an .npmrc has secrets, we need to ignore it\n if (hasNpmrcSecret(contents ?? '')) {\n return [...AUTOFIX_IGNORE_FILES_BASE, ...AUTOFIX_IGNORE_FILES_NPMRC];\n }\n\n return AUTOFIX_IGNORE_FILES_BASE;\n};\n\ninterface AutofixParameters {\n debug: Input['debug'];\n\n eslint: boolean;\n prettier: boolean;\n internal: boolean;\n\n eslintConfigFile?: string;\n}\n\nexport const autofix = async (params: AutofixParameters): Promise<void> => {\n const dir = process.cwd();\n\n if (!params.eslint && !params.prettier && !params.internal) {\n return;\n }\n\n let currentBranch;\n try {\n currentBranch = await Git.currentBranch({ dir });\n } catch {}\n\n if (!(await shouldPush({ currentBranch, dir }))) {\n return;\n }\n\n try {\n log.newline();\n\n log.warn(\n `Attempting to autofix issues (${[\n params.eslint ? 'ESLint' : undefined,\n params.internal ? 'skuba' : undefined,\n 'Prettier', // Prettier is always run\n ]\n .filter((s) => s !== undefined)\n .join(', ')})...`,\n );\n\n const logger = createLogger({ debug: params.debug });\n\n if (params.internal) {\n await internalLint('format');\n }\n\n if (params.eslint) {\n await runESLint('format', logger, params.eslintConfigFile);\n }\n\n // Unconditionally re-run Prettier; reaching here means we have pre-existing\n // format violations or may have created new ones through ESLint/internal fixes.\n await runPrettier('format', logger);\n\n if (process.env.GITHUB_ACTIONS) {\n // GitHub runners have Git installed locally\n const ref = await Git.commitAllChanges({\n dir,\n message: AUTOFIX_COMMIT_MESSAGE,\n\n ignore: await getIgnores(dir),\n });\n\n if (!ref) {\n return log.warn('No autofixes detected.');\n }\n\n await throwOnTimeout(simpleGit().push(), { s: 30 });\n log.warn(`Pushed fix commit ${ref}.`);\n return;\n }\n\n // Other CI Environments, use GitHub API\n if (!currentBranch) {\n log.warn('Could not determine the current branch.');\n log.warn(\n 'Please propagate BUILDKITE_BRANCH, GITHUB_HEAD_REF, GITHUB_REF_NAME, or the .git directory to your container.',\n );\n return;\n }\n\n const ref = await throwOnTimeout(\n GitHub.uploadAllFileChanges({\n branch: currentBranch,\n dir,\n messageHeadline: AUTOFIX_COMMIT_MESSAGE,\n\n ignore: await getIgnores(dir),\n }),\n { s: 30 },\n );\n\n if (!ref) {\n return log.warn('No autofixes detected.');\n }\n\n log.warn(`Pushed fix commit ${ref}.`);\n } catch (err) {\n log.warn(log.bold('Failed to push fix commit.'));\n log.warn(\n log.bold(\n 'Does your CI environment have write access to your Git repository?',\n ),\n );\n log.subtle(inspect(err));\n }\n};\n"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport simpleGit from 'simple-git';\n\nimport * as Buildkite from '../../api/buildkite/index.js';\nimport * as Git from '../../api/git/index.js';\nimport * as GitHub from '../../api/github/index.js';\nimport { isCiEnv } from '../../utils/env.js';\nimport { createLogger, log } from '../../utils/logging.js';\nimport { hasNpmrcSecret } from '../../utils/npmrc.js';\nimport { throwOnTimeout } from '../../utils/wait.js';\nimport { runESLint } from '../adapter/eslint.js';\nimport { runPrettier } from '../adapter/prettier.js';\nimport { createDestinationFileReader } from '../configure/analysis/project.js';\n\nimport { internalLint } from './internal.js';\nimport type { Input } from './types.js';\n\nconst RENOVATE_DEFAULT_PREFIX = 'renovate';\n\nconst AUTOFIX_COMMIT_MESSAGE = 'Run `skuba format`';\n\nexport const AUTOFIX_IGNORE_FILES_BASE: Git.ChangedFile[] = [\n {\n path: 'Dockerfile-incunabulum',\n state: 'added',\n },\n];\n\nexport const AUTOFIX_IGNORE_FILES_NPMRC: Git.ChangedFile[] = [\n {\n path: '.npmrc',\n state: 'added',\n },\n {\n path: '.npmrc',\n state: 'modified',\n },\n];\n\nconst shouldPush = async ({\n currentBranch,\n dir,\n}: {\n currentBranch?: string;\n dir: string;\n}) => {\n if (!isCiEnv()) {\n // We're not running in a CI environment so we don't need to push autofixes.\n // Ideally we'd drive this off of repository write permissions, but that is\n // non-trivial to infer without attempting an actual write.\n return false;\n }\n\n const isDefaultBuildkiteBranch =\n currentBranch &&\n [process.env.BUILDKITE_PIPELINE_DEFAULT_BRANCH, 'master', 'main'].includes(\n currentBranch,\n );\n\n const isProtectedGitHubBranch = process.env.GITHUB_REF_PROTECTED === 'true';\n\n if (isDefaultBuildkiteBranch || isProtectedGitHubBranch) {\n // The current branch is a protected branch.\n // We respect GitHub Flow; avoid pushing directly to the default branch.\n return false;\n }\n\n if (currentBranch?.startsWith(RENOVATE_DEFAULT_PREFIX)) {\n try {\n await GitHub.getPullRequestNumber();\n } catch {\n const warning =\n 'An autofix is available, but it was not pushed because an open pull request for this Renovate branch could not be found. If a pull request has since been created, retry the lint step to push the fix.';\n log.warn(warning);\n try {\n await Buildkite.annotate(Buildkite.md.terminal(warning));\n } catch {}\n\n return false;\n }\n }\n\n let headCommitMessage;\n try {\n headCommitMessage = await Git.getHeadCommitMessage({ dir });\n } catch {}\n\n if (headCommitMessage?.startsWith(AUTOFIX_COMMIT_MESSAGE)) {\n // Short circuit when the head commit appears to be one of our autofixes.\n // Repeating the same operation is unlikely to correct outstanding issues.\n return false;\n }\n\n // Allow the push attempt to go ahead if our guards have been cleared.\n return true;\n};\n\nconst getIgnores = async (dir: string): Promise<Git.ChangedFile[]> => {\n const contents = await createDestinationFileReader(dir)('.npmrc');\n\n // If an .npmrc has secrets, we need to ignore it\n if (hasNpmrcSecret(contents ?? '')) {\n return [...AUTOFIX_IGNORE_FILES_BASE, ...AUTOFIX_IGNORE_FILES_NPMRC];\n }\n\n return AUTOFIX_IGNORE_FILES_BASE;\n};\n\ninterface AutofixParameters {\n debug: Input['debug'];\n\n eslint: boolean;\n prettier: boolean;\n internal: boolean;\n\n eslintConfigFile?: string;\n}\n\nexport const autofix = async (params: AutofixParameters): Promise<void> => {\n const dir = process.cwd();\n\n if (!params.eslint && !params.prettier && !params.internal) {\n return;\n }\n\n let currentBranch;\n try {\n currentBranch = await Git.currentBranch({ dir });\n } catch {}\n\n if (!(await shouldPush({ currentBranch, dir }))) {\n return;\n }\n\n try {\n log.newline();\n\n log.warn(\n `Attempting to autofix issues (${[\n params.eslint ? 'ESLint' : undefined,\n params.internal ? 'skuba' : undefined,\n 'Prettier', // Prettier is always run\n ]\n .filter((s) => s !== undefined)\n .join(', ')})...`,\n );\n\n const logger = createLogger({ debug: params.debug });\n\n if (params.internal) {\n await internalLint('format');\n }\n\n if (params.eslint) {\n await runESLint('format', logger, params.eslintConfigFile);\n }\n\n // Unconditionally re-run Prettier; reaching here means we have pre-existing\n // format violations or may have created new ones through ESLint/internal fixes.\n await runPrettier('format', logger);\n\n if (process.env.GITHUB_ACTIONS) {\n // GitHub runners have Git installed locally\n const ref = await Git.commitAllChanges({\n dir,\n message: AUTOFIX_COMMIT_MESSAGE,\n\n ignore: await getIgnores(dir),\n });\n\n if (!ref) {\n return log.warn('No autofixes detected.');\n }\n\n await throwOnTimeout(simpleGit().push(), { s: 30 });\n log.warn(`Pushed fix commit ${ref}.`);\n return;\n }\n\n // Other CI Environments, use GitHub API\n if (!currentBranch) {\n log.warn('Could not determine the current branch.');\n log.warn(\n 'Please propagate BUILDKITE_BRANCH, GITHUB_HEAD_REF, GITHUB_REF_NAME, or the .git directory to your container.',\n );\n return;\n }\n\n const ref = await throwOnTimeout(\n GitHub.uploadAllFileChanges({\n branch: currentBranch,\n dir,\n messageHeadline: AUTOFIX_COMMIT_MESSAGE,\n\n ignore: await getIgnores(dir),\n }),\n { s: 30 },\n );\n\n if (!ref) {\n return log.warn('No autofixes detected.');\n }\n\n log.warn(`Pushed fix commit ${ref}.`);\n } catch (err) {\n log.warn(log.bold('Failed to push fix commit.'));\n log.warn(\n log.bold(\n 'Does your CI environment have write access to your Git repository?',\n ),\n );\n log.subtle(inspect(err));\n }\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,wBAAsB;AAEtB,gBAA2B;AAC3B,UAAqB;AACrB,aAAwB;AACxB,iBAAwB;AACxB,qBAAkC;AAClC,mBAA+B;AAC/B,kBAA+B;AAC/B,oBAA0B;AAC1B,sBAA4B;AAC5B,qBAA4C;AAE5C,sBAA6B;AAG7B,MAAM,0BAA0B;AAEhC,MAAM,yBAAyB;AAExB,MAAM,4BAA+C;AAAA,EAC1D;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF;AAEO,MAAM,6BAAgD;AAAA,EAC3D;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF;AAEA,MAAM,aAAa,OAAO;AAAA,EACxB;AAAA,EACA;AACF,MAGM;AACJ,MAAI,KAAC,oBAAQ,GAAG;AAId,WAAO;AAAA,EACT;AAEA,QAAM,2BACJ,iBACA,CAAC,QAAQ,IAAI,mCAAmC,UAAU,MAAM,EAAE;AAAA,IAChE;AAAA,EACF;AAEF,QAAM,0BAA0B,QAAQ,IAAI,yBAAyB;AAErE,MAAI,4BAA4B,yBAAyB;AAGvD,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,WAAW,uBAAuB,GAAG;AACtD,QAAI;AACF,YAAM,OAAO,qBAAqB;AAAA,IACpC,QAAQ;AACN,YAAM,UACJ;AACF,yBAAI,KAAK,OAAO;AAChB,UAAI;AACF,cAAM,UAAU,SAAS,UAAU,GAAG,SAAS,OAAO,CAAC;AAAA,MACzD,QAAQ;AAAA,MAAC;AAET,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,wBAAoB,MAAM,IAAI,qBAAqB,EAAE,IAAI,CAAC;AAAA,EAC5D,QAAQ;AAAA,EAAC;AAET,MAAI,mBAAmB,WAAW,sBAAsB,GAAG;AAGzD,WAAO;AAAA,EACT;AAGA,SAAO;AACT;AAEA,MAAM,aAAa,OAAO,QAA4C;AACpE,QAAM,WAAW,UAAM,4CAA4B,GAAG,EAAE,QAAQ;AAGhE,UAAI,6BAAe,YAAY,EAAE,GAAG;AAClC,WAAO,CAAC,GAAG,2BAA2B,GAAG,0BAA0B;AAAA,EACrE;AAEA,SAAO;AACT;AAYO,MAAM,UAAU,OAAO,WAA6C;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,CAAC,OAAO,UAAU,CAAC,OAAO,YAAY,CAAC,OAAO,UAAU;AAC1D;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,oBAAgB,MAAM,IAAI,cAAc,EAAE,IAAI,CAAC;AAAA,EACjD,QAAQ;AAAA,EAAC;AAET,MAAI,CAAE,MAAM,WAAW,EAAE,eAAe,IAAI,CAAC,GAAI;AAC/C;AAAA,EACF;AAEA,MAAI;AACF,uBAAI,QAAQ;AAEZ,uBAAI;AAAA,MACF,iCAAiC;AAAA,QAC/B,OAAO,SAAS,WAAW;AAAA,QAC3B,OAAO,WAAW,UAAU;AAAA,QAC5B;AAAA;AAAA,MACF,EACG,OAAO,CAAC,MAAM,MAAM,MAAS,EAC7B,KAAK,IAAI,CAAC;AAAA,IACf;AAEA,UAAM,aAAS,6BAAa,EAAE,OAAO,OAAO,MAAM,CAAC;AAEnD,QAAI,OAAO,UAAU;AACnB,gBAAM,8BAAa,QAAQ;AAAA,IAC7B;AAEA,QAAI,OAAO,QAAQ;AACjB,gBAAM,yBAAU,UAAU,QAAQ,OAAO,gBAAgB;AAAA,IAC3D;AAIA,cAAM,6BAAY,UAAU,MAAM;AAElC,QAAI,QAAQ,IAAI,gBAAgB;AAE9B,YAAMA,OAAM,MAAM,IAAI,iBAAiB;AAAA,QACrC;AAAA,QACA,SAAS;AAAA,QAET,QAAQ,MAAM,WAAW,GAAG;AAAA,MAC9B,CAAC;AAED,UAAI,CAACA,MAAK;AACR,eAAO,mBAAI,KAAK,wBAAwB;AAAA,MAC1C;AAEA,gBAAM,gCAAe,kBAAAC,SAAU,EAAE,KAAK,GAAG,EAAE,GAAG,GAAG,CAAC;AAClD,yBAAI,KAAK,qBAAqBD,IAAG,GAAG;AACpC;AAAA,IACF;AAGA,QAAI,CAAC,eAAe;AAClB,yBAAI,KAAK,yCAAyC;AAClD,yBAAI;AAAA,QACF;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,MAAM,UAAM;AAAA,MAChB,OAAO,qBAAqB;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,QACA,iBAAiB;AAAA,QAEjB,QAAQ,MAAM,WAAW,GAAG;AAAA,MAC9B,CAAC;AAAA,MACD,EAAE,GAAG,GAAG;AAAA,IACV;AAEA,QAAI,CAAC,KAAK;AACR,aAAO,mBAAI,KAAK,wBAAwB;AAAA,IAC1C;AAEA,uBAAI,KAAK,qBAAqB,GAAG,GAAG;AAAA,EACtC,SAAS,KAAK;AACZ,uBAAI,KAAK,mBAAI,KAAK,4BAA4B,CAAC;AAC/C,uBAAI;AAAA,MACF,mBAAI;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AACF;",
6
6
  "names": ["ref", "simpleGit"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import { type ESLintOutput } from '../adapter/eslint';
2
- import type { Input } from './types';
1
+ import { type ESLintOutput } from '../adapter/eslint.js';
2
+ import type { Input } from './types.js';
3
3
  export declare const runESLintInCurrentThread: ({ debug, eslintConfigFile }: Input) => Promise<ESLintOutput>;
4
4
  export declare const runESLintInWorkerThread: (input: Input) => Promise<ESLintOutput>;
@@ -35,9 +35,9 @@ module.exports = __toCommonJS(eslint_exports);
35
35
  var import_path = __toESM(require("path"));
36
36
  var import_worker_threads = require("worker_threads");
37
37
  var import_chalk = __toESM(require("chalk"));
38
- var import_logging = require("../../utils/logging");
39
- var import_worker = require("../../utils/worker");
40
- var import_eslint = require("../adapter/eslint");
38
+ var import_logging = require("../../utils/logging.js");
39
+ var import_worker = require("../../utils/worker.js");
40
+ var import_eslint = require("../adapter/eslint.js");
41
41
  const LOG_PREFIX = import_chalk.default.magenta("ESLint \u2502");
42
42
  const runESLintInCurrentThread = ({ debug, eslintConfigFile }) => (0, import_eslint.runESLint)(
43
43
  "lint",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/eslint.ts"],
4
- "sourcesContent": ["import path from 'path';\nimport { isMainThread } from 'worker_threads';\n\nimport chalk from 'chalk';\n\nimport { createLogger } from '../../utils/logging';\nimport { execWorkerThread, postWorkerOutput } from '../../utils/worker';\nimport { type ESLintOutput, runESLint } from '../adapter/eslint';\n\nimport type { Input } from './types';\n\nconst LOG_PREFIX = chalk.magenta('ESLint \u2502');\n\nexport const runESLintInCurrentThread = ({ debug, eslintConfigFile }: Input) =>\n runESLint(\n 'lint',\n createLogger({ debug, prefixes: [LOG_PREFIX] }),\n eslintConfigFile,\n );\n\nexport const runESLintInWorkerThread = (input: Input) =>\n execWorkerThread<Input, ESLintOutput>(\n path.posix.join(__dirname, 'eslint.js'),\n input,\n );\n\nif (!isMainThread) {\n postWorkerOutput(\n runESLintInCurrentThread,\n createLogger({ debug: false, prefixes: [LOG_PREFIX] }),\n );\n}\n"],
4
+ "sourcesContent": ["import path from 'path';\nimport { isMainThread } from 'worker_threads';\n\nimport chalk from 'chalk';\n\nimport { createLogger } from '../../utils/logging.js';\nimport { execWorkerThread, postWorkerOutput } from '../../utils/worker.js';\nimport { type ESLintOutput, runESLint } from '../adapter/eslint.js';\n\nimport type { Input } from './types.js';\n\nconst LOG_PREFIX = chalk.magenta('ESLint \u2502');\n\nexport const runESLintInCurrentThread = ({ debug, eslintConfigFile }: Input) =>\n runESLint(\n 'lint',\n createLogger({ debug, prefixes: [LOG_PREFIX] }),\n eslintConfigFile,\n );\n\nexport const runESLintInWorkerThread = (input: Input) =>\n execWorkerThread<Input, ESLintOutput>(\n path.posix.join(__dirname, 'eslint.js'),\n input,\n );\n\nif (!isMainThread) {\n postWorkerOutput(\n runESLintInCurrentThread,\n createLogger({ debug: false, prefixes: [LOG_PREFIX] }),\n );\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,4BAA6B;AAE7B,mBAAkB;AAElB,qBAA6B;AAC7B,oBAAmD;AACnD,oBAA6C;AAI7C,MAAM,aAAa,aAAAA,QAAM,QAAQ,iBAAY;AAEtC,MAAM,2BAA2B,CAAC,EAAE,OAAO,iBAAiB,UACjE;AAAA,EACE;AAAA,MACA,6BAAa,EAAE,OAAO,UAAU,CAAC,UAAU,EAAE,CAAC;AAAA,EAC9C;AACF;AAEK,MAAM,0BAA0B,CAAC,cACtC;AAAA,EACE,YAAAC,QAAK,MAAM,KAAK,WAAW,WAAW;AAAA,EACtC;AACF;AAEF,IAAI,CAAC,oCAAc;AACjB;AAAA,IACE;AAAA,QACA,6BAAa,EAAE,OAAO,OAAO,UAAU,CAAC,UAAU,EAAE,CAAC;AAAA,EACvD;AACF;",
6
6
  "names": ["chalk", "path"]
7
7
  }
@@ -1,13 +1,13 @@
1
1
  import stream from 'stream';
2
- import type { Input } from './types';
2
+ import type { Input } from './types.js';
3
3
  export declare class StreamInterceptor extends stream.Transform {
4
4
  private chunks;
5
5
  output(): string;
6
6
  _transform(chunk: Uint8Array, _encoding: BufferEncoding, callback: stream.TransformCallback): void;
7
7
  }
8
8
  export declare const externalLint: (input: Input) => Promise<{
9
- eslint: import("../adapter/eslint").ESLintOutput;
10
- prettier: import("../adapter/prettier").PrettierOutput;
9
+ eslint: import("../adapter/eslint.js").ESLintOutput;
10
+ prettier: import("../adapter/prettier.js").PrettierOutput;
11
11
  tscOk: boolean;
12
12
  tscOutputStream: StreamInterceptor;
13
13
  }>;
@@ -33,9 +33,9 @@ __export(external_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(external_exports);
35
35
  var import_stream = __toESM(require("stream"));
36
- var import_eslint = require("./eslint");
37
- var import_prettier = require("./prettier");
38
- var import_tsc = require("./tsc");
36
+ var import_eslint = require("./eslint.js");
37
+ var import_prettier = require("./prettier.js");
38
+ var import_tsc = require("./tsc.js");
39
39
  const tscPrefixRegex = /^(.*?tsc\s+│.*?\s)/gm;
40
40
  class StreamInterceptor extends import_stream.default.Transform {
41
41
  chunks = [];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/external.ts"],
4
- "sourcesContent": ["import stream from 'stream';\n\nimport { runESLintInCurrentThread, runESLintInWorkerThread } from './eslint';\nimport {\n runPrettierInCurrentThread,\n runPrettierInWorkerThread,\n} from './prettier';\nimport { runTscInNewProcess } from './tsc';\nimport type { Input } from './types';\n\nconst tscPrefixRegex = /^(.*?tsc\\s+\u2502.*?\\s)/gm;\n\nexport class StreamInterceptor extends stream.Transform {\n private chunks: Uint8Array[] = [];\n\n public output() {\n return Buffer.concat(this.chunks).toString().replace(tscPrefixRegex, '');\n }\n\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n this.chunks.push(chunk);\n\n callback(null, chunk);\n }\n}\n\nconst lintConcurrently = async ({ tscOutputStream, ...input }: Input) => {\n const [eslint, prettier, tscOk] = await Promise.all([\n runESLintInWorkerThread(input),\n runPrettierInWorkerThread(input),\n runTscInNewProcess({ ...input, tscOutputStream }),\n ]);\n\n return { eslint, prettier, tscOk };\n};\n\n/**\n * Run linting tools `--serial`ly for resource-constrained environments.\n *\n * Note that we still run ESLint and Prettier in worker threads as a\n * counterintuitive optimisation. Memory can be more readily freed on worker\n * thread exit, which isn't as easy with a monolithic main thread.\n */\nconst lintSerially = async ({ tscOutputStream, ...input }: Input) => {\n const eslint = await runESLintInWorkerThread(input);\n const prettier = await runPrettierInWorkerThread(input);\n const tscOk = await runTscInNewProcess({ ...input, tscOutputStream });\n\n return { eslint, prettier, tscOk };\n};\n\nconst lintSeriallyWithoutWorkerThreads = async (input: Input) => {\n const eslint = await runESLintInCurrentThread(input);\n const prettier = await runPrettierInCurrentThread(input);\n const tscOk = await runTscInNewProcess(input);\n\n return { eslint, prettier, tscOk };\n};\n\nconst selectLintFunction = (input: Input) => {\n if (!input.workerThreads) {\n return lintSeriallyWithoutWorkerThreads;\n }\n\n // `--debug` implies `--serial`.\n const isSerial = input.debug || input.serial;\n\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const externalLint = async (input: Input) => {\n const lint = selectLintFunction(input);\n\n const tscOutputStream = new StreamInterceptor();\n tscOutputStream.pipe(input.tscOutputStream ?? process.stdout);\n\n const { eslint, prettier, tscOk } = await lint({ ...input, tscOutputStream });\n\n return {\n eslint,\n prettier,\n tscOk,\n tscOutputStream,\n };\n};\n"],
4
+ "sourcesContent": ["import stream from 'stream';\n\nimport { runESLintInCurrentThread, runESLintInWorkerThread } from './eslint.js';\nimport {\n runPrettierInCurrentThread,\n runPrettierInWorkerThread,\n} from './prettier.js';\nimport { runTscInNewProcess } from './tsc.js';\nimport type { Input } from './types.js';\n\nconst tscPrefixRegex = /^(.*?tsc\\s+\u2502.*?\\s)/gm;\n\nexport class StreamInterceptor extends stream.Transform {\n private chunks: Uint8Array[] = [];\n\n public output() {\n return Buffer.concat(this.chunks).toString().replace(tscPrefixRegex, '');\n }\n\n _transform(\n chunk: Uint8Array,\n _encoding: BufferEncoding,\n callback: stream.TransformCallback,\n ) {\n this.chunks.push(chunk);\n\n callback(null, chunk);\n }\n}\n\nconst lintConcurrently = async ({ tscOutputStream, ...input }: Input) => {\n const [eslint, prettier, tscOk] = await Promise.all([\n runESLintInWorkerThread(input),\n runPrettierInWorkerThread(input),\n runTscInNewProcess({ ...input, tscOutputStream }),\n ]);\n\n return { eslint, prettier, tscOk };\n};\n\n/**\n * Run linting tools `--serial`ly for resource-constrained environments.\n *\n * Note that we still run ESLint and Prettier in worker threads as a\n * counterintuitive optimisation. Memory can be more readily freed on worker\n * thread exit, which isn't as easy with a monolithic main thread.\n */\nconst lintSerially = async ({ tscOutputStream, ...input }: Input) => {\n const eslint = await runESLintInWorkerThread(input);\n const prettier = await runPrettierInWorkerThread(input);\n const tscOk = await runTscInNewProcess({ ...input, tscOutputStream });\n\n return { eslint, prettier, tscOk };\n};\n\nconst lintSeriallyWithoutWorkerThreads = async (input: Input) => {\n const eslint = await runESLintInCurrentThread(input);\n const prettier = await runPrettierInCurrentThread(input);\n const tscOk = await runTscInNewProcess(input);\n\n return { eslint, prettier, tscOk };\n};\n\nconst selectLintFunction = (input: Input) => {\n if (!input.workerThreads) {\n return lintSeriallyWithoutWorkerThreads;\n }\n\n // `--debug` implies `--serial`.\n const isSerial = input.debug || input.serial;\n\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const externalLint = async (input: Input) => {\n const lint = selectLintFunction(input);\n\n const tscOutputStream = new StreamInterceptor();\n tscOutputStream.pipe(input.tscOutputStream ?? process.stdout);\n\n const { eslint, prettier, tscOk } = await lint({ ...input, tscOutputStream });\n\n return {\n eslint,\n prettier,\n tscOk,\n tscOutputStream,\n };\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AAEnB,oBAAkE;AAClE,sBAGO;AACP,iBAAmC;AAGnC,MAAM,iBAAiB;AAEhB,MAAM,0BAA0B,cAAAA,QAAO,UAAU;AAAA,EAC9C,SAAuB,CAAC;AAAA,EAEzB,SAAS;AACd,WAAO,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,EAAE,QAAQ,gBAAgB,EAAE;AAAA,EACzE;AAAA,EAEA,WACE,OACA,WACA,UACA;AACA,SAAK,OAAO,KAAK,KAAK;AAEtB,aAAS,MAAM,KAAK;AAAA,EACtB;AACF;AAEA,MAAM,mBAAmB,OAAO,EAAE,iBAAiB,GAAG,MAAM,MAAa;AACvE,QAAM,CAAC,QAAQ,UAAU,KAAK,IAAI,MAAM,QAAQ,IAAI;AAAA,QAClD,uCAAwB,KAAK;AAAA,QAC7B,2CAA0B,KAAK;AAAA,QAC/B,+BAAmB,EAAE,GAAG,OAAO,gBAAgB,CAAC;AAAA,EAClD,CAAC;AAED,SAAO,EAAE,QAAQ,UAAU,MAAM;AACnC;AASA,MAAM,eAAe,OAAO,EAAE,iBAAiB,GAAG,MAAM,MAAa;AACnE,QAAM,SAAS,UAAM,uCAAwB,KAAK;AAClD,QAAM,WAAW,UAAM,2CAA0B,KAAK;AACtD,QAAM,QAAQ,UAAM,+BAAmB,EAAE,GAAG,OAAO,gBAAgB,CAAC;AAEpE,SAAO,EAAE,QAAQ,UAAU,MAAM;AACnC;AAEA,MAAM,mCAAmC,OAAO,UAAiB;AAC/D,QAAM,SAAS,UAAM,wCAAyB,KAAK;AACnD,QAAM,WAAW,UAAM,4CAA2B,KAAK;AACvD,QAAM,QAAQ,UAAM,+BAAmB,KAAK;AAE5C,SAAO,EAAE,QAAQ,UAAU,MAAM;AACnC;AAEA,MAAM,qBAAqB,CAAC,UAAiB;AAC3C,MAAI,CAAC,MAAM,eAAe;AACxB,WAAO;AAAA,EACT;AAGA,QAAM,WAAW,MAAM,SAAS,MAAM;AAEtC,SAAO,WAAW,eAAe;AACnC;AAEO,MAAM,eAAe,OAAO,UAAiB;AAClD,QAAM,OAAO,mBAAmB,KAAK;AAErC,QAAM,kBAAkB,IAAI,kBAAkB;AAC9C,kBAAgB,KAAK,MAAM,mBAAmB,QAAQ,MAAM;AAE5D,QAAM,EAAE,QAAQ,UAAU,MAAM,IAAI,MAAM,KAAK,EAAE,GAAG,OAAO,gBAAgB,CAAC;AAE5E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": ["stream"]
7
7
  }
@@ -22,14 +22,14 @@ __export(lint_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(lint_exports);
24
24
  var import_util = require("util");
25
- var import_args = require("../../utils/args");
26
- var import_logging = require("../../utils/logging");
27
- var import_packageManager = require("../../utils/packageManager");
28
- var import_wait = require("../../utils/wait");
29
- var import_annotate = require("./annotate");
30
- var import_autofix = require("./autofix");
31
- var import_external = require("./external");
32
- var import_internal = require("./internal");
25
+ var import_args = require("../../utils/args.js");
26
+ var import_logging = require("../../utils/logging.js");
27
+ var import_packageManager = require("../../utils/packageManager.js");
28
+ var import_wait = require("../../utils/wait.js");
29
+ var import_annotate = require("./annotate/index.js");
30
+ var import_autofix = require("./autofix.js");
31
+ var import_external = require("./external.js");
32
+ var import_internal = require("./internal.js");
33
33
  const lint = async (args = process.argv.slice(2), tscWriteable = void 0, workerThreads = true) => {
34
34
  const opts = {
35
35
  debug: (0, import_args.hasDebugFlag)(args),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/index.ts"],
4
- "sourcesContent": ["import type { Writable } from 'stream';\nimport { inspect } from 'util';\n\nimport { hasDebugFlag, hasSerialFlag } from '../../utils/args';\nimport { log } from '../../utils/logging';\nimport { detectPackageManager } from '../../utils/packageManager';\nimport { throwOnTimeout } from '../../utils/wait';\n\nimport { createAnnotations } from './annotate';\nimport { autofix } from './autofix';\nimport { externalLint } from './external';\nimport { internalLint } from './internal';\nimport type { Input } from './types';\n\nexport const lint = async (\n args = process.argv.slice(2),\n tscWriteable: Writable | undefined = undefined,\n workerThreads = true,\n) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n serial: hasSerialFlag(args),\n tscOutputStream: tscWriteable,\n workerThreads,\n };\n\n const { eslint, prettier, tscOk, tscOutputStream } = await externalLint(opts);\n const internal = await internalLint('lint', opts);\n\n try {\n await throwOnTimeout(\n createAnnotations(internal, eslint, prettier, tscOk, tscOutputStream),\n { s: 30 },\n );\n } catch (err) {\n log.warn('Failed to annotate lint results.');\n log.subtle(inspect(err));\n }\n\n if (!internal.ok || !eslint.ok || !prettier.ok || !tscOk) {\n process.exitCode = 1;\n\n const tools = [\n ...(internal.ok ? [] : ['skuba']),\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ...(tscOk ? [] : ['tsc']),\n ];\n\n log.err(`${tools.join(', ')} found issues that require triage.`);\n\n if (internal.fixable || eslint.fixable || !prettier.ok) {\n const packageManager = await detectPackageManager();\n log.newline();\n log.warn(\n `Try running ${log.bold(\n packageManager.print.exec,\n 'skuba',\n 'format',\n )} to fix them.`,\n );\n }\n }\n\n await autofix({\n debug: opts.debug,\n eslint: eslint.fixable,\n prettier: !prettier.ok,\n internal: internal.fixable,\n });\n};\n"],
4
+ "sourcesContent": ["import type { Writable } from 'stream';\nimport { inspect } from 'util';\n\nimport { hasDebugFlag, hasSerialFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport { throwOnTimeout } from '../../utils/wait.js';\n\nimport { createAnnotations } from './annotate/index.js';\nimport { autofix } from './autofix.js';\nimport { externalLint } from './external.js';\nimport { internalLint } from './internal.js';\nimport type { Input } from './types.js';\n\nexport const lint = async (\n args = process.argv.slice(2),\n tscWriteable: Writable | undefined = undefined,\n workerThreads = true,\n) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n serial: hasSerialFlag(args),\n tscOutputStream: tscWriteable,\n workerThreads,\n };\n\n const { eslint, prettier, tscOk, tscOutputStream } = await externalLint(opts);\n const internal = await internalLint('lint', opts);\n\n try {\n await throwOnTimeout(\n createAnnotations(internal, eslint, prettier, tscOk, tscOutputStream),\n { s: 30 },\n );\n } catch (err) {\n log.warn('Failed to annotate lint results.');\n log.subtle(inspect(err));\n }\n\n if (!internal.ok || !eslint.ok || !prettier.ok || !tscOk) {\n process.exitCode = 1;\n\n const tools = [\n ...(internal.ok ? [] : ['skuba']),\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ...(tscOk ? [] : ['tsc']),\n ];\n\n log.err(`${tools.join(', ')} found issues that require triage.`);\n\n if (internal.fixable || eslint.fixable || !prettier.ok) {\n const packageManager = await detectPackageManager();\n log.newline();\n log.warn(\n `Try running ${log.bold(\n packageManager.print.exec,\n 'skuba',\n 'format',\n )} to fix them.`,\n );\n }\n }\n\n await autofix({\n debug: opts.debug,\n eslint: eslint.fixable,\n prettier: !prettier.ok,\n internal: internal.fixable,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAwB;AAExB,kBAA4C;AAC5C,qBAAoB;AACpB,4BAAqC;AACrC,kBAA+B;AAE/B,sBAAkC;AAClC,qBAAwB;AACxB,sBAA6B;AAC7B,sBAA6B;AAGtB,MAAM,OAAO,OAClB,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,eAAqC,QACrC,gBAAgB,SACb;AACH,QAAM,OAAc;AAAA,IAClB,WAAO,0BAAa,IAAI;AAAA,IACxB,YAAQ,2BAAc,IAAI;AAAA,IAC1B,iBAAiB;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,QAAQ,UAAU,OAAO,gBAAgB,IAAI,UAAM,8BAAa,IAAI;AAC5E,QAAM,WAAW,UAAM,8BAAa,QAAQ,IAAI;AAEhD,MAAI;AACF,cAAM;AAAA,UACJ,mCAAkB,UAAU,QAAQ,UAAU,OAAO,eAAe;AAAA,MACpE,EAAE,GAAG,GAAG;AAAA,IACV;AAAA,EACF,SAAS,KAAK;AACZ,uBAAI,KAAK,kCAAkC;AAC3C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AAEA,MAAI,CAAC,SAAS,MAAM,CAAC,OAAO,MAAM,CAAC,SAAS,MAAM,CAAC,OAAO;AACxD,YAAQ,WAAW;AAEnB,UAAM,QAAQ;AAAA,MACZ,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,OAAO;AAAA,MAC/B,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;AAAA,MAC9B,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,UAAU;AAAA,MAClC,GAAI,QAAQ,CAAC,IAAI,CAAC,KAAK;AAAA,IACzB;AAEA,uBAAI,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC,oCAAoC;AAE/D,QAAI,SAAS,WAAW,OAAO,WAAW,CAAC,SAAS,IAAI;AACtD,YAAM,iBAAiB,UAAM,4CAAqB;AAClD,yBAAI,QAAQ;AACZ,yBAAI;AAAA,QACF,eAAe,mBAAI;AAAA,UACjB,eAAe,MAAM;AAAA,UACrB;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,YAAM,wBAAQ;AAAA,IACZ,OAAO,KAAK;AAAA,IACZ,QAAQ,OAAO;AAAA,IACf,UAAU,CAAC,SAAS;AAAA,IACpB,UAAU,SAAS;AAAA,EACrB,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { Input } from './types';
1
+ import type { Input } from './types.js';
2
2
  export type InternalLintResult = {
3
3
  ok: boolean;
4
4
  fixable: boolean;
@@ -33,11 +33,11 @@ __export(internal_exports, {
33
33
  module.exports = __toCommonJS(internal_exports);
34
34
  var import_util = require("util");
35
35
  var import_chalk = __toESM(require("chalk"));
36
- var import_logging = require("../../utils/logging");
37
- var import_detectBadCodeowners = require("./internalLints/detectBadCodeowners");
38
- var import_noSkubaTemplateJs = require("./internalLints/noSkubaTemplateJs");
39
- var import_refreshConfigFiles = require("./internalLints/refreshConfigFiles");
40
- var import_upgrade = require("./internalLints/upgrade");
36
+ var import_logging = require("../../utils/logging.js");
37
+ var import_detectBadCodeowners = require("./internalLints/detectBadCodeowners.js");
38
+ var import_noSkubaTemplateJs = require("./internalLints/noSkubaTemplateJs.js");
39
+ var import_refreshConfigFiles = require("./internalLints/refreshConfigFiles.js");
40
+ var import_upgrade = require("./internalLints/upgrade/index.js");
41
41
  const lints = [
42
42
  // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling
43
43
  [{ name: "upgrade-skuba", lint: import_upgrade.upgradeSkuba }],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/internal.ts"],
4
- "sourcesContent": ["import { inspect } from 'util';\n\nimport chalk from 'chalk';\n\nimport { type Logger, childLogger, createLogger } from '../../utils/logging';\n\nimport { tryDetectBadCodeowners } from './internalLints/detectBadCodeowners';\nimport { noSkubaTemplateJs } from './internalLints/noSkubaTemplateJs';\nimport { tryRefreshConfigFiles } from './internalLints/refreshConfigFiles';\nimport { upgradeSkuba } from './internalLints/upgrade';\nimport type { Input } from './types';\n\nexport type InternalLintResult = {\n ok: boolean;\n fixable: boolean;\n annotations?: Array<{\n start_line?: number;\n end_line?: number;\n path: string;\n message: string;\n }>;\n};\n\nconst lints: Array<\n Array<{\n name: string;\n lint: (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n ) => Promise<InternalLintResult>;\n }>\n> = [\n // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling\n [{ name: 'upgrade-skuba', lint: upgradeSkuba }],\n [\n { name: 'no-skuba-template-js', lint: noSkubaTemplateJs },\n { name: 'refresh-config-files', lint: tryRefreshConfigFiles },\n { name: 'detect-bad-codeowners', lint: tryDetectBadCodeowners },\n ],\n];\n\nconst lintSerially = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n for (const lintGroup of lints) {\n for (const { lint, name } of lintGroup) {\n results.push(\n await lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n );\n }\n }\n return results;\n};\n\nconst lintConcurrently = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n\n for (const lintGroup of lints) {\n results.push(\n ...(await Promise.all(\n lintGroup.map(({ name, lint }) =>\n lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n ),\n )),\n );\n }\n\n return results;\n};\n\nconst selectLintFunction = (input?: Input) => {\n const isSerial = input?.debug || input?.serial;\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const internalLint = async (\n mode: 'format' | 'lint',\n input?: Input,\n): Promise<InternalLintResult> => {\n const start = process.hrtime.bigint();\n const logger = createLogger({\n debug: input?.debug ?? false,\n prefixes: [...(mode === 'lint' ? [chalk.blueBright('skuba \u2502')] : [])],\n });\n\n try {\n const lint = selectLintFunction(input);\n const results = await lint(mode, logger, input?.additionalFlags ?? []);\n const result = combineResults(results);\n const end = process.hrtime.bigint();\n logger.plain(`Processed skuba lints in ${logger.timing(start, end)}.`);\n return result;\n } catch (err) {\n logger.err(logger.bold('Failed to run skuba lints.'));\n logger.subtle(inspect(err));\n\n process.exitCode = 1;\n\n return { ok: false, fixable: false, annotations: [] };\n }\n};\n\nconst combineResults = (results: InternalLintResult[]): InternalLintResult =>\n results.reduce(\n (cur, next) => ({\n ok: cur.ok && next.ok,\n fixable: cur.fixable || next.fixable,\n annotations: [...(cur.annotations ?? []), ...(next.annotations ?? [])],\n }),\n { ok: true, fixable: false },\n );\n"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport chalk from 'chalk';\n\nimport { type Logger, childLogger, createLogger } from '../../utils/logging.js';\n\nimport { tryDetectBadCodeowners } from './internalLints/detectBadCodeowners.js';\nimport { noSkubaTemplateJs } from './internalLints/noSkubaTemplateJs.js';\nimport { tryRefreshConfigFiles } from './internalLints/refreshConfigFiles.js';\nimport { upgradeSkuba } from './internalLints/upgrade/index.js';\nimport type { Input } from './types.js';\n\nexport type InternalLintResult = {\n ok: boolean;\n fixable: boolean;\n annotations?: Array<{\n start_line?: number;\n end_line?: number;\n path: string;\n message: string;\n }>;\n};\n\nconst lints: Array<\n Array<{\n name: string;\n lint: (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n ) => Promise<InternalLintResult>;\n }>\n> = [\n // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling\n [{ name: 'upgrade-skuba', lint: upgradeSkuba }],\n [\n { name: 'no-skuba-template-js', lint: noSkubaTemplateJs },\n { name: 'refresh-config-files', lint: tryRefreshConfigFiles },\n { name: 'detect-bad-codeowners', lint: tryDetectBadCodeowners },\n ],\n];\n\nconst lintSerially = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n for (const lintGroup of lints) {\n for (const { lint, name } of lintGroup) {\n results.push(\n await lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n );\n }\n }\n return results;\n};\n\nconst lintConcurrently = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n\n for (const lintGroup of lints) {\n results.push(\n ...(await Promise.all(\n lintGroup.map(({ name, lint }) =>\n lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n ),\n )),\n );\n }\n\n return results;\n};\n\nconst selectLintFunction = (input?: Input) => {\n const isSerial = input?.debug || input?.serial;\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const internalLint = async (\n mode: 'format' | 'lint',\n input?: Input,\n): Promise<InternalLintResult> => {\n const start = process.hrtime.bigint();\n const logger = createLogger({\n debug: input?.debug ?? false,\n prefixes: [...(mode === 'lint' ? [chalk.blueBright('skuba \u2502')] : [])],\n });\n\n try {\n const lint = selectLintFunction(input);\n const results = await lint(mode, logger, input?.additionalFlags ?? []);\n const result = combineResults(results);\n const end = process.hrtime.bigint();\n logger.plain(`Processed skuba lints in ${logger.timing(start, end)}.`);\n return result;\n } catch (err) {\n logger.err(logger.bold('Failed to run skuba lints.'));\n logger.subtle(inspect(err));\n\n process.exitCode = 1;\n\n return { ok: false, fixable: false, annotations: [] };\n }\n};\n\nconst combineResults = (results: InternalLintResult[]): InternalLintResult =>\n results.reduce(\n (cur, next) => ({\n ok: cur.ok && next.ok,\n fixable: cur.fixable || next.fixable,\n annotations: [...(cur.annotations ?? []), ...(next.annotations ?? [])],\n }),\n { ok: true, fixable: false },\n );\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,mBAAkB;AAElB,qBAAuD;AAEvD,iCAAuC;AACvC,+BAAkC;AAClC,gCAAsC;AACtC,qBAA6B;AAc7B,MAAM,QASF;AAAA;AAAA,EAEF,CAAC,EAAE,MAAM,iBAAiB,MAAM,4BAAa,CAAC;AAAA,EAC9C;AAAA,IACE,EAAE,MAAM,wBAAwB,MAAM,2CAAkB;AAAA,IACxD,EAAE,MAAM,wBAAwB,MAAM,gDAAsB;AAAA,IAC5D,EAAE,MAAM,yBAAyB,MAAM,kDAAuB;AAAA,EAChE;AACF;AAEA,MAAM,eAAe,OACnB,MACA,QACA,oBACG;AACH,QAAM,UAAgC,CAAC;AACvC,aAAW,aAAa,OAAO;AAC7B,eAAW,EAAE,MAAM,KAAK,KAAK,WAAW;AACtC,cAAQ;AAAA,QACN,MAAM;AAAA,UACJ;AAAA,cACA,4BAAY,QAAQ,EAAE,UAAU,CAAC,aAAAA,QAAM,IAAI,IAAI,CAAC,EAAE,CAAC;AAAA,UACnD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,mBAAmB,OACvB,MACA,QACA,oBACG;AACH,QAAM,UAAgC,CAAC;AAEvC,aAAW,aAAa,OAAO;AAC7B,YAAQ;AAAA,MACN,GAAI,MAAM,QAAQ;AAAA,QAChB,UAAU;AAAA,UAAI,CAAC,EAAE,MAAM,KAAK,MAC1B;AAAA,YACE;AAAA,gBACA,4BAAY,QAAQ,EAAE,UAAU,CAAC,aAAAA,QAAM,IAAI,IAAI,CAAC,EAAE,CAAC;AAAA,YACnD;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,qBAAqB,CAAC,UAAkB;AAC5C,QAAM,WAAW,OAAO,SAAS,OAAO;AACxC,SAAO,WAAW,eAAe;AACnC;AAEO,MAAM,eAAe,OAC1B,MACA,UACgC;AAChC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AACpC,QAAM,aAAS,6BAAa;AAAA,IAC1B,OAAO,OAAO,SAAS;AAAA,IACvB,UAAU,CAAC,GAAI,SAAS,SAAS,CAAC,aAAAA,QAAM,WAAW,iBAAY,CAAC,IAAI,CAAC,CAAE;AAAA,EACzE,CAAC;AAED,MAAI;AACF,UAAM,OAAO,mBAAmB,KAAK;AACrC,UAAM,UAAU,MAAM,KAAK,MAAM,QAAQ,OAAO,mBAAmB,CAAC,CAAC;AACrE,UAAM,SAAS,eAAe,OAAO;AACrC,UAAM,MAAM,QAAQ,OAAO,OAAO;AAClC,WAAO,MAAM,4BAA4B,OAAO,OAAO,OAAO,GAAG,CAAC,GAAG;AACrE,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,WAAO,IAAI,OAAO,KAAK,4BAA4B,CAAC;AACpD,WAAO,WAAO,qBAAQ,GAAG,CAAC;AAE1B,YAAQ,WAAW;AAEnB,WAAO,EAAE,IAAI,OAAO,SAAS,OAAO,aAAa,CAAC,EAAE;AAAA,EACtD;AACF;AAEA,MAAM,iBAAiB,CAAC,YACtB,QAAQ;AAAA,EACN,CAAC,KAAK,UAAU;AAAA,IACd,IAAI,IAAI,MAAM,KAAK;AAAA,IACnB,SAAS,IAAI,WAAW,KAAK;AAAA,IAC7B,aAAa,CAAC,GAAI,IAAI,eAAe,CAAC,GAAI,GAAI,KAAK,eAAe,CAAC,CAAE;AAAA,EACvE;AAAA,EACA,EAAE,IAAI,MAAM,SAAS,MAAM;AAC7B;",
6
6
  "names": ["chalk"]
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { Logger } from '../../../utils/logging';
2
- import type { InternalLintResult } from '../internal';
1
+ import type { Logger } from '../../../utils/logging.js';
2
+ import type { InternalLintResult } from '../internal.js';
3
3
  export declare const detectBadCodeowners: (logger: Logger) => Promise<InternalLintResult>;
4
4
  export declare const tryDetectBadCodeowners: (_mode: "format" | "lint", logger: Logger) => Promise<InternalLintResult>;
@@ -23,8 +23,8 @@ __export(detectBadCodeowners_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(detectBadCodeowners_exports);
25
25
  var import_util = require("util");
26
- var import__ = require("../../..");
27
- var import_project = require("../../configure/analysis/project");
26
+ var import__ = require("../../../index.js");
27
+ var import_project = require("../../configure/analysis/project.js");
28
28
  const detectBadCodeowners = async (logger) => {
29
29
  const gitRoot = await import__.Git.findRoot({ dir: process.cwd() });
30
30
  const reader = (0, import_project.createDestinationFileReader)(gitRoot ?? process.cwd());
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/lint/internalLints/detectBadCodeowners.ts"],
4
- "sourcesContent": ["import { inspect } from 'util';\n\nimport { Git } from '../../..';\nimport type { Logger } from '../../../utils/logging';\nimport { createDestinationFileReader } from '../../configure/analysis/project';\nimport type { InternalLintResult } from '../internal';\n\nexport const detectBadCodeowners = async (\n logger: Logger,\n): Promise<InternalLintResult> => {\n const gitRoot = await Git.findRoot({ dir: process.cwd() });\n const reader = createDestinationFileReader(gitRoot ?? process.cwd());\n\n const annotations = (\n await Promise.all(\n ['.github/CODEOWNERS', 'CODEOWNERS', 'docs/CODEOWNERS'].map(\n async (filename) => {\n const lines = (await reader(filename))?.split('\\n');\n\n if (lines?.some((line) => line.startsWith('- '))) {\n return [\n {\n message:\n 'CODEOWNERS file has a line starting with `- `. This is probably an autoformatting mistake, where your editor thinks this file is a markdown file and is trying to format a list item. Did you mean to use `*` instead?',\n path: filename,\n },\n ];\n }\n\n return [];\n },\n ),\n )\n )\n .flat()\n .toSorted((a, b) => a.path.localeCompare(b.path));\n\n annotations.forEach(({ path, message }) => {\n logger.warn(`${path}: ${message}`);\n });\n\n return {\n ok: annotations.length === 0,\n fixable: false,\n annotations,\n };\n};\n\nexport const tryDetectBadCodeowners = async (\n _mode: 'format' | 'lint',\n logger: Logger,\n): Promise<InternalLintResult> => {\n try {\n return await detectBadCodeowners(logger);\n } catch (err) {\n logger.warn('Failed to detect bad CODEOWNERS.');\n logger.subtle(inspect(err));\n\n return {\n ok: false,\n fixable: false,\n annotations: [],\n };\n }\n};\n"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport { Git } from '../../../index.js';\nimport type { Logger } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\nimport type { InternalLintResult } from '../internal.js';\n\nexport const detectBadCodeowners = async (\n logger: Logger,\n): Promise<InternalLintResult> => {\n const gitRoot = await Git.findRoot({ dir: process.cwd() });\n const reader = createDestinationFileReader(gitRoot ?? process.cwd());\n\n const annotations = (\n await Promise.all(\n ['.github/CODEOWNERS', 'CODEOWNERS', 'docs/CODEOWNERS'].map(\n async (filename) => {\n const lines = (await reader(filename))?.split('\\n');\n\n if (lines?.some((line) => line.startsWith('- '))) {\n return [\n {\n message:\n 'CODEOWNERS file has a line starting with `- `. This is probably an autoformatting mistake, where your editor thinks this file is a markdown file and is trying to format a list item. Did you mean to use `*` instead?',\n path: filename,\n },\n ];\n }\n\n return [];\n },\n ),\n )\n )\n .flat()\n .toSorted((a, b) => a.path.localeCompare(b.path));\n\n annotations.forEach(({ path, message }) => {\n logger.warn(`${path}: ${message}`);\n });\n\n return {\n ok: annotations.length === 0,\n fixable: false,\n annotations,\n };\n};\n\nexport const tryDetectBadCodeowners = async (\n _mode: 'format' | 'lint',\n logger: Logger,\n): Promise<InternalLintResult> => {\n try {\n return await detectBadCodeowners(logger);\n } catch (err) {\n logger.warn('Failed to detect bad CODEOWNERS.');\n logger.subtle(inspect(err));\n\n return {\n ok: false,\n fixable: false,\n annotations: [],\n };\n }\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,eAAoB;AAEpB,qBAA4C;AAGrC,MAAM,sBAAsB,OACjC,WACgC;AAChC,QAAM,UAAU,MAAM,aAAI,SAAS,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC;AACzD,QAAM,aAAS,4CAA4B,WAAW,QAAQ,IAAI,CAAC;AAEnE,QAAM,eACJ,MAAM,QAAQ;AAAA,IACZ,CAAC,sBAAsB,cAAc,iBAAiB,EAAE;AAAA,MACtD,OAAO,aAAa;AAClB,cAAM,SAAS,MAAM,OAAO,QAAQ,IAAI,MAAM,IAAI;AAElD,YAAI,OAAO,KAAK,CAAC,SAAS,KAAK,WAAW,IAAI,CAAC,GAAG;AAChD,iBAAO;AAAA,YACL;AAAA,cACE,SACE;AAAA,cACF,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAEA,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAAA,EACF,GAEC,KAAK,EACL,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAElD,cAAY,QAAQ,CAAC,EAAE,MAAM,QAAQ,MAAM;AACzC,WAAO,KAAK,GAAG,IAAI,KAAK,OAAO,EAAE;AAAA,EACnC,CAAC;AAED,SAAO;AAAA,IACL,IAAI,YAAY,WAAW;AAAA,IAC3B,SAAS;AAAA,IACT;AAAA,EACF;AACF;AAEO,MAAM,yBAAyB,OACpC,OACA,WACgC;AAChC,MAAI;AACF,WAAO,MAAM,oBAAoB,MAAM;AAAA,EACzC,SAAS,KAAK;AACZ,WAAO,KAAK,kCAAkC;AAC9C,WAAO,WAAO,qBAAQ,GAAG,CAAC;AAE1B,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,aAAa,CAAC;AAAA,IAChB;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- import type { Logger } from '../../../utils/logging';
2
- import type { InternalLintResult } from '../internal';
1
+ import type { Logger } from '../../../utils/logging.js';
2
+ import type { InternalLintResult } from '../internal.js';
3
3
  export declare const noSkubaTemplateJs: (_mode: "format" | "lint", logger: Logger) => Promise<InternalLintResult>;
@@ -33,8 +33,8 @@ __export(noSkubaTemplateJs_exports, {
33
33
  module.exports = __toCommonJS(noSkubaTemplateJs_exports);
34
34
  var import_path = __toESM(require("path"));
35
35
  var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_manifest = require("../../../utils/manifest");
37
- var import_packageManager = require("../../../utils/packageManager");
36
+ var import_manifest = require("../../../utils/manifest.js");
37
+ var import_packageManager = require("../../../utils/packageManager.js");
38
38
  const noSkubaTemplateJs = async (_mode, logger) => {
39
39
  const [manifest, packageManager] = await Promise.all([
40
40
  (0, import_manifest.getConsumerManifest)(),