skuba 14.0.0-migrate-to-inquirer-20251031055743 → 14.0.0-replace-global-vars-20251117052457

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/config/eslint.js +1 -1
  2. package/config/prettier.d.ts +8 -4
  3. package/config/prettier.js +10 -2
  4. package/lib/cli/adapter/eslint.js +11 -45
  5. package/lib/cli/adapter/eslint.js.map +3 -3
  6. package/lib/cli/adapter/prettier.js +39 -67
  7. package/lib/cli/adapter/prettier.js.map +2 -2
  8. package/lib/cli/build/args.js +8 -42
  9. package/lib/cli/build/args.js.map +2 -2
  10. package/lib/cli/build/assets.d.ts +3 -2
  11. package/lib/cli/build/assets.js +28 -60
  12. package/lib/cli/build/assets.js.map +3 -3
  13. package/lib/cli/build/esbuild.js +21 -45
  14. package/lib/cli/build/esbuild.js.map +2 -2
  15. package/lib/cli/build/index.js +21 -55
  16. package/lib/cli/build/index.js.map +3 -3
  17. package/lib/cli/build/tsc.js +23 -61
  18. package/lib/cli/build/tsc.js.map +3 -3
  19. package/lib/cli/buildPackage/index.js +8 -32
  20. package/lib/cli/buildPackage/index.js.map +1 -1
  21. package/lib/cli/configure/analyseConfiguration.js +16 -50
  22. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  23. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  24. package/lib/cli/configure/analyseDependencies.js +25 -59
  25. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  26. package/lib/cli/configure/analysis/diff.js +5 -39
  27. package/lib/cli/configure/analysis/diff.js.map +3 -3
  28. package/lib/cli/configure/analysis/files.js +8 -42
  29. package/lib/cli/configure/analysis/files.js.map +2 -2
  30. package/lib/cli/configure/analysis/git.js +12 -46
  31. package/lib/cli/configure/analysis/git.js.map +2 -2
  32. package/lib/cli/configure/analysis/package.d.ts +2 -3
  33. package/lib/cli/configure/analysis/package.js +10 -45
  34. package/lib/cli/configure/analysis/package.js.map +3 -3
  35. package/lib/cli/configure/analysis/project.js +18 -50
  36. package/lib/cli/configure/analysis/project.js.map +2 -2
  37. package/lib/cli/configure/dependencies/index.js +7 -35
  38. package/lib/cli/configure/dependencies/index.js.map +1 -1
  39. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +4 -28
  40. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  41. package/lib/cli/configure/dependencies/seekKoala.js +4 -28
  42. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  43. package/lib/cli/configure/dependencies/skuba.js +4 -28
  44. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  45. package/lib/cli/configure/dependencies/skubaDeps.js +2 -26
  46. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  47. package/lib/cli/configure/dependencies/skubaDive.js +4 -29
  48. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  49. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  50. package/lib/cli/configure/ensureTemplateCompletion.js +35 -60
  51. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  52. package/lib/cli/configure/getEntryPoint.d.ts +1 -1
  53. package/lib/cli/configure/getEntryPoint.js +14 -48
  54. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  55. package/lib/cli/configure/getProjectType.d.ts +1 -1
  56. package/lib/cli/configure/getProjectType.js +14 -35
  57. package/lib/cli/configure/getProjectType.js.map +2 -2
  58. package/lib/cli/configure/index.js +50 -84
  59. package/lib/cli/configure/index.js.map +3 -3
  60. package/lib/cli/configure/modules/eslint.js +10 -34
  61. package/lib/cli/configure/modules/eslint.js.map +1 -1
  62. package/lib/cli/configure/modules/ignore.js +8 -32
  63. package/lib/cli/configure/modules/ignore.js.map +1 -1
  64. package/lib/cli/configure/modules/index.js +18 -44
  65. package/lib/cli/configure/modules/index.js.map +2 -2
  66. package/lib/cli/configure/modules/nodemon.js +4 -28
  67. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  68. package/lib/cli/configure/modules/package.js +10 -34
  69. package/lib/cli/configure/modules/package.js.map +1 -1
  70. package/lib/cli/configure/modules/prettier.js +11 -35
  71. package/lib/cli/configure/modules/prettier.js.map +1 -1
  72. package/lib/cli/configure/modules/renovate.js +17 -40
  73. package/lib/cli/configure/modules/renovate.js.map +2 -2
  74. package/lib/cli/configure/modules/serverless.js +2 -26
  75. package/lib/cli/configure/modules/serverless.js.map +1 -1
  76. package/lib/cli/configure/modules/tslint.js +4 -28
  77. package/lib/cli/configure/modules/tslint.js.map +1 -1
  78. package/lib/cli/configure/processing/configFile.js +3 -39
  79. package/lib/cli/configure/processing/configFile.js.map +1 -1
  80. package/lib/cli/configure/processing/deleteFiles.js +2 -26
  81. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  82. package/lib/cli/configure/processing/javascript.js +2 -27
  83. package/lib/cli/configure/processing/javascript.js.map +1 -1
  84. package/lib/cli/configure/processing/json.js +6 -31
  85. package/lib/cli/configure/processing/json.js.map +1 -1
  86. package/lib/cli/configure/processing/loadFiles.js +2 -26
  87. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  88. package/lib/cli/configure/processing/module.js +4 -28
  89. package/lib/cli/configure/processing/module.js.map +1 -1
  90. package/lib/cli/configure/processing/package.d.ts +1 -67
  91. package/lib/cli/configure/processing/package.js +8 -45
  92. package/lib/cli/configure/processing/package.js.map +3 -3
  93. package/lib/cli/configure/processing/prettier.js +4 -38
  94. package/lib/cli/configure/processing/prettier.js.map +2 -2
  95. package/lib/cli/configure/processing/record.js +5 -41
  96. package/lib/cli/configure/processing/record.js.map +2 -2
  97. package/lib/cli/configure/processing/typescript.js +26 -63
  98. package/lib/cli/configure/processing/typescript.js.map +2 -2
  99. package/lib/cli/configure/types.d.ts +15 -4
  100. package/lib/cli/configure/types.js +0 -16
  101. package/lib/cli/configure/types.js.map +3 -3
  102. package/lib/cli/format/index.js +20 -54
  103. package/lib/cli/format/index.js.map +3 -3
  104. package/lib/cli/help/index.js +6 -30
  105. package/lib/cli/help/index.js.map +1 -1
  106. package/lib/cli/init/getConfig.d.ts +1 -1
  107. package/lib/cli/init/getConfig.js +89 -118
  108. package/lib/cli/init/getConfig.js.map +3 -3
  109. package/lib/cli/init/git.js +16 -51
  110. package/lib/cli/init/git.js.map +2 -2
  111. package/lib/cli/init/index.js +67 -98
  112. package/lib/cli/init/index.js.map +2 -2
  113. package/lib/cli/init/prompts.js +21 -42
  114. package/lib/cli/init/prompts.js.map +1 -1
  115. package/lib/cli/init/types.js +7 -41
  116. package/lib/cli/init/types.js.map +1 -1
  117. package/lib/cli/init/validation.js +2 -30
  118. package/lib/cli/init/validation.js.map +1 -1
  119. package/lib/cli/init/writePackageJson.js +8 -42
  120. package/lib/cli/init/writePackageJson.js.map +2 -2
  121. package/lib/cli/lint/annotate/buildkite/eslint.js +3 -37
  122. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  123. package/lib/cli/lint/annotate/buildkite/index.js +11 -45
  124. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  125. package/lib/cli/lint/annotate/buildkite/internal.js +3 -37
  126. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  127. package/lib/cli/lint/annotate/buildkite/prettier.js +3 -37
  128. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  129. package/lib/cli/lint/annotate/buildkite/tsc.js +3 -37
  130. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  131. package/lib/cli/lint/annotate/github/eslint.js +2 -26
  132. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  133. package/lib/cli/lint/annotate/github/index.js +11 -45
  134. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  135. package/lib/cli/lint/annotate/github/internal.js +2 -26
  136. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  137. package/lib/cli/lint/annotate/github/prettier.js +2 -26
  138. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  139. package/lib/cli/lint/annotate/github/tsc.js +4 -28
  140. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  141. package/lib/cli/lint/annotate/index.js +6 -30
  142. package/lib/cli/lint/annotate/index.js.map +1 -1
  143. package/lib/cli/lint/autofix.js +37 -73
  144. package/lib/cli/lint/autofix.js.map +1 -1
  145. package/lib/cli/lint/eslint.js +16 -51
  146. package/lib/cli/lint/eslint.js.map +3 -3
  147. package/lib/cli/lint/external.js +19 -51
  148. package/lib/cli/lint/external.js.map +2 -2
  149. package/lib/cli/lint/index.js +26 -52
  150. package/lib/cli/lint/index.js.map +2 -2
  151. package/lib/cli/lint/internal.js +20 -52
  152. package/lib/cli/lint/internal.js.map +3 -3
  153. package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -33
  154. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  155. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +12 -48
  156. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
  157. package/lib/cli/lint/internalLints/patchRenovateConfig.js +21 -55
  158. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  159. package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -66
  160. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  161. package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
  162. package/lib/cli/lint/internalLints/upgrade/index.js +23 -56
  163. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  164. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +4 -28
  165. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  166. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +11 -45
  167. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  168. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +6 -30
  169. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  170. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +37 -65
  171. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
  172. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -46
  173. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  174. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +4 -28
  175. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  176. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +23 -59
  177. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  178. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +4 -28
  179. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  180. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -46
  181. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  182. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +6 -30
  183. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  184. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -46
  185. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  186. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -46
  187. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  188. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +4 -28
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -46
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +29 -67
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +10 -34
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +11 -45
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +4 -0
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +18 -63
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +15 -50
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.d.ts +2 -0
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +11 -0
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +7 -0
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +5 -0
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +72 -0
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +7 -0
  209. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +17 -51
  210. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  211. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +10 -34
  212. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  213. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +10 -44
  214. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +12 -46
  216. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  217. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +4 -28
  218. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  219. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +15 -49
  220. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  221. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +11 -45
  222. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  223. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +10 -39
  224. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
  225. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +11 -45
  226. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  227. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +11 -45
  228. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  229. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +13 -47
  230. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  231. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +4 -28
  232. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  233. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +11 -45
  234. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  235. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +4 -28
  236. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +8 -32
  238. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
  239. package/lib/cli/lint/prettier.js +15 -50
  240. package/lib/cli/lint/prettier.js.map +3 -3
  241. package/lib/cli/lint/tsc.js +4 -28
  242. package/lib/cli/lint/tsc.js.map +1 -1
  243. package/lib/cli/lint/types.js +0 -16
  244. package/lib/cli/lint/types.js.map +3 -3
  245. package/lib/cli/migrate/index.js +10 -34
  246. package/lib/cli/migrate/index.js.map +1 -1
  247. package/lib/cli/migrate/nodeVersion/checks.js +24 -61
  248. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  249. package/lib/cli/migrate/nodeVersion/index.js +25 -55
  250. package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
  251. package/lib/cli/node/index.js +20 -57
  252. package/lib/cli/node/index.js.map +3 -3
  253. package/lib/cli/release/index.js +4 -28
  254. package/lib/cli/release/index.js.map +1 -1
  255. package/lib/cli/start/index.js +16 -50
  256. package/lib/cli/start/index.js.map +3 -3
  257. package/lib/cli/test/index.js +4 -44
  258. package/lib/cli/test/index.js.map +2 -2
  259. package/lib/cli/version/index.js +6 -30
  260. package/lib/cli/version/index.js.map +1 -1
  261. package/lib/eslint.d.js +0 -1
  262. package/lib/index.d.ts +0 -1
  263. package/lib/index.js +6 -46
  264. package/lib/index.js.map +2 -2
  265. package/lib/skuba.js +26 -45
  266. package/lib/skuba.js.map +3 -3
  267. package/lib/utils/args.js +6 -43
  268. package/lib/utils/args.js.map +2 -2
  269. package/lib/utils/command.js +4 -42
  270. package/lib/utils/command.js.map +3 -3
  271. package/lib/utils/copy.js +20 -57
  272. package/lib/utils/copy.js.map +2 -2
  273. package/lib/utils/dir.js +32 -72
  274. package/lib/utils/dir.js.map +2 -2
  275. package/lib/utils/env.js +2 -26
  276. package/lib/utils/env.js.map +1 -1
  277. package/lib/utils/error.js +10 -47
  278. package/lib/utils/error.js.map +1 -1
  279. package/lib/utils/exec.d.ts +3 -2
  280. package/lib/utils/exec.js +24 -62
  281. package/lib/utils/exec.js.map +3 -3
  282. package/lib/utils/fs.js +6 -40
  283. package/lib/utils/fs.js.map +3 -3
  284. package/lib/utils/help.js +6 -30
  285. package/lib/utils/help.js.map +1 -1
  286. package/lib/utils/logging.d.ts +9 -10
  287. package/lib/utils/logging.js +11 -48
  288. package/lib/utils/logging.js.map +3 -3
  289. package/lib/utils/logo.js +28 -59
  290. package/lib/utils/logo.js.map +3 -3
  291. package/lib/utils/manifest.d.ts +3 -2
  292. package/lib/utils/manifest.js +8 -48
  293. package/lib/utils/manifest.js.map +3 -3
  294. package/lib/utils/npmrc.js +2 -26
  295. package/lib/utils/npmrc.js.map +1 -1
  296. package/lib/utils/packageManager.js +12 -49
  297. package/lib/utils/packageManager.js.map +2 -2
  298. package/lib/utils/port.js +4 -39
  299. package/lib/utils/port.js.map +2 -2
  300. package/lib/utils/sleep.js +2 -26
  301. package/lib/utils/sleep.js.map +1 -1
  302. package/lib/utils/template.js +18 -55
  303. package/lib/utils/template.js.map +3 -3
  304. package/lib/utils/validation.js +2 -31
  305. package/lib/utils/validation.js.map +1 -1
  306. package/lib/utils/version.js +9 -46
  307. package/lib/utils/version.js.map +2 -2
  308. package/lib/utils/wait.js +7 -32
  309. package/lib/utils/wait.js.map +1 -1
  310. package/lib/utils/worker.d.ts +3 -3
  311. package/lib/utils/worker.js +10 -35
  312. package/lib/utils/worker.js.map +1 -1
  313. package/lib/wrapper/function-arguments.d.js +0 -1
  314. package/lib/wrapper/functionHandler.js +18 -49
  315. package/lib/wrapper/functionHandler.js.map +2 -2
  316. package/lib/wrapper/http.d.ts +0 -6
  317. package/lib/wrapper/http.js +8 -51
  318. package/lib/wrapper/http.js.map +3 -3
  319. package/lib/wrapper/index.js +6 -7
  320. package/lib/wrapper/index.js.map +1 -1
  321. package/lib/wrapper/main.js +8 -42
  322. package/lib/wrapper/main.js.map +3 -3
  323. package/lib/wrapper/requestListener.js +13 -46
  324. package/lib/wrapper/requestListener.js.map +3 -3
  325. package/lib/wrapper/server.d.ts +7 -0
  326. package/lib/wrapper/server.js +11 -0
  327. package/lib/wrapper/server.js.map +7 -0
  328. package/package.json +17 -24
  329. package/template/base/_.prettierrc.js +1 -1
  330. package/template/base/_eslint.config.js +1 -1
  331. package/template/base/_pnpm-workspace.yaml +3 -2
  332. package/template/base/vitest.config.ts +25 -0
  333. package/template/express-rest-api/package.json +2 -1
  334. package/template/express-rest-api/skuba.template.js +1 -1
  335. package/template/express-rest-api/src/app.test.ts +1 -0
  336. package/template/greeter/package.json +4 -3
  337. package/template/greeter/skuba.template.js +1 -1
  338. package/template/greeter/src/app.test.ts +3 -1
  339. package/template/koa-rest-api/package.json +2 -1
  340. package/template/koa-rest-api/skuba.template.js +1 -1
  341. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
  342. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
  343. package/template/koa-rest-api/src/app.test.ts +2 -0
  344. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  345. package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
  346. package/template/koa-rest-api/src/testing/metrics.ts +2 -0
  347. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
  348. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
  349. package/template/lambda-sqs-worker-cdk/package.json +6 -5
  350. package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
  351. package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
  352. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
  353. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
  354. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
  355. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
  356. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
  357. package/template/oss-npm-package/_package.json +1 -0
  358. package/template/oss-npm-package/skuba.template.js +1 -1
  359. package/template/oss-npm-package/src/index.test.ts +2 -0
  360. package/template/private-npm-package/_package.json +1 -0
  361. package/template/private-npm-package/skuba.template.js +1 -1
  362. package/template/private-npm-package/src/index.test.ts +2 -0
  363. package/config/jest.js +0 -1
  364. package/jest/moduleNameMapper.js +0 -64
  365. package/jest/transform.js +0 -62
  366. package/jest/tsConfig.js +0 -26
  367. package/jest-preset.js +0 -37
  368. package/lib/api/jest/index.d.ts +0 -15
  369. package/lib/api/jest/index.js +0 -59
  370. package/lib/api/jest/index.js.map +0 -7
  371. package/lib/cli/configure/modules/jest.d.ts +0 -2
  372. package/lib/cli/configure/modules/jest.js +0 -86
  373. package/lib/cli/configure/modules/jest.js.map +0 -7
  374. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
  375. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
  376. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
  377. package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
  378. package/lib/cli/test/reporters/github/annotations.js +0 -102
  379. package/lib/cli/test/reporters/github/annotations.js.map +0 -7
  380. package/lib/cli/test/reporters/github/index.d.ts +0 -5
  381. package/lib/cli/test/reporters/github/index.js +0 -74
  382. package/lib/cli/test/reporters/github/index.js.map +0 -7
  383. package/template/base/jest.config.ts +0 -19
  384. package/template/base/jest.setup.ts +0 -3
