skuba 11.1.0-jest30-20250620003740 → 12.0.0-enable-js-extensions-20250704134302

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 (431) hide show
  1. package/jest/moduleNameMapper.js +4 -1
  2. package/lib/api/buildkite/annotate.js +2 -2
  3. package/lib/api/buildkite/annotate.js.map +1 -1
  4. package/lib/api/buildkite/index.d.ts +3 -3
  5. package/lib/api/buildkite/index.js +2 -2
  6. package/lib/api/buildkite/index.js.map +1 -1
  7. package/lib/api/git/commitAllChanges.d.ts +2 -2
  8. package/lib/api/git/commitAllChanges.js +3 -3
  9. package/lib/api/git/commitAllChanges.js.map +1 -1
  10. package/lib/api/git/getChangedFiles.js +1 -1
  11. package/lib/api/git/getChangedFiles.js.map +1 -1
  12. package/lib/api/git/index.d.ts +12 -12
  13. package/lib/api/git/index.js +11 -11
  14. package/lib/api/git/index.js.map +1 -1
  15. package/lib/api/git/pull.js +2 -2
  16. package/lib/api/git/pull.js.map +1 -1
  17. package/lib/api/git/push.js +2 -2
  18. package/lib/api/git/push.js.map +1 -1
  19. package/lib/api/git/reset.js +1 -1
  20. package/lib/api/git/reset.js.map +1 -1
  21. package/lib/api/github/checkRun.js +4 -4
  22. package/lib/api/github/checkRun.js.map +1 -1
  23. package/lib/api/github/environment.js +1 -1
  24. package/lib/api/github/environment.js.map +1 -1
  25. package/lib/api/github/index.d.ts +7 -7
  26. package/lib/api/github/index.js +6 -6
  27. package/lib/api/github/index.js.map +1 -1
  28. package/lib/api/github/issueComment.js +4 -4
  29. package/lib/api/github/issueComment.js.map +1 -1
  30. package/lib/api/github/pullRequest.js +3 -3
  31. package/lib/api/github/pullRequest.js.map +1 -1
  32. package/lib/api/github/push.d.ts +1 -1
  33. package/lib/api/github/push.js +3 -3
  34. package/lib/api/github/push.js.map +1 -1
  35. package/lib/api/jest/index.js +2 -2
  36. package/lib/api/jest/index.js.map +1 -1
  37. package/lib/api/net/compose.js +1 -1
  38. package/lib/api/net/compose.js.map +1 -1
  39. package/lib/api/net/index.d.ts +1 -1
  40. package/lib/api/net/index.js +1 -1
  41. package/lib/api/net/index.js.map +1 -1
  42. package/lib/api/net/waitFor.d.ts +1 -1
  43. package/lib/api/net/waitFor.js +2 -2
  44. package/lib/api/net/waitFor.js.map +1 -1
  45. package/lib/cli/adapter/eslint.d.ts +1 -1
  46. package/lib/cli/adapter/eslint.js +1 -1
  47. package/lib/cli/adapter/eslint.js.map +1 -1
  48. package/lib/cli/adapter/prettier.d.ts +1 -1
  49. package/lib/cli/adapter/prettier.js +4 -4
  50. package/lib/cli/adapter/prettier.js.map +2 -2
  51. package/lib/cli/build/assets.d.ts +1 -1
  52. package/lib/cli/build/assets.js +4 -4
  53. package/lib/cli/build/assets.js.map +1 -1
  54. package/lib/cli/build/esbuild.js +3 -3
  55. package/lib/cli/build/esbuild.js.map +1 -1
  56. package/lib/cli/build/index.js +6 -6
  57. package/lib/cli/build/index.js.map +1 -1
  58. package/lib/cli/build/tsc.d.ts +1 -1
  59. package/lib/cli/build/tsc.js +2 -2
  60. package/lib/cli/build/tsc.js.map +1 -1
  61. package/lib/cli/buildPackage/index.js +3 -3
  62. package/lib/cli/buildPackage/index.js.map +1 -1
  63. package/lib/cli/configure/analyseConfiguration.d.ts +2 -2
  64. package/lib/cli/configure/analyseConfiguration.js +2 -2
  65. package/lib/cli/configure/analyseConfiguration.js.map +1 -1
  66. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  67. package/lib/cli/configure/analyseDependencies.js +6 -6
  68. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  69. package/lib/cli/configure/analysis/files.js +1 -1
  70. package/lib/cli/configure/analysis/files.js.map +1 -1
  71. package/lib/cli/configure/analysis/git.js +2 -2
  72. package/lib/cli/configure/analysis/git.js.map +1 -1
  73. package/lib/cli/configure/analysis/package.d.ts +1 -1
  74. package/lib/cli/configure/analysis/package.js +2 -2
  75. package/lib/cli/configure/analysis/package.js.map +1 -1
  76. package/lib/cli/configure/analysis/project.d.ts +1 -1
  77. package/lib/cli/configure/analysis/project.js +4 -4
  78. package/lib/cli/configure/analysis/project.js.map +2 -2
  79. package/lib/cli/configure/dependencies/index.d.ts +5 -5
  80. package/lib/cli/configure/dependencies/index.js +5 -5
  81. package/lib/cli/configure/dependencies/index.js.map +1 -1
  82. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -2
  83. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +1 -1
  84. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  85. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -2
  86. package/lib/cli/configure/dependencies/seekKoala.js +1 -1
  87. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  88. package/lib/cli/configure/dependencies/skuba.d.ts +2 -2
  89. package/lib/cli/configure/dependencies/skuba.js +1 -1
  90. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  91. package/lib/cli/configure/dependencies/skubaDeps.d.ts +1 -1
  92. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  93. package/lib/cli/configure/dependencies/skubaDive.d.ts +2 -2
  94. package/lib/cli/configure/dependencies/skubaDive.js +1 -1
  95. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  96. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  97. package/lib/cli/configure/ensureTemplateCompletion.js +6 -6
  98. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  99. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  100. package/lib/cli/configure/getEntryPoint.js +3 -3
  101. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  102. package/lib/cli/configure/getProjectType.d.ts +2 -2
  103. package/lib/cli/configure/getProjectType.js +3 -3
  104. package/lib/cli/configure/getProjectType.js.map +1 -1
  105. package/lib/cli/configure/index.js +14 -14
  106. package/lib/cli/configure/index.js.map +1 -1
  107. package/lib/cli/configure/modules/eslint.d.ts +1 -1
  108. package/lib/cli/configure/modules/eslint.js +4 -4
  109. package/lib/cli/configure/modules/eslint.js.map +1 -1
  110. package/lib/cli/configure/modules/ignore.d.ts +1 -1
  111. package/lib/cli/configure/modules/ignore.js +2 -2
  112. package/lib/cli/configure/modules/ignore.js.map +1 -1
  113. package/lib/cli/configure/modules/index.d.ts +1 -1
  114. package/lib/cli/configure/modules/index.js +10 -10
  115. package/lib/cli/configure/modules/index.js.map +1 -1
  116. package/lib/cli/configure/modules/jest.d.ts +1 -1
  117. package/lib/cli/configure/modules/jest.js +4 -4
  118. package/lib/cli/configure/modules/jest.js.map +1 -1
  119. package/lib/cli/configure/modules/nodemon.d.ts +1 -1
  120. package/lib/cli/configure/modules/nodemon.js +1 -1
  121. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  122. package/lib/cli/configure/modules/package.d.ts +1 -1
  123. package/lib/cli/configure/modules/package.js +4 -4
  124. package/lib/cli/configure/modules/package.js.map +1 -1
  125. package/lib/cli/configure/modules/prettier.d.ts +1 -1
  126. package/lib/cli/configure/modules/prettier.js +4 -4
  127. package/lib/cli/configure/modules/prettier.js.map +1 -1
  128. package/lib/cli/configure/modules/renovate.d.ts +1 -1
  129. package/lib/cli/configure/modules/renovate.js +5 -5
  130. package/lib/cli/configure/modules/renovate.js.map +1 -1
  131. package/lib/cli/configure/modules/serverless.d.ts +1 -1
  132. package/lib/cli/configure/modules/serverless.js.map +1 -1
  133. package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
  134. package/lib/cli/configure/modules/skubaDive.js +4 -4
  135. package/lib/cli/configure/modules/skubaDive.js.map +1 -1
  136. package/lib/cli/configure/modules/tslint.d.ts +1 -1
  137. package/lib/cli/configure/modules/tslint.js +1 -1
  138. package/lib/cli/configure/modules/tslint.js.map +1 -1
  139. package/lib/cli/configure/processing/deleteFiles.d.ts +1 -1
  140. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  141. package/lib/cli/configure/processing/json.js +2 -2
  142. package/lib/cli/configure/processing/json.js.map +1 -1
  143. package/lib/cli/configure/processing/loadFiles.d.ts +1 -1
  144. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  145. package/lib/cli/configure/processing/module.d.ts +1 -1
  146. package/lib/cli/configure/processing/module.js +1 -1
  147. package/lib/cli/configure/processing/module.js.map +1 -1
  148. package/lib/cli/configure/processing/package.d.ts +1 -1
  149. package/lib/cli/configure/processing/package.js +2 -2
  150. package/lib/cli/configure/processing/package.js.map +1 -1
  151. package/lib/cli/configure/processing/prettier.js +1 -1
  152. package/lib/cli/configure/processing/prettier.js.map +1 -1
  153. package/lib/cli/configure/processing/typescript.js +1 -1
  154. package/lib/cli/configure/processing/typescript.js.map +1 -1
  155. package/lib/cli/configure/types.d.ts +2 -2
  156. package/lib/cli/configure/types.js.map +1 -1
  157. package/lib/cli/format/index.js +5 -5
  158. package/lib/cli/format/index.js.map +1 -1
  159. package/lib/cli/help/index.js +2 -2
  160. package/lib/cli/help/index.js.map +1 -1
  161. package/lib/cli/init/getConfig.d.ts +3 -3
  162. package/lib/cli/init/getConfig.js +9 -9
  163. package/lib/cli/init/getConfig.js.map +1 -1
  164. package/lib/cli/init/git.js +2 -2
  165. package/lib/cli/init/git.js.map +1 -1
  166. package/lib/cli/init/index.js +15 -15
  167. package/lib/cli/init/index.js.map +1 -1
  168. package/lib/cli/init/prompts.d.ts +1 -1
  169. package/lib/cli/init/prompts.js +2 -2
  170. package/lib/cli/init/prompts.js.map +1 -1
  171. package/lib/cli/init/types.js +2 -2
  172. package/lib/cli/init/types.js.map +1 -1
  173. package/lib/cli/init/writePackageJson.d.ts +1 -1
  174. package/lib/cli/init/writePackageJson.js +2 -2
  175. package/lib/cli/init/writePackageJson.js.map +1 -1
  176. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
  177. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  178. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  179. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -4
  180. package/lib/cli/lint/annotate/buildkite/index.js +5 -5
  181. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  182. package/lib/cli/lint/annotate/buildkite/internal.d.ts +1 -1
  183. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  184. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  185. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
  186. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  187. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  188. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
  189. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  190. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  191. package/lib/cli/lint/annotate/github/eslint.d.ts +2 -2
  192. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  193. package/lib/cli/lint/annotate/github/index.d.ts +4 -4
  194. package/lib/cli/lint/annotate/github/index.js +6 -6
  195. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  196. package/lib/cli/lint/annotate/github/internal.d.ts +2 -2
  197. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  198. package/lib/cli/lint/annotate/github/prettier.d.ts +2 -2
  199. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  200. package/lib/cli/lint/annotate/github/tsc.d.ts +2 -2
  201. package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
  202. package/lib/cli/lint/annotate/index.d.ts +4 -4
  203. package/lib/cli/lint/annotate/index.js +2 -2
  204. package/lib/cli/lint/annotate/index.js.map +1 -1
  205. package/lib/cli/lint/autofix.d.ts +2 -2
  206. package/lib/cli/lint/autofix.js +11 -11
  207. package/lib/cli/lint/autofix.js.map +1 -1
  208. package/lib/cli/lint/eslint.d.ts +2 -2
  209. package/lib/cli/lint/eslint.js +3 -3
  210. package/lib/cli/lint/eslint.js.map +1 -1
  211. package/lib/cli/lint/external.d.ts +3 -3
  212. package/lib/cli/lint/external.js +3 -3
  213. package/lib/cli/lint/external.js.map +1 -1
  214. package/lib/cli/lint/index.js +8 -8
  215. package/lib/cli/lint/index.js.map +1 -1
  216. package/lib/cli/lint/internal.d.ts +1 -1
  217. package/lib/cli/lint/internal.js +5 -5
  218. package/lib/cli/lint/internal.js.map +1 -1
  219. package/lib/cli/lint/internalLints/detectBadCodeowners.d.ts +2 -2
  220. package/lib/cli/lint/internalLints/detectBadCodeowners.js +2 -2
  221. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  222. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +2 -2
  223. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +2 -2
  224. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +1 -1
  225. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +2 -2
  226. package/lib/cli/lint/internalLints/patchRenovateConfig.js +5 -5
  227. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
  228. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +3 -3
  229. package/lib/cli/lint/internalLints/refreshConfigFiles.js +7 -7
  230. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +1 -1
  231. package/lib/cli/lint/internalLints/upgrade/index.d.ts +3 -3
  232. package/lib/cli/lint/internalLints/upgrade/index.js +4 -4
  233. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +1 -1
  235. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +1 -1
  236. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +1 -1
  239. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  240. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +1 -1
  241. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +2 -2
  242. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  243. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +1 -1
  244. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +4 -4
  245. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  246. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +1 -1
  247. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +1 -1
  248. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  249. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +1 -1
  250. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +4 -4
  251. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  252. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +1 -1
  253. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +4 -4
  254. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +2 -2
  255. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +1 -1
  256. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +2 -2
  257. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  258. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +1 -1
  259. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +3 -3
  260. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  261. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +1 -1
  262. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +1 -1
  263. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  264. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +1 -1
  265. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +1 -1
  266. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  267. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +1 -1
  268. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +1 -1
  269. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  270. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +1 -1
  271. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +5 -5
  272. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  273. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +1 -1
  274. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +1 -1
  275. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  276. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +1 -1
  277. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +1 -1
  278. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  279. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +1 -1
  280. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +1 -1
  281. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  282. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +1 -1
  283. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +5 -5
  284. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  285. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +1 -1
  286. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +1 -1
  287. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  288. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +1 -1
  289. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +1 -1
  290. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  291. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +1 -1
  292. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +1 -1
  293. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  294. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +1 -1
  295. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +2 -2
  296. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +2 -2
  297. package/lib/cli/lint/prettier.d.ts +2 -2
  298. package/lib/cli/lint/prettier.js +3 -3
  299. package/lib/cli/lint/prettier.js.map +1 -1
  300. package/lib/cli/lint/tsc.d.ts +1 -1
  301. package/lib/cli/lint/tsc.js +1 -1
  302. package/lib/cli/lint/tsc.js.map +1 -1
  303. package/lib/cli/migrate/index.js +2 -2
  304. package/lib/cli/migrate/index.js.map +1 -1
  305. package/lib/cli/migrate/nodeVersion/checks.js +1 -1
  306. package/lib/cli/migrate/nodeVersion/checks.js.map +1 -1
  307. package/lib/cli/migrate/nodeVersion/index.js +21 -21
  308. package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
  309. package/lib/cli/node/index.js +3 -3
  310. package/lib/cli/node/index.js.map +1 -1
  311. package/lib/cli/release/index.js +1 -1
  312. package/lib/cli/release/index.js.map +1 -1
  313. package/lib/cli/start/index.js +4 -4
  314. package/lib/cli/start/index.js.map +1 -1
  315. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  316. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  317. package/lib/cli/test/reporters/github/index.js +5 -5
  318. package/lib/cli/test/reporters/github/index.js.map +2 -2
  319. package/lib/cli/version/index.js +2 -2
  320. package/lib/cli/version/index.js.map +1 -1
  321. package/lib/index.d.ts +5 -5
  322. package/lib/index.js +5 -5
  323. package/lib/index.js.map +1 -1
  324. package/lib/skuba.js +8 -8
  325. package/lib/skuba.js.map +1 -1
  326. package/lib/utils/args.js +1 -1
  327. package/lib/utils/args.js.map +1 -1
  328. package/lib/utils/copy.js +2 -2
  329. package/lib/utils/copy.js.map +1 -1
  330. package/lib/utils/dir.js +2 -2
  331. package/lib/utils/dir.js.map +1 -1
  332. package/lib/utils/error.js +2 -2
  333. package/lib/utils/error.js.map +1 -1
  334. package/lib/utils/exec.d.ts +1 -1
  335. package/lib/utils/exec.js +2 -2
  336. package/lib/utils/exec.js.map +1 -1
  337. package/lib/utils/help.js +2 -2
  338. package/lib/utils/help.js.map +1 -1
  339. package/lib/utils/logo.js +3 -3
  340. package/lib/utils/logo.js.map +1 -1
  341. package/lib/utils/manifest.js +1 -1
  342. package/lib/utils/manifest.js.map +1 -1
  343. package/lib/utils/packageManager.js +1 -1
  344. package/lib/utils/packageManager.js.map +1 -1
  345. package/lib/utils/template.js +2 -2
  346. package/lib/utils/template.js.map +1 -1
  347. package/lib/utils/version.js +2 -2
  348. package/lib/utils/version.js.map +1 -1
  349. package/lib/utils/wait.js +2 -2
  350. package/lib/utils/wait.js.map +1 -1
  351. package/lib/utils/worker.d.ts +3 -3
  352. package/lib/utils/worker.js +1 -1
  353. package/lib/utils/worker.js.map +1 -1
  354. package/lib/wrapper/functionHandler.js +3 -3
  355. package/lib/wrapper/functionHandler.js.map +1 -1
  356. package/lib/wrapper/http.js +1 -1
  357. package/lib/wrapper/http.js.map +1 -1
  358. package/lib/wrapper/index.js +3 -3
  359. package/lib/wrapper/index.js.map +1 -1
  360. package/lib/wrapper/main.js +2 -2
  361. package/lib/wrapper/main.js.map +1 -1
  362. package/lib/wrapper/requestListener.js +2 -2
  363. package/lib/wrapper/requestListener.js.map +1 -1
  364. package/package.json +15 -15
  365. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  366. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  367. package/template/express-rest-api/package.json +1 -1
  368. package/template/express-rest-api/src/app.test.ts +1 -1
  369. package/template/express-rest-api/src/app.ts +3 -3
  370. package/template/express-rest-api/src/framework/logging.ts +1 -1
  371. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  372. package/template/express-rest-api/src/listen.ts +4 -4
  373. package/template/greeter/.buildkite/pipeline.yml +1 -1
  374. package/template/greeter/Dockerfile +1 -1
  375. package/template/greeter/package.json +2 -2
  376. package/template/greeter/src/app.test.ts +1 -1
  377. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  378. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  379. package/template/koa-rest-api/package.json +7 -7
  380. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  381. package/template/koa-rest-api/src/api/index.ts +3 -3
  382. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  383. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  384. package/template/koa-rest-api/src/api/jobs/index.ts +3 -3
  385. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +4 -4
  386. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  387. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  388. package/template/koa-rest-api/src/app.test.ts +2 -2
  389. package/template/koa-rest-api/src/app.ts +3 -3
  390. package/template/koa-rest-api/src/config.ts +1 -1
  391. package/template/koa-rest-api/src/framework/logging.ts +22 -13
  392. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  393. package/template/koa-rest-api/src/framework/server.test.ts +95 -64
  394. package/template/koa-rest-api/src/framework/server.ts +3 -3
  395. package/template/koa-rest-api/src/framework/validation.test.ts +35 -35
  396. package/template/koa-rest-api/src/framework/validation.ts +15 -22
  397. package/template/koa-rest-api/src/listen.ts +4 -4
  398. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  399. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  400. package/template/koa-rest-api/src/testing/server.ts +1 -1
  401. package/template/koa-rest-api/src/testing/types.ts +2 -2
  402. package/template/koa-rest-api/src/types/jobs.ts +1 -1
  403. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  404. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  405. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +6 -0
  406. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
  407. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  408. package/template/lambda-sqs-worker-cdk/package.json +5 -5
  409. package/template/lambda-sqs-worker-cdk/src/app.test.ts +81 -22
  410. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -7
  411. package/template/lambda-sqs-worker-cdk/src/config.ts +1 -1
  412. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +38 -18
  413. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  414. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -12
  415. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  416. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +8 -11
  417. package/template/lambda-sqs-worker-cdk/src/framework/validation.ts +3 -7
  418. package/template/lambda-sqs-worker-cdk/src/mapping/jobScorer.ts +2 -2
  419. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  420. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +3 -3
  421. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  422. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  423. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +1 -1
  424. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  425. package/template/lambda-sqs-worker-cdk/src/testing/types.ts +2 -2
  426. package/template/lambda-sqs-worker-cdk/src/types/jobScorer.ts +1 -1
  427. package/template/lambda-sqs-worker-cdk/src/types/pipelineEvents.ts +1 -1
  428. package/template/oss-npm-package/src/index.test.ts +1 -1
  429. package/template/private-npm-package/src/index.test.ts +1 -1
  430. package/template/koa-rest-api/src/testing/logging.ts +0 -16
  431. package/template/lambda-sqs-worker-cdk/src/testing/logging.ts +0 -19
