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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/jest/moduleNameMapper.js +4 -1
  2. package/jest/transform.js +15 -1
  3. package/jest-preset.js +7 -1
  4. package/lib/api/buildkite/annotate.js +2 -2
  5. package/lib/api/buildkite/annotate.js.map +1 -1
  6. package/lib/api/buildkite/index.d.ts +3 -3
  7. package/lib/api/buildkite/index.js +2 -2
  8. package/lib/api/buildkite/index.js.map +1 -1
  9. package/lib/api/git/commitAllChanges.d.ts +2 -2
  10. package/lib/api/git/commitAllChanges.js +3 -3
  11. package/lib/api/git/commitAllChanges.js.map +1 -1
  12. package/lib/api/git/getChangedFiles.js +1 -1
  13. package/lib/api/git/getChangedFiles.js.map +1 -1
  14. package/lib/api/git/index.d.ts +12 -12
  15. package/lib/api/git/index.js +11 -11
  16. package/lib/api/git/index.js.map +1 -1
  17. package/lib/api/git/pull.js +2 -2
  18. package/lib/api/git/pull.js.map +1 -1
  19. package/lib/api/git/push.js +2 -2
  20. package/lib/api/git/push.js.map +1 -1
  21. package/lib/api/git/reset.js +1 -1
  22. package/lib/api/git/reset.js.map +1 -1
  23. package/lib/api/github/checkRun.js +4 -4
  24. package/lib/api/github/checkRun.js.map +1 -1
  25. package/lib/api/github/environment.js +1 -1
  26. package/lib/api/github/environment.js.map +1 -1
  27. package/lib/api/github/index.d.ts +7 -7
  28. package/lib/api/github/index.js +6 -6
  29. package/lib/api/github/index.js.map +1 -1
  30. package/lib/api/github/issueComment.js +4 -4
  31. package/lib/api/github/issueComment.js.map +1 -1
  32. package/lib/api/github/pullRequest.js +3 -3
  33. package/lib/api/github/pullRequest.js.map +1 -1
  34. package/lib/api/github/push.d.ts +1 -1
  35. package/lib/api/github/push.js +3 -3
  36. package/lib/api/github/push.js.map +1 -1
  37. package/lib/api/jest/index.js +2 -2
  38. package/lib/api/jest/index.js.map +1 -1
  39. package/lib/api/net/compose.js +1 -1
  40. package/lib/api/net/compose.js.map +1 -1
  41. package/lib/api/net/index.d.ts +1 -1
  42. package/lib/api/net/index.js +1 -1
  43. package/lib/api/net/index.js.map +1 -1
  44. package/lib/api/net/waitFor.d.ts +1 -1
  45. package/lib/api/net/waitFor.js +2 -2
  46. package/lib/api/net/waitFor.js.map +1 -1
  47. package/lib/cli/adapter/eslint.d.ts +1 -1
  48. package/lib/cli/adapter/eslint.js +1 -1
  49. package/lib/cli/adapter/eslint.js.map +1 -1
  50. package/lib/cli/adapter/prettier.d.ts +1 -1
  51. package/lib/cli/adapter/prettier.js +4 -4
  52. package/lib/cli/adapter/prettier.js.map +2 -2
  53. package/lib/cli/build/assets.d.ts +1 -1
  54. package/lib/cli/build/assets.js +4 -4
  55. package/lib/cli/build/assets.js.map +1 -1
  56. package/lib/cli/build/esbuild.js +3 -3
  57. package/lib/cli/build/esbuild.js.map +1 -1
  58. package/lib/cli/build/index.js +6 -6
  59. package/lib/cli/build/index.js.map +1 -1
  60. package/lib/cli/build/tsc.d.ts +1 -1
  61. package/lib/cli/build/tsc.js +2 -2
  62. package/lib/cli/build/tsc.js.map +1 -1
  63. package/lib/cli/buildPackage/index.js +3 -3
  64. package/lib/cli/buildPackage/index.js.map +1 -1
  65. package/lib/cli/configure/analyseConfiguration.d.ts +2 -2
  66. package/lib/cli/configure/analyseConfiguration.js +2 -2
  67. package/lib/cli/configure/analyseConfiguration.js.map +1 -1
  68. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  69. package/lib/cli/configure/analyseDependencies.js +6 -6
  70. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  71. package/lib/cli/configure/analysis/files.js +1 -1
  72. package/lib/cli/configure/analysis/files.js.map +1 -1
  73. package/lib/cli/configure/analysis/git.js +2 -2
  74. package/lib/cli/configure/analysis/git.js.map +1 -1
  75. package/lib/cli/configure/analysis/package.d.ts +1 -1
  76. package/lib/cli/configure/analysis/package.js +2 -2
  77. package/lib/cli/configure/analysis/package.js.map +1 -1
  78. package/lib/cli/configure/analysis/project.d.ts +1 -1
  79. package/lib/cli/configure/analysis/project.js +4 -4
  80. package/lib/cli/configure/analysis/project.js.map +2 -2
  81. package/lib/cli/configure/dependencies/index.d.ts +5 -5
  82. package/lib/cli/configure/dependencies/index.js +5 -5
  83. package/lib/cli/configure/dependencies/index.js.map +1 -1
  84. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -2
  85. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +1 -1
  86. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  87. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -2
  88. package/lib/cli/configure/dependencies/seekKoala.js +1 -1
  89. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  90. package/lib/cli/configure/dependencies/skuba.d.ts +2 -2
  91. package/lib/cli/configure/dependencies/skuba.js +1 -1
  92. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  93. package/lib/cli/configure/dependencies/skubaDeps.d.ts +1 -1
  94. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  95. package/lib/cli/configure/dependencies/skubaDive.d.ts +2 -2
  96. package/lib/cli/configure/dependencies/skubaDive.js +1 -1
  97. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  98. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  99. package/lib/cli/configure/ensureTemplateCompletion.js +6 -6
  100. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  101. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  102. package/lib/cli/configure/getEntryPoint.js +3 -3
  103. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  104. package/lib/cli/configure/getProjectType.d.ts +2 -2
  105. package/lib/cli/configure/getProjectType.js +3 -3
  106. package/lib/cli/configure/getProjectType.js.map +1 -1
  107. package/lib/cli/configure/index.js +14 -14
  108. package/lib/cli/configure/index.js.map +1 -1
  109. package/lib/cli/configure/modules/eslint.d.ts +1 -1
  110. package/lib/cli/configure/modules/eslint.js +4 -4
  111. package/lib/cli/configure/modules/eslint.js.map +1 -1
  112. package/lib/cli/configure/modules/ignore.d.ts +1 -1
  113. package/lib/cli/configure/modules/ignore.js +2 -2
  114. package/lib/cli/configure/modules/ignore.js.map +1 -1
  115. package/lib/cli/configure/modules/index.d.ts +1 -1
  116. package/lib/cli/configure/modules/index.js +10 -10
  117. package/lib/cli/configure/modules/index.js.map +1 -1
  118. package/lib/cli/configure/modules/jest.d.ts +1 -1
  119. package/lib/cli/configure/modules/jest.js +4 -4
  120. package/lib/cli/configure/modules/jest.js.map +1 -1
  121. package/lib/cli/configure/modules/nodemon.d.ts +1 -1
  122. package/lib/cli/configure/modules/nodemon.js +1 -1
  123. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  124. package/lib/cli/configure/modules/package.d.ts +1 -1
  125. package/lib/cli/configure/modules/package.js +4 -4
  126. package/lib/cli/configure/modules/package.js.map +1 -1
  127. package/lib/cli/configure/modules/prettier.d.ts +1 -1
  128. package/lib/cli/configure/modules/prettier.js +4 -4
  129. package/lib/cli/configure/modules/prettier.js.map +1 -1
  130. package/lib/cli/configure/modules/renovate.d.ts +1 -1
  131. package/lib/cli/configure/modules/renovate.js +5 -5
  132. package/lib/cli/configure/modules/renovate.js.map +1 -1
  133. package/lib/cli/configure/modules/serverless.d.ts +1 -1
  134. package/lib/cli/configure/modules/serverless.js.map +1 -1
  135. package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
  136. package/lib/cli/configure/modules/skubaDive.js +4 -4
  137. package/lib/cli/configure/modules/skubaDive.js.map +1 -1
  138. package/lib/cli/configure/modules/tslint.d.ts +1 -1
  139. package/lib/cli/configure/modules/tslint.js +1 -1
  140. package/lib/cli/configure/modules/tslint.js.map +1 -1
  141. package/lib/cli/configure/processing/deleteFiles.d.ts +1 -1
  142. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  143. package/lib/cli/configure/processing/json.js +2 -2
  144. package/lib/cli/configure/processing/json.js.map +1 -1
  145. package/lib/cli/configure/processing/loadFiles.d.ts +1 -1
  146. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  147. package/lib/cli/configure/processing/module.d.ts +1 -1
  148. package/lib/cli/configure/processing/module.js +1 -1
  149. package/lib/cli/configure/processing/module.js.map +1 -1
  150. package/lib/cli/configure/processing/package.d.ts +1 -1
  151. package/lib/cli/configure/processing/package.js +2 -2
  152. package/lib/cli/configure/processing/package.js.map +1 -1
  153. package/lib/cli/configure/processing/prettier.d.ts +1 -1
  154. package/lib/cli/configure/processing/prettier.js +6 -8
  155. package/lib/cli/configure/processing/prettier.js.map +3 -3
  156. package/lib/cli/configure/processing/typescript.js +1 -1
  157. package/lib/cli/configure/processing/typescript.js.map +1 -1
  158. package/lib/cli/configure/types.d.ts +2 -2
  159. package/lib/cli/configure/types.js.map +1 -1
  160. package/lib/cli/format/index.js +5 -5
  161. package/lib/cli/format/index.js.map +1 -1
  162. package/lib/cli/help/index.js +2 -2
  163. package/lib/cli/help/index.js.map +1 -1
  164. package/lib/cli/init/getConfig.d.ts +3 -3
  165. package/lib/cli/init/getConfig.js +9 -9
  166. package/lib/cli/init/getConfig.js.map +1 -1
  167. package/lib/cli/init/git.js +2 -2
  168. package/lib/cli/init/git.js.map +1 -1
  169. package/lib/cli/init/index.js +15 -15
  170. package/lib/cli/init/index.js.map +1 -1
  171. package/lib/cli/init/prompts.d.ts +1 -1
  172. package/lib/cli/init/prompts.js +2 -2
  173. package/lib/cli/init/prompts.js.map +1 -1
  174. package/lib/cli/init/types.js +2 -2
  175. package/lib/cli/init/types.js.map +1 -1
  176. package/lib/cli/init/writePackageJson.d.ts +1 -1
  177. package/lib/cli/init/writePackageJson.js +2 -2
  178. package/lib/cli/init/writePackageJson.js.map +1 -1
  179. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
  180. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  181. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  182. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -4
  183. package/lib/cli/lint/annotate/buildkite/index.js +5 -5
  184. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  185. package/lib/cli/lint/annotate/buildkite/internal.d.ts +1 -1
  186. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  187. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  188. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
  189. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  190. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  191. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
  192. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  193. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  194. package/lib/cli/lint/annotate/github/eslint.d.ts +2 -2
  195. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  196. package/lib/cli/lint/annotate/github/index.d.ts +4 -4
  197. package/lib/cli/lint/annotate/github/index.js +6 -6
  198. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  199. package/lib/cli/lint/annotate/github/internal.d.ts +2 -2
  200. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  201. package/lib/cli/lint/annotate/github/prettier.d.ts +2 -2
  202. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  203. package/lib/cli/lint/annotate/github/tsc.d.ts +2 -2
  204. package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
  205. package/lib/cli/lint/annotate/index.d.ts +4 -4
  206. package/lib/cli/lint/annotate/index.js +2 -2
  207. package/lib/cli/lint/annotate/index.js.map +1 -1
  208. package/lib/cli/lint/autofix.d.ts +2 -2
  209. package/lib/cli/lint/autofix.js +11 -11
  210. package/lib/cli/lint/autofix.js.map +1 -1
  211. package/lib/cli/lint/eslint.d.ts +2 -2
  212. package/lib/cli/lint/eslint.js +3 -3
  213. package/lib/cli/lint/eslint.js.map +1 -1
  214. package/lib/cli/lint/external.d.ts +3 -3
  215. package/lib/cli/lint/external.js +3 -3
  216. package/lib/cli/lint/external.js.map +1 -1
  217. package/lib/cli/lint/index.js +8 -8
  218. package/lib/cli/lint/index.js.map +1 -1
  219. package/lib/cli/lint/internal.d.ts +1 -1
  220. package/lib/cli/lint/internal.js +5 -5
  221. package/lib/cli/lint/internal.js.map +1 -1
  222. package/lib/cli/lint/internalLints/detectBadCodeowners.d.ts +2 -2
  223. package/lib/cli/lint/internalLints/detectBadCodeowners.js +2 -2
  224. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  225. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +2 -2
  226. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +2 -2
  227. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +1 -1
  228. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +2 -2
  229. package/lib/cli/lint/internalLints/patchRenovateConfig.js +5 -5
  230. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
  231. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +3 -3
  232. package/lib/cli/lint/internalLints/refreshConfigFiles.js +7 -7
  233. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/index.d.ts +3 -3
  235. package/lib/cli/lint/internalLints/upgrade/index.js +4 -4
  236. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +1 -1
  239. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  240. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +1 -1
  241. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +1 -1
  242. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  243. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +1 -1
  244. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +2 -2
  245. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  246. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +1 -1
  247. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +4 -4
  248. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  249. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +1 -1
  250. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +1 -1
  251. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  252. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +1 -1
  253. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +4 -4
  254. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  255. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +1 -1
  256. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +4 -4
  257. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +2 -2
  258. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +1 -1
  259. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +2 -2
  260. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  261. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +1 -1
  262. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +3 -3
  263. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  264. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +1 -1
  265. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +1 -1
  266. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  267. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +1 -1
  268. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +1 -1
  269. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  270. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +1 -1
  271. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +1 -1
  272. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  273. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +1 -1
  274. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +5 -5
  275. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  276. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +1 -1
  277. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +1 -1
  278. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  279. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +1 -1
  280. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +1 -1
  281. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  282. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +1 -1
  283. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +1 -1
  284. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  285. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +1 -1
  286. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +5 -5
  287. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  288. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +1 -1
  289. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +1 -1
  290. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  291. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +1 -1
  292. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +1 -1
  293. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  294. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +1 -1
  295. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +1 -1
  296. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  297. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +1 -1
  298. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +2 -2
  299. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +2 -2
  300. package/lib/cli/lint/prettier.d.ts +2 -2
  301. package/lib/cli/lint/prettier.js +3 -3
  302. package/lib/cli/lint/prettier.js.map +1 -1
  303. package/lib/cli/lint/tsc.d.ts +1 -1
  304. package/lib/cli/lint/tsc.js +1 -1
  305. package/lib/cli/lint/tsc.js.map +1 -1
  306. package/lib/cli/migrate/index.js +2 -2
  307. package/lib/cli/migrate/index.js.map +1 -1
  308. package/lib/cli/migrate/nodeVersion/checks.js +1 -1
  309. package/lib/cli/migrate/nodeVersion/checks.js.map +1 -1
  310. package/lib/cli/migrate/nodeVersion/index.js +3 -3
  311. package/lib/cli/migrate/nodeVersion/index.js.map +1 -1
  312. package/lib/cli/node/index.js +3 -3
  313. package/lib/cli/node/index.js.map +1 -1
  314. package/lib/cli/release/index.js +1 -1
  315. package/lib/cli/release/index.js.map +1 -1
  316. package/lib/cli/start/index.js +4 -4
  317. package/lib/cli/start/index.js.map +1 -1
  318. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  319. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  320. package/lib/cli/test/reporters/github/index.js +5 -5
  321. package/lib/cli/test/reporters/github/index.js.map +2 -2
  322. package/lib/cli/test/reporters/prettier/index.d.ts +4 -0
  323. package/lib/cli/test/reporters/prettier/index.js +67 -0
  324. package/lib/cli/test/reporters/prettier/index.js.map +7 -0
  325. package/lib/cli/version/index.js +2 -2
  326. package/lib/cli/version/index.js.map +1 -1
  327. package/lib/index.d.ts +5 -5
  328. package/lib/index.js +5 -5
  329. package/lib/index.js.map +1 -1
  330. package/lib/skuba.js +8 -8
  331. package/lib/skuba.js.map +1 -1
  332. package/lib/utils/args.js +1 -1
  333. package/lib/utils/args.js.map +1 -1
  334. package/lib/utils/copy.js +2 -2
  335. package/lib/utils/copy.js.map +1 -1
  336. package/lib/utils/dir.js +2 -2
  337. package/lib/utils/dir.js.map +1 -1
  338. package/lib/utils/error.js +2 -2
  339. package/lib/utils/error.js.map +1 -1
  340. package/lib/utils/exec.d.ts +1 -1
  341. package/lib/utils/exec.js +2 -2
  342. package/lib/utils/exec.js.map +1 -1
  343. package/lib/utils/help.js +2 -2
  344. package/lib/utils/help.js.map +1 -1
  345. package/lib/utils/logo.js +3 -3
  346. package/lib/utils/logo.js.map +1 -1
  347. package/lib/utils/manifest.js +1 -1
  348. package/lib/utils/manifest.js.map +1 -1
  349. package/lib/utils/packageManager.js +1 -1
  350. package/lib/utils/packageManager.js.map +1 -1
  351. package/lib/utils/template.js +2 -2
  352. package/lib/utils/template.js.map +1 -1
  353. package/lib/utils/version.js +2 -2
  354. package/lib/utils/version.js.map +1 -1
  355. package/lib/utils/wait.js +2 -2
  356. package/lib/utils/wait.js.map +1 -1
  357. package/lib/utils/worker.d.ts +3 -3
  358. package/lib/utils/worker.js +1 -1
  359. package/lib/utils/worker.js.map +1 -1
  360. package/lib/wrapper/functionHandler.js +3 -3
  361. package/lib/wrapper/functionHandler.js.map +1 -1
  362. package/lib/wrapper/http.js +1 -1
  363. package/lib/wrapper/http.js.map +1 -1
  364. package/lib/wrapper/index.js +3 -3
  365. package/lib/wrapper/index.js.map +1 -1
  366. package/lib/wrapper/main.js +2 -2
  367. package/lib/wrapper/main.js.map +1 -1
  368. package/lib/wrapper/requestListener.js +2 -2
  369. package/lib/wrapper/requestListener.js.map +1 -1
  370. package/package.json +12 -12
  371. package/template/express-rest-api/src/app.test.ts +1 -1
  372. package/template/express-rest-api/src/app.ts +3 -3
  373. package/template/express-rest-api/src/framework/logging.ts +1 -1
  374. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  375. package/template/express-rest-api/src/listen.ts +4 -4
  376. package/template/greeter/package.json +1 -1
  377. package/template/greeter/src/app.test.ts +1 -1
  378. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  379. package/template/koa-rest-api/src/api/index.ts +3 -3
  380. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  381. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  382. package/template/koa-rest-api/src/api/jobs/index.ts +3 -3
  383. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -3
  384. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  385. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  386. package/template/koa-rest-api/src/app.test.ts +2 -2
  387. package/template/koa-rest-api/src/app.ts +3 -3
  388. package/template/koa-rest-api/src/framework/logging.ts +1 -1
  389. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  390. package/template/koa-rest-api/src/framework/server.test.ts +5 -5
  391. package/template/koa-rest-api/src/framework/server.ts +3 -3
  392. package/template/koa-rest-api/src/framework/validation.test.ts +4 -4
  393. package/template/koa-rest-api/src/framework/validation.ts +1 -1
  394. package/template/koa-rest-api/src/listen.ts +4 -4
  395. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  396. package/template/koa-rest-api/src/testing/logging.ts +1 -1
  397. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  398. package/template/koa-rest-api/src/testing/server.ts +1 -1
  399. package/template/koa-rest-api/src/testing/types.ts +1 -1
  400. package/template/koa-rest-api/tsconfig.json +18 -0
  401. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
  402. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  403. package/template/lambda-sqs-worker-cdk/package.json +1 -1
  404. package/template/lambda-sqs-worker-cdk/src/app.test.ts +6 -6
  405. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -7
  406. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +4 -4
  407. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  408. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +1 -1
  409. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  410. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +2 -2
  411. package/template/lambda-sqs-worker-cdk/src/mapping/jobScorer.ts +2 -2
  412. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  413. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +3 -3
  414. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  415. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  416. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +1 -1
  417. package/template/lambda-sqs-worker-cdk/src/testing/logging.ts +1 -1
  418. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  419. package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
  420. package/template/oss-npm-package/src/index.test.ts +1 -1
  421. package/template/private-npm-package/src/index.test.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/typescript.ts"],