@@ -1,89 +1,63 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var getConfig_exports = {};
30
- __export(getConfig_exports, {
31
- configureFromPrompt: () => configureFromPrompt,
32
- getConfig: () => getConfig,
33
- getTemplateConfig: () => getTemplateConfig,
34
- readJSONFromStdIn: () => readJSONFromStdIn,
35
- runForm: () => runForm
36
- });
37
- module.exports = __toCommonJS(getConfig_exports);
38
- var import_path = __toESM(require("path"));
39
- var import_prompts = require("@inquirer/prompts");
40
- var import_chalk = __toESM(require("chalk"));
41
- var import_fs_extra = __toESM(require("fs-extra"));
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_prompts2 = require("./prompts.js");
50
- var import_types = require("./types.js");
1
+ import { styleText } from "node:util";
2
+ import path from "path";
3
+ import { input } from "@inquirer/prompts";
4
+ import fs from "fs-extra";
5
+ import { copyFiles } from "../../utils/copy.js";
6
+ import { isErrorWithCode } from "../../utils/error.js";
7
+ import { log } from "../../utils/logging.js";
8
+ import {
9
+ DEFAULT_PACKAGE_MANAGER,
10
+ configForPackageManager
11
+ } from "../../utils/packageManager.js";
12
+ import { getRandomPort } from "../../utils/port.js";
13
+ import {
14
+ TEMPLATE_CONFIG_FILENAME,
15
+ TEMPLATE_DIR,
16
+ templateConfigSchema
17
+ } from "../../utils/template.js";
18
+ import { downloadGitHubTemplate } from "./git.js";
19
+ import {
20
+ BASE_PROMPT_PROPS,
21
+ getGitPath,
22
+ getTemplateName,
23
+ shouldContinue
24
+ } from "./prompts.js";
25
+ import { initConfigInputSchema } from "./types.js";
51
26
  const runForm = async (props) => {
52
27
  const { message } = props;
53
- import_logging.log.plain(message);
54
- const entries = await Promise.all(
55
- props.choices.map(async (choice) => {
56
- const inputValue = await (0, import_prompts.input)({
57
- message: choice.message,
58
- default: choice.initial,
59
- validate: async (inputText) => {
60
- if (!inputText || inputText === "" || inputText === choice.initial && !choice.allowInitial) {
61
- return "Form is not complete";
62
- }
63
- return choice.validate?.(inputText) ?? true;
28
+ log.plain(message);
29
+ const result = {};
30
+ for (const choice of props.choices) {
31
+ const inputValue = await input({
32
+ message: choice.message,
33
+ default: choice.initial,
34
+ validate: async (inputText) => {
35
+ if (!inputText || inputText === "" || inputText === choice.initial && !choice.allowInitial) {
36
+ return "Form is not complete";
64
37
  }
65
- });
66
- return [choice.name, inputValue];
67
- })
68
- );
69
- return Object.fromEntries(entries);
38
+ return choice.validate?.(inputText) ?? true;
39
+ }
40
+ });
41
+ result[choice.name] = inputValue;
42
+ }
43
+ return result;
70
44
  };
71
45
  const confirmShouldContinue = async (choices) => {
72
46
  const fieldsList = choices.map((choice) => choice.message);
73
- import_logging.log.newline();
74
- import_logging.log.plain("This template uses the following information:");
75
- import_logging.log.newline();
76
- fieldsList.forEach((message) => import_logging.log.subtle(`- ${message}`));
77
- import_logging.log.newline();
78
- const result = await (0, import_prompts2.shouldContinue)();
47
+ log.newline();
48
+ log.plain("This template uses the following information:");
49
+ log.newline();
50
+ fieldsList.forEach((message) => log.subtle(`- ${message}`));
51
+ log.newline();
52
+ const result = await shouldContinue();
79
53
  return result === "yes";
80
54
  };
81
55
  const createDirectory = async (dir) => {
82
56
  try {
83
- await import_fs_extra.default.promises.mkdir(dir);
57
+ await fs.promises.mkdir(dir);
84
58
  } catch (err) {
85
- if ((0, import_error.isErrorWithCode)(err, "EEXIST")) {
86
- import_logging.log.err(`The directory '${dir}' already exists.`);
59
+ if (isErrorWithCode(err, "EEXIST")) {
60
+ log.err(`The directory '${dir}' already exists.`);
87
61
  process.exit(1);
88
62
  }
89
63
  throw err;
@@ -93,10 +67,10 @@ const cloneTemplate = async (templateName, destinationDir) => {
93
67
  const isCustomTemplate = templateName.startsWith("github:");
94
68
  if (isCustomTemplate) {
95
69
  const gitHubPath = templateName.slice("github:".length);
96
- await (0, import_git.downloadGitHubTemplate)(gitHubPath, destinationDir);
70
+ await downloadGitHubTemplate(gitHubPath, destinationDir);
97
71
  } else {
98
- const templateDir = import_path.default.join(import_template.TEMPLATE_DIR, templateName);
99
- await (0, import_copy.copyFiles)({
72
+ const templateDir = path.join(TEMPLATE_DIR, templateName);
73
+ await copyFiles({
100
74
  // assume built-in templates have no extraneous files
101
75
  include: () => true,
102
76
  sourceRoot: templateDir,
@@ -106,17 +80,15 @@ const cloneTemplate = async (templateName, destinationDir) => {
106
80
  stripUnderscorePrefix: true
107
81
  });
108
82
  }
109
- const templateConfig = getTemplateConfig(
110
- import_path.default.join(process.cwd(), destinationDir)
83
+ const templateConfig = await getTemplateConfig(
84
+ path.join(process.cwd(), destinationDir)
111
85
  );
112
86
  if (isCustomTemplate) {
113
- import_logging.log.newline();
114
- import_logging.log.warn(
87
+ log.newline();
88
+ log.warn(
115
89
  "You may need to run",
116
- import_logging.log.bold(
117
- (0, import_packageManager.configForPackageManager)(templateConfig.packageManager).print.exec,
118
- "skuba",
119
- "configure"
90
+ log.bold(
91
+ `${configForPackageManager(templateConfig.packageManager).print.exec} skuba configure`
120
92
  ),
121
93
  "once this is done."
122
94
  );
@@ -124,9 +96,9 @@ const cloneTemplate = async (templateName, destinationDir) => {
124
96
  return templateConfig;
125
97
  };
126
98
  const selectTemplateName = async () => {
127
- const templateSelection = await (0, import_prompts2.getTemplateName)();
99
+ const templateSelection = await getTemplateName();
128
100
  if (templateSelection === "github \u2192") {
129
- const gitHubPath = await (0, import_prompts2.getGitPath)();
101
+ const gitHubPath = await getGitPath();
130
102
  return `github:${gitHubPath}`;
131
103
  }
132
104
  return templateSelection;
@@ -134,17 +106,17 @@ const selectTemplateName = async () => {
134
106
  const generatePlaceholders = (choices) => Object.fromEntries(
135
107
  choices.map(({ name }) => [name, `<%- ${name} %>`])
136
108
  );
137
- const getTemplateConfig = (dir) => {
138
- const templateConfigPath = import_path.default.join(dir, import_template.TEMPLATE_CONFIG_FILENAME);
109
+ const getTemplateConfig = async (dir) => {
110
+ const templateConfigPath = path.join(dir, TEMPLATE_CONFIG_FILENAME);
139
111
  try {
140
- const templateConfig = require(templateConfigPath);
141
- return import_template.templateConfigSchema.parse(templateConfig);
112
+ const templateModule = await import(templateConfigPath);
113
+ return templateConfigSchema.parse(templateModule.default);
142
114
  } catch (err) {
143
- if ((0, import_error.isErrorWithCode)(err, "MODULE_NOT_FOUND")) {
115
+ if (isErrorWithCode(err, "MODULE_NOT_FOUND")) {
144
116
  return {
145
117
  entryPoint: void 0,
146
118
  fields: [],
147
- packageManager: import_packageManager.DEFAULT_PACKAGE_MANAGER,
119
+ packageManager: DEFAULT_PACKAGE_MANAGER,
148
120
  type: void 0
149
121
  };
150
122
  }
@@ -158,7 +130,7 @@ const baseToTemplateData = async ({
158
130
  defaultBranch
159
131
  }) => {
160
132
  const [orgName, teamName] = ownerName.split("/");
161
- const port = String(await (0, import_port.getRandomPort)());
133
+ const port = String(await getRandomPort());
162
134
  if (!orgName) {
163
135
  throw new Error(`Invalid format for owner name: ${ownerName}`);
164
136
  }
@@ -176,8 +148,8 @@ const baseToTemplateData = async ({
176
148
  };
177
149
  };
178
150
  const configureFromPrompt = async () => {
179
- const { ownerName, platformName, repoName, defaultBranch } = await runForm(import_prompts2.BASE_PROMPT_PROPS);
180
- import_logging.log.plain(import_chalk.default.cyan(repoName), "by", import_chalk.default.cyan(ownerName));
151
+ const { ownerName, platformName, repoName, defaultBranch } = await runForm(BASE_PROMPT_PROPS);
152
+ log.plain(styleText("cyan", repoName), "by", styleText("cyan", ownerName));
181
153
  const templateData = await baseToTemplateData({
182
154
  ownerName,
183
155
  platformName,
@@ -186,7 +158,7 @@ const configureFromPrompt = async () => {
186
158
  });
187
159
  const destinationDir = repoName;
188
160
  await createDirectory(destinationDir);
189
- import_logging.log.newline();
161
+ log.newline();
190
162
  const templateName = await selectTemplateName();
191
163
  const { entryPoint, fields, noSkip, packageManager, type } = await cloneTemplate(templateName, destinationDir);
192
164
  if (fields.length === 0) {
@@ -202,10 +174,13 @@ const configureFromPrompt = async () => {
202
174
  }
203
175
  const shouldContinueWithTemplate = noSkip ? true : await confirmShouldContinue(fields);
204
176
  if (shouldContinueWithTemplate) {
205
- import_logging.log.newline();
177
+ log.newline();
206
178
  const customAnswers2 = await runForm({
207
179
  choices: fields,
208
- message: import_chalk.default.bold(`Complete ${import_chalk.default.cyan(templateName)}:`),
180
+ message: styleText(
181
+ "bold",
182
+ `Complete ${styleText("cyan", templateName)}:`
183
+ ),
209
184
  name: "customAnswers"
210
185
  });
211
186
  return {
@@ -218,12 +193,9 @@ const configureFromPrompt = async () => {
218
193
  type
219
194
  };
220
195
  }
221
- import_logging.log.newline();
222
- import_logging.log.warn(
223
- `Resume this later with ${import_chalk.default.bold(
224
- (0, import_packageManager.configForPackageManager)(packageManager).print.exec,
225
- "skuba configure"
226
- )}.`
196
+ log.newline();
197
+ log.warn(
198
+ `Resume this later with ${styleText("bold", `${configForPackageManager(packageManager).print.exec} skuba configure`)}.`
227
199
  );
228
200
  const customAnswers = generatePlaceholders(fields);
229
201
  return {
@@ -243,24 +215,24 @@ const readJSONFromStdIn = async () => {
243
215
  );
244
216
  text = text.trim();
245
217
  if (text === "") {
246
- import_logging.log.err("No data from stdin.");
218
+ log.err("No data from stdin.");
247
219
  process.exit(1);
248
220
  }
249
221
  let value;
250
222
  try {
251
223
  value = JSON.parse(text);
252
224
  } catch {
253
- import_logging.log.err("Invalid JSON from stdin.");
225
+ log.err("Invalid JSON from stdin.");
254
226
  process.exit(1);
255
227
  }
256
228
  return value;
257
229
  };
258
230
  const configureFromPipe = async () => {
259
231
  const value = await readJSONFromStdIn();
260
- const result = import_types.initConfigInputSchema.safeParse(value);
232
+ const result = initConfigInputSchema.safeParse(value);
261
233
  if (!result.success) {
262
- import_logging.log.err("Invalid data from stdin:");
263
- import_logging.log.err(result.error);
234
+ log.err("Invalid data from stdin:");
235
+ log.err(result.error);
264
236
  process.exit(1);
265
237
  }
266
238
  const { destinationDir, templateComplete, templateName } = result.data;
@@ -272,7 +244,7 @@ const configureFromPipe = async () => {
272
244
  const { entryPoint, fields, noSkip, packageManager, type } = await cloneTemplate(templateName, destinationDir);
273
245
  if (!templateComplete) {
274
246
  if (noSkip) {
275
- import_logging.log.err("Templating for", import_logging.log.bold(templateName), "cannot be skipped.");
247
+ log.err("Templating for", log.bold(templateName), "cannot be skipped.");
276
248
  process.exit(1);
277
249
  }
278
250
  return {
@@ -290,9 +262,9 @@ const configureFromPipe = async () => {
290
262
  const provided = new Set(Object.keys(templateData));
291
263
  const missing = required.filter((name) => !provided.has(name));
292
264
  if (missing.length > 0) {
293
- import_logging.log.err("This template uses the following information:");
294
- import_logging.log.newline();
295
- missing.forEach((name) => import_logging.log.err(`- ${name}`));
265
+ log.err("This template uses the following information:");
266
+ log.newline();
267
+ missing.forEach((name) => log.err(`- ${name}`));
296
268
  process.exit(1);
297
269
  }
298
270
  return {
@@ -304,12 +276,11 @@ const configureFromPipe = async () => {
304
276
  };
305
277
  };
306
278
  const getConfig = () => process.stdin.isTTY ? configureFromPrompt() : configureFromPipe();
307
- // Annotate the CommonJS export names for ESM import in node:
308
- 0 && (module.exports = {
279
+ export {
309
280
  configureFromPrompt,
310
281
  getConfig,
311
282
  getTemplateConfig,
312
283
  readJSONFromStdIn,
313
284
  runForm
314
- });
285
+ };
315
286
  //# sourceMappingURL=getConfig.js.map
@@ -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 { input } from '@inquirer/prompts';\nimport chalk from 'chalk';\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 getGitPath,\n getTemplateName,\n shouldContinue,\n} from './prompts.js';\nimport { type InitConfig, initConfigInputSchema } from './types.js';\n\nexport const runForm = async <T = Record<string, string>>(props: {\n choices: readonly Choice[];\n message: string;\n name: string;\n}): Promise<T> => {\n const { message } = props;\n log.plain(message);\n\n const entries = await Promise.all(\n props.choices.map(async (choice) => {\n const inputValue = await input({\n message: choice.message,\n default: choice.initial,\n validate: async (inputText: string) => {\n if (\n !inputText ||\n inputText === '' ||\n (inputText === choice.initial && !choice.allowInitial)\n ) {\n return 'Form is not complete';\n }\n\n return choice.validate?.(inputText) ?? true;\n },\n });\n\n return [choice.name, inputValue] as const;\n }),\n );\n\n return Object.fromEntries(entries) as T;\n};\n\nconst confirmShouldContinue = async (choices: readonly Choice[]) => {\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 shouldContinue();\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 selectTemplateName = async () => {\n const templateSelection = await getTemplateName();\n\n if (templateSelection === 'github \u2192') {\n const gitHubPath = await getGitPath();\n return `github:${gitHubPath}`;\n }\n\n return templateSelection;\n};\n\nconst generatePlaceholders = (choices: Choice[]) =>\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 selectTemplateName();\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 shouldContinueWithTemplate = noSkip\n ? true\n : await confirmShouldContinue(fields);\n\n if (shouldContinueWithTemplate) {\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
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,qBAAsB;AACtB,mBAAkB;AAClB,sBAAe;AAEf,kBAA0B;AAC1B,mBAAgC;AAChC,qBAAoB;AACpB,4BAGO;AACP,kBAA8B;AAC9B,sBAKO;AAEP,iBAAuC;AACvC,IAAAA,kBAOO;AACP,mBAAuD;AAEhD,MAAM,UAAU,OAAmC,UAIxC;AAChB,QAAM,EAAE,QAAQ,IAAI;AACpB,qBAAI,MAAM,OAAO;AAEjB,QAAM,UAAU,MAAM,QAAQ;AAAA,IAC5B,MAAM,QAAQ,IAAI,OAAO,WAAW;AAClC,YAAM,aAAa,UAAM,sBAAM;AAAA,QAC7B,SAAS,OAAO;AAAA,QAChB,SAAS,OAAO;AAAA,QAChB,UAAU,OAAO,cAAsB;AACrC,cACE,CAAC,aACD,cAAc,MACb,cAAc,OAAO,WAAW,CAAC,OAAO,cACzC;AACA,mBAAO;AAAA,UACT;AAEA,iBAAO,OAAO,WAAW,SAAS,KAAK;AAAA,QACzC;AAAA,MACF,CAAC;AAED,aAAO,CAAC,OAAO,MAAM,UAAU;AAAA,IACjC,CAAC;AAAA,EACH;AAEA,SAAO,OAAO,YAAY,OAAO;AACnC;AAEA,MAAM,wBAAwB,OAAO,YAA+B;AAClE,QAAM,aAAa,QAAQ,IAAI,CAAC,WAAW,OAAO,OAAO;AAEzD,qBAAI,QAAQ;AACZ,qBAAI,MAAM,+CAA+C;AACzD,qBAAI,QAAQ;AACZ,aAAW,QAAQ,CAAC,YAAY,mBAAI,OAAO,KAAK,OAAO,EAAE,CAAC;AAE1D,qBAAI,QAAQ;AACZ,QAAM,SAAS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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
- "names": ["import_prompts", "fs", "path", "chalk", "customAnswers"]
4
+ "sourcesContent": ["import { styleText } from 'node:util';\nimport path from 'path';\n\nimport { input } from '@inquirer/prompts';\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 getGitPath,\n getTemplateName,\n shouldContinue,\n} from './prompts.js';\nimport { type InitConfig, initConfigInputSchema } from './types.js';\n\nexport const runForm = async <T = Record<string, string>>(props: {\n choices: readonly Choice[];\n message: string;\n name: string;\n}): Promise<T> => {\n const { message } = props;\n log.plain(message);\n\n const result: Record<string, string> = {};\n\n for (const choice of props.choices) {\n const inputValue = await input({\n message: choice.message,\n default: choice.initial,\n validate: async (inputText: string) => {\n if (\n !inputText ||\n inputText === '' ||\n (inputText === choice.initial && !choice.allowInitial)\n ) {\n return 'Form is not complete';\n }\n\n return choice.validate?.(inputText) ?? true;\n },\n });\n\n result[choice.name] = inputValue;\n }\n\n return result as T;\n};\n\nconst confirmShouldContinue = async (choices: readonly Choice[]) => {\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 shouldContinue();\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 = await 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} skuba configure`,\n ),\n 'once this is done.',\n );\n }\n\n return templateConfig;\n};\n\nconst selectTemplateName = async () => {\n const templateSelection = await getTemplateName();\n\n if (templateSelection === 'github \u2192') {\n const gitHubPath = await getGitPath();\n return `github:${gitHubPath}`;\n }\n\n return templateSelection;\n};\n\nconst generatePlaceholders = (choices: Choice[]) =>\n Object.fromEntries(\n choices.map(({ name }) => [name, `<%- ${name} %>`] as const),\n );\n\nexport const getTemplateConfig = async (\n dir: string,\n): Promise<TemplateConfig> => {\n const templateConfigPath = path.join(dir, TEMPLATE_CONFIG_FILENAME);\n\n try {\n const templateModule = (await import(templateConfigPath)) as {\n default: unknown;\n };\n\n return templateConfigSchema.parse(templateModule.default);\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(styleText('cyan', repoName), 'by', styleText('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 selectTemplateName();\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 shouldContinueWithTemplate = noSkip\n ? true\n : await confirmShouldContinue(fields);\n\n if (shouldContinueWithTemplate) {\n log.newline();\n const customAnswers = await runForm({\n choices: fields,\n message: styleText(\n 'bold',\n `Complete ${styleText('cyan', templateName)}:`,\n ),\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 ${styleText('bold', `${configForPackageManager(packageManager).print.exec} skuba configure`)}.`,\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
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AAEjB,SAAS,aAAa;AACtB,OAAO,QAAQ;AAEf,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA0B,6BAA6B;AAEhD,MAAM,UAAU,OAAmC,UAIxC;AAChB,QAAM,EAAE,QAAQ,IAAI;AACpB,MAAI,MAAM,OAAO;AAEjB,QAAM,SAAiC,CAAC;AAExC,aAAW,UAAU,MAAM,SAAS;AAClC,UAAM,aAAa,MAAM,MAAM;AAAA,MAC7B,SAAS,OAAO;AAAA,MAChB,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO,cAAsB;AACrC,YACE,CAAC,aACD,cAAc,MACb,cAAc,OAAO,WAAW,CAAC,OAAO,cACzC;AACA,iBAAO;AAAA,QACT;AAEA,eAAO,OAAO,WAAW,SAAS,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAED,WAAO,OAAO,IAAI,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;AAEA,MAAM,wBAAwB,OAAO,YAA+B;AAClE,QAAM,aAAa,QAAQ,IAAI,CAAC,WAAW,OAAO,OAAO;AAEzD,MAAI,QAAQ;AACZ,MAAI,MAAM,+CAA+C;AACzD,MAAI,QAAQ;AACZ,aAAW,QAAQ,CAAC,YAAY,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;AAE1D,MAAI,QAAQ;AACZ,QAAM,SAAS,MAAM,eAAe;AAEpC,SAAO,WAAW;AACpB;AA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I,+CAA+C;AACvD,QAAI,QAAQ;AACZ,YAAQ,QAAQ,CAAC,SAAS,IAAI,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
+ "names": ["customAnswers"]
7
7
  }
@@ -1,75 +1,40 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var git_exports = {};
30
- __export(git_exports, {
31
- downloadGitHubTemplate: () => downloadGitHubTemplate,
32
- initialiseRepo: () => initialiseRepo
33
- });
34
- module.exports = __toCommonJS(git_exports);
35
- var import_path = __toESM(require("path"));
36
- var import_fs_extra = __toESM(require("fs-extra"));
37
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
38
- var import_simple_git = require("simple-git");
39
- var import_logging = require("../../utils/logging.js");
40
- var Git = __toESM(require("@skuba-lib/api/git"));
1
+ import path from "path";
2
+ import fs from "fs-extra";
3
+ import git from "isomorphic-git";
4
+ import { simpleGit } from "simple-git";
5
+ import { log } from "../../utils/logging.js";
6
+ import * as Git from "@skuba-lib/api/git";
41
7
  const initialiseRepo = async (dir, { orgName, repoName, defaultBranch }) => {
42
- await import_isomorphic_git.default.init({
8
+ await git.init({
43
9
  defaultBranch,
44
10
  dir,
45
- fs: import_fs_extra.default
11
+ fs
46
12
  });
47
13
  await Git.commit({
48
14
  dir,
49
15
  message: "Initial commit"
50
16
  });
51
- await import_isomorphic_git.default.addRemote({
17
+ await git.addRemote({
52
18
  dir,
53
- fs: import_fs_extra.default,
19
+ fs,
54
20
  remote: "origin",
55
21
  url: `git@github.com:${orgName}/${repoName}.git`
56
22
  });
57
23
  };
58
24
  const downloadGitHubTemplate = async (gitHubPath, destinationDir) => {
59
- import_logging.log.newline();
60
- import_logging.log.plain("Downloading", import_logging.log.bold(gitHubPath), "from GitHub...");
61
- await (0, import_simple_git.simpleGit)().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [
25
+ log.newline();
26
+ log.plain("Downloading", log.bold(gitHubPath), "from GitHub...");
27
+ await simpleGit().clone(`git@github.com:${gitHubPath}.git`, destinationDir, [
62
28
  "--depth=1",
63
29
  "--quiet"
64
30
  ]);
65
- await import_fs_extra.default.promises.rm(import_path.default.join(destinationDir, ".git"), {
31
+ await fs.promises.rm(path.join(destinationDir, ".git"), {
66
32
  force: true,
67
33
  recursive: true
68
34
  });
69
35
  };
70
- // Annotate the CommonJS export names for ESM import in node:
71
- 0 && (module.exports = {
36
+ export {
72
37
  downloadGitHubTemplate,
73
38
  initialiseRepo
74
- });
39
+ };
75
40
  //# sourceMappingURL=git.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/init/git.ts"],
4
4
  "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport { simpleGit } from 'simple-git';\n\nimport { log } from '../../utils/logging.js';\n\nimport * as Git from '@skuba-lib/api/git';\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
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAChB,wBAA0B;AAE1B,qBAAoB;AAEpB,UAAqB;AAQd,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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