@@ -32,11 +32,11 @@ __export(format_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(format_exports);
34
34
  var import_chalk = __toESM(require("chalk"));
35
- var import_args = require("../../utils/args");
36
- var import_logging = require("../../utils/logging");
37
- var import_eslint = require("../adapter/eslint");
38
- var import_prettier = require("../adapter/prettier");
39
- var import_internal = require("../lint/internal");
35
+ var import_args = require("../../utils/args.js");
36
+ var import_logging = require("../../utils/logging.js");
37
+ var import_eslint = require("../adapter/eslint.js");
38
+ var import_prettier = require("../adapter/prettier.js");
39
+ var import_internal = require("../lint/internal.js");
40
40
  const format = async (args = process.argv.slice(2), overrideConfigFile) => {
41
41
  const debug = (0, import_args.hasDebugFlag)(args);
42
42
  import_logging.log.plain(import_chalk.default.blueBright("skuba lints"));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/format/index.ts"],
4
- "sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../../utils/args';\nimport { createLogger, log } from '../../utils/logging';\nimport { runESLint } from '../adapter/eslint';\nimport { runPrettier } from '../adapter/prettier';\nimport { internalLint } from '../lint/internal';\n\nexport const format = async (\n args = process.argv.slice(2),\n overrideConfigFile?: string,\n): Promise<void> => {\n const debug = hasDebugFlag(args);\n\n log.plain(chalk.blueBright('skuba lints'));\n\n const internal = await internalLint('format', {\n debug,\n additionalFlags: args.includes('--force-apply-all-patches')\n ? ['--force-apply-all-patches']\n : [],\n serial: true,\n });\n\n const logger = createLogger({ debug });\n\n log.newline();\n log.plain(chalk.magenta('ESLint'));\n\n const eslint = await runESLint('format', logger, overrideConfigFile);\n\n log.newline();\n log.plain(chalk.cyan('Prettier'));\n\n const prettier = await runPrettier('format', logger);\n\n if (eslint.ok && prettier.ok && internal.ok) {\n return;\n }\n\n const tools = [\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ...(internal.ok ? [] : ['skuba']),\n ];\n\n log.newline();\n log.err(tools.join(', '), 'found issues that require triage.');\n\n process.exitCode = 1;\n};\n"],
4
+ "sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { createLogger, log } from '../../utils/logging.js';\nimport { runESLint } from '../adapter/eslint.js';\nimport { runPrettier } from '../adapter/prettier.js';\nimport { internalLint } from '../lint/internal.js';\n\nexport const format = async (\n args = process.argv.slice(2),\n overrideConfigFile?: string,\n): Promise<void> => {\n const debug = hasDebugFlag(args);\n\n log.plain(chalk.blueBright('skuba lints'));\n\n const internal = await internalLint('format', {\n debug,\n additionalFlags: args.includes('--force-apply-all-patches')\n ? ['--force-apply-all-patches']\n : [],\n serial: true,\n });\n\n const logger = createLogger({ debug });\n\n log.newline();\n log.plain(chalk.magenta('ESLint'));\n\n const eslint = await runESLint('format', logger, overrideConfigFile);\n\n log.newline();\n log.plain(chalk.cyan('Prettier'));\n\n const prettier = await runPrettier('format', logger);\n\n if (eslint.ok && prettier.ok && internal.ok) {\n return;\n }\n\n const tools = [\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ...(internal.ok ? [] : ['skuba']),\n ];\n\n log.newline();\n log.err(tools.join(', '), 'found issues that require triage.');\n\n process.exitCode = 1;\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAkC;AAClC,oBAA0B;AAC1B,sBAA4B;AAC5B,sBAA6B;AAEtB,MAAM,SAAS,OACpB,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,uBACkB;AAClB,QAAM,YAAQ,0BAAa,IAAI;AAE/B,qBAAI,MAAM,aAAAA,QAAM,WAAW,aAAa,CAAC;AAEzC,QAAM,WAAW,UAAM,8BAAa,UAAU;AAAA,IAC5C;AAAA,IACA,iBAAiB,KAAK,SAAS,2BAA2B,IACtD,CAAC,2BAA2B,IAC5B,CAAC;AAAA,IACL,QAAQ;AAAA,EACV,CAAC;AAED,QAAM,aAAS,6BAAa,EAAE,MAAM,CAAC;AAErC,qBAAI,QAAQ;AACZ,qBAAI,MAAM,aAAAA,QAAM,QAAQ,QAAQ,CAAC;AAEjC,QAAM,SAAS,UAAM,yBAAU,UAAU,QAAQ,kBAAkB;AAEnE,qBAAI,QAAQ;AACZ,qBAAI,MAAM,aAAAA,QAAM,KAAK,UAAU,CAAC;AAEhC,QAAM,WAAW,UAAM,6BAAY,UAAU,MAAM;AAEnD,MAAI,OAAO,MAAM,SAAS,MAAM,SAAS,IAAI;AAC3C;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;AAAA,IAC9B,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,UAAU;AAAA,IAClC,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,OAAO;AAAA,EACjC;AAEA,qBAAI,QAAQ;AACZ,qBAAI,IAAI,MAAM,KAAK,IAAI,GAAG,mCAAmC;AAE7D,UAAQ,WAAW;AACrB;",
6
6
  "names": ["chalk"]
7
7
  }
