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,51 +1,24 @@
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 ensureTemplateCompletion_exports = {};
30
- __export(ensureTemplateCompletion_exports, {
31
- ensureTemplateCompletion: () => ensureTemplateCompletion
32
- });
33
- module.exports = __toCommonJS(ensureTemplateCompletion_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_chalk = __toESM(require("chalk"));
36
- var import_fs_extra = __toESM(require("fs-extra"));
37
- var z = __toESM(require("zod/v4"));
38
- var import_copy = require("../../utils/copy.js");
39
- var import_logging = require("../../utils/logging.js");
40
- var import_template = require("../../utils/template.js");
41
- var import_validation = require("../../utils/validation.js");
42
- var import_getConfig = require("../init/getConfig.js");
43
- var import_package = require("./processing/package.js");
1
+ import { styleText } from "node:util";
2
+ import path from "path";
3
+ import fs from "fs-extra";
4
+ import * as z from "zod/v4";
5
+ import { copyFiles, createEjsRenderer } from "../../utils/copy.js";
6
+ import { log } from "../../utils/logging.js";
7
+ import {
8
+ ensureTemplateConfigDeletion
9
+ } from "../../utils/template.js";
10
+ import { hasStringProp } from "../../utils/validation.js";
11
+ import {
12
+ getTemplateConfig,
13
+ readJSONFromStdIn,
14
+ runForm
15
+ } from "../init/getConfig.js";
16
+ import { formatPackage } from "./processing/package.js";
44
17
  const templateDataSchema = z.object({
45
18
  templateData: z.record(z.string(), z.string())
46
19
  });
47
20
  const getTemplateDataFromStdIn = async (templateConfig) => {
48
- const config = await (0, import_getConfig.readJSONFromStdIn)();
21
+ const config = await readJSONFromStdIn();
49
22
  const data = templateDataSchema.parse(config);
50
23
  templateConfig.fields.forEach((field) => {
51
24
  const value = data.templateData[field.name];
@@ -63,33 +36,35 @@ const ensureTemplateCompletion = async ({
63
36
  include,
64
37
  manifest
65
38
  }) => {
66
- const templateConfig = (0, import_getConfig.getTemplateConfig)(destinationRoot);
39
+ const templateConfig = await getTemplateConfig(destinationRoot);
67
40
  if (templateConfig.fields.length === 0) {
68
41
  return templateConfig;
69
42
  }
70
- const templateName = (0, import_validation.hasStringProp)(manifest.packageJson.skuba, "template") ? manifest.packageJson.skuba.template : "template";
71
- import_logging.log.newline();
72
- const templateData = process.stdin.isTTY ? await (0, import_getConfig.runForm)({
43
+ const templateName = hasStringProp(manifest.packageJson.skuba, "template") ? manifest.packageJson.skuba.template : "template";
44
+ log.newline();
45
+ const templateData = process.stdin.isTTY ? await runForm({
73
46
  choices: templateConfig.fields,
74
- message: import_chalk.default.bold(`Complete ${import_chalk.default.cyan(templateName)}:`),
47
+ message: styleText(
48
+ "bold",
49
+ `Complete ${styleText("cyan", templateName)}:`
50
+ ),
75
51
  name: "customAnswers"
76
52
  }) : await getTemplateDataFromStdIn(templateConfig);
77
- const updatedPackageJson = await (0, import_package.formatPackage)(manifest.packageJson);
78
- const packageJsonFilepath = import_path.default.join(destinationRoot, "package.json");
79
- await import_fs_extra.default.promises.writeFile(packageJsonFilepath, updatedPackageJson);
80
- await (0, import_copy.copyFiles)({
53
+ const updatedPackageJson = await formatPackage(manifest.packageJson);
54
+ const packageJsonFilepath = path.join(destinationRoot, "package.json");
55
+ await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);
56
+ await copyFiles({
81
57
  sourceRoot: destinationRoot,
82
58
  destinationRoot,
83
59
  include,
84
- processors: [(0, import_copy.createEjsRenderer)(templateData)]
60
+ processors: [createEjsRenderer(templateData)]
85
61
  });
86
- await (0, import_template.ensureTemplateConfigDeletion)(destinationRoot);
87
- import_logging.log.newline();
88
- import_logging.log.ok("Templating complete!");
62
+ await ensureTemplateConfigDeletion(destinationRoot);
63
+ log.newline();
64
+ log.ok("Templating complete!");
89
65
  return templateConfig;
90
66
  };
91
- // Annotate the CommonJS export names for ESM import in node:
92
- 0 && (module.exports = {
67
+ export {
93
68
  ensureTemplateCompletion
94
- });
69
+ };
95
70
  //# sourceMappingURL=ensureTemplateCompletion.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/ensureTemplateCompletion.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\nimport * as z from 'zod/v4';\n\nimport { copyFiles, createEjsRenderer } from '../../utils/copy.js';\nimport { log } from '../../utils/logging.js';\nimport {\n type TemplateConfig,\n ensureTemplateConfigDeletion,\n} from '../../utils/template.js';\nimport { hasStringProp } from '../../utils/validation.js';\nimport {\n getTemplateConfig,\n readJSONFromStdIn,\n runForm,\n} from '../init/getConfig.js';\n\nimport { formatPackage } from './processing/package.js';\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: ReadResult;\n}\n\nconst templateDataSchema = z.object({\n templateData: z.record(z.string(), z.string()),\n});\n\nconst getTemplateDataFromStdIn = async (\n templateConfig: TemplateConfig,\n): Promise<Record<string, string>> => {\n const config = await readJSONFromStdIn();\n const data = templateDataSchema.parse(config);\n\n templateConfig.fields.forEach((field) => {\n const value = data.templateData[field.name];\n if (value === undefined) {\n throw new Error(`Missing field: ${field.name}`);\n }\n\n if (field.validate && !field.validate(value)) {\n throw new Error(`Invalid value for field: ${field.name}`);\n }\n });\n\n return data.templateData;\n};\n\nexport const ensureTemplateCompletion = async ({\n destinationRoot,\n include,\n manifest,\n}: Props): Promise<TemplateConfig> => {\n const templateConfig = getTemplateConfig(destinationRoot);\n\n if (templateConfig.fields.length === 0) {\n return templateConfig;\n }\n\n const templateName = hasStringProp(manifest.packageJson.skuba, 'template')\n ? manifest.packageJson.skuba.template\n : 'template';\n\n log.newline();\n const templateData = process.stdin.isTTY\n ? await runForm({\n choices: templateConfig.fields,\n message: chalk.bold(`Complete ${chalk.cyan(templateName)}:`),\n name: 'customAnswers',\n })\n : await getTemplateDataFromStdIn(templateConfig);\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors: [createEjsRenderer(templateData)],\n });\n\n await ensureTemplateConfigDeletion(destinationRoot);\n\n log.newline();\n log.ok('Templating complete!');\n\n return templateConfig;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAe;AAEf,QAAmB;AAEnB,kBAA6C;AAC7C,qBAAoB;AACpB,sBAGO;AACP,wBAA8B;AAC9B,uBAIO;AAEP,qBAA8B;AAQ9B,MAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAC/C,CAAC;AAED,MAAM,2BAA2B,OAC/B,mBACoC;AACpC,QAAM,SAAS,UAAM,oCAAkB;AACvC,QAAM,OAAO,mBAAmB,MAAM,MAAM;AAE5C,iBAAe,OAAO,QAAQ,CAAC,UAAU;AACvC,UAAM,QAAQ,KAAK,aAAa,MAAM,IAAI;AAC1C,QAAI,UAAU,QAAW;AACvB,YAAM,IAAI,MAAM,kBAAkB,MAAM,IAAI,EAAE;AAAA,IAChD;AAEA,QAAI,MAAM,YAAY,CAAC,MAAM,SAAS,KAAK,GAAG;AAC5C,YAAM,IAAI,MAAM,4BAA4B,MAAM,IAAI,EAAE;AAAA,IAC1D;AAAA,EACF,CAAC;AAED,SAAO,KAAK;AACd;AAEO,MAAM,2BAA2B,OAAO;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AACpC,QAAM,qBAAiB,oCAAkB,eAAe;AAExD,MAAI,eAAe,OAAO,WAAW,GAAG;AACtC,WAAO;AAAA,EACT;AAEA,QAAM,mBAAe,iCAAc,SAAS,YAAY,OAAO,UAAU,IACrE,SAAS,YAAY,MAAM,WAC3B;AAEJ,qBAAI,QAAQ;AACZ,QAAM,eAAe,QAAQ,MAAM,QAC/B,UAAM,0BAAQ;AAAA,IACZ,SAAS,eAAe;AAAA,IACxB,SAAS,aAAAA,QAAM,KAAK,YAAY,aAAAA,QAAM,KAAK,YAAY,CAAC,GAAG;AAAA,IAC3D,MAAM;AAAA,EACR,CAAC,IACD,MAAM,yBAAyB,cAAc;AAEjD,QAAM,qBAAqB,UAAM,8BAAc,SAAS,WAAW;AACnE,QAAM,sBAAsB,YAAAC,QAAK,KAAK,iBAAiB,cAAc;AACrE,QAAM,gBAAAC,QAAG,SAAS,UAAU,qBAAqB,kBAAkB;AAEnE,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,YAAY,KAAC,+BAAkB,YAAY,CAAC;AAAA,EAC9C,CAAC;AAED,YAAM,8CAA6B,eAAe;AAElD,qBAAI,QAAQ;AACZ,qBAAI,GAAG,sBAAsB;AAE7B,SAAO;AACT;",
6
- "names": ["chalk", "path", "fs"]
4
+ "sourcesContent": ["import { styleText } from 'node:util';\nimport path from 'path';\n\nimport fs from 'fs-extra';\nimport * as z from 'zod/v4';\n\nimport { copyFiles, createEjsRenderer } from '../../utils/copy.js';\nimport { log } from '../../utils/logging.js';\nimport {\n type TemplateConfig,\n ensureTemplateConfigDeletion,\n} from '../../utils/template.js';\nimport { hasStringProp } from '../../utils/validation.js';\nimport {\n getTemplateConfig,\n readJSONFromStdIn,\n runForm,\n} from '../init/getConfig.js';\n\nimport { formatPackage } from './processing/package.js';\nimport type { ReadResult } from './types.js';\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: ReadResult;\n}\n\nconst templateDataSchema = z.object({\n templateData: z.record(z.string(), z.string()),\n});\n\nconst getTemplateDataFromStdIn = async (\n templateConfig: TemplateConfig,\n): Promise<Record<string, string>> => {\n const config = await readJSONFromStdIn();\n const data = templateDataSchema.parse(config);\n\n templateConfig.fields.forEach((field) => {\n const value = data.templateData[field.name];\n if (value === undefined) {\n throw new Error(`Missing field: ${field.name}`);\n }\n\n if (field.validate && !field.validate(value)) {\n throw new Error(`Invalid value for field: ${field.name}`);\n }\n });\n\n return data.templateData;\n};\n\nexport const ensureTemplateCompletion = async ({\n destinationRoot,\n include,\n manifest,\n}: Props): Promise<TemplateConfig> => {\n const templateConfig = await getTemplateConfig(destinationRoot);\n\n if (templateConfig.fields.length === 0) {\n return templateConfig;\n }\n\n const templateName = hasStringProp(manifest.packageJson.skuba, 'template')\n ? manifest.packageJson.skuba.template\n : 'template';\n\n log.newline();\n const templateData = process.stdin.isTTY\n ? await runForm({\n choices: templateConfig.fields,\n message: styleText(\n 'bold',\n `Complete ${styleText('cyan', templateName)}:`,\n ),\n name: 'customAnswers',\n })\n : await getTemplateDataFromStdIn(templateConfig);\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors: [createEjsRenderer(templateData)],\n });\n\n await ensureTemplateConfigDeletion(destinationRoot);\n\n log.newline();\n log.ok('Templating complete!');\n\n return templateConfig;\n};\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AAEjB,OAAO,QAAQ;AACf,YAAY,OAAO;AAEnB,SAAS,WAAW,yBAAyB;AAC7C,SAAS,WAAW;AACpB;AAAA,EAEE;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,qBAAqB;AAS9B,MAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC;AAC/C,CAAC;AAED,MAAM,2BAA2B,OAC/B,mBACoC;AACpC,QAAM,SAAS,MAAM,kBAAkB;AACvC,QAAM,OAAO,mBAAmB,MAAM,MAAM;AAE5C,iBAAe,OAAO,QAAQ,CAAC,UAAU;AACvC,UAAM,QAAQ,KAAK,aAAa,MAAM,IAAI;AAC1C,QAAI,UAAU,QAAW;AACvB,YAAM,IAAI,MAAM,kBAAkB,MAAM,IAAI,EAAE;AAAA,IAChD;AAEA,QAAI,MAAM,YAAY,CAAC,MAAM,SAAS,KAAK,GAAG;AAC5C,YAAM,IAAI,MAAM,4BAA4B,MAAM,IAAI,EAAE;AAAA,IAC1D;AAAA,EACF,CAAC;AAED,SAAO,KAAK;AACd;AAEO,MAAM,2BAA2B,OAAO;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AACpC,QAAM,iBAAiB,MAAM,kBAAkB,eAAe;AAE9D,MAAI,eAAe,OAAO,WAAW,GAAG;AACtC,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,cAAc,SAAS,YAAY,OAAO,UAAU,IACrE,SAAS,YAAY,MAAM,WAC3B;AAEJ,MAAI,QAAQ;AACZ,QAAM,eAAe,QAAQ,MAAM,QAC/B,MAAM,QAAQ;AAAA,IACZ,SAAS,eAAe;AAAA,IACxB,SAAS;AAAA,MACP;AAAA,MACA,YAAY,UAAU,QAAQ,YAAY,CAAC;AAAA,IAC7C;AAAA,IACA,MAAM;AAAA,EACR,CAAC,IACD,MAAM,yBAAyB,cAAc;AAEjD,QAAM,qBAAqB,MAAM,cAAc,SAAS,WAAW;AACnE,QAAM,sBAAsB,KAAK,KAAK,iBAAiB,cAAc;AACrE,QAAM,GAAG,SAAS,UAAU,qBAAqB,kBAAkB;AAEnE,QAAM,UAAU;AAAA,IACd,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,YAAY,CAAC,kBAAkB,YAAY,CAAC;AAAA,EAC9C,CAAC;AAED,QAAM,6BAA6B,eAAe;AAElD,MAAI,QAAQ;AACZ,MAAI,GAAG,sBAAsB;AAE7B,SAAO;AACT;",
6
+ "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
- import type { ReadResult } from 'read-pkg-up';
2
1
  import type { ProjectType } from '../../utils/manifest.js';
3
2
  import type { TemplateConfig } from '../../utils/template.js';
3
+ import type { ReadResult } from './types.js';
4
4
  interface Props {
5
5
  destinationRoot: string;
6
6
  manifest: ReadResult;
@@ -1,71 +1,37 @@
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 getEntryPoint_exports = {};
30
- __export(getEntryPoint_exports, {
31
- getEntryPoint: () => getEntryPoint
32
- });
33
- module.exports = __toCommonJS(getEntryPoint_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_prompts = require("@inquirer/prompts");
36
- var import_chalk = __toESM(require("chalk"));
37
- var import_logging = require("../../utils/logging.js");
38
- var import_validation = require("../../utils/validation.js");
39
- var import_files = require("./analysis/files.js");
1
+ import { styleText } from "node:util";
2
+ import path from "path";
3
+ import { input } from "@inquirer/prompts";
4
+ import { log } from "../../utils/logging.js";
5
+ import { hasStringProp } from "../../utils/validation.js";
6
+ import { tsFileExists } from "./analysis/files.js";
40
7
  const getEntryPoint = async ({
41
8
  destinationRoot,
42
9
  manifest,
43
10
  templateConfig,
44
11
  type
45
12
  }) => {
46
- if ((0, import_validation.hasStringProp)(manifest.packageJson.skuba, "entryPoint")) {
13
+ if (hasStringProp(manifest.packageJson.skuba, "entryPoint")) {
47
14
  return manifest.packageJson.skuba.entryPoint;
48
15
  }
49
16
  if (templateConfig.entryPoint !== void 0) {
50
17
  return templateConfig.entryPoint;
51
18
  }
52
- import_logging.log.newline();
53
- const result = await (0, import_prompts.input)({
19
+ log.newline();
20
+ const result = await input({
54
21
  message: "Entry point:",
55
22
  default: type === "package" ? "src/index.ts" : "src/app.ts",
56
23
  validate: async (value) => {
57
24
  const [modulePath] = value.split("#", 2);
58
25
  if (!modulePath) {
59
- return `${import_chalk.default.bold(value)} is an invalid module path`;
26
+ return `${styleText("bold", value)} is an invalid module path`;
60
27
  }
61
- const exists = await (0, import_files.tsFileExists)(import_path.default.join(destinationRoot, modulePath));
62
- return exists || `${import_chalk.default.bold(value)} is not a TypeScript file.`;
28
+ const exists = await tsFileExists(path.join(destinationRoot, modulePath));
29
+ return exists || `${styleText("bold", value)} is not a TypeScript file.`;
63
30
  }
64
31
  });
65
32
  return result.endsWith(".ts") ? result : `${result}.ts`;
66
33
  };
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
34
+ export {
69
35
  getEntryPoint
70
- });
36
+ };
71
37
  //# sourceMappingURL=getEntryPoint.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/getEntryPoint.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport { input } from '@inquirer/prompts';\nimport chalk from 'chalk';\nimport type { ReadResult } from 'read-pkg-up';\n\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { TemplateConfig } from '../../utils/template.js';\nimport { hasStringProp } from '../../utils/validation.js';\n\nimport { tsFileExists } from './analysis/files.js';\n\ninterface Props {\n destinationRoot: string;\n manifest: ReadResult;\n templateConfig: TemplateConfig;\n type: ProjectType;\n}\nexport const getEntryPoint = async ({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n}: Props) => {\n if (hasStringProp(manifest.packageJson.skuba, 'entryPoint')) {\n return manifest.packageJson.skuba.entryPoint;\n }\n\n if (templateConfig.entryPoint !== undefined) {\n return templateConfig.entryPoint;\n }\n\n log.newline();\n\n const result = await input({\n message: 'Entry point:',\n default: type === 'package' ? 'src/index.ts' : 'src/app.ts',\n validate: async (value) => {\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath] = value.split('#', 2);\n\n if (!modulePath) {\n return `${chalk.bold(value)} is an invalid module path`;\n }\n\n const exists = await tsFileExists(path.join(destinationRoot, modulePath));\n\n return exists || `${chalk.bold(value)} is not a TypeScript file.`;\n },\n });\n\n return result.endsWith('.ts') ? result : `${result}.ts`;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,qBAAsB;AACtB,mBAAkB;AAGlB,qBAAoB;AAGpB,wBAA8B;AAE9B,mBAA6B;AAQtB,MAAM,gBAAgB,OAAO;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAa;AACX,UAAI,iCAAc,SAAS,YAAY,OAAO,YAAY,GAAG;AAC3D,WAAO,SAAS,YAAY,MAAM;AAAA,EACpC;AAEA,MAAI,eAAe,eAAe,QAAW;AAC3C,WAAO,eAAe;AAAA,EACxB;AAEA,qBAAI,QAAQ;AAEZ,QAAM,SAAS,UAAM,sBAAM;AAAA,IACzB,SAAS;AAAA,IACT,SAAS,SAAS,YAAY,iBAAiB;AAAA,IAC/C,UAAU,OAAO,UAAU;AAEzB,YAAM,CAAC,UAAU,IAAI,MAAM,MAAM,KAAK,CAAC;AAEvC,UAAI,CAAC,YAAY;AACf,eAAO,GAAG,aAAAA,QAAM,KAAK,KAAK,CAAC;AAAA,MAC7B;AAEA,YAAM,SAAS,UAAM,2BAAa,YAAAC,QAAK,KAAK,iBAAiB,UAAU,CAAC;AAExE,aAAO,UAAU,GAAG,aAAAD,QAAM,KAAK,KAAK,CAAC;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,OAAO,SAAS,KAAK,IAAI,SAAS,GAAG,MAAM;AACpD;",
6
- "names": ["chalk", "path"]
4
+ "sourcesContent": ["import { styleText } from 'node:util';\nimport path from 'path';\n\nimport { input } from '@inquirer/prompts';\n\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { TemplateConfig } from '../../utils/template.js';\nimport { hasStringProp } from '../../utils/validation.js';\n\nimport { tsFileExists } from './analysis/files.js';\nimport type { ReadResult } from './types.js';\n\ninterface Props {\n destinationRoot: string;\n manifest: ReadResult;\n templateConfig: TemplateConfig;\n type: ProjectType;\n}\nexport const getEntryPoint = async ({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n}: Props) => {\n if (hasStringProp(manifest.packageJson.skuba, 'entryPoint')) {\n return manifest.packageJson.skuba.entryPoint;\n }\n\n if (templateConfig.entryPoint !== undefined) {\n return templateConfig.entryPoint;\n }\n\n log.newline();\n\n const result = await input({\n message: 'Entry point:',\n default: type === 'package' ? 'src/index.ts' : 'src/app.ts',\n validate: async (value) => {\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath] = value.split('#', 2);\n\n if (!modulePath) {\n return `${styleText('bold', value)} is an invalid module path`;\n }\n\n const exists = await tsFileExists(path.join(destinationRoot, modulePath));\n\n return exists || `${styleText('bold', value)} is not a TypeScript file.`;\n },\n });\n\n return result.endsWith('.ts') ? result : `${result}.ts`;\n};\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AAEjB,SAAS,aAAa;AAEtB,SAAS,WAAW;AAGpB,SAAS,qBAAqB;AAE9B,SAAS,oBAAoB;AAStB,MAAM,gBAAgB,OAAO;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAa;AACX,MAAI,cAAc,SAAS,YAAY,OAAO,YAAY,GAAG;AAC3D,WAAO,SAAS,YAAY,MAAM;AAAA,EACpC;AAEA,MAAI,eAAe,eAAe,QAAW;AAC3C,WAAO,eAAe;AAAA,EACxB;AAEA,MAAI,QAAQ;AAEZ,QAAM,SAAS,MAAM,MAAM;AAAA,IACzB,SAAS;AAAA,IACT,SAAS,SAAS,YAAY,iBAAiB;AAAA,IAC/C,UAAU,OAAO,UAAU;AAEzB,YAAM,CAAC,UAAU,IAAI,MAAM,MAAM,KAAK,CAAC;AAEvC,UAAI,CAAC,YAAY;AACf,eAAO,GAAG,UAAU,QAAQ,KAAK,CAAC;AAAA,MACpC;AAEA,YAAM,SAAS,MAAM,aAAa,KAAK,KAAK,iBAAiB,UAAU,CAAC;AAExE,aAAO,UAAU,GAAG,UAAU,QAAQ,KAAK,CAAC;AAAA,IAC9C;AAAA,EACF,CAAC;AAED,SAAO,OAAO,SAAS,KAAK,IAAI,SAAS,GAAG,MAAM;AACpD;",
6
+ "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
- import type { ReadResult } from 'read-pkg-up';
2
1
  import { type ProjectType } from '../../utils/manifest.js';
3
2
  import type { TemplateConfig } from '../../utils/template.js';
3
+ import type { ReadResult } from './types.js';
4
4
  interface Props {
5
5
  manifest: ReadResult;
6
6
  templateConfig: TemplateConfig;
@@ -1,36 +1,16 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var getProjectType_exports = {};
20
- __export(getProjectType_exports, {
21
- getProjectType: () => getProjectType
22
- });
23
- module.exports = __toCommonJS(getProjectType_exports);
24
- var import_prompts = require("@inquirer/prompts");
25
- var import_logging = require("../../utils/logging.js");
26
- var import_manifest = require("../../utils/manifest.js");
27
- var import_validation = require("../../utils/validation.js");
1
+ import { select } from "@inquirer/prompts";
2
+ import { log } from "../../utils/logging.js";
3
+ import {
4
+ PROJECT_TYPES,
5
+ projectTypeSchema
6
+ } from "../../utils/manifest.js";
7
+ import { hasProp } from "../../utils/validation.js";
28
8
  const getProjectType = async ({
29
9
  manifest,
30
10
  templateConfig
31
11
  }) => {
32
- const projectType = import_manifest.projectTypeSchema.safeParse(
33
- (0, import_validation.hasProp)(manifest.packageJson.skuba, "type") ? manifest.packageJson.skuba.type : null
12
+ const projectType = projectTypeSchema.safeParse(
13
+ hasProp(manifest.packageJson.skuba, "type") ? manifest.packageJson.skuba.type : null
34
14
  );
35
15
  if (projectType.success) {
36
16
  return projectType.data;
@@ -39,15 +19,14 @@ const getProjectType = async ({
39
19
  return templateConfig.type;
40
20
  }
41
21
  const initial = manifest.packageJson.devDependencies?.["@seek/seek-module-toolkit"] || manifest.packageJson.files ? "package" : "application";
42
- import_logging.log.newline();
43
- return (0, import_prompts.select)({
22
+ log.newline();
23
+ return select({
44
24
  message: "Project type:",
45
- choices: import_manifest.PROJECT_TYPES.map((type) => ({ name: type, value: type })),
25
+ choices: PROJECT_TYPES.map((type) => ({ name: type, value: type })),
46
26
  default: initial
47
27
  });
48
28
  };
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
29
+ export {
51
30
  getProjectType
52
- });
31
+ };
53
32
  //# sourceMappingURL=getProjectType.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/getProjectType.ts"],
4
- "sourcesContent": ["import { select } from '@inquirer/prompts';\nimport type { ReadResult } from 'read-pkg-up';\n\nimport { log } from '../../utils/logging.js';\nimport {\n PROJECT_TYPES,\n type ProjectType,\n projectTypeSchema,\n} from '../../utils/manifest.js';\nimport type { TemplateConfig } from '../../utils/template.js';\nimport { hasProp } from '../../utils/validation.js';\n\ninterface Props {\n manifest: ReadResult;\n templateConfig: TemplateConfig;\n}\n\nexport const getProjectType = async ({\n manifest,\n templateConfig,\n}: Props): Promise<ProjectType> => {\n const projectType = projectTypeSchema.safeParse(\n hasProp(manifest.packageJson.skuba, 'type')\n ? manifest.packageJson.skuba.type\n : null,\n );\n\n if (projectType.success) {\n return projectType.data;\n }\n\n if (templateConfig.type !== undefined) {\n return templateConfig.type;\n }\n\n const initial: ProjectType =\n manifest.packageJson.devDependencies?.['@seek/seek-module-toolkit'] ||\n manifest.packageJson.files\n ? 'package'\n : 'application';\n\n log.newline();\n\n return select({\n message: 'Project type:',\n choices: PROJECT_TYPES.map((type) => ({ name: type, value: type })),\n default: initial,\n });\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AAGvB,qBAAoB;AACpB,sBAIO;AAEP,wBAAwB;AAOjB,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AACF,MAAmC;AACjC,QAAM,cAAc,kCAAkB;AAAA,QACpC,2BAAQ,SAAS,YAAY,OAAO,MAAM,IACtC,SAAS,YAAY,MAAM,OAC3B;AAAA,EACN;AAEA,MAAI,YAAY,SAAS;AACvB,WAAO,YAAY;AAAA,EACrB;AAEA,MAAI,eAAe,SAAS,QAAW;AACrC,WAAO,eAAe;AAAA,EACxB;AAEA,QAAM,UACJ,SAAS,YAAY,kBAAkB,2BAA2B,KAClE,SAAS,YAAY,QACjB,YACA;AAEN,qBAAI,QAAQ;AAEZ,aAAO,uBAAO;AAAA,IACZ,SAAS;AAAA,IACT,SAAS,8BAAc,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,OAAO,KAAK,EAAE;AAAA,IAClE,SAAS;AAAA,EACX,CAAC;AACH;",
4
+ "sourcesContent": ["import { select } from '@inquirer/prompts';\n\nimport { log } from '../../utils/logging.js';\nimport {\n PROJECT_TYPES,\n type ProjectType,\n projectTypeSchema,\n} from '../../utils/manifest.js';\nimport type { TemplateConfig } from '../../utils/template.js';\nimport { hasProp } from '../../utils/validation.js';\n\nimport type { ReadResult } from './types.js';\n\ninterface Props {\n manifest: ReadResult;\n templateConfig: TemplateConfig;\n}\n\nexport const getProjectType = async ({\n manifest,\n templateConfig,\n}: Props): Promise<ProjectType> => {\n const projectType = projectTypeSchema.safeParse(\n hasProp(manifest.packageJson.skuba, 'type')\n ? manifest.packageJson.skuba.type\n : null,\n );\n\n if (projectType.success) {\n return projectType.data;\n }\n\n if (templateConfig.type !== undefined) {\n return templateConfig.type;\n }\n\n const initial: ProjectType =\n manifest.packageJson.devDependencies?.['@seek/seek-module-toolkit'] ||\n manifest.packageJson.files\n ? 'package'\n : 'application';\n\n log.newline();\n\n return select({\n message: 'Project type:',\n choices: PROJECT_TYPES.map((type) => ({ name: type, value: type })),\n default: initial,\n });\n};\n"],
5
+ "mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,eAAe;AASjB,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AACF,MAAmC;AACjC,QAAM,cAAc,kBAAkB;AAAA,IACpC,QAAQ,SAAS,YAAY,OAAO,MAAM,IACtC,SAAS,YAAY,MAAM,OAC3B;AAAA,EACN;AAEA,MAAI,YAAY,SAAS;AACvB,WAAO,YAAY;AAAA,EACrB;AAEA,MAAI,eAAe,SAAS,QAAW;AACrC,WAAO,eAAe;AAAA,EACxB;AAEA,QAAM,UACJ,SAAS,YAAY,kBAAkB,2BAA2B,KAClE,SAAS,YAAY,QACjB,YACA;AAEN,MAAI,QAAQ;AAEZ,SAAO,OAAO;AAAA,IACZ,SAAS;AAAA,IACT,SAAS,cAAc,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,OAAO,KAAK,EAAE;AAAA,IAClE,SAAS;AAAA,EACX,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,57 +1,24 @@
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 configure_exports = {};
30
- __export(configure_exports, {
31
- configure: () => configure
32
- });
33
- module.exports = __toCommonJS(configure_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_prompts = require("@inquirer/prompts");
36
- var import_dir = require("../../utils/dir.js");
37
- var import_exec = require("../../utils/exec.js");
38
- var import_logging = require("../../utils/logging.js");
39
- var import_logo = require("../../utils/logo.js");
40
- var import_packageManager = require("../../utils/packageManager.js");
41
- var import_template = require("../../utils/template.js");
42
- var import_validation = require("../../utils/validation.js");
43
- var import_analyseConfiguration = require("./analyseConfiguration.js");
44
- var import_analyseDependencies = require("./analyseDependencies.js");
45
- var import_git = require("./analysis/git.js");
46
- var import_package = require("./analysis/package.js");
47
- var import_ensureTemplateCompletion = require("./ensureTemplateCompletion.js");
48
- var import_getEntryPoint = require("./getEntryPoint.js");
49
- var import_getProjectType = require("./getProjectType.js");
1
+ import path from "path";
2
+ import { select } from "@inquirer/prompts";
3
+ import { createInclusionFilter } from "../../utils/dir.js";
4
+ import { createExec, ensureCommands } from "../../utils/exec.js";
5
+ import { log } from "../../utils/logging.js";
6
+ import { showLogoAndVersionInfo } from "../../utils/logo.js";
7
+ import { detectPackageManager } from "../../utils/packageManager.js";
8
+ import { BASE_TEMPLATE_DIR } from "../../utils/template.js";
9
+ import { hasProp } from "../../utils/validation.js";
10
+ import { analyseConfiguration } from "./analyseConfiguration.js";
11
+ import { analyseDependencies } from "./analyseDependencies.js";
12
+ import { auditWorkingTree } from "./analysis/git.js";
13
+ import { getDestinationManifest } from "./analysis/package.js";
14
+ import { ensureTemplateCompletion } from "./ensureTemplateCompletion.js";
15
+ import { getEntryPoint } from "./getEntryPoint.js";
16
+ import { getProjectType } from "./getProjectType.js";
50
17
  const shouldApply = async () => {
51
18
  if (!process.stdin.isTTY) {
52
19
  return "yes";
53
20
  }
54
- const result = await (0, import_prompts.select)({
21
+ const result = await select({
55
22
  message: "Apply changes?",
56
23
  choices: [
57
24
  { name: "Yes", value: "yes" },
@@ -61,50 +28,50 @@ const shouldApply = async () => {
61
28
  return result === "yes";
62
29
  };
63
30
  const configure = async () => {
64
- await (0, import_logo.showLogoAndVersionInfo)();
31
+ await showLogoAndVersionInfo();
65
32
  const [manifest, packageManager] = await Promise.all([
66
- (0, import_package.getDestinationManifest)(),
67
- (0, import_packageManager.detectPackageManager)()
33
+ getDestinationManifest(),
34
+ detectPackageManager()
68
35
  ]);
69
- await (0, import_exec.ensureCommands)(packageManager.command);
70
- const destinationRoot = import_path.default.dirname(manifest.path);
71
- import_logging.log.plain("Detected project root:", import_logging.log.bold(destinationRoot));
36
+ await ensureCommands(packageManager.command);
37
+ const destinationRoot = path.dirname(manifest.path);
38
+ log.plain("Detected project root:", log.bold(destinationRoot));
72
39
  const [include] = await Promise.all([
73
- (0, import_dir.createInclusionFilter)([
74
- import_path.default.join(destinationRoot, ".gitignore"),
75
- import_path.default.join(import_template.BASE_TEMPLATE_DIR, "_.gitignore")
40
+ createInclusionFilter([
41
+ path.join(destinationRoot, ".gitignore"),
42
+ path.join(BASE_TEMPLATE_DIR, "_.gitignore")
76
43
  ]),
77
- (0, import_git.auditWorkingTree)(destinationRoot)
44
+ auditWorkingTree(destinationRoot)
78
45
  ]);
79
- const templateConfig = await (0, import_ensureTemplateCompletion.ensureTemplateCompletion)({
46
+ const templateConfig = await ensureTemplateCompletion({
80
47
  destinationRoot,
81
48
  include,
82
49
  manifest
83
50
  });
84
- const type = await (0, import_getProjectType.getProjectType)({
51
+ const type = await getProjectType({
85
52
  manifest,
86
53
  templateConfig
87
54
  });
88
- const entryPoint = await (0, import_getEntryPoint.getEntryPoint)({
55
+ const entryPoint = await getEntryPoint({
89
56
  destinationRoot,
90
57
  manifest,
91
58
  templateConfig,
92
59
  type
93
60
  });
94
- const fixDependencies = await (0, import_analyseDependencies.analyseDependencies)({
61
+ const fixDependencies = await analyseDependencies({
95
62
  destinationRoot,
96
63
  include,
97
64
  manifest,
98
65
  type
99
66
  });
100
67
  if (fixDependencies) {
101
- import_logging.log.newline();
68
+ log.newline();
102
69
  if (await shouldApply()) {
103
70
  await fixDependencies();
104
71
  }
105
72
  }
106
- const firstRun = (0, import_validation.hasProp)(manifest.packageJson, "skuba");
107
- const fixConfiguration = await (0, import_analyseConfiguration.analyseConfiguration)({
73
+ const firstRun = hasProp(manifest.packageJson, "skuba");
74
+ const fixConfiguration = await analyseConfiguration({
108
75
  destinationRoot,
109
76
  entryPoint,
110
77
  firstRun,
@@ -112,40 +79,39 @@ const configure = async () => {
112
79
  type
113
80
  });
114
81
  if (fixConfiguration) {
115
- import_logging.log.newline();
82
+ log.newline();
116
83
  if (await shouldApply()) {
117
84
  await fixConfiguration();
118
85
  }
119
86
  }
120
87
  if (fixDependencies) {
121
- const exec = (0, import_exec.createExec)({
88
+ const exec = createExec({
122
89
  stdio: "pipe",
123
90
  streamStdio: packageManager.command
124
91
  });
125
- import_logging.log.newline();
92
+ log.newline();
126
93
  try {
127
94
  await exec(packageManager.command, "install");
128
95
  } catch {
129
- import_logging.log.newline();
130
- import_logging.log.warn(import_logging.log.bold("\u2717 Failed to install dependencies. Resume with:"));
131
- import_logging.log.newline();
132
- import_logging.log.plain(import_logging.log.bold(packageManager.command, "install"));
133
- import_logging.log.plain(import_logging.log.bold(packageManager.command, "format"));
134
- import_logging.log.newline();
96
+ log.newline();
97
+ log.warn(log.bold("\u2717 Failed to install dependencies. Resume with:"));
98
+ log.newline();
99
+ log.plain(log.bold(`${packageManager.command} install`));
100
+ log.plain(log.bold(`${packageManager.command} format`));
101
+ log.newline();
135
102
  process.exitCode = 1;
136
103
  return;
137
104
  }
138
105
  }
139
106
  if (fixConfiguration ?? fixDependencies) {
140
- import_logging.log.newline();
141
- import_logging.log.ok(import_logging.log.bold("\u2714 All done! Try running:"));
142
- import_logging.log.newline();
143
- import_logging.log.plain(import_logging.log.bold(packageManager.command, "format"));
107
+ log.newline();
108
+ log.ok(log.bold("\u2714 All done! Try running:"));
109
+ log.newline();
110
+ log.plain(log.bold(`${packageManager.command} format`));
144
111
  }
145
- import_logging.log.newline();
112
+ log.newline();
146
113
  };
147
- // Annotate the CommonJS export names for ESM import in node:
148
- 0 && (module.exports = {
114
+ export {
149
115
  configure
150
- });
116
+ };
151
117
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/index.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport { select } from '@inquirer/prompts';\n\nimport { createInclusionFilter } from '../../utils/dir.js';\nimport { createExec, ensureCommands } from '../../utils/exec.js';\nimport { log } from '../../utils/logging.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport { BASE_TEMPLATE_DIR } from '../../utils/template.js';\nimport { hasProp } from '../../utils/validation.js';\n\nimport { analyseConfiguration } from './analyseConfiguration.js';\nimport { analyseDependencies } from './analyseDependencies.js';\nimport { auditWorkingTree } from './analysis/git.js';\nimport { getDestinationManifest } from './analysis/package.js';\nimport { ensureTemplateCompletion } from './ensureTemplateCompletion.js';\nimport { getEntryPoint } from './getEntryPoint.js';\nimport { getProjectType } from './getProjectType.js';\n\nconst shouldApply = async () => {\n if (!process.stdin.isTTY) {\n return 'yes';\n }\n\n const result = await select({\n message: 'Apply changes?',\n choices: [\n { name: 'Yes', value: 'yes' },\n { name: 'No', value: 'no' },\n ],\n });\n\n return result === 'yes';\n};\n\nexport const configure = async () => {\n await showLogoAndVersionInfo();\n\n const [manifest, packageManager] = await Promise.all([\n getDestinationManifest(),\n detectPackageManager(),\n ]);\n\n await ensureCommands(packageManager.command);\n\n const destinationRoot = path.dirname(manifest.path);\n\n log.plain('Detected project root:', log.bold(destinationRoot));\n\n const [include] = await Promise.all([\n createInclusionFilter([\n path.join(destinationRoot, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]),\n\n auditWorkingTree(destinationRoot),\n ]);\n\n const templateConfig = await ensureTemplateCompletion({\n destinationRoot,\n include,\n manifest,\n });\n\n const type = await getProjectType({\n manifest,\n templateConfig,\n });\n\n const entryPoint = await getEntryPoint({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n });\n\n const fixDependencies = await analyseDependencies({\n destinationRoot,\n include,\n manifest,\n type,\n });\n\n if (fixDependencies) {\n log.newline();\n\n if (await shouldApply()) {\n await fixDependencies();\n }\n }\n\n const firstRun = hasProp(manifest.packageJson, 'skuba');\n\n const fixConfiguration = await analyseConfiguration({\n destinationRoot,\n entryPoint,\n firstRun,\n packageManager,\n type,\n });\n\n if (fixConfiguration) {\n log.newline();\n\n if (await shouldApply()) {\n await fixConfiguration();\n }\n }\n\n if (fixDependencies) {\n const exec = createExec({\n stdio: 'pipe',\n streamStdio: packageManager.command,\n });\n\n log.newline();\n try {\n await exec(packageManager.command, 'install');\n } catch {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies. Resume with:'));\n\n log.newline();\n log.plain(log.bold(packageManager.command, 'install'));\n log.plain(log.bold(packageManager.command, 'format'));\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n }\n\n if (fixConfiguration ?? fixDependencies) {\n log.newline();\n log.ok(log.bold('\u2714 All done! Try running:'));\n\n log.newline();\n log.plain(log.bold(packageManager.command, 'format'));\n }\n\n log.newline();\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,qBAAuB;AAEvB,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAoB;AACpB,kBAAuC;AACvC,4BAAqC;AACrC,sBAAkC;AAClC,wBAAwB;AAExB,kCAAqC;AACrC,iCAAoC;AACpC,iBAAiC;AACjC,qBAAuC;AACvC,sCAAyC;AACzC,2BAA8B;AAC9B,4BAA+B;AAE/B,MAAM,cAAc,YAAY;AAC9B,MAAI,CAAC,QAAQ,MAAM,OAAO;AACxB,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAM,uBAAO;AAAA,IAC1B,SAAS;AAAA,IACT,SAAS;AAAA,MACP,EAAE,MAAM,OAAO,OAAO,MAAM;AAAA,MAC5B,EAAE,MAAM,MAAM,OAAO,KAAK;AAAA,IAC5B;AAAA,EACF,CAAC;AAED,SAAO,WAAW;AACpB;AAEO,MAAM,YAAY,YAAY;AACnC,YAAM,oCAAuB;AAE7B,QAAM,CAAC,UAAU,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,QACnD,uCAAuB;AAAA,QACvB,4CAAqB;AAAA,EACvB,CAAC;AAED,YAAM,4BAAe,eAAe,OAAO;AAE3C,QAAM,kBAAkB,YAAAA,QAAK,QAAQ,SAAS,IAAI;AAElD,qBAAI,MAAM,0BAA0B,mBAAI,KAAK,eAAe,CAAC;AAE7D,QAAM,CAAC,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,QAClC,kCAAsB;AAAA,MACpB,YAAAA,QAAK,KAAK,iBAAiB,YAAY;AAAA,MACvC,YAAAA,QAAK,KAAK,mCAAmB,aAAa;AAAA,IAC5C,CAAC;AAAA,QAED,6BAAiB,eAAe;AAAA,EAClC,CAAC;AAED,QAAM,iBAAiB,UAAM,0DAAyB;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,OAAO,UAAM,sCAAe;AAAA,IAChC;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,aAAa,UAAM,oCAAc;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,kBAAkB,UAAM,gDAAoB;AAAA,IAChD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,MAAI,iBAAiB;AACnB,uBAAI,QAAQ;AAEZ,QAAI,MAAM,YAAY,GAAG;AACvB,YAAM,gBAAgB;AAAA,IACxB;AAAA,EACF;AAEA,QAAM,eAAW,2BAAQ,SAAS,aAAa,OAAO;AAEtD,QAAM,mBAAmB,UAAM,kDAAqB;AAAA,IAClD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,MAAI,kBAAkB;AACpB,uBAAI,QAAQ;AAEZ,QAAI,MAAM,YAAY,GAAG;AACvB,YAAM,iBAAiB;AAAA,IACzB;AAAA,EACF;AAEA,MAAI,iBAAiB;AACnB,UAAM,WAAO,wBAAW;AAAA,MACtB,OAAO;AAAA,MACP,aAAa,eAAe;AAAA,IAC9B,CAAC;AAED,uBAAI,QAAQ;AACZ,QAAI;AACF,YAAM,KAAK,eAAe,SAAS,SAAS;AAAA,IAC9C,QAAQ;AACN,yBAAI,QAAQ;AACZ,yBAAI,KAAK,mBAAI,KAAK,qDAAgD,CAAC;AAEnE,yBAAI,QAAQ;AACZ,yBAAI,MAAM,mBAAI,KAAK,eAAe,SAAS,SAAS,CAAC;AACrD,yBAAI,MAAM,mBAAI,KAAK,eAAe,SAAS,QAAQ,CAAC;AAEpD,yBAAI,QAAQ;AACZ,cAAQ,WAAW;AACnB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,oBAAoB,iBAAiB;AACvC,uBAAI,QAAQ;AACZ,uBAAI,GAAG,mBAAI,KAAK,+BAA0B,CAAC;AAE3C,uBAAI,QAAQ;AACZ,uBAAI,MAAM,mBAAI,KAAK,eAAe,SAAS,QAAQ,CAAC;AAAA,EACtD;AAEA,qBAAI,QAAQ;AACd;",
6
- "names": ["path"]
4
+ "sourcesContent": ["import path from 'path';\n\nimport { select } from '@inquirer/prompts';\n\nimport { createInclusionFilter } from '../../utils/dir.js';\nimport { createExec, ensureCommands } from '../../utils/exec.js';\nimport { log } from '../../utils/logging.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport { BASE_TEMPLATE_DIR } from '../../utils/template.js';\nimport { hasProp } from '../../utils/validation.js';\n\nimport { analyseConfiguration } from './analyseConfiguration.js';\nimport { analyseDependencies } from './analyseDependencies.js';\nimport { auditWorkingTree } from './analysis/git.js';\nimport { getDestinationManifest } from './analysis/package.js';\nimport { ensureTemplateCompletion } from './ensureTemplateCompletion.js';\nimport { getEntryPoint } from './getEntryPoint.js';\nimport { getProjectType } from './getProjectType.js';\n\nconst shouldApply = async () => {\n if (!process.stdin.isTTY) {\n return 'yes';\n }\n\n const result = await select({\n message: 'Apply changes?',\n choices: [\n { name: 'Yes', value: 'yes' },\n { name: 'No', value: 'no' },\n ],\n });\n\n return result === 'yes';\n};\n\nexport const configure = async () => {\n await showLogoAndVersionInfo();\n\n const [manifest, packageManager] = await Promise.all([\n getDestinationManifest(),\n detectPackageManager(),\n ]);\n\n await ensureCommands(packageManager.command);\n\n const destinationRoot = path.dirname(manifest.path);\n\n log.plain('Detected project root:', log.bold(destinationRoot));\n\n const [include] = await Promise.all([\n createInclusionFilter([\n path.join(destinationRoot, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]),\n\n auditWorkingTree(destinationRoot),\n ]);\n\n const templateConfig = await ensureTemplateCompletion({\n destinationRoot,\n include,\n manifest,\n });\n\n const type = await getProjectType({\n manifest,\n templateConfig,\n });\n\n const entryPoint = await getEntryPoint({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n });\n\n const fixDependencies = await analyseDependencies({\n destinationRoot,\n include,\n manifest,\n type,\n });\n\n if (fixDependencies) {\n log.newline();\n\n if (await shouldApply()) {\n await fixDependencies();\n }\n }\n\n const firstRun = hasProp(manifest.packageJson, 'skuba');\n\n const fixConfiguration = await analyseConfiguration({\n destinationRoot,\n entryPoint,\n firstRun,\n packageManager,\n type,\n });\n\n if (fixConfiguration) {\n log.newline();\n\n if (await shouldApply()) {\n await fixConfiguration();\n }\n }\n\n if (fixDependencies) {\n const exec = createExec({\n stdio: 'pipe',\n streamStdio: packageManager.command,\n });\n\n log.newline();\n try {\n await exec(packageManager.command, 'install');\n } catch {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies. Resume with:'));\n\n log.newline();\n log.plain(log.bold(`${packageManager.command} install`));\n log.plain(log.bold(`${packageManager.command} format`));\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n }\n\n if (fixConfiguration ?? fixDependencies) {\n log.newline();\n log.ok(log.bold('\u2714 All done! Try running:'));\n\n log.newline();\n log.plain(log.bold(`${packageManager.command} format`));\n }\n\n log.newline();\n};\n"],
5
+ "mappings": "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",
6
+ "names": []
7
7
  }