skuba 14.0.0-migrate-to-inquirer-20251031060542 → 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 +76 -104
  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,47 +1,13 @@
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 main_exports = {};
30
- __export(main_exports, {
31
- main: () => main
32
- });
33
- module.exports = __toCommonJS(main_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_functionHandler = require("./functionHandler.js");
36
- var import_requestListener = require("./requestListener.js");
1
+ import path from "path";
2
+ import { runFunctionHandler } from "./functionHandler.js";
3
+ import { runRequestListener } from "./requestListener.js";
37
4
  const main = async (rawEntryPoint, rawPort) => {
38
5
  const availablePort = Number(rawPort) || void 0;
39
- const [modulePath, functionName] = import_path.default.join(process.cwd(), rawEntryPoint).split("#", 2);
40
- const entryPoint = require(modulePath);
41
- return functionName ? (0, import_functionHandler.runFunctionHandler)({ availablePort, entryPoint, functionName }) : (0, import_requestListener.runRequestListener)({ availablePort, entryPoint });
6
+ const [modulePath, functionName] = path.join(process.cwd(), rawEntryPoint).split("#", 2);
7
+ const entryPoint = await import(modulePath);
8
+ return functionName ? runFunctionHandler({ availablePort, entryPoint, functionName }) : runRequestListener({ availablePort, entryPoint });
42
9
  };
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
10
+ export {
45
11
  main
46
- });
12
+ };
47
13
  //# sourceMappingURL=main.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/wrapper/main.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport { runFunctionHandler } from './functionHandler.js';\nimport { runRequestListener } from './requestListener.js';\n\nexport const main = async (rawEntryPoint: string, rawPort: string) => {\n const availablePort = Number(rawPort) || undefined;\n\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath, functionName] = path\n .join(process.cwd(), rawEntryPoint)\n .split('#', 2);\n\n // Load entry point as module\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const entryPoint = require(modulePath as string) as unknown;\n\n return functionName\n ? runFunctionHandler({ availablePort, entryPoint, functionName })\n : runRequestListener({ availablePort, entryPoint });\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,6BAAmC;AACnC,6BAAmC;AAE5B,MAAM,OAAO,OAAO,eAAuB,YAAoB;AACpE,QAAM,gBAAgB,OAAO,OAAO,KAAK;AAGzC,QAAM,CAAC,YAAY,YAAY,IAAI,YAAAA,QAChC,KAAK,QAAQ,IAAI,GAAG,aAAa,EACjC,MAAM,KAAK,CAAC;AAIf,QAAM,aAAa,QAAQ,UAAoB;AAE/C,SAAO,mBACH,2CAAmB,EAAE,eAAe,YAAY,aAAa,CAAC,QAC9D,2CAAmB,EAAE,eAAe,WAAW,CAAC;AACtD;",
6
- "names": ["path"]
4
+ "sourcesContent": ["import path from 'path';\n\nimport { runFunctionHandler } from './functionHandler.js';\nimport { runRequestListener } from './requestListener.js';\n\nexport const main = async (rawEntryPoint: string, rawPort: string) => {\n const availablePort = Number(rawPort) || undefined;\n\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath, functionName] = path\n .join(process.cwd(), rawEntryPoint)\n .split('#', 2);\n\n // Load entry point as module\n\n const entryPoint = (await import(modulePath as string)) as unknown;\n\n return functionName\n ? runFunctionHandler({ availablePort, entryPoint, functionName })\n : runRequestListener({ availablePort, entryPoint });\n};\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AAEjB,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAE5B,MAAM,OAAO,OAAO,eAAuB,YAAoB;AACpE,QAAM,gBAAgB,OAAO,OAAO,KAAK;AAGzC,QAAM,CAAC,YAAY,YAAY,IAAI,KAChC,KAAK,QAAQ,IAAI,GAAG,aAAa,EACjC,MAAM,KAAK,CAAC;AAIf,QAAM,aAAc,MAAM,OAAO;AAEjC,SAAO,eACH,mBAAmB,EAAE,eAAe,YAAY,aAAa,CAAC,IAC9D,mBAAmB,EAAE,eAAe,WAAW,CAAC;AACtD;",
6
+ "names": []
7
7
  }