@@ -21,8 +21,8 @@ __export(help_exports, {
21
21
  help: () => help
22
22
  });
23
23
  module.exports = __toCommonJS(help_exports);
24
- var import_help = require("../../utils/help");
25
- var import_logo = require("../../utils/logo");
24
+ var import_help = require("../../utils/help.js");
25
+ var import_logo = require("../../utils/logo.js");
26
26
  const help = async () => {
27
27
  await (0, import_logo.showLogoAndVersionInfo)();
28
28
  (0, import_help.showHelp)();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/help/index.ts"],
4
- "sourcesContent": ["import { showHelp } from '../../utils/help';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\n\nexport const help = async () => {\n await showLogoAndVersionInfo();\n\n showHelp();\n};\n"],
4
+ "sourcesContent": ["import { showHelp } from '../../utils/help.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\n\nexport const help = async () => {\n await showLogoAndVersionInfo();\n\n showHelp();\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AACzB,kBAAuC;AAEhC,MAAM,OAAO,YAAY;AAC9B,YAAM,oCAAuB;AAE7B,4BAAS;AACX;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
- import { type TemplateConfig } from '../../utils/template';
2
- import { type Choice } from './prompts';
3
- import { type InitConfig } from './types';
1
+ import { type TemplateConfig } from '../../utils/template.js';
2
+ import { type Choice } from './prompts.js';
3
+ import { type InitConfig } from './types.js';
4
4
  export declare const runForm: <T = Record<string, string>>(props: {
5
5
  choices: readonly Choice[];
6
6
  message: string;
@@ -39,15 +39,15 @@ var import_path = __toESM(require("path"));
39
39
  var import_chalk = __toESM(require("chalk"));
40
40
  var import_enquirer = require("enquirer");
41
41
  var import_fs_extra = __toESM(require("fs-extra"));
42
- var import_copy = require("../../utils/copy");
43
- var import_error = require("../../utils/error");
44
- var import_logging = require("../../utils/logging");
45
- var import_packageManager = require("../../utils/packageManager");
46
- var import_port = require("../../utils/port");
47
- var import_template = require("../../utils/template");
48
- var import_git = require("./git");
49
- var import_prompts = require("./prompts");
50
- var import_types = require("./types");
42
+ var import_copy = require("../../utils/copy.js");
43
+ var import_error = require("../../utils/error.js");
44
+ var import_logging = require("../../utils/logging.js");
45
+ var import_packageManager = require("../../utils/packageManager.js");
46
+ var import_port = require("../../utils/port.js");
47
+ var import_template = require("../../utils/template.js");
48
+ var import_git = require("./git.js");
49
+ var import_prompts = require("./prompts.js");
50
+ var import_types = require("./types.js");
51
51
  const runForm = (props) => {
52
52
  const { message, name } = props;
53
53
  const choices = props.choices.map((choice) => ({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/getConfig.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport { Form, type FormChoice } from 'enquirer';\nimport fs from 'fs-extra';\n\nimport { copyFiles } from '../../utils/copy';\nimport { isErrorWithCode } from '../../utils/error';\nimport { log } from '../../utils/logging';\nimport {\n DEFAULT_PACKAGE_MANAGER,\n configForPackageManager,\n} from '../../utils/packageManager';\nimport { getRandomPort } from '../../utils/port';\nimport {\n TEMPLATE_CONFIG_FILENAME,\n TEMPLATE_DIR,\n type TemplateConfig,\n templateConfigSchema,\n} from '../../utils/template';\n\nimport { downloadGitHubTemplate } from './git';\nimport {\n BASE_PROMPT_PROPS,\n type BaseFields,\n type Choice,\n GIT_PATH_PROMPT,\n SHOULD_CONTINUE_PROMPT,\n TEMPLATE_PROMPT,\n} from './prompts';\nimport { type InitConfig, initConfigInputSchema } from './types';\n\nexport const runForm = <T = Record<string, string>>(props: {\n choices: readonly Choice[];\n message: string;\n name: string;\n}) => {\n const { message, name } = props;\n\n const choices = props.choices.map((choice) => ({\n ...choice,\n validate: (value: string | undefined) => {\n if (\n !value ||\n value === '' ||\n (value === choice.initial && !choice.allowInitial)\n ) {\n return 'Form is not complete';\n }\n\n return choice.validate?.(value) ?? true;\n },\n }));\n\n const form = new Form<T>({\n choices,\n message,\n name,\n validate: async (values) => {\n const results = await Promise.all(\n choices.map((choice) => choice.validate(values[choice.name])),\n );\n\n return (\n results.find((result) => typeof result === 'string') ??\n results.every((result) => result === true)\n );\n },\n });\n\n return form.run();\n};\n\nconst confirmShouldContinue = async (choices: readonly FormChoice[]) => {\n const fieldsList = choices.map((choice) => choice.message);\n\n log.newline();\n log.plain('This template uses the following information:');\n log.newline();\n fieldsList.forEach((message) => log.subtle(`- ${message}`));\n\n log.newline();\n const result = await SHOULD_CONTINUE_PROMPT.run();\n\n return result === 'yes';\n};\n\nconst createDirectory = async (dir: string) => {\n try {\n await fs.promises.mkdir(dir);\n } catch (err) {\n if (isErrorWithCode(err, 'EEXIST')) {\n log.err(`The directory '${dir}' already exists.`);\n process.exit(1);\n }\n\n throw err;\n }\n};\n\nconst cloneTemplate = async (\n templateName: string,\n destinationDir: string,\n): Promise<TemplateConfig> => {\n const isCustomTemplate = templateName.startsWith('github:');\n\n if (isCustomTemplate) {\n const gitHubPath = templateName.slice('github:'.length);\n\n await downloadGitHubTemplate(gitHubPath, destinationDir);\n } else {\n const templateDir = path.join(TEMPLATE_DIR, templateName);\n\n await copyFiles({\n // assume built-in templates have no extraneous files\n include: () => true,\n sourceRoot: templateDir,\n destinationRoot: destinationDir,\n processors: [],\n // built-in templates have files like _package.json\n stripUnderscorePrefix: true,\n });\n }\n\n const templateConfig = getTemplateConfig(\n path.join(process.cwd(), destinationDir),\n );\n\n if (isCustomTemplate) {\n log.newline();\n log.warn(\n 'You may need to run',\n log.bold(\n configForPackageManager(templateConfig.packageManager).print.exec,\n 'skuba',\n 'configure',\n ),\n 'once this is done.',\n );\n }\n\n return templateConfig;\n};\n\nconst getTemplateName = async () => {\n const templateSelection = await TEMPLATE_PROMPT.run();\n\n if (templateSelection === 'github \u2192') {\n const gitHubPath = await GIT_PATH_PROMPT.run();\n return `github:${gitHubPath}`;\n }\n\n return templateSelection;\n};\n\nconst generatePlaceholders = (choices: FormChoice[]) =>\n Object.fromEntries(\n choices.map(({ name }) => [name, `<%- ${name} %>`] as const),\n );\n\nexport const getTemplateConfig = (dir: string): TemplateConfig => {\n const templateConfigPath = path.join(dir, TEMPLATE_CONFIG_FILENAME);\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const templateConfig = require(templateConfigPath) as unknown;\n\n return templateConfigSchema.parse(templateConfig);\n } catch (err) {\n if (isErrorWithCode(err, 'MODULE_NOT_FOUND')) {\n return {\n entryPoint: undefined,\n fields: [],\n packageManager: DEFAULT_PACKAGE_MANAGER,\n type: undefined,\n };\n }\n\n throw err;\n }\n};\n\nconst baseToTemplateData = async ({\n ownerName,\n platformName,\n repoName,\n defaultBranch,\n}: BaseFields) => {\n const [orgName, teamName] = ownerName.split('/');\n\n const port = String(await getRandomPort());\n\n if (!orgName) {\n throw new Error(`Invalid format for owner name: ${ownerName}`);\n }\n\n return {\n orgName,\n ownerName,\n repoName,\n defaultBranch,\n // Use standalone username in `teamName` contexts\n teamName: teamName ?? orgName,\n\n port,\n\n platformName,\n lambdaCdkArchitecture: platformName === 'amd64' ? 'X86_64' : 'ARM_64',\n lambdaServerlessArchitecture:\n platformName === 'amd64' ? 'x86_64' : platformName,\n };\n};\n\nexport const configureFromPrompt = async (): Promise<InitConfig> => {\n const { ownerName, platformName, repoName, defaultBranch } =\n await runForm<BaseFields>(BASE_PROMPT_PROPS);\n log.plain(chalk.cyan(repoName), 'by', chalk.cyan(ownerName));\n\n const templateData = await baseToTemplateData({\n ownerName,\n platformName,\n repoName,\n defaultBranch,\n });\n\n const destinationDir = repoName;\n\n await createDirectory(destinationDir);\n\n log.newline();\n const templateName = await getTemplateName();\n\n const { entryPoint, fields, noSkip, packageManager, type } =\n await cloneTemplate(templateName, destinationDir);\n\n if (fields.length === 0) {\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: true,\n templateData,\n templateName,\n type,\n };\n }\n\n const shouldContinue = noSkip ? true : await confirmShouldContinue(fields);\n\n if (shouldContinue) {\n log.newline();\n const customAnswers = await runForm({\n choices: fields,\n message: chalk.bold(`Complete ${chalk.cyan(templateName)}:`),\n name: 'customAnswers',\n });\n\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: true,\n templateData: { ...templateData, ...customAnswers },\n templateName,\n type,\n };\n }\n\n log.newline();\n log.warn(\n `Resume this later with ${chalk.bold(\n configForPackageManager(packageManager).print.exec,\n 'skuba configure',\n )}.`,\n );\n\n const customAnswers = generatePlaceholders(fields);\n\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: false,\n templateData: { ...templateData, ...customAnswers },\n templateName,\n type,\n };\n};\n\nexport const readJSONFromStdIn = async () => {\n let text = '';\n\n await new Promise((resolve) =>\n process.stdin\n .on('data', (chunk) => (text += chunk.toString()))\n .once('end', resolve),\n );\n\n text = text.trim();\n\n if (text === '') {\n log.err('No data from stdin.');\n process.exit(1);\n }\n\n let value: unknown;\n\n try {\n value = JSON.parse(text) as unknown;\n } catch {\n log.err('Invalid JSON from stdin.');\n process.exit(1);\n }\n\n return value;\n};\n\nconst configureFromPipe = async (): Promise<InitConfig> => {\n const value = await readJSONFromStdIn();\n\n const result = initConfigInputSchema.safeParse(value);\n\n if (!result.success) {\n log.err('Invalid data from stdin:');\n log.err(result.error);\n process.exit(1);\n }\n\n const { destinationDir, templateComplete, templateName } = result.data;\n\n const templateData = {\n ...(await baseToTemplateData(result.data.templateData)),\n ...result.data.templateData,\n };\n\n await createDirectory(destinationDir);\n\n const { entryPoint, fields, noSkip, packageManager, type } =\n await cloneTemplate(templateName, destinationDir);\n\n if (!templateComplete) {\n if (noSkip) {\n log.err('Templating for', log.bold(templateName), 'cannot be skipped.');\n process.exit(1);\n }\n\n return {\n ...result.data,\n entryPoint,\n packageManager,\n templateData: {\n ...templateData,\n ...generatePlaceholders(fields),\n },\n type,\n };\n }\n\n const required = fields.map(({ name }) => name);\n\n const provided = new Set(Object.keys(templateData));\n\n const missing = required.filter((name) => !provided.has(name));\n\n if (missing.length > 0) {\n log.err('This template uses the following information:');\n log.newline();\n missing.forEach((name) => log.err(`- ${name}`));\n process.exit(1);\n }\n\n return {\n ...result.data,\n entryPoint,\n packageManager,\n templateData,\n type,\n };\n};\n\nexport const getConfig = () =>\n process.stdin.isTTY ? configureFromPrompt() : configureFromPipe();\n"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport { Form, type FormChoice } from 'enquirer';\nimport fs from 'fs-extra';\n\nimport { copyFiles } from '../../utils/copy.js';\nimport { isErrorWithCode } from '../../utils/error.js';\nimport { log } from '../../utils/logging.js';\nimport {\n DEFAULT_PACKAGE_MANAGER,\n configForPackageManager,\n} from '../../utils/packageManager.js';\nimport { getRandomPort } from '../../utils/port.js';\nimport {\n TEMPLATE_CONFIG_FILENAME,\n TEMPLATE_DIR,\n type TemplateConfig,\n templateConfigSchema,\n} from '../../utils/template.js';\n\nimport { downloadGitHubTemplate } from './git.js';\nimport {\n BASE_PROMPT_PROPS,\n type BaseFields,\n type Choice,\n GIT_PATH_PROMPT,\n SHOULD_CONTINUE_PROMPT,\n TEMPLATE_PROMPT,\n} from './prompts.js';\nimport { type InitConfig, initConfigInputSchema } from './types.js';\n\nexport const runForm = <T = Record<string, string>>(props: {\n choices: readonly Choice[];\n message: string;\n name: string;\n}) => {\n const { message, name } = props;\n\n const choices = props.choices.map((choice) => ({\n ...choice,\n validate: (value: string | undefined) => {\n if (\n !value ||\n value === '' ||\n (value === choice.initial && !choice.allowInitial)\n ) {\n return 'Form is not complete';\n }\n\n return choice.validate?.(value) ?? true;\n },\n }));\n\n const form = new Form<T>({\n choices,\n message,\n name,\n validate: async (values) => {\n const results = await Promise.all(\n choices.map((choice) => choice.validate(values[choice.name])),\n );\n\n return (\n results.find((result) => typeof result === 'string') ??\n results.every((result) => result === true)\n );\n },\n });\n\n return form.run();\n};\n\nconst confirmShouldContinue = async (choices: readonly FormChoice[]) => {\n const fieldsList = choices.map((choice) => choice.message);\n\n log.newline();\n log.plain('This template uses the following information:');\n log.newline();\n fieldsList.forEach((message) => log.subtle(`- ${message}`));\n\n log.newline();\n const result = await SHOULD_CONTINUE_PROMPT.run();\n\n return result === 'yes';\n};\n\nconst createDirectory = async (dir: string) => {\n try {\n await fs.promises.mkdir(dir);\n } catch (err) {\n if (isErrorWithCode(err, 'EEXIST')) {\n log.err(`The directory '${dir}' already exists.`);\n process.exit(1);\n }\n\n throw err;\n }\n};\n\nconst cloneTemplate = async (\n templateName: string,\n destinationDir: string,\n): Promise<TemplateConfig> => {\n const isCustomTemplate = templateName.startsWith('github:');\n\n if (isCustomTemplate) {\n const gitHubPath = templateName.slice('github:'.length);\n\n await downloadGitHubTemplate(gitHubPath, destinationDir);\n } else {\n const templateDir = path.join(TEMPLATE_DIR, templateName);\n\n await copyFiles({\n // assume built-in templates have no extraneous files\n include: () => true,\n sourceRoot: templateDir,\n destinationRoot: destinationDir,\n processors: [],\n // built-in templates have files like _package.json\n stripUnderscorePrefix: true,\n });\n }\n\n const templateConfig = getTemplateConfig(\n path.join(process.cwd(), destinationDir),\n );\n\n if (isCustomTemplate) {\n log.newline();\n log.warn(\n 'You may need to run',\n log.bold(\n configForPackageManager(templateConfig.packageManager).print.exec,\n 'skuba',\n 'configure',\n ),\n 'once this is done.',\n );\n }\n\n return templateConfig;\n};\n\nconst getTemplateName = async () => {\n const templateSelection = await TEMPLATE_PROMPT.run();\n\n if (templateSelection === 'github \u2192') {\n const gitHubPath = await GIT_PATH_PROMPT.run();\n return `github:${gitHubPath}`;\n }\n\n return templateSelection;\n};\n\nconst generatePlaceholders = (choices: FormChoice[]) =>\n Object.fromEntries(\n choices.map(({ name }) => [name, `<%- ${name} %>`] as const),\n );\n\nexport const getTemplateConfig = (dir: string): TemplateConfig => {\n const templateConfigPath = path.join(dir, TEMPLATE_CONFIG_FILENAME);\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const templateConfig = require(templateConfigPath) as unknown;\n\n return templateConfigSchema.parse(templateConfig);\n } catch (err) {\n if (isErrorWithCode(err, 'MODULE_NOT_FOUND')) {\n return {\n entryPoint: undefined,\n fields: [],\n packageManager: DEFAULT_PACKAGE_MANAGER,\n type: undefined,\n };\n }\n\n throw err;\n }\n};\n\nconst baseToTemplateData = async ({\n ownerName,\n platformName,\n repoName,\n defaultBranch,\n}: BaseFields) => {\n const [orgName, teamName] = ownerName.split('/');\n\n const port = String(await getRandomPort());\n\n if (!orgName) {\n throw new Error(`Invalid format for owner name: ${ownerName}`);\n }\n\n return {\n orgName,\n ownerName,\n repoName,\n defaultBranch,\n // Use standalone username in `teamName` contexts\n teamName: teamName ?? orgName,\n\n port,\n\n platformName,\n lambdaCdkArchitecture: platformName === 'amd64' ? 'X86_64' : 'ARM_64',\n lambdaServerlessArchitecture:\n platformName === 'amd64' ? 'x86_64' : platformName,\n };\n};\n\nexport const configureFromPrompt = async (): Promise<InitConfig> => {\n const { ownerName, platformName, repoName, defaultBranch } =\n await runForm<BaseFields>(BASE_PROMPT_PROPS);\n log.plain(chalk.cyan(repoName), 'by', chalk.cyan(ownerName));\n\n const templateData = await baseToTemplateData({\n ownerName,\n platformName,\n repoName,\n defaultBranch,\n });\n\n const destinationDir = repoName;\n\n await createDirectory(destinationDir);\n\n log.newline();\n const templateName = await getTemplateName();\n\n const { entryPoint, fields, noSkip, packageManager, type } =\n await cloneTemplate(templateName, destinationDir);\n\n if (fields.length === 0) {\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: true,\n templateData,\n templateName,\n type,\n };\n }\n\n const shouldContinue = noSkip ? true : await confirmShouldContinue(fields);\n\n if (shouldContinue) {\n log.newline();\n const customAnswers = await runForm({\n choices: fields,\n message: chalk.bold(`Complete ${chalk.cyan(templateName)}:`),\n name: 'customAnswers',\n });\n\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: true,\n templateData: { ...templateData, ...customAnswers },\n templateName,\n type,\n };\n }\n\n log.newline();\n log.warn(\n `Resume this later with ${chalk.bold(\n configForPackageManager(packageManager).print.exec,\n 'skuba configure',\n )}.`,\n );\n\n const customAnswers = generatePlaceholders(fields);\n\n return {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete: false,\n templateData: { ...templateData, ...customAnswers },\n templateName,\n type,\n };\n};\n\nexport const readJSONFromStdIn = async () => {\n let text = '';\n\n await new Promise((resolve) =>\n process.stdin\n .on('data', (chunk) => (text += chunk.toString()))\n .once('end', resolve),\n );\n\n text = text.trim();\n\n if (text === '') {\n log.err('No data from stdin.');\n process.exit(1);\n }\n\n let value: unknown;\n\n try {\n value = JSON.parse(text) as unknown;\n } catch {\n log.err('Invalid JSON from stdin.');\n process.exit(1);\n }\n\n return value;\n};\n\nconst configureFromPipe = async (): Promise<InitConfig> => {\n const value = await readJSONFromStdIn();\n\n const result = initConfigInputSchema.safeParse(value);\n\n if (!result.success) {\n log.err('Invalid data from stdin:');\n log.err(result.error);\n process.exit(1);\n }\n\n const { destinationDir, templateComplete, templateName } = result.data;\n\n const templateData = {\n ...(await baseToTemplateData(result.data.templateData)),\n ...result.data.templateData,\n };\n\n await createDirectory(destinationDir);\n\n const { entryPoint, fields, noSkip, packageManager, type } =\n await cloneTemplate(templateName, destinationDir);\n\n if (!templateComplete) {\n if (noSkip) {\n log.err('Templating for', log.bold(templateName), 'cannot be skipped.');\n process.exit(1);\n }\n\n return {\n ...result.data,\n entryPoint,\n packageManager,\n templateData: {\n ...templateData,\n ...generatePlaceholders(fields),\n },\n type,\n };\n }\n\n const required = fields.map(({ name }) => name);\n\n const provided = new Set(Object.keys(templateData));\n\n const missing = required.filter((name) => !provided.has(name));\n\n if (missing.length > 0) {\n log.err('This template uses the following information:');\n log.newline();\n missing.forEach((name) => log.err(`- ${name}`));\n process.exit(1);\n }\n\n return {\n ...result.data,\n entryPoint,\n packageManager,\n templateData,\n type,\n };\n};\n\nexport const getConfig = () =>\n process.stdin.isTTY ? configureFromPrompt() : configureFromPipe();\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAsC;AACtC,sBAAe;AAEf,kBAA0B;AAC1B,mBAAgC;AAChC,qBAAoB;AACpB,4BAGO;AACP,kBAA8B;AAC9B,sBAKO;AAEP,iBAAuC;AACvC,qBAOO;AACP,mBAAuD;AAEhD,MAAM,UAAU,CAA6B,UAI9C;AACJ,QAAM,EAAE,SAAS,KAAK,IAAI;AAE1B,QAAM,UAAU,MAAM,QAAQ,IAAI,CAAC,YAAY;AAAA,IAC7C,GAAG;AAAA,IACH,UAAU,CAAC,UAA8B;AACvC,UACE,CAAC,SACD,UAAU,MACT,UAAU,OAAO,WAAW,CAAC,OAAO,cACrC;AACA,eAAO;AAAA,MACT;AAEA,aAAO,OAAO,WAAW,KAAK,KAAK;AAAA,IACrC;AAAA,EACF,EAAE;AAEF,QAAM,OAAO,IAAI,qBAAQ;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,OAAO,WAAW;AAC1B,YAAM,UAAU,MAAM,QAAQ;AAAA,QAC5B,QAAQ,IAAI,CAAC,WAAW,OAAO,SAAS,OAAO,OAAO,IAAI,CAAC,CAAC;AAAA,MAC9D;AAEA,aACE,QAAQ,KAAK,CAAC,WAAW,OAAO,WAAW,QAAQ,KACnD,QAAQ,MAAM,CAAC,WAAW,WAAW,IAAI;AAAA,IAE7C;AAAA,EACF,CAAC;AAED,SAAO,KAAK,IAAI;AAClB;AAEA,MAAM,wBAAwB,OAAO,YAAmC;AACtE,QAAM,aAAa,QAAQ,IAAI,CAAC,WAAW,OAAO,OAAO;AAEzD,qBAAI,QAAQ;AACZ,qBA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MAAM;AAAA,MAChC;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,WAAW,OAAO,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI;AAE9C,QAAM,WAAW,IAAI,IAAI,OAAO,KAAK,YAAY,CAAC;AAElD,QAAM,UAAU,SAAS,OAAO,CAAC,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC;AAE7D,MAAI,QAAQ,SAAS,GAAG;AACtB,uBAAI,IAAI,+CAA+C;AACvD,uBAAI,QAAQ;AACZ,YAAQ,QAAQ,CAAC,SAAS,mBAAI,IAAI,KAAK,IAAI,EAAE,CAAC;AAC9C,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,GAAG,OAAO;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,YAAY,MACvB,QAAQ,MAAM,QAAQ,oBAAoB,IAAI,kBAAkB;",
6
6
  "names": ["fs", "path", "chalk", "customAnswers"]
7
7
  }
@@ -36,8 +36,8 @@ var import_path = __toESM(require("path"));
36
36
  var import_fs_extra = __toESM(require("fs-extra"));
37
37
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
38
38
  var import_simple_git = __toESM(require("simple-git"));
39
- var Git = __toESM(require("../../api/git"));
40
- var import_logging = require("../../utils/logging");
39
+ var Git = __toESM(require("../../api/git/index.js"));
40
+ var import_logging = require("../../utils/logging.js");
41
41
  const initialiseRepo = async (dir, { orgName, repoName, defaultBranch }) => {
42
42
  await import_isomorphic_git.default.init({
43
43
  defaultBranch,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/git.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport simpleGit from 'simple-git';\n\nimport * as Git from '../../api/git';\nimport { log } from '../../utils/logging';\n\ninterface GitHubProject {\n orgName: string;\n repoName: string;\n defaultBranch: string;\n}\n\nexport const initialiseRepo = async (\n dir: string,\n { orgName, repoName, defaultBranch }: GitHubProject,\n) => {\n await git.init({\n defaultBranch,\n dir,\n fs,\n });\n\n await Git.commit({\n dir,\n message: 'Initial commit',\n });\n\n await git.addRemote({\n dir,\n fs,\n remote: 'origin',\n url: `git@github.com:${orgName}/${repoName}.git`,\n });\n};\n\nexport const downloadGitHubTemplate = async (\n gitHubPath: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain('Downloading', log.bold(gitHubPath), 'from GitHub...');\n\n await simpleGit().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [\n '--depth=1',\n '--quiet',\n ]);\n\n await fs.promises.rm(path.join(destinationDir, '.git'), {\n force: true,\n recursive: true,\n });\n};\n"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport simpleGit from 'simple-git';\n\nimport * as Git from '../../api/git/index.js';\nimport { log } from '../../utils/logging.js';\n\ninterface GitHubProject {\n orgName: string;\n repoName: string;\n defaultBranch: string;\n}\n\nexport const initialiseRepo = async (\n dir: string,\n { orgName, repoName, defaultBranch }: GitHubProject,\n) => {\n await git.init({\n defaultBranch,\n dir,\n fs,\n });\n\n await Git.commit({\n dir,\n message: 'Initial commit',\n });\n\n await git.addRemote({\n dir,\n fs,\n remote: 'origin',\n url: `git@github.com:${orgName}/${repoName}.git`,\n });\n};\n\nexport const downloadGitHubTemplate = async (\n gitHubPath: string,\n destinationDir: string,\n) => {\n log.newline();\n log.plain('Downloading', log.bold(gitHubPath), 'from GitHub...');\n\n await simpleGit().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [\n '--depth=1',\n '--quiet',\n ]);\n\n await fs.promises.rm(path.join(destinationDir, '.git'), {\n force: true,\n recursive: true,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAChB,wBAAsB;AAEtB,UAAqB;AACrB,qBAAoB;AAQb,MAAM,iBAAiB,OAC5B,KACA,EAAE,SAAS,UAAU,cAAc,MAChC;AACH,QAAM,sBAAAA,QAAI,KAAK;AAAA,IACb;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,EACF,CAAC;AAED,QAAM,IAAI,OAAO;AAAA,IACf;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,QAAM,sBAAAD,QAAI,UAAU;AAAA,IAClB;AAAA,IACA,oBAAAC;AAAA,IACA,QAAQ;AAAA,IACR,KAAK,kBAAkB,OAAO,IAAI,QAAQ;AAAA,EAC5C,CAAC;AACH;AAEO,MAAM,yBAAyB,OACpC,YACA,mBACG;AACH,qBAAI,QAAQ;AACZ,qBAAI,MAAM,eAAe,mBAAI,KAAK,UAAU,GAAG,gBAAgB;AAE/D,YAAM,kBAAAC,SAAU,EAAE,MAAM,kBAAkB,UAAU,QAAQ,gBAAgB;AAAA,IAC1E;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,gBAAAD,QAAG,SAAS,GAAG,YAAAE,QAAK,KAAK,gBAAgB,MAAM,GAAG;AAAA,IACtD,OAAO;AAAA,IACP,WAAW;AAAA,EACb,CAAC;AACH;",
6
6
  "names": ["git", "fs", "simpleGit", "path"]
7
7
  }
@@ -33,21 +33,21 @@ __export(init_exports, {
33
33
  module.exports = __toCommonJS(init_exports);
34
34
  var import_path = __toESM(require("path"));
35
35
  var import_util = require("util");
36
- var import_git = require("../../api/git");
37
- var import_args = require("../../utils/args");
38
- var import_copy = require("../../utils/copy");
39
- var import_dir = require("../../utils/dir");
40
- var import_exec = require("../../utils/exec");
41
- var import_logging = require("../../utils/logging");
42
- var import_logo = require("../../utils/logo");
43
- var import_manifest = require("../../utils/manifest");
44
- var import_packageManager = require("../../utils/packageManager");
45
- var import_template = require("../../utils/template");
46
- var import_prettier = require("../adapter/prettier");
47
- var import_patchRenovateConfig = require("../lint/internalLints/patchRenovateConfig");
48
- var import_getConfig = require("./getConfig");
49
- var import_git2 = require("./git");
50
- var import_writePackageJson = require("./writePackageJson");
36
+ var import_git = require("../../api/git/index.js");
37
+ var import_args = require("../../utils/args.js");
38
+ var import_copy = require("../../utils/copy.js");
39
+ var import_dir = require("../../utils/dir.js");
40
+ var import_exec = require("../../utils/exec.js");
41
+ var import_logging = require("../../utils/logging.js");
42
+ var import_logo = require("../../utils/logo.js");
43
+ var import_manifest = require("../../utils/manifest.js");
44
+ var import_packageManager = require("../../utils/packageManager.js");
45
+ var import_template = require("../../utils/template.js");
46
+ var import_prettier = require("../adapter/prettier.js");
47
+ var import_patchRenovateConfig = require("../lint/internalLints/patchRenovateConfig.js");
48
+ var import_getConfig = require("./getConfig.js");
49
+ var import_git2 = require("./git.js");
50
+ var import_writePackageJson = require("./writePackageJson.js");
51
51
  const init = async (args = process.argv.slice(2)) => {
52
52
  const opts = {
53
53
  debug: (0, import_args.hasDebugFlag)(args)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/index.ts"],
4
- "sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { commitAllChanges } from '../../api/git';\nimport { hasDebugFlag } from '../../utils/args';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { createLogger, log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport { getConsumerManifest } from '../../utils/manifest';\nimport { detectPackageManager } from '../../utils/packageManager';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { runPrettier } from '../adapter/prettier';\nimport { tryPatchRenovateConfig } from '../lint/internalLints/patchRenovateConfig';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport type { Input } from './types';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async (args = process.argv.slice(2)) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n };\n\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n const {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n await ensureCommands(packageManager);\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _eslint.config.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: packageManager,\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n const [manifest, packageManagerConfig] = await Promise.all([\n getConsumerManifest(destinationDir),\n detectPackageManager(destinationDir),\n ]);\n\n if (!manifest) {\n throw new Error(\"Repository doesn't contain a package.json file.\");\n }\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig({\n mode: 'format',\n dir: destinationDir,\n manifest,\n packageManager: packageManagerConfig,\n });\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n // The `-D` shorthand is portable across our package managers.\n await exec(packageManager, 'add', '-D', skubaSlug);\n\n // Templating can initially leave certain files in an unformatted state;\n // consider a Markdown table with columns sized based on content length.\n await runPrettier(\n 'format',\n createLogger({ debug: opts.debug }),\n destinationDir,\n );\n\n depsInstalled = true;\n } catch (err) {\n log.warn(inspect(err));\n }\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n // The `-D` shorthand is portable across our package managers.\n log.ok(packageManager, 'add', '-D', skubaSlug);\n log.ok(packageManager, 'run', 'format');\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n};\n"],
4
+ "sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { commitAllChanges } from '../../api/git/index.js';\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy.js';\nimport { createInclusionFilter } from '../../utils/dir.js';\nimport { createExec, ensureCommands } from '../../utils/exec.js';\nimport { createLogger, log } from '../../utils/logging.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\nimport { getConsumerManifest } from '../../utils/manifest.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template.js';\nimport { runPrettier } from '../adapter/prettier.js';\nimport { tryPatchRenovateConfig } from '../lint/internalLints/patchRenovateConfig.js';\n\nimport { getConfig } from './getConfig.js';\nimport { initialiseRepo } from './git.js';\nimport type { Input } from './types.js';\nimport { writePackageJson } from './writePackageJson.js';\n\nexport const init = async (args = process.argv.slice(2)) => {\n const opts: Input = {\n debug: hasDebugFlag(args),\n };\n\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n const {\n destinationDir,\n entryPoint,\n packageManager,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n await ensureCommands(packageManager);\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _eslint.config.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: packageManager,\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n const [manifest, packageManagerConfig] = await Promise.all([\n getConsumerManifest(destinationDir),\n detectPackageManager(destinationDir),\n ]);\n\n if (!manifest) {\n throw new Error(\"Repository doesn't contain a package.json file.\");\n }\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig({\n mode: 'format',\n dir: destinationDir,\n manifest,\n packageManager: packageManagerConfig,\n });\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n // The `-D` shorthand is portable across our package managers.\n await exec(packageManager, 'add', '-D', skubaSlug);\n\n // Templating can initially leave certain files in an unformatted state;\n // consider a Markdown table with columns sized based on content length.\n await runPrettier(\n 'format',\n createLogger({ debug: opts.debug }),\n destinationDir,\n );\n\n depsInstalled = true;\n } catch (err) {\n log.warn(inspect(err));\n }\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n // The `-D` shorthand is portable across our package managers.\n log.ok(packageManager, 'add', '-D', skubaSlug);\n log.ok(packageManager, 'run', 'format');\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok(`git push --set-upstream origin ${templateData.defaultBranch}`);\n\n log.newline();\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,iBAAiC;AACjC,kBAA6B;AAC7B,kBAA6C;AAC7C,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAkC;AAClC,kBAAuC;AACvC,sBAAoC;AACpC,4BAAqC;AACrC,sBAGO;AACP,sBAA4B;AAC5B,iCAAuC;AAEvC,uBAA0B;AAC1B,IAAAA,cAA+B;AAE/B,8BAAiC;AAE1B,MAAM,OAAO,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAC1D,QAAM,OAAc;AAAA,IAClB,WAAO,0BAAa,IAAI;AAAA,EAC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gCAAgC;AAC1C,qBAAI,GAAG,MAAM,cAAc;AAC3B,qBAAI,GAAG,kCAAkC,aAAa,aAAa,EAAE;AAErE,qBAAI,QAAQ;AACd;",
6
6
  "names": ["import_git", "path"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { type FormChoice, Input, Select } from 'enquirer';
2
- import { type Platform } from './validation';
2
+ import { type Platform } from './validation.js';
3
3
  export type Choice = FormChoice & {
4
4
  /**
5
5
  * Whether the user is allowed to skip field entry and use the initial value.
@@ -36,8 +36,8 @@ __export(prompts_exports, {
36
36
  module.exports = __toCommonJS(prompts_exports);
37
37
  var import_enquirer = require("enquirer");
38
38
  var import_fs_extra = __toESM(require("fs-extra"));
39
- var import_template = require("../../utils/template");
40
- var import_validation = require("./validation");
39
+ var import_template = require("../../utils/template.js");
40
+ var import_validation = require("./validation.js");
41
41
  const BASE_CHOICES = [
42
42
  {
43
43
  name: "ownerName",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/prompts.ts"],
4
- "sourcesContent": ["import { type FormChoice, Input, Select } from 'enquirer';\nimport fs from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation';\n\nexport type Choice = FormChoice & {\n /**\n * Whether the user is allowed to skip field entry and use the initial value.\n *\n * Defaults to `false`.\n */\n allowInitial?: boolean;\n};\n\nexport type BaseFields = Record<\n (typeof BASE_CHOICES)[number]['name'],\n string\n> & {\n platformName: Platform;\n};\n\nconst BASE_CHOICES = [\n {\n name: 'ownerName',\n message: 'Owner',\n initial: 'SEEK-Jobs/my-team',\n validate: (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n const [org, team] = value.split('/');\n\n if (!org || !isGitHubOrg(org)) {\n return 'fails GitHub validation';\n }\n\n return (\n team === undefined || isGitHubTeam(team) || 'fails GitHub validation'\n );\n },\n },\n {\n name: 'repoName',\n message: 'Repo',\n initial: 'my-repo',\n validate: async (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n if (!isGitHubRepo(value)) {\n return 'fails GitHub validation';\n }\n\n const exists = await fs.pathExists(value);\n\n return !exists || `'${value}' is an existing directory`;\n },\n },\n {\n name: 'platformName',\n message: 'Platform',\n initial: 'arm64',\n allowInitial: true,\n validate: (value: unknown) =>\n isPlatform(value) || `must be ${PLATFORM_OPTIONS}`,\n },\n {\n name: 'defaultBranch',\n message: 'Default Branch',\n initial: 'main',\n allowInitial: true,\n validate: (value: unknown) =>\n typeof value === 'string' && value.length > 0 ? true : 'required',\n },\n] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some project details:',\n name: 'baseAnswers',\n};\n\nexport const SHOULD_CONTINUE_PROMPT = new Select({\n choices: ['yes', 'no'] as const,\n message: 'Fill this in now?',\n name: 'shouldContinue',\n});\n\nexport const GIT_PATH_PROMPT = new Input({\n message: 'Git path',\n name: 'gitPath',\n initial: 'seek-oss/skuba',\n validate: (value) => /[^/]+\\/[^/]+/.test(value) || 'Path is not valid',\n});\n\nexport const TEMPLATE_PROMPT = new Select({\n choices: TEMPLATE_NAMES_WITH_BYO,\n message: 'Select a template:',\n name: 'templateName',\n});\n"],
4
+ "sourcesContent": ["import { type FormChoice, Input, Select } from 'enquirer';\nimport fs from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template.js';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation.js';\n\nexport type Choice = FormChoice & {\n /**\n * Whether the user is allowed to skip field entry and use the initial value.\n *\n * Defaults to `false`.\n */\n allowInitial?: boolean;\n};\n\nexport type BaseFields = Record<\n (typeof BASE_CHOICES)[number]['name'],\n string\n> & {\n platformName: Platform;\n};\n\nconst BASE_CHOICES = [\n {\n name: 'ownerName',\n message: 'Owner',\n initial: 'SEEK-Jobs/my-team',\n validate: (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n const [org, team] = value.split('/');\n\n if (!org || !isGitHubOrg(org)) {\n return 'fails GitHub validation';\n }\n\n return (\n team === undefined || isGitHubTeam(team) || 'fails GitHub validation'\n );\n },\n },\n {\n name: 'repoName',\n message: 'Repo',\n initial: 'my-repo',\n validate: async (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n if (!isGitHubRepo(value)) {\n return 'fails GitHub validation';\n }\n\n const exists = await fs.pathExists(value);\n\n return !exists || `'${value}' is an existing directory`;\n },\n },\n {\n name: 'platformName',\n message: 'Platform',\n initial: 'arm64',\n allowInitial: true,\n validate: (value: unknown) =>\n isPlatform(value) || `must be ${PLATFORM_OPTIONS}`,\n },\n {\n name: 'defaultBranch',\n message: 'Default Branch',\n initial: 'main',\n allowInitial: true,\n validate: (value: unknown) =>\n typeof value === 'string' && value.length > 0 ? true : 'required',\n },\n] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some project details:',\n name: 'baseAnswers',\n};\n\nexport const SHOULD_CONTINUE_PROMPT = new Select({\n choices: ['yes', 'no'] as const,\n message: 'Fill this in now?',\n name: 'shouldContinue',\n});\n\nexport const GIT_PATH_PROMPT = new Input({\n message: 'Git path',\n name: 'gitPath',\n initial: 'seek-oss/skuba',\n validate: (value) => /[^/]+\\/[^/]+/.test(value) || 'Path is not valid',\n});\n\nexport const TEMPLATE_PROMPT = new Select({\n choices: TEMPLATE_NAMES_WITH_BYO,\n message: 'Select a template:',\n name: 'templateName',\n});\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA+C;AAC/C,sBAAe;AAEf,sBAAwC;AAExC,wBAOO;AAkBP,MAAM,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AA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,UAAU,eAAe,KAAK,KAAK,KAAK;AACrD,CAAC;AAEM,MAAM,kBAAkB,IAAI,uBAAO;AAAA,EACxC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR,CAAC;",
6
6
  "names": ["fs"]
7
7
  }
@@ -22,8 +22,8 @@ __export(types_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(types_exports);
24
24
  var import_zod = require("zod");
25
- var import_manifest = require("../../utils/manifest");
26
- var import_packageManager = require("../../utils/packageManager");
25
+ var import_manifest = require("../../utils/manifest.js");
26
+ var import_packageManager = require("../../utils/packageManager.js");
27
27
  const initConfigInputSchema = import_zod.z.object({
28
28
  destinationDir: import_zod.z.string(),
29
29
  templateComplete: import_zod.z.boolean(),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/types.ts"],
4
- "sourcesContent": ["import { z } from 'zod';\n\nimport { projectTypeSchema } from '../../utils/manifest';\nimport { packageManagerSchema } from '../../utils/packageManager';\n\nexport interface Input {\n /**\n * Whether to enable verbose debug logging.\n *\n * Defaults to `false`.\n */\n debug: boolean;\n}\n\nexport type InitConfigInput = z.infer<typeof initConfigInputSchema>;\n\nexport const initConfigInputSchema = z.object({\n destinationDir: z.string(),\n templateComplete: z.boolean(),\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n platformName: z.union([z.literal('amd64'), z.literal('arm64')]),\n defaultBranch: z.string(),\n })\n .catchall(z.string()),\n templateName: z.string(),\n});\n\nexport type InitConfig = z.infer<typeof initConfigSchema>;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst initConfigSchema = initConfigInputSchema\n .omit({\n templateData: true,\n })\n .extend({\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n defaultBranch: z.string(),\n\n // Derived from ownerName\n // TODO: use zod to transform `InitConfigInput` -> `InitConfig`?\n orgName: z.string(),\n teamName: z.string(),\n\n // Generated by init command\n port: z.string(),\n })\n .catchall(z.string()),\n\n entryPoint: z.string().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n });\n"],
4
+ "sourcesContent": ["import { z } from 'zod';\n\nimport { projectTypeSchema } from '../../utils/manifest.js';\nimport { packageManagerSchema } from '../../utils/packageManager.js';\n\nexport interface Input {\n /**\n * Whether to enable verbose debug logging.\n *\n * Defaults to `false`.\n */\n debug: boolean;\n}\n\nexport type InitConfigInput = z.infer<typeof initConfigInputSchema>;\n\nexport const initConfigInputSchema = z.object({\n destinationDir: z.string(),\n templateComplete: z.boolean(),\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n platformName: z.union([z.literal('amd64'), z.literal('arm64')]),\n defaultBranch: z.string(),\n })\n .catchall(z.string()),\n templateName: z.string(),\n});\n\nexport type InitConfig = z.infer<typeof initConfigSchema>;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst initConfigSchema = initConfigInputSchema\n .omit({\n templateData: true,\n })\n .extend({\n templateData: z\n .object({\n ownerName: z.string(),\n repoName: z.string(),\n defaultBranch: z.string(),\n\n // Derived from ownerName\n // TODO: use zod to transform `InitConfigInput` -> `InitConfig`?\n orgName: z.string(),\n teamName: z.string(),\n\n // Generated by init command\n port: z.string(),\n })\n .catchall(z.string()),\n\n entryPoint: z.string().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n });\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAElB,sBAAkC;AAClC,4BAAqC;AAa9B,MAAM,wBAAwB,aAAE,OAAO;AAAA,EAC5C,gBAAgB,aAAE,OAAO;AAAA,EACzB,kBAAkB,aAAE,QAAQ;AAAA,EAC5B,cAAc,aACX,OAAO;AAAA,IACN,WAAW,aAAE,OAAO;AAAA,IACpB,UAAU,aAAE,OAAO;AAAA,IACnB,cAAc,aAAE,MAAM,CAAC,aAAE,QAAQ,OAAO,GAAG,aAAE,QAAQ,OAAO,CAAC,CAAC;AAAA,IAC9D,eAAe,aAAE,OAAO;AAAA,EAC1B,CAAC,EACA,SAAS,aAAE,OAAO,CAAC;AAAA,EACtB,cAAc,aAAE,OAAO;AACzB,CAAC;AAKD,MAAM,mBAAmB,sBACtB,KAAK;AAAA,EACJ,cAAc;AAChB,CAAC,EACA,OAAO;AAAA,EACN,cAAc,aACX,OAAO;AAAA,IACN,WAAW,aAAE,OAAO;AAAA,IACpB,UAAU,aAAE,OAAO;AAAA,IACnB,eAAe,aAAE,OAAO;AAAA;AAAA;AAAA,IAIxB,SAAS,aAAE,OAAO;AAAA,IAClB,UAAU,aAAE,OAAO;AAAA;AAAA,IAGnB,MAAM,aAAE,OAAO;AAAA,EACjB,CAAC,EACA,SAAS,aAAE,OAAO,CAAC;AAAA,EAEtB,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,EAChC,gBAAgB;AAAA,EAChB,MAAM,kCAAkB,SAAS;AACnC,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { ProjectType } from '../../utils/manifest';
1
+ import type { ProjectType } from '../../utils/manifest.js';
2
2
  interface WritePackageJsonProps {
3
3
  cwd: string;
4
4
  entryPoint?: string;
@@ -32,8 +32,8 @@ __export(writePackageJson_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(writePackageJson_exports);
34
34
  var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_package = require("../configure/analysis/package");
36
- var import_package2 = require("../configure/processing/package");
35
+ var import_package = require("../configure/analysis/package.js");
36
+ var import_package2 = require("../configure/processing/package.js");
37
37
  const writePackageJson = async ({
38
38
  cwd,
39
39
  entryPoint,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/writePackageJson.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest';\nimport { getDestinationManifest } from '../configure/analysis/package';\nimport { formatPackage } from '../configure/processing/package';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\nexport interface SkubaPackageJson {\n entryPoint: string | null;\n template: string;\n type?: string;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n } satisfies SkubaPackageJson;\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
4
+ "sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest.js';\nimport { getDestinationManifest } from '../configure/analysis/package.js';\nimport { formatPackage } from '../configure/processing/package.js';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\nexport interface SkubaPackageJson {\n entryPoint: string | null;\n template: string;\n type?: string;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n } satisfies SkubaPackageJson;\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AAGf,qBAAuC;AACvC,IAAAA,kBAA8B;AAoBvB,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA6B;AAC3B,QAAM,WAAW,UAAM,uCAAuB,EAAE,IAAI,CAAC;AAErD,WAAS,YAAY,QAAQ;AAAA,IAC3B,YAAY,cAAc;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,UAAM,+BAAc,SAAS,WAAW;AAEnE,QAAM,gBAAAC,QAAG,SAAS,UAAU,SAAS,MAAM,kBAAkB;AAC/D;",
6
6
  "names": ["import_package", "fs"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { ESLintOutput } from '../../../adapter/eslint';
1
+ import type { ESLintOutput } from '../../../adapter/eslint.js';
2
2
  export declare const createEslintAnnotations: (eslint: ESLintOutput) => string[];
@@ -31,7 +31,7 @@ __export(eslint_exports, {
31
31
  createEslintAnnotations: () => createEslintAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(eslint_exports);
34
- var Buildkite = __toESM(require("../../../../api/buildkite"));
34
+ var Buildkite = __toESM(require("../../../../api/buildkite/index.js"));
35
35
  const createEslintAnnotations = (eslint) => !eslint.ok ? ["**ESLint**", Buildkite.md.terminal(eslint.output.trim())] : [];
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/buildkite/eslint.ts"],
4
- "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { ESLintOutput } from '../../../adapter/eslint';\n\nexport const createEslintAnnotations = (eslint: ESLintOutput): string[] =>\n !eslint.ok ? ['**ESLint**', Buildkite.md.terminal(eslint.output.trim())] : [];\n"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite/index.js';\nimport type { ESLintOutput } from '../../../adapter/eslint.js';\n\nexport const createEslintAnnotations = (eslint: ESLintOutput): string[] =>\n !eslint.ok ? ['**ESLint**', Buildkite.md.terminal(eslint.output.trim())] : [];\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,0BAA0B,CAAC,WACtC,CAAC,OAAO,KAAK,CAAC,cAAc,UAAU,GAAG,SAAS,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC;",
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 createBuildkiteAnnotations: (internal: InternalLintResult, eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
@@ -31,11 +31,11 @@ __export(buildkite_exports, {
31
31
  createBuildkiteAnnotations: () => createBuildkiteAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(buildkite_exports);
34
- var Buildkite = __toESM(require("../../../../api/buildkite"));
35
- var import_eslint = require("./eslint");
36
- var import_internal = require("./internal");
37
- var import_prettier = require("./prettier");
38
- var import_tsc = require("./tsc");
34
+ var Buildkite = __toESM(require("../../../../api/buildkite/index.js"));
35
+ var import_eslint = require("./eslint.js");
36
+ var import_internal = require("./internal.js");
37
+ var import_prettier = require("./prettier.js");
38
+ var import_tsc = require("./tsc.js");
39
39
  const createBuildkiteAnnotations = async (internal, eslint, prettier, tscOk, tscOutputStream) => {
40
40
  if (internal.ok && eslint.ok && prettier.ok && tscOk) {
41
41
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/buildkite/index.ts"],
4
- "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\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 createBuildkiteAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n if (internal.ok && eslint.ok && prettier.ok && tscOk) {\n return;\n }\n\n const buildkiteOutput = [\n '`skuba lint` found issues that require triage:',\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ].join('\\n\\n');\n\n await Buildkite.annotate(buildkiteOutput, {\n context: 'skuba-lint',\n scopeContextToStep: true,\n style: 'error',\n });\n};\n"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite/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 createBuildkiteAnnotations = async (\n internal: InternalLintResult,\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n if (internal.ok && eslint.ok && prettier.ok && tscOk) {\n return;\n }\n\n const buildkiteOutput = [\n '`skuba lint` found issues that require triage:',\n ...createInternalAnnotations(internal),\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ].join('\\n\\n');\n\n await Buildkite.annotate(buildkiteOutput, {\n context: 'skuba-lint',\n scopeContextToStep: true,\n style: 'error',\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAM3B,oBAAwC;AACxC,sBAA0C;AAC1C,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,6BAA6B,OACxC,UACA,QACA,UACA,OACA,oBACkB;AAClB,MAAI,SAAS,MAAM,OAAO,MAAM,SAAS,MAAM,OAAO;AACpD;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD,EAAE,KAAK,MAAM;AAEb,QAAM,UAAU,SAAS,iBAAiB;AAAA,IACxC,SAAS;AAAA,IACT,oBAAoB;AAAA,IACpB,OAAO;AAAA,EACT,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { InternalLintResult } from '../../internal';
1
+ import type { InternalLintResult } from '../../internal.js';
2
2
  export declare const createInternalAnnotations: (internal: InternalLintResult) => string[];
@@ -31,7 +31,7 @@ __export(internal_exports, {
31
31
  createInternalAnnotations: () => createInternalAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(internal_exports);
34
- var Buildkite = __toESM(require("../../../../api/buildkite"));
34
+ var Buildkite = __toESM(require("../../../../api/buildkite/index.js"));
35
35
  const createInternalAnnotations = (internal) => !internal.ok && internal.annotations?.length ? [
36
36
  "**skuba**",
37
37
  Buildkite.md.terminal(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/annotate/buildkite/internal.ts"],
4
- "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { InternalLintResult } from '../../internal';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): string[] =>\n !internal.ok && internal.annotations?.length\n ? [\n '**skuba**',\n Buildkite.md.terminal(\n internal.annotations\n .map(({ message, path }) => `${path} ${message}`)\n .join('\\n'),\n ),\n ]\n : [];\n"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite/index.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nexport const createInternalAnnotations = (\n internal: InternalLintResult,\n): string[] =>\n !internal.ok && internal.annotations?.length\n ? [\n '**skuba**',\n Buildkite.md.terminal(\n internal.annotations\n .map(({ message, path }) => `${path} ${message}`)\n .join('\\n'),\n ),\n ]\n : [];\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CACvC,aAEA,CAAC,SAAS,MAAM,SAAS,aAAa,SAClC;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,YACN,IAAI,CAAC,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI,IAAI,OAAO,EAAE,EAC/C,KAAK,IAAI;AAAA,EACd;AACF,IACA,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- import type { PrettierOutput } from '../../../adapter/prettier';
1
+ import type { PrettierOutput } from '../../../adapter/prettier.js';
2
2
  export declare const createPrettierAnnotations: (prettier: PrettierOutput) => string[];
@@ -31,7 +31,7 @@ __export(prettier_exports, {
31
31
  createPrettierAnnotations: () => createPrettierAnnotations
32
32
  });
33
33
  module.exports = __toCommonJS(prettier_exports);
34
- var Buildkite = __toESM(require("../../../../api/buildkite"));
34
+ var Buildkite = __toESM(require("../../../../api/buildkite/index.js"));
35
35
  const createPrettierAnnotations = (prettier) => !prettier.ok ? [
36
36
  "**Prettier**",
37
37
  Buildkite.md.terminal(
@@ -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>;