4
- "sourcesContent": ["import ts from 'typescript';\n\nimport { formatPrettier } from './prettier';\n\ntype Props = ts.NodeArray<ts.ObjectLiteralElementLike>;\n\ntype Transformer<T> = (context: ts.TransformationContext | null, props: T) => T;\n\nconst BLANK_LINE_PLACEHOLDER = ' __BLANK_LINE_PLACEHOLDER__';\nconst BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, 'g');\n\n/**\n * Append a placeholder comment to the start of a node.\n *\n * Blank lines can be annotated and preserved through the TypeScript printer\n * when this is paired with a dodgy `String.prototype.replace` post-processor.\n */\nconst withLeadingBlankLinePlaceholder = <T extends ts.Node>(node: T) =>\n ts.addSyntheticLeadingComment(\n node,\n ts.SyntaxKind.SingleLineCommentTrivia,\n BLANK_LINE_PLACEHOLDER,\n true,\n );\n\n/**\n * Create the following expression:\n *\n * ```javascript\n * export default {};\n * ```\n */\nconst createExportDefaultObjectLiteralExpression = (\n factory: ts.NodeFactory,\n props: Props,\n callExpression?: ts.Expression,\n): ts.ExportAssignment =>\n factory.createExportAssignment(\n undefined,\n undefined,\n callExpression === undefined\n ? factory.createObjectLiteralExpression(props, true)\n : factory.createCallExpression(callExpression, undefined, [\n factory.createObjectLiteralExpression(props, true),\n ]),\n );\n\nconst createImportFromExpression = (\n factory: ts.NodeFactory,\n moduleName: string,\n importNames: string | string[],\n) => {\n const importClause =\n typeof importNames === 'string'\n ? factory.createImportClause(\n false,\n factory.createIdentifier(importNames),\n undefined,\n )\n : factory.createImportClause(\n false,\n undefined,\n factory.createNamedImports(\n importNames.map((importName) =>\n factory.createImportSpecifier(\n false,\n undefined,\n factory.createIdentifier(importName),\n ),\n ),\n ),\n );\n\n return factory.createImportDeclaration(\n undefined,\n importClause,\n factory.createStringLiteral(moduleName),\n );\n};\n\nconst getPropName = (prop: ts.ObjectLiteralElementLike) =>\n ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)\n ? prop.name.escapedText.toString()\n : undefined;\n\nconst expressionAsDefaultExport = (\n context: ts.TransformationContext,\n transformProps: Transformer<Props>,\n expression: ts.Expression,\n): ts.ExportAssignment | null =>\n withLeadingBlankLinePlaceholder(\n (() => {\n // {}\n if (ts.isObjectLiteralExpression(expression)) {\n const props = transformProps(context, expression.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n );\n }\n\n // fn({})\n if (\n ts.isCallExpression(expression) &&\n expression.arguments.length === 1 &&\n expression.arguments[0]\n ) {\n const [firstArgument] = expression.arguments;\n\n if (ts.isObjectLiteralExpression(firstArgument)) {\n const props = transformProps(context, firstArgument.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n expression.expression,\n );\n }\n }\n\n // Anything else\n return context.factory.createExportAssignment(\n undefined,\n undefined,\n expression,\n );\n })(),\n );\n\n/**\n * Mutate `const x = require('')` into `import x from ''`:\n *\n * ```javascript\n * const x = require('');\n *\n * const { x } = require('');\n * ```\n *\n * There's no recursion needed here as we expect the import statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst requireImportsTransformer: ts.TransformerFactory<ts.Node> =\n (context) => (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n let declaration, moduleName;\n\n if (\n ts.isVariableStatement(node) &&\n node.declarationList.declarations.length === 1 &&\n node.declarationList.declarations[0] &&\n ts.isVariableDeclaration(\n (declaration = node.declarationList.declarations[0]),\n ) &&\n declaration.initializer &&\n ts.isCallExpression(declaration.initializer) &&\n declaration.initializer.arguments.length === 1 &&\n declaration.initializer.arguments[0] &&\n ts.isStringLiteral(\n (moduleName = declaration.initializer.arguments[0]),\n ) &&\n ts.isIdentifier(declaration.initializer.expression) &&\n declaration.initializer.expression.text === 'require'\n ) {\n // const x\n if (ts.isIdentifier(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.text,\n );\n }\n\n // const { x }\n if (ts.isObjectBindingPattern(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.elements.flatMap((element) =>\n ts.isIdentifier(element.name) ? [element.name.text] : [],\n ),\n );\n }\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to mutate `module.exports` and `export default`:\n *\n * ```javascript\n * export default {};\n *\n * module.exports = {};\n * ```\n *\n * If the export is a call expression with a single argument, it will try to\n * transform the props of that argument.\n *\n * ```javascript\n * module.exports = fn({});\n * ```\n *\n * There's no recursion needed here as we expect the export statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst createModuleExportsTransformer =\n (transformProps: Transformer<Props>): ts.TransformerFactory<ts.Node> =>\n (context) =>\n (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n // module.exports =\n if (\n ts.isExpressionStatement(node) &&\n ts.isBinaryExpression(node.expression) &&\n ts.isPropertyAccessExpression(node.expression.left) &&\n ts.isIdentifier(node.expression.left.expression) &&\n node.expression.left.expression.escapedText.toString() === 'module' &&\n node.expression.left.name.text === 'exports' &&\n node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken\n ) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression.right,\n ) ?? node\n );\n }\n\n // export default\n if (ts.isExportAssignment(node)) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression,\n ) ?? node\n );\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to filter out unspecified props from an object literal.\n */\nexport const createPropFilter =\n (names: string[]): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(names);\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray(\n props.filter((prop) => nameSet.has(getPropName(prop))),\n );\n };\n\nexport const createPropAppender =\n (appendingProps: Props): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(\n props.map(getPropName).filter((prop) => typeof prop === 'string'),\n );\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray([\n ...props,\n ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop))),\n ]);\n };\n\n/**\n * Read out `export default` or `module.exports` props from a source file.\n *\n * The props can then be used when transforming another source file.\n */\nexport const readModuleExports = async (\n inputFile: string,\n): Promise<Props | undefined> => {\n let result: Props | undefined;\n\n await transformModuleImportsAndExports(\n inputFile,\n (_, props) => (result = props),\n );\n\n return result;\n};\n\n/**\n * Mutate imports and exports in a source file:\n *\n * - Convert `const x = require('')` into `import x from ''`\n * - Convert `module.exports =` into `export default`\n * - Run a transformer over the exported props\n */\nexport const transformModuleImportsAndExports = async (\n inputFile: string,\n transformProps: Transformer<Props>,\n): Promise<string> => {\n const sourceFile = ts.createSourceFile('', inputFile, ts.ScriptTarget.Latest);\n\n const moduleExportsTransformer =\n createModuleExportsTransformer(transformProps);\n\n const result = ts.transform(sourceFile, [\n requireImportsTransformer,\n moduleExportsTransformer,\n ]);\n\n const [transformedFile] = result.transformed;\n\n if (!transformedFile) {\n throw new Error(\n `Could not get transformed result for ${JSON.stringify(result)}`,\n );\n }\n\n const text = ts\n .createPrinter()\n .printNode(ts.EmitHint.SourceFile, transformedFile, sourceFile)\n .replace(BLANK_LINE_REGEXP, '');\n\n return formatPrettier(text, { parser: 'typescript' });\n};\n"],
4
+ "sourcesContent": ["import ts from 'typescript';\n\nimport { formatPrettier } from './prettier.js';\n\ntype Props = ts.NodeArray<ts.ObjectLiteralElementLike>;\n\ntype Transformer<T> = (context: ts.TransformationContext | null, props: T) => T;\n\nconst BLANK_LINE_PLACEHOLDER = ' __BLANK_LINE_PLACEHOLDER__';\nconst BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, 'g');\n\n/**\n * Append a placeholder comment to the start of a node.\n *\n * Blank lines can be annotated and preserved through the TypeScript printer\n * when this is paired with a dodgy `String.prototype.replace` post-processor.\n */\nconst withLeadingBlankLinePlaceholder = <T extends ts.Node>(node: T) =>\n ts.addSyntheticLeadingComment(\n node,\n ts.SyntaxKind.SingleLineCommentTrivia,\n BLANK_LINE_PLACEHOLDER,\n true,\n );\n\n/**\n * Create the following expression:\n *\n * ```javascript\n * export default {};\n * ```\n */\nconst createExportDefaultObjectLiteralExpression = (\n factory: ts.NodeFactory,\n props: Props,\n callExpression?: ts.Expression,\n): ts.ExportAssignment =>\n factory.createExportAssignment(\n undefined,\n undefined,\n callExpression === undefined\n ? factory.createObjectLiteralExpression(props, true)\n : factory.createCallExpression(callExpression, undefined, [\n factory.createObjectLiteralExpression(props, true),\n ]),\n );\n\nconst createImportFromExpression = (\n factory: ts.NodeFactory,\n moduleName: string,\n importNames: string | string[],\n) => {\n const importClause =\n typeof importNames === 'string'\n ? factory.createImportClause(\n false,\n factory.createIdentifier(importNames),\n undefined,\n )\n : factory.createImportClause(\n false,\n undefined,\n factory.createNamedImports(\n importNames.map((importName) =>\n factory.createImportSpecifier(\n false,\n undefined,\n factory.createIdentifier(importName),\n ),\n ),\n ),\n );\n\n return factory.createImportDeclaration(\n undefined,\n importClause,\n factory.createStringLiteral(moduleName),\n );\n};\n\nconst getPropName = (prop: ts.ObjectLiteralElementLike) =>\n ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)\n ? prop.name.escapedText.toString()\n : undefined;\n\nconst expressionAsDefaultExport = (\n context: ts.TransformationContext,\n transformProps: Transformer<Props>,\n expression: ts.Expression,\n): ts.ExportAssignment | null =>\n withLeadingBlankLinePlaceholder(\n (() => {\n // {}\n if (ts.isObjectLiteralExpression(expression)) {\n const props = transformProps(context, expression.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n );\n }\n\n // fn({})\n if (\n ts.isCallExpression(expression) &&\n expression.arguments.length === 1 &&\n expression.arguments[0]\n ) {\n const [firstArgument] = expression.arguments;\n\n if (ts.isObjectLiteralExpression(firstArgument)) {\n const props = transformProps(context, firstArgument.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n expression.expression,\n );\n }\n }\n\n // Anything else\n return context.factory.createExportAssignment(\n undefined,\n undefined,\n expression,\n );\n })(),\n );\n\n/**\n * Mutate `const x = require('')` into `import x from ''`:\n *\n * ```javascript\n * const x = require('');\n *\n * const { x } = require('');\n * ```\n *\n * There's no recursion needed here as we expect the import statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst requireImportsTransformer: ts.TransformerFactory<ts.Node> =\n (context) => (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n let declaration, moduleName;\n\n if (\n ts.isVariableStatement(node) &&\n node.declarationList.declarations.length === 1 &&\n node.declarationList.declarations[0] &&\n ts.isVariableDeclaration(\n (declaration = node.declarationList.declarations[0]),\n ) &&\n declaration.initializer &&\n ts.isCallExpression(declaration.initializer) &&\n declaration.initializer.arguments.length === 1 &&\n declaration.initializer.arguments[0] &&\n ts.isStringLiteral(\n (moduleName = declaration.initializer.arguments[0]),\n ) &&\n ts.isIdentifier(declaration.initializer.expression) &&\n declaration.initializer.expression.text === 'require'\n ) {\n // const x\n if (ts.isIdentifier(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.text,\n );\n }\n\n // const { x }\n if (ts.isObjectBindingPattern(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.elements.flatMap((element) =>\n ts.isIdentifier(element.name) ? [element.name.text] : [],\n ),\n );\n }\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to mutate `module.exports` and `export default`:\n *\n * ```javascript\n * export default {};\n *\n * module.exports = {};\n * ```\n *\n * If the export is a call expression with a single argument, it will try to\n * transform the props of that argument.\n *\n * ```javascript\n * module.exports = fn({});\n * ```\n *\n * There's no recursion needed here as we expect the export statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst createModuleExportsTransformer =\n (transformProps: Transformer<Props>): ts.TransformerFactory<ts.Node> =>\n (context) =>\n (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n // module.exports =\n if (\n ts.isExpressionStatement(node) &&\n ts.isBinaryExpression(node.expression) &&\n ts.isPropertyAccessExpression(node.expression.left) &&\n ts.isIdentifier(node.expression.left.expression) &&\n node.expression.left.expression.escapedText.toString() === 'module' &&\n node.expression.left.name.text === 'exports' &&\n node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken\n ) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression.right,\n ) ?? node\n );\n }\n\n // export default\n if (ts.isExportAssignment(node)) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression,\n ) ?? node\n );\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to filter out unspecified props from an object literal.\n */\nexport const createPropFilter =\n (names: string[]): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(names);\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray(\n props.filter((prop) => nameSet.has(getPropName(prop))),\n );\n };\n\nexport const createPropAppender =\n (appendingProps: Props): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(\n props.map(getPropName).filter((prop) => typeof prop === 'string'),\n );\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray([\n ...props,\n ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop))),\n ]);\n };\n\n/**\n * Read out `export default` or `module.exports` props from a source file.\n *\n * The props can then be used when transforming another source file.\n */\nexport const readModuleExports = async (\n inputFile: string,\n): Promise<Props | undefined> => {\n let result: Props | undefined;\n\n await transformModuleImportsAndExports(\n inputFile,\n (_, props) => (result = props),\n );\n\n return result;\n};\n\n/**\n * Mutate imports and exports in a source file:\n *\n * - Convert `const x = require('')` into `import x from ''`\n * - Convert `module.exports =` into `export default`\n * - Run a transformer over the exported props\n */\nexport const transformModuleImportsAndExports = async (\n inputFile: string,\n transformProps: Transformer<Props>,\n): Promise<string> => {\n const sourceFile = ts.createSourceFile('', inputFile, ts.ScriptTarget.Latest);\n\n const moduleExportsTransformer =\n createModuleExportsTransformer(transformProps);\n\n const result = ts.transform(sourceFile, [\n requireImportsTransformer,\n moduleExportsTransformer,\n ]);\n\n const [transformedFile] = result.transformed;\n\n if (!transformedFile) {\n throw new Error(\n `Could not get transformed result for ${JSON.stringify(result)}`,\n );\n }\n\n const text = ts\n .createPrinter()\n .printNode(ts.EmitHint.SourceFile, transformedFile, sourceFile)\n .replace(BLANK_LINE_REGEXP, '');\n\n return formatPrettier(text, { parser: 'typescript' });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAe;AAEf,sBAA+B;AAM/B,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB,IAAI,OAAO,KAAK,sBAAsB,IAAI,GAAG;AAQvE,MAAM,kCAAkC,CAAoB,SAC1D,kBAAAA,QAAG;AAAA,EACD;AAAA,EACA,kBAAAA,QAAG,WAAW;AAAA,EACd;AAAA,EACA;AACF;AASF,MAAM,6CAA6C,CACjD,SACA,OACA,mBAEA,QAAQ;AAAA,EACN;AAAA,EACA;AAAA,EACA,mBAAmB,SACf,QAAQ,8BAA8B,OAAO,IAAI,IACjD,QAAQ,qBAAqB,gBAAgB,QAAW;AAAA,IACtD,QAAQ,8BAA8B,OAAO,IAAI;AAAA,EACnD,CAAC;AACP;AAEF,MAAM,6BAA6B,CACjC,SACA,YACA,gBACG;AACH,QAAM,eACJ,OAAO,gBAAgB,WACnB,QAAQ;AAAA,IACN;AAAA,IACA,QAAQ,iBAAiB,WAAW;AAAA,IACpC;AAAA,EACF,IACA,QAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAA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EjC,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK,UAAU,MAAM,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,QAAM,OAAO,kBAAAA,QACV,cAAc,EACd,UAAU,kBAAAA,QAAG,SAAS,YAAY,iBAAiB,UAAU,EAC7D,QAAQ,mBAAmB,EAAE;AAEhC,aAAO,gCAAe,MAAM,EAAE,QAAQ,aAAa,CAAC;AACtD;",
6
6
  "names": ["ts"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { PackageJson as TypeFestPackageJson } from 'type-fest';
2
- import type { ProjectType } from '../../utils/manifest';
3
- import type { PackageManagerConfig } from '../../utils/packageManager';
2
+ import type { ProjectType } from '../../utils/manifest.js';
3
+ import type { PackageManagerConfig } from '../../utils/packageManager.js';
4
4
  export type { TsConfigJson } from 'type-fest';
5
5
  export type PackageJson = TypeFestPackageJson & Record<string, unknown>;
6
6
  export interface DependencySet {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/types.ts"],
4
- "sourcesContent": ["import type { PackageJson as TypeFestPackageJson } from 'type-fest';\n\nimport type { ProjectType } from '../../utils/manifest';\nimport type { PackageManagerConfig } from '../../utils/packageManager';\n\nexport type { TsConfigJson } from 'type-fest';\n\nexport type PackageJson = TypeFestPackageJson & Record<string, unknown>;\n\nexport interface DependencySet {\n dependencies: Record<string, string>;\n devDependencies: Record<string, string>;\n type: ProjectType;\n}\n\nexport type DependencyDiff = Record<\n string,\n { operation: string; version: string }\n>;\n\ntype FileProcessor = (\n file: string | undefined,\n files: Files,\n initialFiles: Readonly<Files>,\n) => Promise<string | undefined> | string | undefined;\n\nexport type FileDiff = Record<\n string,\n { data: string | undefined; operation: string }\n>;\n\nexport type Files = Record<string, string | undefined>;\n\nexport type Module = Record<string, FileProcessor>;\n\nexport interface Options {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n packageManager: PackageManagerConfig;\n type: ProjectType;\n}\n"],
4
+ "sourcesContent": ["import type { PackageJson as TypeFestPackageJson } from 'type-fest';\n\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { PackageManagerConfig } from '../../utils/packageManager.js';\n\nexport type { TsConfigJson } from 'type-fest';\n\nexport type PackageJson = TypeFestPackageJson & Record<string, unknown>;\n\nexport interface DependencySet {\n dependencies: Record<string, string>;\n devDependencies: Record<string, string>;\n type: ProjectType;\n}\n\nexport type DependencyDiff = Record<\n string,\n { operation: string; version: string }\n>;\n\ntype FileProcessor = (\n file: string | undefined,\n files: Files,\n initialFiles: Readonly<Files>,\n) => Promise<string | undefined> | string | undefined;\n\nexport type FileDiff = Record<\n string,\n { data: string | undefined; operation: string }\n>;\n\nexport type Files = Record<string, string | undefined>;\n\nexport type Module = Record<string, FileProcessor>;\n\nexport interface Options {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n packageManager: PackageManagerConfig;\n type: ProjectType;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -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,qB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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,EA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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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AAA,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(