@@ -1,40 +1,8 @@
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 requestListener_exports = {};
30
- __export(requestListener_exports, {
31
- runRequestListener: () => runRequestListener
32
- });
33
- module.exports = __toCommonJS(requestListener_exports);
34
- var import_http = __toESM(require("http"));
35
- var import_validation = require("../utils/validation.js");
36
- var import_http2 = require("./http.js");
37
- const isConfig = (data) => (0, import_validation.isFunction)(data) || (0, import_validation.isObject)(data);
1
+ import http from "http";
2
+ import { isFunction, isIpPort, isObject } from "../utils/validation.js";
3
+ import { serveRequestListener } from "./http.js";
4
+ import { startServer } from "./server.js";
5
+ const isConfig = (data) => isFunction(data) || isObject(data);
38
6
  const runRequestListener = async ({
39
7
  availablePort,
40
8
  entryPoint
@@ -49,21 +17,20 @@ const runRequestListener = async ({
49
17
  if (Object.keys(config).length === 0) {
50
18
  return;
51
19
  }
52
- const port = (0, import_validation.isIpPort)(config.port) ? config.port : availablePort;
53
- if (typeof config !== "function" && config instanceof import_http.default.Server) {
54
- return (0, import_http2.startServer)(config, port);
20
+ const port = isIpPort(config.port) ? config.port : availablePort;
21
+ if (typeof config !== "function" && config instanceof http.Server) {
22
+ return startServer(config, port);
55
23
  }
56
- if (typeof config !== "function" && config.server && config.server instanceof import_http.default.Server) {
57
- return (0, import_http2.startServer)(config.server, port);
24
+ if (typeof config !== "function" && config.server && config.server instanceof http.Server) {
25
+ return startServer(config.server, port);
58
26
  }
59
27
  const requestListener = typeof config === "function" ? config : config.requestListener ?? config.callback?.();
60
28
  if (typeof requestListener !== "function") {
61
29
  return;
62
30
  }
63
- return (0, import_http2.serveRequestListener)(requestListener, port);
31
+ return serveRequestListener(requestListener, port);
64
32
  };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
33
+ export {
67
34
  runRequestListener
68
- });
35
+ };
69
36
  //# sourceMappingURL=requestListener.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/wrapper/requestListener.ts"],
4
- "sourcesContent": ["import http from 'http';\n\nimport { isFunction, isIpPort, isObject } from '../utils/validation.js';\n\nimport { serveRequestListener, startServer } from './http.js';\n\n// Express compatibility\ninterface FunctionConfig extends http.RequestListener {\n port?: number;\n}\n\ninterface ObjectConfig {\n // Koa compatibility\n callback?: () => http.RequestListener;\n\n requestListener?: http.RequestListener;\n\n // Fastify compatibility\n server?: http.Server;\n\n default?: Promise<unknown>;\n port?: unknown;\n}\n\nconst isConfig = (\n data: unknown,\n): data is Promise<FunctionConfig> | Promise<ObjectConfig> =>\n isFunction(data) || isObject(data);\n\ninterface Args {\n availablePort?: number;\n entryPoint: unknown;\n}\n\n/**\n * Create an HTTP server that calls into an exported `http.RequestListener`.\n *\n * This supports Express and Koa applications out of the box.\n */\nexport const runRequestListener = async ({\n availablePort,\n entryPoint,\n}: Args): Promise<void> => {\n if (!isConfig(entryPoint)) {\n // Assume an executable script with weird exports\n return;\n }\n\n let config: FunctionConfig | ObjectConfig = await entryPoint;\n\n if (typeof config === 'object' && isConfig(config.default)) {\n // Prefer `export default` over `export =`\n config = await config.default;\n }\n\n if (Object.keys(config).length === 0) {\n // Assume an executable script with no exports\n return;\n }\n\n const port = isIpPort(config.port) ? config.port : availablePort;\n\n // http.Server support\n if (typeof config !== 'function' && config instanceof http.Server) {\n return startServer(config, port);\n }\n\n // Fastify workaround\n if (\n typeof config !== 'function' &&\n config.server &&\n config.server instanceof http.Server\n ) {\n return startServer(config.server, port);\n }\n\n const requestListener =\n typeof config === 'function'\n ? config\n : (config.requestListener ?? config.callback?.());\n\n if (typeof requestListener !== 'function') {\n // Assume an executable script with non-request listener exports\n return;\n }\n\n return serveRequestListener(requestListener, port);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,wBAA+C;AAE/C,IAAAA,eAAkD;AAoBlD,MAAM,WAAW,CACf,aAEA,8BAAW,IAAI,SAAK,4BAAS,IAAI;AAY5B,MAAM,qBAAqB,OAAO;AAAA,EACvC;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,SAAS,UAAU,GAAG;AAEzB;AAAA,EACF;AAEA,MAAI,SAAwC,MAAM;AAElD,MAAI,OAAO,WAAW,YAAY,SAAS,OAAO,OAAO,GAAG;AAE1D,aAAS,MAAM,OAAO;AAAA,EACxB;AAEA,MAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AAEpC;AAAA,EACF;AAEA,QAAM,WAAO,4BAAS,OAAO,IAAI,IAAI,OAAO,OAAO;AAGnD,MAAI,OAAO,WAAW,cAAc,kBAAkB,YAAAC,QAAK,QAAQ;AACjE,eAAO,0BAAY,QAAQ,IAAI;AAAA,EACjC;AAGA,MACE,OAAO,WAAW,cAClB,OAAO,UACP,OAAO,kBAAkB,YAAAA,QAAK,QAC9B;AACA,eAAO,0BAAY,OAAO,QAAQ,IAAI;AAAA,EACxC;AAEA,QAAM,kBACJ,OAAO,WAAW,aACd,SACC,OAAO,mBAAmB,OAAO,WAAW;AAEnD,MAAI,OAAO,oBAAoB,YAAY;AAEzC;AAAA,EACF;AAEA,aAAO,mCAAqB,iBAAiB,IAAI;AACnD;",
6
- "names": ["import_http", "http"]
4
+ "sourcesContent": ["import http from 'http';\n\nimport { isFunction, isIpPort, isObject } from '../utils/validation.js';\n\nimport { serveRequestListener } from './http.js';\nimport { startServer } from './server.js';\n\n// Express compatibility\ninterface FunctionConfig extends http.RequestListener {\n port?: number;\n}\n\ninterface ObjectConfig {\n // Koa compatibility\n callback?: () => http.RequestListener;\n\n requestListener?: http.RequestListener;\n\n // Fastify compatibility\n server?: http.Server;\n\n default?: Promise<unknown>;\n port?: unknown;\n}\n\nconst isConfig = (\n data: unknown,\n): data is Promise<FunctionConfig> | Promise<ObjectConfig> =>\n isFunction(data) || isObject(data);\n\ninterface Args {\n availablePort?: number;\n entryPoint: unknown;\n}\n\n/**\n * Create an HTTP server that calls into an exported `http.RequestListener`.\n *\n * This supports Express and Koa applications out of the box.\n */\nexport const runRequestListener = async ({\n availablePort,\n entryPoint,\n}: Args): Promise<void> => {\n if (!isConfig(entryPoint)) {\n // Assume an executable script with weird exports\n return;\n }\n\n let config: FunctionConfig | ObjectConfig = await entryPoint;\n\n if (typeof config === 'object' && isConfig(config.default)) {\n // Prefer `export default` over `export =`\n config = await config.default;\n }\n\n if (Object.keys(config).length === 0) {\n // Assume an executable script with no exports\n return;\n }\n\n const port = isIpPort(config.port) ? config.port : availablePort;\n\n // http.Server support\n if (typeof config !== 'function' && config instanceof http.Server) {\n return startServer(config, port);\n }\n\n // Fastify workaround\n if (\n typeof config !== 'function' &&\n config.server &&\n config.server instanceof http.Server\n ) {\n return startServer(config.server, port);\n }\n\n const requestListener =\n typeof config === 'function'\n ? config\n : (config.requestListener ?? config.callback?.());\n\n if (typeof requestListener !== 'function') {\n // Assume an executable script with non-request listener exports\n return;\n }\n\n return serveRequestListener(requestListener, port);\n};\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AAEjB,SAAS,YAAY,UAAU,gBAAgB;AAE/C,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAoB5B,MAAM,WAAW,CACf,SAEA,WAAW,IAAI,KAAK,SAAS,IAAI;AAY5B,MAAM,qBAAqB,OAAO;AAAA,EACvC;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,SAAS,UAAU,GAAG;AAEzB;AAAA,EACF;AAEA,MAAI,SAAwC,MAAM;AAElD,MAAI,OAAO,WAAW,YAAY,SAAS,OAAO,OAAO,GAAG;AAE1D,aAAS,MAAM,OAAO;AAAA,EACxB;AAEA,MAAI,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AAEpC;AAAA,EACF;AAEA,QAAM,OAAO,SAAS,OAAO,IAAI,IAAI,OAAO,OAAO;AAGnD,MAAI,OAAO,WAAW,cAAc,kBAAkB,KAAK,QAAQ;AACjE,WAAO,YAAY,QAAQ,IAAI;AAAA,EACjC;AAGA,MACE,OAAO,WAAW,cAClB,OAAO,UACP,OAAO,kBAAkB,KAAK,QAC9B;AACA,WAAO,YAAY,OAAO,QAAQ,IAAI;AAAA,EACxC;AAEA,QAAM,kBACJ,OAAO,WAAW,aACd,SACC,OAAO,mBAAmB,OAAO,WAAW;AAEnD,MAAI,OAAO,oBAAoB,YAAY;AAEzC;AAAA,EACF;AAEA,SAAO,qBAAqB,iBAAiB,IAAI;AACnD;",
6
+ "names": []
7
7
  }
@@ -0,0 +1,7 @@
1
+ import type http from 'http';
2
+ /**
3
+ * Returns a HTTP server wrapped in a promise
4
+ *
5
+ * This function resolves when the server is closed.
6
+ */
7
+ export declare const startServer: (server: http.Server, port?: number) => Promise<void>;
@@ -0,0 +1,11 @@
1
+ import { log } from "../utils/logging.js";
2
+ const startServer = (server, port) => new Promise(
3
+ (resolve, reject) => server.listen(port).on("close", resolve).on("error", reject).on("listening", () => {
4
+ const address = server.address();
5
+ log.ok("listening on port", log.bold(String(address.port)));
6
+ })
7
+ );
8
+ export {
9
+ startServer
10
+ };
11
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/wrapper/server.ts"],
4
+ "sourcesContent": ["import type http from 'http';\nimport type { AddressInfo } from 'net';\n\nimport { log } from '../utils/logging.js';\n\n/**\n * Returns a HTTP server wrapped in a promise\n *\n * This function resolves when the server is closed.\n */\nexport const startServer = (server: http.Server, port?: number) =>\n new Promise<void>((resolve, reject) =>\n server\n .listen(port)\n .on('close', resolve)\n .on('error', reject)\n .on('listening', () => {\n const address = server.address() as AddressInfo;\n\n log.ok('listening on port', log.bold(String(address.port)));\n }),\n );\n"],
5
+ "mappings": "AAGA,SAAS,WAAW;AAOb,MAAM,cAAc,CAAC,QAAqB,SAC/C,IAAI;AAAA,EAAc,CAAC,SAAS,WAC1B,OACG,OAAO,IAAI,EACX,GAAG,SAAS,OAAO,EACnB,GAAG,SAAS,MAAM,EAClB,GAAG,aAAa,MAAM;AACrB,UAAM,UAAU,OAAO,QAAQ;AAE/B,QAAI,GAAG,qBAAqB,IAAI,KAAK,OAAO,QAAQ,IAAI,CAAC,CAAC;AAAA,EAC5D,CAAC;AACL;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "14.0.0-migrate-to-inquirer-20251031060542",
3
+ "version": "14.0.0-replace-global-vars-20251117052457",
4
4
  "private": false,
5
5
  "description": "SEEK development toolkit for backend applications and packages",
6
6
  "homepage": "https://github.com/seek-oss/skuba#readme",
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "sideEffects": false,
16
+ "type": "module",
16
17
  "main": "lib/index.js",
17
18
  "types": "./lib/index.d.ts",
18
19
  "bin": {
@@ -20,12 +21,10 @@
20
21
  },
21
22
  "files": [
22
23
  "config/**/*",
23
- "jest/**/*.js",
24
24
  "lib*/**/*.d.ts",
25
25
  "lib*/**/*.js",
26
26
  "lib*/**/*.js.map",
27
- "template/**/*",
28
- "jest-preset.js"
27
+ "template/**/*"
29
28
  ],
30
29
  "remarkConfig": {
31
30
  "plugins": [
@@ -58,14 +57,14 @@
58
57
  "@esbuild-plugins/tsconfig-paths": "^0.1.0",
59
58
  "@eslint/migrate-config": "~1.3.8",
60
59
  "@inquirer/prompts": "^7.9.0",
61
- "@jest/types": "^30.0.0",
62
60
  "@octokit/graphql": "^9.0.0",
63
61
  "@octokit/graphql-schema": "^15.3.0",
64
62
  "@octokit/rest": "^22.0.0",
65
63
  "@octokit/types": "^15.0.0",
66
- "@types/jest": "^30.0.0",
67
64
  "@types/node": "^22.0.0",
68
- "chalk": "^4.1.0",
65
+ "@vitest/coverage-v8": "^4.0.5",
66
+ "@vitest/ui": "^4.0.5",
67
+ "@vitest/utils": "^4.0.5",
69
68
  "concurrently": "^9.0.0",
70
69
  "ejs": "^3.1.6",
71
70
  "esbuild": "~0.25.0",
@@ -80,8 +79,6 @@
80
79
  "ignore": "^7.0.0",
81
80
  "is-installed-globally": "^0.4.0",
82
81
  "isomorphic-git": "^1.11.1",
83
- "jest": "^30.0.0",
84
- "jest-watch-typeahead": "^3.0.1",
85
82
  "lodash.mergewith": "^4.6.2",
86
83
  "minimist": "^1.2.6",
87
84
  "normalize-package-data": "^7.0.0",
@@ -91,25 +88,21 @@
91
88
  "picomatch": "^4.0.0",
92
89
  "prettier": "~3.6.0",
93
90
  "prettier-plugin-packagejson": "^2.4.10",
94
- "read-pkg-up": "^7.0.1",
91
+ "read-package-up": "^11.0.0",
95
92
  "semantic-release": "^24.2.3",
96
93
  "simple-git": "^3.5.0",
97
- "ts-dedent": "^2.2.0",
98
- "ts-jest": "^29.4.0",
99
- "ts-node": "^10.9.2",
100
94
  "tsconfig-paths": "^4.0.0",
101
95
  "tsconfig-seek": "2.0.0",
102
96
  "tsx": "^4.16.2",
103
97
  "typescript": "~5.9.0",
98
+ "vitest": "^4.0.5",
104
99
  "zod": "^4.0.0",
105
- "@skuba-lib/api": "^1.0.1",
106
- "eslint-config-skuba": "7.2.0"
100
+ "@skuba-lib/api": "^1.1.0-replace-global-vars-20251117052457",
101
+ "eslint-config-skuba": "7.3.0-replace-global-vars-20251117052457"
107
102
  },
108
103
  "devDependencies": {
109
104
  "@changesets/cli": "2.29.7",
110
105
  "@changesets/get-github-info": "0.6.0",
111
- "@jest/reporters": "30.2.0",
112
- "@jest/test-result": "30.2.0",
113
106
  "@types/ejs": "3.1.5",
114
107
  "@types/express": "5.0.3",
115
108
  "@types/fs-extra": "11.0.4",
@@ -125,7 +118,6 @@
125
118
  "enhanced-resolve": "5.18.3",
126
119
  "express": "5.1.0",
127
120
  "fastify": "5.6.1",
128
- "jest-diff": "30.2.0",
129
121
  "jsonfile": "6.2.0",
130
122
  "koa": "3.0.3",
131
123
  "memfs": "4.49.0",
@@ -133,10 +125,11 @@
133
125
  "remark-preset-lint-recommended": "7.0.1",
134
126
  "semver": "7.7.3",
135
127
  "supertest": "7.1.4",
128
+ "ts-dedent": "^2.2.0",
136
129
  "type-fest": "2.19.0"
137
130
  },
138
131
  "peerDependencies": {
139
- "skuba-dive": "3.0.0-migrate-to-inquirer-20251031060542"
132
+ "skuba-dive": "3.0.0-replace-global-vars-20251117052457"
140
133
  },
141
134
  "peerDependenciesMeta": {
142
135
  "skuba-dive": {
@@ -166,12 +159,12 @@
166
159
  "release": "pnpm --silent build && changeset publish",
167
160
  "skuba": "pnpm --silent build && pnpm --silent skuba:exec",
168
161
  "skuba:exec": "node lib/skuba",
169
- "stage": "changeset version && node ./.changeset/inject.js && pnpm format",
170
- "test": "pnpm --silent skuba test --selectProjects unit",
171
- "test:ci": "pnpm --silent skuba test --runInBand",
172
- "test:int": "pnpm --silent skuba test --selectProjects integration --runInBand",
162
+ "stage": "changeset version && node ./.changeset/inject.cjs && pnpm format",
163
+ "test": "pnpm --silent skuba test run",
164
+ "test:ci": "pnpm --silent skuba test run",
165
+ "test:int": "pnpm --silent skuba test run",
173
166
  "test:template": "scripts/test-template.sh",
174
167
  "test:template:updateSnapshot": "scripts/test-template.sh -u",
175
- "test:watch": "pnpm --silent skuba test --runInBand --watch"
168
+ "test:watch": "pnpm --silent skuba test"
176
169
  }
177
170
  }
@@ -1 +1 @@
1
- module.exports = require('skuba/config/prettier');
1
+ export { default } from 'skuba/config/prettier.js';
@@ -1 +1 @@
1
- module.exports = require('eslint-config-skuba');
1
+ export { default } from 'eslint-config-skuba';
@@ -1,6 +1,6 @@
1
1
  # managed by skuba
2
2
  ignorePatchFailures: false
3
- minimumReleaseAge: 4320 # 3 days
3
+ # minimumReleaseAge: 4320 # 3 days
4
4
  minimumReleaseAgeExclude:
5
5
  - '@seek/*'
6
6
  - '@skuba-lib/*'
@@ -12,11 +12,12 @@ minimumReleaseAgeExclude:
12
12
  packageManagerStrictVersion: true
13
13
  publicHoistPattern:
14
14
  - '@types*'
15
+ - '@vitest/*'
15
16
  - eslint
16
17
  - eslint-config-skuba
17
18
  - prettier
18
19
  - esbuild
19
- - jest
20
20
  - tsconfig-seek
21
21
  - typescript
22
+ - vitest
22
23
  # end managed by skuba
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ ssr: {
5
+ resolve: {
6
+ conditions: ['@seek/<%- serviceName %>/source'],
7
+ },
8
+ },
9
+ test: {
10
+ env: {
11
+ DEPLOYMENT: 'test',
12
+ },
13
+ coverage: {
14
+ thresholds: {
15
+ branches: 0,
16
+ functions: 0,
17
+ lines: 0,
18
+ statements: 0,
19
+ },
20
+ include: ['src'],
21
+ exclude: ['src/testing'],
22
+ },
23
+ include: ['**/*.test*.ts'],
24
+ },
25
+ });
@@ -2,6 +2,7 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "type": "module",
5
6
  "imports": {
6
7
  "#src/*": {
7
8
  "@seek/<%- serviceName %>/source": "./src/*",
@@ -40,7 +41,7 @@
40
41
  "skuba": "*",
41
42
  "supertest": "^7.0.0"
42
43
  },
43
- "packageManager": "pnpm@10.19.0",
44
+ "packageManager": "pnpm@10.20.0",
44
45
  "engines": {
45
46
  "node": ">=22"
46
47
  }
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- module.exports = {
5
+ export default {
6
6
  entryPoint: 'src/app.ts',
7
7
  fields: [
8
8
  {
@@ -1,4 +1,5 @@
1
1
  import request from 'supertest';
2
+ import { describe, it } from 'vitest';
2
3
 
3
4
  import app from './app.js';
4
5
 
@@ -2,6 +2,7 @@
2
2
  "name": "@seek/greeter",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "type": "module",
5
6
  "imports": {
6
7
  "#src/*": {
7
8
  "@seek/<%- serviceName %>/source": "./src/*",
@@ -19,13 +20,13 @@
19
20
  "test:watch": "skuba test --watch"
20
21
  },
21
22
  "dependencies": {
22
- "skuba-dive": "3.0.0-migrate-to-inquirer-20251031060542"
23
+ "skuba-dive": "3.0.0-replace-global-vars-20251117052457"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/node": "^22.13.10",
26
- "skuba": "14.0.0-migrate-to-inquirer-20251031060542"
27
+ "skuba": "14.0.0-replace-global-vars-20251117052457"
27
28
  },
28
- "packageManager": "pnpm@10.19.0",
29
+ "packageManager": "pnpm@10.20.0",
29
30
  "engines": {
30
31
  "node": ">=22"
31
32
  }
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- module.exports = {
5
+ export default {
6
6
  entryPoint: 'src/app.ts',
7
7
  fields: [
8
8
  {
@@ -1,5 +1,7 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
1
3
  import * as app from './app.js';
2
4
 
3
5
  describe('app', () => {
4
- it('is importable', () => expect(app).toEqual({}));
6
+ it('is importable', () => expect(app).toBeDefined());
5
7
  });
@@ -2,6 +2,7 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "type": "module",
5
6
  "imports": {
6
7
  "#src/*": {
7
8
  "@seek/<%- serviceName %>/source": "./src/*",
@@ -49,7 +50,7 @@
49
50
  "skuba": "*",
50
51
  "supertest": "^7.0.0"
51
52
  },
52
- "packageManager": "pnpm@10.19.0",
53
+ "packageManager": "pnpm@10.20.0",
53
54
  "engines": {
54
55
  "node": ">=22"
55
56
  }
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- module.exports = {
5
+ export default {
6
6
  entryPoint: 'src/app.ts',
7
7
  fields: [
8
8
  {
@@ -1,3 +1,5 @@
1
+ import { describe, it } from 'vitest';
2
+
1
3
  import { jobRouter } from './index.js';
2
4
 
3
5
  import { agentFromRouter } from '#src/testing/server.js';
@@ -1,3 +1,5 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
1
3
  import { jobRouter } from './index.js';
2
4
 
3
5
  import { agentFromRouter } from '#src/testing/server.js';
@@ -1,3 +1,5 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
1
3
  import app from './app.js';
2
4
 
3
5
  import { agentFromApp } from '#src/testing/server.js';
@@ -1,4 +1,5 @@
1
1
  import Router from '@koa/router';
2
+ import { afterEach, describe, expect, it, vi } from 'vitest';
2
3
 
3
4
  import { stdoutMock } from './logging.js';
4
5
 
@@ -7,8 +8,7 @@ import { agentFromRouter } from '#src/testing/server.js';
7
8
  import { chance } from '#src/testing/types.js';
8
9
  import type { Middleware } from '#src/types/koa.js';
9
10
 
10
- const middleware = jest.fn<void, Parameters<Middleware>>();
11
-
11
+ const middleware = vi.fn<Middleware>();
12
12
  const router = new Router()
13
13
  .use('/nested', new Router().put('/:param', middleware).routes())
14
14
  .get('/', middleware);
@@ -1,3 +1,5 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
1
3
  import { jsonBodyParser } from './bodyParser.js';
2
4
  import { validate } from './validation.js';
3
5
 
@@ -1,3 +1,5 @@
1
+ import { expect } from 'vitest';
2
+
1
3
  import * as metrics from '#src/framework/metrics.js';
2
4
 
3
5
  function assertDefined<T>(value: T | undefined): asserts value is T {
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`returns expected CloudFormation stack for dev 1`] = `
4
4
  {
@@ -763,6 +763,14 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
763
763
  },
764
764
  },
765
765
  "Resources": {
766
+ "datadogapikeysecret046FEF06": {
767
+ "DeletionPolicy": "Delete",
768
+ "Properties": {
769
+ "GenerateSecretString": {},
770
+ },
771
+ "Type": "AWS::SecretsManager::Secret",
772
+ "UpdateReplacePolicy": "Delete",
773
+ },
766
774
  "destinationtopicDCE2E0B8": {
767
775
  "Properties": {
768
776
  "KmsMasterKeyId": {
@@ -920,7 +928,9 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
920
928
  },
921
929
  "Environment": {
922
930
  "Variables": {
923
- "DD_API_KEY_SECRET_ARN": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME",
931
+ "DD_API_KEY_SECRET_ARN": {
932
+ "Ref": "datadogapikeysecret046FEF06",
933
+ },
924
934
  "DD_CAPTURE_LAMBDA_PAYLOAD": "false",
925
935
  "DD_ENV": "production",
926
936
  "DD_FLUSH_TO_LOG": "false",
@@ -1384,7 +1394,9 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1384
1394
  "secretsmanager:DescribeSecret",
1385
1395
  ],
1386
1396
  "Effect": "Allow",
1387
- "Resource": "arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME-??????",
1397
+ "Resource": {
1398
+ "Ref": "datadogapikeysecret046FEF06",
1399
+ },
1388
1400
  },
1389
1401
  {
1390
1402
  "Action": [
@@ -1,5 +1,6 @@
1
1
  import { App, aws_secretsmanager, aws_sns } from 'aws-cdk-lib';
2
2
  import { Template } from 'aws-cdk-lib/assertions';
3
+ import { afterAll, afterEach, expect, it, vi } from 'vitest';
3
4
 
4
5
  const originalDeployment = process.env.DEPLOYMENT;
5
6
  const originalVersion = process.env.VERSION;
@@ -10,7 +11,7 @@ afterAll(() => {
10
11
  });
11
12
 
12
13
  afterEach(() => {
13
- jest.resetModules();
14
+ vi.resetModules();
14
15
  });
15
16
 
16
17
  it.each(['dev', 'prod'])(
@@ -21,15 +22,16 @@ it.each(['dev', 'prod'])(
21
22
 
22
23
  const { AppStack } = await import('./appStack.js');
23
24
 
24
- jest
25
- .spyOn(aws_sns.Topic, 'fromTopicArn')
26
- .mockImplementation((scope, id) => new aws_sns.Topic(scope, id));
25
+ vi.spyOn(aws_sns.Topic, 'fromTopicArn').mockImplementation(
26
+ (scope, id) => new aws_sns.Topic(scope, id),
27
+ );
27
28
 
28
- jest
29
- .spyOn(aws_secretsmanager.Secret, 'fromSecretPartialArn')
30
- .mockImplementation(
31
- (scope, id) => new aws_secretsmanager.Secret(scope, id),
32
- );
29
+ vi.spyOn(
30
+ aws_secretsmanager.Secret,
31
+ 'fromSecretPartialArn',
32
+ ).mockImplementation(
33
+ (scope, id) => new aws_secretsmanager.Secret(scope, id),
34
+ );
33
35
 
34
36
  const app = new App({ context: { 'aws:cdk:bundling-stacks': [] } });
35
37