skuba 14.0.0-esmify-skuba-20251105034821 → 14.0.0-hacky-hack-lang-json-20260108235938

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 (408) hide show
  1. package/config/eslint.js +1 -1
  2. package/config/jest.js +1 -0
  3. package/config/prettier.d.ts +4 -8
  4. package/config/prettier.js +2 -10
  5. package/jest/moduleNameMapper.js +64 -0
  6. package/jest/transform.js +62 -0
  7. package/jest/tsConfig.js +26 -0
  8. package/jest-preset.js +37 -0
  9. package/lib/api/jest/index.d.ts +15 -0
  10. package/lib/api/jest/index.js +59 -0
  11. package/lib/api/jest/index.js.map +7 -0
  12. package/lib/cli/adapter/eslint.js +45 -11
  13. package/lib/cli/adapter/eslint.js.map +3 -3
  14. package/lib/cli/adapter/prettier.js +67 -39
  15. package/lib/cli/adapter/prettier.js.map +2 -2
  16. package/lib/cli/build/args.js +42 -8
  17. package/lib/cli/build/args.js.map +2 -2
  18. package/lib/cli/build/assets.d.ts +3 -2
  19. package/lib/cli/build/assets.js +60 -28
  20. package/lib/cli/build/assets.js.map +3 -3
  21. package/lib/cli/build/esbuild.d.ts +4 -2
  22. package/lib/cli/build/esbuild.js +64 -23
  23. package/lib/cli/build/esbuild.js.map +2 -2
  24. package/lib/cli/build/index.js +53 -21
  25. package/lib/cli/build/index.js.map +2 -2
  26. package/lib/cli/build/tsc.js +60 -24
  27. package/lib/cli/build/tsc.js.map +3 -3
  28. package/lib/cli/buildPackage/index.js +32 -8
  29. package/lib/cli/buildPackage/index.js.map +1 -1
  30. package/lib/cli/configure/analyseConfiguration.js +50 -16
  31. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  32. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  33. package/lib/cli/configure/analyseDependencies.js +59 -25
  34. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  35. package/lib/cli/configure/analysis/diff.js +29 -5
  36. package/lib/cli/configure/analysis/diff.js.map +2 -2
  37. package/lib/cli/configure/analysis/files.js +42 -8
  38. package/lib/cli/configure/analysis/files.js.map +2 -2
  39. package/lib/cli/configure/analysis/git.js +46 -12
  40. package/lib/cli/configure/analysis/git.js.map +2 -2
  41. package/lib/cli/configure/analysis/package.d.ts +3 -2
  42. package/lib/cli/configure/analysis/package.js +45 -10
  43. package/lib/cli/configure/analysis/package.js.map +3 -3
  44. package/lib/cli/configure/analysis/project.js +50 -18
  45. package/lib/cli/configure/analysis/project.js.map +2 -2
  46. package/lib/cli/configure/dependencies/index.js +35 -7
  47. package/lib/cli/configure/dependencies/index.js.map +1 -1
  48. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
  49. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  50. package/lib/cli/configure/dependencies/seekKoala.js +28 -4
  51. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  52. package/lib/cli/configure/dependencies/skuba.js +28 -4
  53. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  54. package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
  55. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  56. package/lib/cli/configure/dependencies/skubaDive.js +29 -4
  57. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  58. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  59. package/lib/cli/configure/ensureTemplateCompletion.js +63 -32
  60. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  61. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  62. package/lib/cli/configure/getEntryPoint.js +51 -19
  63. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  64. package/lib/cli/configure/getProjectType.d.ts +1 -1
  65. package/lib/cli/configure/getProjectType.js +36 -17
  66. package/lib/cli/configure/getProjectType.js.map +2 -2
  67. package/lib/cli/configure/index.js +91 -56
  68. package/lib/cli/configure/index.js.map +3 -3
  69. package/lib/cli/configure/modules/eslint.js +34 -10
  70. package/lib/cli/configure/modules/eslint.js.map +1 -1
  71. package/lib/cli/configure/modules/ignore.js +32 -8
  72. package/lib/cli/configure/modules/ignore.js.map +1 -1
  73. package/lib/cli/configure/modules/index.js +44 -18
  74. package/lib/cli/configure/modules/index.js.map +2 -2
  75. package/lib/cli/configure/modules/jest.d.ts +2 -0
  76. package/lib/cli/configure/modules/jest.js +86 -0
  77. package/lib/cli/configure/modules/jest.js.map +7 -0
  78. package/lib/cli/configure/modules/nodemon.js +28 -4
  79. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  80. package/lib/cli/configure/modules/package.js +34 -10
  81. package/lib/cli/configure/modules/package.js.map +1 -1
  82. package/lib/cli/configure/modules/prettier.js +35 -11
  83. package/lib/cli/configure/modules/prettier.js.map +1 -1
  84. package/lib/cli/configure/modules/renovate.js +40 -17
  85. package/lib/cli/configure/modules/renovate.js.map +2 -2
  86. package/lib/cli/configure/modules/serverless.js +26 -2
  87. package/lib/cli/configure/modules/serverless.js.map +1 -1
  88. package/lib/cli/configure/modules/tslint.js +28 -4
  89. package/lib/cli/configure/modules/tslint.js.map +1 -1
  90. package/lib/cli/configure/processing/configFile.js +39 -3
  91. package/lib/cli/configure/processing/configFile.js.map +1 -1
  92. package/lib/cli/configure/processing/deleteFiles.js +26 -2
  93. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  94. package/lib/cli/configure/processing/javascript.js +27 -2
  95. package/lib/cli/configure/processing/javascript.js.map +1 -1
  96. package/lib/cli/configure/processing/json.js +31 -6
  97. package/lib/cli/configure/processing/json.js.map +1 -1
  98. package/lib/cli/configure/processing/loadFiles.js +26 -2
  99. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  100. package/lib/cli/configure/processing/module.js +28 -4
  101. package/lib/cli/configure/processing/module.js.map +1 -1
  102. package/lib/cli/configure/processing/package.d.ts +67 -1
  103. package/lib/cli/configure/processing/package.js +45 -8
  104. package/lib/cli/configure/processing/package.js.map +3 -3
  105. package/lib/cli/configure/processing/prettier.js +38 -4
  106. package/lib/cli/configure/processing/prettier.js.map +2 -2
  107. package/lib/cli/configure/processing/record.js +41 -5
  108. package/lib/cli/configure/processing/record.js.map +2 -2
  109. package/lib/cli/configure/processing/typescript.js +63 -26
  110. package/lib/cli/configure/processing/typescript.js.map +2 -2
  111. package/lib/cli/configure/types.d.ts +4 -15
  112. package/lib/cli/configure/types.js +16 -0
  113. package/lib/cli/configure/types.js.map +3 -3
  114. package/lib/cli/format/index.js +44 -20
  115. package/lib/cli/format/index.js.map +2 -2
  116. package/lib/cli/help/index.js +30 -6
  117. package/lib/cli/help/index.js.map +1 -1
  118. package/lib/cli/init/getConfig.d.ts +2 -2
  119. package/lib/cli/init/getConfig.js +121 -102
  120. package/lib/cli/init/getConfig.js.map +3 -3
  121. package/lib/cli/init/git.js +51 -16
  122. package/lib/cli/init/git.js.map +2 -2
  123. package/lib/cli/init/index.js +98 -67
  124. package/lib/cli/init/index.js.map +2 -2
  125. package/lib/cli/init/prompts.d.ts +13 -10
  126. package/lib/cli/init/prompts.js +56 -35
  127. package/lib/cli/init/prompts.js.map +2 -2
  128. package/lib/cli/init/types.d.ts +1 -1
  129. package/lib/cli/init/types.js +41 -7
  130. package/lib/cli/init/types.js.map +1 -1
  131. package/lib/cli/init/validation.js +30 -2
  132. package/lib/cli/init/validation.js.map +1 -1
  133. package/lib/cli/init/writePackageJson.js +42 -8
  134. package/lib/cli/init/writePackageJson.js.map +2 -2
  135. package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
  136. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  137. package/lib/cli/lint/annotate/buildkite/index.js +45 -11
  138. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  139. package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
  140. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  141. package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
  142. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  143. package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
  144. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  145. package/lib/cli/lint/annotate/github/eslint.js +26 -2
  146. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  147. package/lib/cli/lint/annotate/github/index.js +45 -11
  148. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  149. package/lib/cli/lint/annotate/github/internal.js +26 -2
  150. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  151. package/lib/cli/lint/annotate/github/prettier.js +26 -2
  152. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  153. package/lib/cli/lint/annotate/github/tsc.js +28 -4
  154. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  155. package/lib/cli/lint/annotate/index.js +30 -6
  156. package/lib/cli/lint/annotate/index.js.map +1 -1
  157. package/lib/cli/lint/autofix.d.ts +5 -0
  158. package/lib/cli/lint/autofix.js +80 -40
  159. package/lib/cli/lint/autofix.js.map +2 -2
  160. package/lib/cli/lint/eslint.js +51 -16
  161. package/lib/cli/lint/eslint.js.map +3 -3
  162. package/lib/cli/lint/external.js +51 -19
  163. package/lib/cli/lint/external.js.map +2 -2
  164. package/lib/cli/lint/index.js +50 -28
  165. package/lib/cli/lint/index.js.map +2 -2
  166. package/lib/cli/lint/internal.js +44 -18
  167. package/lib/cli/lint/internal.js.map +2 -2
  168. package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
  169. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  170. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +46 -14
  171. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
  172. package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
  173. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  174. package/lib/cli/lint/internalLints/refreshConfigFiles.js +64 -35
  175. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  176. package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
  177. package/lib/cli/lint/internalLints/upgrade/index.js +105 -41
  178. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  179. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
  180. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  181. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
  182. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  183. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
  184. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  185. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
  186. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  187. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
  188. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  209. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
  210. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  211. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
  212. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  213. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -17
  214. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
  216. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  217. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
  218. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  219. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  220. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +149 -0
  221. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  222. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
  223. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  224. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
  225. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  226. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
  227. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  228. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
  229. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  230. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
  231. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  232. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
  233. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
  235. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  236. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
  237. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  238. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
  239. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  240. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
  241. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  242. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
  243. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  244. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
  245. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  246. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
  247. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  248. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
  249. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  250. package/lib/cli/lint/prettier.js +50 -15
  251. package/lib/cli/lint/prettier.js.map +3 -3
  252. package/lib/cli/lint/tsc.js +28 -4
  253. package/lib/cli/lint/tsc.js.map +1 -1
  254. package/lib/cli/lint/types.js +16 -0
  255. package/lib/cli/lint/types.js.map +3 -3
  256. package/lib/cli/migrate/index.d.ts +5 -0
  257. package/lib/cli/migrate/index.js +79 -15
  258. package/lib/cli/migrate/index.js.map +2 -2
  259. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  260. package/lib/cli/migrate/nodeVersion/checks.js +51 -120
  261. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  262. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  263. package/lib/cli/migrate/nodeVersion/index.js +239 -65
  264. package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
  265. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  266. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  267. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  268. package/lib/cli/node/index.js +57 -20
  269. package/lib/cli/node/index.js.map +3 -3
  270. package/lib/cli/release/index.js +28 -4
  271. package/lib/cli/release/index.js.map +1 -1
  272. package/lib/cli/start/index.js +50 -16
  273. package/lib/cli/start/index.js.map +3 -3
  274. package/lib/cli/test/index.js +44 -4
  275. package/lib/cli/test/index.js.map +2 -2
  276. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  277. package/lib/cli/test/reporters/github/annotations.js +102 -0
  278. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  279. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  280. package/lib/cli/test/reporters/github/index.js +74 -0
  281. package/lib/cli/test/reporters/github/index.js.map +7 -0
  282. package/lib/cli/version/index.js +30 -6
  283. package/lib/cli/version/index.js.map +1 -1
  284. package/lib/index.d.ts +1 -0
  285. package/lib/index.js +46 -6
  286. package/lib/index.js.map +2 -2
  287. package/lib/skuba.js +45 -26
  288. package/lib/skuba.js.map +3 -3
  289. package/lib/utils/args.js +43 -6
  290. package/lib/utils/args.js.map +2 -2
  291. package/lib/utils/command.js +42 -4
  292. package/lib/utils/command.js.map +3 -3
  293. package/lib/utils/copy.js +57 -20
  294. package/lib/utils/copy.js.map +2 -2
  295. package/lib/utils/dir.js +72 -32
  296. package/lib/utils/dir.js.map +2 -2
  297. package/lib/utils/env.js +26 -2
  298. package/lib/utils/env.js.map +1 -1
  299. package/lib/utils/error.js +47 -10
  300. package/lib/utils/error.js.map +1 -1
  301. package/lib/utils/exec.d.ts +3 -2
  302. package/lib/utils/exec.js +62 -24
  303. package/lib/utils/exec.js.map +3 -3
  304. package/lib/utils/fs.js +40 -6
  305. package/lib/utils/fs.js.map +2 -2
  306. package/lib/utils/help.js +30 -6
  307. package/lib/utils/help.js.map +1 -1
  308. package/lib/utils/logging.d.ts +9 -10
  309. package/lib/utils/logging.js +38 -11
  310. package/lib/utils/logging.js.map +2 -2
  311. package/lib/utils/logo.js +52 -25
  312. package/lib/utils/logo.js.map +2 -2
  313. package/lib/utils/manifest.d.ts +2 -3
  314. package/lib/utils/manifest.js +48 -8
  315. package/lib/utils/manifest.js.map +3 -3
  316. package/lib/utils/npmrc.js +26 -2
  317. package/lib/utils/npmrc.js.map +1 -1
  318. package/lib/utils/packageManager.js +49 -12
  319. package/lib/utils/packageManager.js.map +2 -2
  320. package/lib/utils/port.js +39 -4
  321. package/lib/utils/port.js.map +2 -2
  322. package/lib/utils/sleep.js +26 -2
  323. package/lib/utils/sleep.js.map +1 -1
  324. package/lib/utils/template.js +55 -18
  325. package/lib/utils/template.js.map +3 -3
  326. package/lib/utils/validation.js +31 -2
  327. package/lib/utils/validation.js.map +1 -1
  328. package/lib/utils/version.js +46 -9
  329. package/lib/utils/version.js.map +2 -2
  330. package/lib/utils/wait.js +32 -7
  331. package/lib/utils/wait.js.map +1 -1
  332. package/lib/utils/worker.d.ts +3 -3
  333. package/lib/utils/worker.js +35 -10
  334. package/lib/utils/worker.js.map +1 -1
  335. package/lib/wrapper/function-arguments.d.js +1 -0
  336. package/lib/wrapper/functionHandler.js +49 -18
  337. package/lib/wrapper/functionHandler.js.map +2 -2
  338. package/lib/wrapper/http.js +43 -8
  339. package/lib/wrapper/http.js.map +2 -2
  340. package/lib/wrapper/index.js +7 -6
  341. package/lib/wrapper/index.js.map +1 -1
  342. package/lib/wrapper/main.js +42 -8
  343. package/lib/wrapper/main.js.map +3 -3
  344. package/lib/wrapper/requestListener.js +47 -13
  345. package/lib/wrapper/requestListener.js.map +2 -2
  346. package/lib/wrapper/server.js +28 -4
  347. package/lib/wrapper/server.js.map +2 -2
  348. package/package.json +43 -45
  349. package/template/base/_.prettierrc.js +1 -1
  350. package/template/base/_eslint.config.js +1 -1
  351. package/template/base/_pnpm-workspace.yaml +4 -3
  352. package/template/base/jest.config.ts +19 -0
  353. package/template/base/jest.setup.ts +3 -0
  354. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  355. package/template/express-rest-api/.nvmrc +1 -1
  356. package/template/express-rest-api/package.json +8 -9
  357. package/template/express-rest-api/skuba.template.js +1 -1
  358. package/template/express-rest-api/src/app.test.ts +0 -1
  359. package/template/greeter/.buildkite/pipeline.yml +1 -1
  360. package/template/greeter/.nvmrc +1 -1
  361. package/template/greeter/package.json +4 -5
  362. package/template/greeter/skuba.template.js +1 -1
  363. package/template/greeter/src/app.test.ts +1 -3
  364. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  365. package/template/koa-rest-api/.nvmrc +1 -1
  366. package/template/koa-rest-api/package.json +9 -11
  367. package/template/koa-rest-api/skuba.template.js +1 -1
  368. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
  369. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
  370. package/template/koa-rest-api/src/app.test.ts +0 -2
  371. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  372. package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
  373. package/template/koa-rest-api/src/testing/metrics.ts +0 -2
  374. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  375. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  376. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -21
  377. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
  378. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  379. package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
  380. package/template/lambda-sqs-worker-cdk/package.json +9 -9
  381. package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
  382. package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
  383. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
  384. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
  385. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
  386. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
  387. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
  388. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  389. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  390. package/template/oss-npm-package/.nvmrc +1 -1
  391. package/template/oss-npm-package/_package.json +0 -1
  392. package/template/oss-npm-package/skuba.template.js +1 -1
  393. package/template/oss-npm-package/src/index.test.ts +0 -2
  394. package/template/private-npm-package/.nvmrc +1 -1
  395. package/template/private-npm-package/_package.json +1 -2
  396. package/template/private-npm-package/skuba.template.js +2 -2
  397. package/template/private-npm-package/src/index.test.ts +0 -2
  398. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
  399. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  400. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
  401. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  402. package/lib/enquirer.d.js +0 -1
  403. package/lib/enquirer.d.js.map +0 -7
  404. package/lib/eslint.d.js +0 -1
  405. package/lib/eslint.d.js.map +0 -7
  406. package/template/base/vitest.config.ts +0 -25
  407. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.d.ts +0 -0
  408. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
package/lib/utils/port.js CHANGED
@@ -1,13 +1,48 @@
1
- import getPort from "get-port";
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 port_exports = {};
30
+ __export(port_exports, {
31
+ getRandomPort: () => getRandomPort,
32
+ randomIntBetween: () => randomIntBetween
33
+ });
34
+ module.exports = __toCommonJS(port_exports);
35
+ var import_get_port = __toESM(require("get-port"));
2
36
  const MIN_PORT = 1e4;
3
37
  const MAX_PORT = 49151;
4
38
  const randomIntBetween = (min, max) => min + Math.floor(Math.random() * (1 + max - min));
5
39
  const getRandomPort = () => {
6
40
  const preferredPorts = new Array(10).fill(null).map(() => randomIntBetween(MIN_PORT, MAX_PORT));
7
- return getPort({ port: preferredPorts });
41
+ return (0, import_get_port.default)({ port: preferredPorts });
8
42
  };
9
- export {
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
10
45
  getRandomPort,
11
46
  randomIntBetween
12
- };
47
+ });
13
48
  //# sourceMappingURL=port.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/port.ts"],
4
4
  "sourcesContent": ["import getPort from 'get-port';\n\n/* Smallest 5-digit port; these are less common than 4-digit ports. */\nconst MIN_PORT = 10000;\n\n/** Largest port in the IANA user port range. */\nconst MAX_PORT = 49151;\n\nexport const randomIntBetween = (min: number, max: number) =>\n min + Math.floor(Math.random() * (1 + max - min));\n\nexport const getRandomPort = () => {\n // Seed some random ports to use, if available.\n // get-port falls back to the private port range.\n const preferredPorts = new Array(10)\n .fill(null)\n .map(() => randomIntBetween(MIN_PORT, MAX_PORT));\n\n return getPort({ port: preferredPorts });\n};\n"],
5
- "mappings": "AAAA,OAAO,aAAa;AAGpB,MAAM,WAAW;AAGjB,MAAM,WAAW;AAEV,MAAM,mBAAmB,CAAC,KAAa,QAC5C,MAAM,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,MAAM,IAAI;AAE3C,MAAM,gBAAgB,MAAM;AAGjC,QAAM,iBAAiB,IAAI,MAAM,EAAE,EAChC,KAAK,IAAI,EACT,IAAI,MAAM,iBAAiB,UAAU,QAAQ,CAAC;AAEjD,SAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC;",
6
- "names": []
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAoB;AAGpB,MAAM,WAAW;AAGjB,MAAM,WAAW;AAEV,MAAM,mBAAmB,CAAC,KAAa,QAC5C,MAAM,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,MAAM,IAAI;AAE3C,MAAM,gBAAgB,MAAM;AAGjC,QAAM,iBAAiB,IAAI,MAAM,EAAE,EAChC,KAAK,IAAI,EACT,IAAI,MAAM,iBAAiB,UAAU,QAAQ,CAAC;AAEjD,aAAO,gBAAAA,SAAQ,EAAE,MAAM,eAAe,CAAC;AACzC;",
6
+ "names": ["getPort"]
7
7
  }
@@ -1,3 +1,26 @@
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 sleep_exports = {};
20
+ __export(sleep_exports, {
21
+ sleep: () => sleep
22
+ });
23
+ module.exports = __toCommonJS(sleep_exports);
1
24
  const sleep = (ms) => {
2
25
  let timeout;
3
26
  return Object.assign(
@@ -5,7 +28,8 @@ const sleep = (ms) => {
5
28
  { clear: () => clearTimeout(timeout) }
6
29
  );
7
30
  };
8
- export {
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
9
33
  sleep
10
- };
34
+ });
11
35
  //# sourceMappingURL=sleep.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/sleep.ts"],
4
4
  "sourcesContent": ["interface Timeout extends PromiseLike<void> {\n clear?: () => void;\n}\n\nexport const sleep = (ms: number): Timeout => {\n let timeout: NodeJS.Timeout;\n\n return Object.assign(\n new Promise<void>((resolve) => (timeout = setTimeout(resolve, ms))),\n { clear: () => clearTimeout(timeout) },\n );\n};\n"],
5
- "mappings": "AAIO,MAAM,QAAQ,CAAC,OAAwB;AAC5C,MAAI;AAEJ,SAAO,OAAO;AAAA,IACZ,IAAI,QAAc,CAAC,YAAa,UAAU,WAAW,SAAS,EAAE,CAAE;AAAA,IAClE,EAAE,OAAO,MAAM,aAAa,OAAO,EAAE;AAAA,EACvC;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,QAAQ,CAAC,OAAwB;AAC5C,MAAI;AAEJ,SAAO,OAAO;AAAA,IACZ,IAAI,QAAc,CAAC,YAAa,UAAU,WAAW,SAAS,EAAE,CAAE;AAAA,IAClE,EAAE,OAAO,MAAM,aAAa,OAAO,EAAE;AAAA,EACvC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,49 @@
1
- import path from "path";
2
- import fs from "fs-extra";
3
- import * as z from "zod/v4";
4
- import { projectTypeSchema } from "./manifest.js";
5
- import { packageManagerSchema } from "./packageManager.js";
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 template_exports = {};
30
+ __export(template_exports, {
31
+ BASE_TEMPLATE_DIR: () => BASE_TEMPLATE_DIR,
32
+ TEMPLATE_CONFIG_FILENAME: () => TEMPLATE_CONFIG_FILENAME,
33
+ TEMPLATE_DIR: () => TEMPLATE_DIR,
34
+ TEMPLATE_DOCUMENTATION_CONFIG: () => TEMPLATE_DOCUMENTATION_CONFIG,
35
+ TEMPLATE_NAMES: () => TEMPLATE_NAMES,
36
+ TEMPLATE_NAMES_WITH_BYO: () => TEMPLATE_NAMES_WITH_BYO,
37
+ ensureTemplateConfigDeletion: () => ensureTemplateConfigDeletion,
38
+ readBaseTemplateFile: () => readBaseTemplateFile,
39
+ templateConfigSchema: () => templateConfigSchema
40
+ });
41
+ module.exports = __toCommonJS(template_exports);
42
+ var import_path = __toESM(require("path"));
43
+ var import_fs_extra = __toESM(require("fs-extra"));
44
+ var z = __toESM(require("zod/v4"));
45
+ var import_manifest = require("./manifest.js");
46
+ var import_packageManager = require("./packageManager.js");
6
47
  const TEMPLATE_NAMES = [
7
48
  "express-rest-api",
8
49
  "greeter",
@@ -61,20 +102,16 @@ const templateConfigSchema = z.object({
61
102
  ),
62
103
  entryPoint: z.string().optional(),
63
104
  noSkip: z.boolean().optional(),
64
- packageManager: packageManagerSchema,
65
- type: projectTypeSchema.optional()
105
+ packageManager: import_packageManager.packageManagerSchema,
106
+ type: import_manifest.projectTypeSchema.optional()
66
107
  });
67
108
  const TEMPLATE_CONFIG_FILENAME = "skuba.template.js";
68
- const TEMPLATE_DIR = path.join(
69
- import.meta.dirname,
70
- "..",
71
- "..",
72
- "template"
73
- );
74
- const BASE_TEMPLATE_DIR = path.join(TEMPLATE_DIR, "base");
75
- const ensureTemplateConfigDeletion = (dir) => fs.promises.rm(path.join(dir, TEMPLATE_CONFIG_FILENAME));
76
- const readBaseTemplateFile = (src) => fs.promises.readFile(path.join(BASE_TEMPLATE_DIR, src), "utf8");
77
- export {
109
+ const TEMPLATE_DIR = import_path.default.join(__dirname, "..", "..", "template");
110
+ const BASE_TEMPLATE_DIR = import_path.default.join(TEMPLATE_DIR, "base");
111
+ const ensureTemplateConfigDeletion = (dir) => import_fs_extra.default.promises.rm(import_path.default.join(dir, TEMPLATE_CONFIG_FILENAME));
112
+ const readBaseTemplateFile = (src) => import_fs_extra.default.promises.readFile(import_path.default.join(BASE_TEMPLATE_DIR, src), "utf8");
113
+ // Annotate the CommonJS export names for ESM import in node:
114
+ 0 && (module.exports = {
78
115
  BASE_TEMPLATE_DIR,
79
116
  TEMPLATE_CONFIG_FILENAME,
80
117
  TEMPLATE_DIR,
@@ -84,5 +121,5 @@ export {
84
121
  ensureTemplateConfigDeletion,
85
122
  readBaseTemplateFile,
86
123
  templateConfigSchema
87
- };
124
+ });
88
125
  //# sourceMappingURL=template.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/template.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport * as z from 'zod/v4';\n\nimport { projectTypeSchema } from './manifest.js';\nimport { packageManagerSchema } from './packageManager.js';\n\nexport const TEMPLATE_NAMES = [\n 'express-rest-api',\n 'greeter',\n 'koa-rest-api',\n 'lambda-sqs-worker-cdk',\n 'oss-npm-package',\n 'private-npm-package',\n] as const;\n\nexport type TemplateName = (typeof TEMPLATE_NAMES)[number];\n\nexport const TEMPLATE_NAMES_WITH_BYO = [...TEMPLATE_NAMES, 'github \u2192'] as const;\n\ninterface TemplateDocumentationConfig {\n /**\n * The semantic version in which the template was first added.\n *\n * This is used to filter out historical changelogs.\n */\n added: string;\n\n /**\n * The Markdown file for the template in our `/docs`.\n *\n * This is used to compile per-template changelogs for our documentation site.\n */\n filename: string;\n}\n\nexport const TEMPLATE_DOCUMENTATION_CONFIG: Record<\n TemplateName,\n TemplateDocumentationConfig\n> = {\n 'express-rest-api': {\n added: '3.8.0',\n filename: 'api.md',\n },\n greeter: {\n added: '3.4.1',\n filename: 'barebones.md',\n },\n 'koa-rest-api': {\n added: '3.4.1',\n filename: 'api.md',\n },\n 'lambda-sqs-worker-cdk': {\n added: '3.13.0',\n filename: 'worker.md',\n },\n 'oss-npm-package': {\n added: '3.7.0',\n filename: 'package.md',\n },\n 'private-npm-package': {\n added: '3.6.0',\n filename: 'package.md',\n },\n};\n\nexport type TemplateConfig = z.infer<typeof templateConfigSchema>;\n\n// https://github.com/colinhacks/zod/issues/4143#issuecomment-2845134912\n// https://github.com/colinhacks/zod/issues/4143#issuecomment-2931729793\nconst functionSchema = <T extends z.core.$ZodFunction>(schema: T) =>\n z.custom<Parameters<T['implement']>[0]>().transform((arg, ctx) => {\n if (typeof arg !== 'function') {\n ctx.addIssue('Must be function');\n return z.NEVER;\n }\n return schema.implement(arg);\n });\n\nexport const templateConfigSchema = z.object({\n fields: z.array(\n z.object({\n name: z.string(),\n message: z.string(),\n initial: z.string(),\n validate: functionSchema(\n z.function({\n input: [z.string()],\n output: z.union([z.boolean(), z.string()]),\n }),\n ).optional(),\n }),\n ),\n entryPoint: z.string().optional(),\n noSkip: z.boolean().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n});\n\nexport const TEMPLATE_CONFIG_FILENAME = 'skuba.template.js';\n\nexport const TEMPLATE_DIR = path.join(\n import.meta.dirname,\n '..',\n '..',\n 'template',\n);\n\nexport const BASE_TEMPLATE_DIR = path.join(TEMPLATE_DIR, 'base');\n\nexport const ensureTemplateConfigDeletion = (dir: string): Promise<void> =>\n fs.promises.rm(path.join(dir, TEMPLATE_CONFIG_FILENAME));\n\nexport const readBaseTemplateFile = (src: string): Promise<string> =>\n fs.promises.readFile(path.join(BASE_TEMPLATE_DIR, src), 'utf8');\n"],
5
- "mappings": "AAAA,OAAO,UAAU;AAEjB,OAAO,QAAQ;AACf,YAAY,OAAO;AAEnB,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AAE9B,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,0BAA0B,CAAC,GAAG,gBAAgB,eAAU;AAkB9D,MAAM,gCAGT;AAAA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AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,oBAAoB,KAAK,KAAK,cAAc,MAAM;AAExD,MAAM,+BAA+B,CAAC,QAC3C,GAAG,SAAS,GAAG,KAAK,KAAK,KAAK,wBAAwB,CAAC;AAElD,MAAM,uBAAuB,CAAC,QACnC,GAAG,SAAS,SAAS,KAAK,KAAK,mBAAmB,GAAG,GAAG,MAAM;",
6
- "names": []
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport * as z from 'zod/v4';\n\nimport { projectTypeSchema } from './manifest.js';\nimport { packageManagerSchema } from './packageManager.js';\n\nexport const TEMPLATE_NAMES = [\n 'express-rest-api',\n 'greeter',\n 'koa-rest-api',\n 'lambda-sqs-worker-cdk',\n 'oss-npm-package',\n 'private-npm-package',\n] as const;\n\nexport type TemplateName = (typeof TEMPLATE_NAMES)[number];\n\nexport const TEMPLATE_NAMES_WITH_BYO = [...TEMPLATE_NAMES, 'github \u2192'] as const;\n\ninterface TemplateDocumentationConfig {\n /**\n * The semantic version in which the template was first added.\n *\n * This is used to filter out historical changelogs.\n */\n added: string;\n\n /**\n * The Markdown file for the template in our `/docs`.\n *\n * This is used to compile per-template changelogs for our documentation site.\n */\n filename: string;\n}\n\nexport const TEMPLATE_DOCUMENTATION_CONFIG: Record<\n TemplateName,\n TemplateDocumentationConfig\n> = {\n 'express-rest-api': {\n added: '3.8.0',\n filename: 'api.md',\n },\n greeter: {\n added: '3.4.1',\n filename: 'barebones.md',\n },\n 'koa-rest-api': {\n added: '3.4.1',\n filename: 'api.md',\n },\n 'lambda-sqs-worker-cdk': {\n added: '3.13.0',\n filename: 'worker.md',\n },\n 'oss-npm-package': {\n added: '3.7.0',\n filename: 'package.md',\n },\n 'private-npm-package': {\n added: '3.6.0',\n filename: 'package.md',\n },\n};\n\nexport type TemplateConfig = z.infer<typeof templateConfigSchema>;\n\n// https://github.com/colinhacks/zod/issues/4143#issuecomment-2845134912\n// https://github.com/colinhacks/zod/issues/4143#issuecomment-2931729793\nconst functionSchema = <T extends z.core.$ZodFunction>(schema: T) =>\n z.custom<Parameters<T['implement']>[0]>().transform((arg, ctx) => {\n if (typeof arg !== 'function') {\n ctx.addIssue('Must be function');\n return z.NEVER;\n }\n return schema.implement(arg);\n });\n\nexport const templateConfigSchema = z.object({\n fields: z.array(\n z.object({\n name: z.string(),\n message: z.string(),\n initial: z.string(),\n validate: functionSchema(\n z.function({\n input: [z.string()],\n output: z.union([z.boolean(), z.string()]),\n }),\n ).optional(),\n }),\n ),\n entryPoint: z.string().optional(),\n noSkip: z.boolean().optional(),\n packageManager: packageManagerSchema,\n type: projectTypeSchema.optional(),\n});\n\nexport const TEMPLATE_CONFIG_FILENAME = 'skuba.template.js';\n\nexport const TEMPLATE_DIR = path.join(__dirname, '..', '..', 'template');\n\nexport const BASE_TEMPLATE_DIR = path.join(TEMPLATE_DIR, 'base');\n\nexport const ensureTemplateConfigDeletion = (dir: string): Promise<void> =>\n fs.promises.rm(path.join(dir, TEMPLATE_CONFIG_FILENAME));\n\nexport const readBaseTemplateFile = (src: string): Promise<string> =>\n fs.promises.readFile(path.join(BASE_TEMPLATE_DIR, src), 'utf8');\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,QAAmB;AAEnB,sBAAkC;AAClC,4BAAqC;AAE9B,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,0BAA0B,CAAC,GAAG,gBAAgB,eAAU;AAkB9D,MAAM,gCAGT;AAAA,EACF,oBAAoB;AAAA,IAClB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,gBAAg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AK,wBAAwB,CAAC;AAElD,MAAM,uBAAuB,CAAC,QACnC,gBAAAC,QAAG,SAAS,SAAS,YAAAD,QAAK,KAAK,mBAAmB,GAAG,GAAG,MAAM;",
6
+ "names": ["path", "fs"]
7
7
  }
@@ -1,15 +1,44 @@
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 validation_exports = {};
20
+ __export(validation_exports, {
21
+ hasNumberProp: () => hasNumberProp,
22
+ hasProp: () => hasProp,
23
+ hasStringProp: () => hasStringProp,
24
+ isFunction: () => isFunction,
25
+ isIpPort: () => isIpPort,
26
+ isObject: () => isObject
27
+ });
28
+ module.exports = __toCommonJS(validation_exports);
1
29
  const isFunction = (data) => typeof data === "function";
2
30
  const isIpPort = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && value <= 65535;
3
31
  const isObject = (value) => typeof value === "object" && value !== null;
4
32
  const hasProp = (value, prop) => isObject(value) && value.hasOwnProperty(prop);
5
33
  const hasNumberProp = (value, prop) => isObject(value) && typeof value[prop] === "number";
6
34
  const hasStringProp = (value, prop) => isObject(value) && typeof value[prop] === "string";
7
- export {
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
8
37
  hasNumberProp,
9
38
  hasProp,
10
39
  hasStringProp,
11
40
  isFunction,
12
41
  isIpPort,
13
42
  isObject
14
- };
43
+ });
15
44
  //# sourceMappingURL=validation.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/validation.ts"],
4
4
  "sourcesContent": ["export const isFunction = (\n data: unknown,\n): data is (...args: unknown[]) => Promise<unknown> =>\n typeof data === 'function';\n\nexport const isIpPort = (value: unknown): value is number =>\n typeof value === 'number' &&\n Number.isSafeInteger(value) &&\n value >= 0 &&\n value <= 65535;\n\nexport const isObject = (\n value: unknown,\n): value is Record<PropertyKey, unknown> =>\n typeof value === 'object' && value !== null;\n\nexport const hasProp = <P extends PropertyKey, V = unknown>(\n value: unknown,\n prop: P,\n): value is Record<P, V> => isObject(value) && value.hasOwnProperty(prop);\n\nexport const hasNumberProp = <P extends PropertyKey>(\n value: unknown,\n prop: P,\n): value is Record<P, number> =>\n isObject(value) && typeof value[prop] === 'number';\n\nexport const hasStringProp = <P extends PropertyKey>(\n value: unknown,\n prop: P,\n): value is Record<P, string> =>\n isObject(value) && typeof value[prop] === 'string';\n"],
5
- "mappings": "AAAO,MAAM,aAAa,CACxB,SAEA,OAAO,SAAS;AAEX,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YACjB,OAAO,cAAc,KAAK,KAC1B,SAAS,KACT,SAAS;AAEJ,MAAM,WAAW,CACtB,UAEA,OAAO,UAAU,YAAY,UAAU;AAElC,MAAM,UAAU,CACrB,OACA,SAC0B,SAAS,KAAK,KAAK,MAAM,eAAe,IAAI;AAEjE,MAAM,gBAAgB,CAC3B,OACA,SAEA,SAAS,KAAK,KAAK,OAAO,MAAM,IAAI,MAAM;AAErC,MAAM,gBAAgB,CAC3B,OACA,SAEA,SAAS,KAAK,KAAK,OAAO,MAAM,IAAI,MAAM;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,CACxB,SAEA,OAAO,SAAS;AAEX,MAAM,WAAW,CAAC,UACvB,OAAO,UAAU,YACjB,OAAO,cAAc,KAAK,KAC1B,SAAS,KACT,SAAS;AAEJ,MAAM,WAAW,CACtB,UAEA,OAAO,UAAU,YAAY,UAAU;AAElC,MAAM,UAAU,CACrB,OACA,SAC0B,SAAS,KAAK,KAAK,MAAM,eAAe,IAAI;AAEjE,MAAM,gBAAgB,CAC3B,OACA,SAEA,SAAS,KAAK,KAAK,OAAO,MAAM,IAAI,MAAM;AAErC,MAAM,gBAAgB,CAC3B,OACA,SAEA,SAAS,KAAK,KAAK,OAAO,MAAM,IAAI,MAAM;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,43 @@
1
- import npmFetch from "npm-registry-fetch";
2
- import * as z from "zod/v4";
3
- import { getSkubaManifest } from "./manifest.js";
4
- import { withTimeout } from "./wait.js";
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 version_exports = {};
30
+ __export(version_exports, {
31
+ getLatestNpmVersion: () => getLatestNpmVersion,
32
+ getNpmVersions: () => getNpmVersions,
33
+ getSkubaVersion: () => getSkubaVersion,
34
+ getSkubaVersionInfo: () => getSkubaVersionInfo
35
+ });
36
+ module.exports = __toCommonJS(version_exports);
37
+ var import_npm_registry_fetch = __toESM(require("npm-registry-fetch"));
38
+ var z = __toESM(require("zod/v4"));
39
+ var import_manifest = require("./manifest.js");
40
+ var import_wait = require("./wait.js");
5
41
  const NpmVersions = z.record(
6
42
  z.string(),
7
43
  z.object({
@@ -16,7 +52,7 @@ const PackageResponse = z.object({
16
52
  });
17
53
  const getNpmPackage = async (packageName) => {
18
54
  try {
19
- const response = await npmFetch.json(packageName, {
55
+ const response = await import_npm_registry_fetch.default.json(packageName, {
20
56
  headers: {
21
57
  Accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"
22
58
  }
@@ -45,14 +81,14 @@ const getLatestNpmVersion = async (packageName) => {
45
81
  };
46
82
  const latestSkubaVersion = async () => {
47
83
  try {
48
- const result = await withTimeout(getLatestNpmVersion("skuba"), { s: 2 });
84
+ const result = await (0, import_wait.withTimeout)(getLatestNpmVersion("skuba"), { s: 2 });
49
85
  return result.ok ? result.value : null;
50
86
  } catch {
51
87
  return null;
52
88
  }
53
89
  };
54
90
  const getSkubaVersion = async () => {
55
- const { version } = await getSkubaManifest();
91
+ const { version } = await (0, import_manifest.getSkubaManifest)();
56
92
  return version;
57
93
  };
58
94
  const getSkubaVersionInfo = async () => {
@@ -73,10 +109,11 @@ const getSkubaVersionInfo = async () => {
73
109
  latest
74
110
  };
75
111
  };
76
- export {
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
77
114
  getLatestNpmVersion,
78
115
  getNpmVersions,
79
116
  getSkubaVersion,
80
117
  getSkubaVersionInfo
81
- };
118
+ });
82
119
  //# sourceMappingURL=version.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/version.ts"],
4
4
  "sourcesContent": ["import npmFetch from 'npm-registry-fetch';\nimport * as z from 'zod/v4';\n\nimport { getSkubaManifest } from './manifest.js';\nimport { withTimeout } from './wait.js';\n\nconst NpmVersions = z.record(\n z.string(),\n z.object({\n name: z.string(),\n version: z.string(),\n deprecated: z.string().optional(),\n }),\n);\n\nexport type NpmVersions = z.infer<typeof NpmVersions>;\n\nconst PackageResponse = z.object({\n 'dist-tags': z.record(z.string(), z.string()).optional(),\n versions: NpmVersions,\n});\n\nconst getNpmPackage = async (packageName: string) => {\n try {\n const response = await npmFetch.json(packageName, {\n headers: {\n Accept:\n 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',\n },\n });\n\n const parsedResponse = PackageResponse.safeParse(response);\n if (!parsedResponse.success) {\n throw new Error(\n `Failed to parse package response from npm for package ${packageName}`,\n );\n }\n\n return parsedResponse.data;\n } catch (error) {\n if (\n error instanceof Error &&\n 'statusCode' in error &&\n error.statusCode === 404\n ) {\n return null;\n }\n throw error;\n }\n};\n\nexport const getNpmVersions = async (\n packageName: string,\n): Promise<NpmVersions | null> => {\n const response = await getNpmPackage(packageName);\n return response?.versions ?? null;\n};\n\nexport const getLatestNpmVersion = async (\n packageName: string,\n): Promise<string | null> => {\n const response = await getNpmPackage(packageName);\n return response?.['dist-tags']?.latest ?? null;\n};\n\nconst latestSkubaVersion = async (): Promise<string | null> => {\n try {\n const result = await withTimeout(getLatestNpmVersion('skuba'), { s: 2 });\n\n return result.ok ? result.value : null;\n } catch {\n return null;\n }\n};\n\nexport const getSkubaVersion = async (): Promise<string> => {\n const { version } = await getSkubaManifest();\n\n return version;\n};\n\ntype SkubaVersionInfo =\n | {\n isStale: true;\n\n local: string;\n latest: string;\n }\n | {\n isStale: false;\n\n local: string;\n latest: string | null;\n };\n\nexport const getSkubaVersionInfo = async (): Promise<SkubaVersionInfo> => {\n const [local, latest] = await Promise.all([\n getSkubaVersion(),\n latestSkubaVersion(),\n ]);\n\n if (latest === null) {\n // Assume we're up to date if we can't reach the npm registry\n return {\n isStale: false,\n local,\n latest,\n };\n }\n\n return {\n isStale: latest !== local,\n local,\n latest,\n };\n};\n"],
5
- "mappings": "AAAA,OAAO,cAAc;AACrB,YAAY,OAAO;AAEnB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAE5B,MAAM,cAAc,EAAE;AAAA,EACpB,EAAE,OAAO;AAAA,EACT,EAAE,OAAO;AAAA,IACP,MAAM,EAAE,OAAO;AAAA,IACf,SAAS,EAAE,OAAO;AAAA,IAClB,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,CAAC;AACH;AAIA,MAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACvD,UAAU;AACZ,CAAC;AAED,MAAM,gBAAgB,OAAO,gBAAwB;AACnD,MAAI;AACF,UAAM,WAAW,MAAM,SAAS,KAAK,aAAa;AAAA,MAChD,SAAS;AAAA,QACP,QACE;AAAA,MACJ;AAAA,IACF,CAAC;AAED,UAAM,iBAAiB,gBAAgB,UAAU,QAAQ;AACzD,QAAI,CAAC,eAAe,SAAS;AAC3B,YAAM,IAAI;AAAA,QACR,yDAAyD,WAAW;AAAA,MACtE;AAAA,IACF;AAEA,WAAO,eAAe;AAAA,EACxB,SAAS,OAAO;AACd,QACE,iBAAiB,SACjB,gBAAgB,SAChB,MAAM,eAAe,KACrB;AACA,aAAO;AAAA,IACT;AACA,UAAM;AAAA,EACR;AACF;AAEO,MAAM,iBAAiB,OAC5B,gBACgC;AAChC,QAAM,WAAW,MAAM,cAAc,WAAW;AAChD,SAAO,UAAU,Y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,IACpB;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": ["npmFetch"]
7
7
  }
package/lib/utils/wait.js CHANGED
@@ -1,15 +1,39 @@
1
- import { createTerseError } from "./error.js";
2
- import { pluralise } from "./logging.js";
3
- import { sleep } from "./sleep.js";
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 wait_exports = {};
20
+ __export(wait_exports, {
21
+ throwOnTimeout: () => throwOnTimeout,
22
+ withTimeout: () => withTimeout
23
+ });
24
+ module.exports = __toCommonJS(wait_exports);
25
+ var import_error = require("./error.js");
26
+ var import_logging = require("./logging.js");
27
+ var import_sleep = require("./sleep.js");
4
28
  const throwOnTimeout = async (promise, { s }) => {
5
29
  const result = await withTimeout(promise, { s });
6
30
  if (!result.ok) {
7
- throw createTerseError(`Timed out after ${pluralise(s, "second")}`);
31
+ throw (0, import_error.createTerseError)(`Timed out after ${(0, import_logging.pluralise)(s, "second")}`);
8
32
  }
9
33
  return result.value;
10
34
  };
11
35
  const withTimeout = async (promise, { s }) => {
12
- const timeout = sleep(s * 1e3);
36
+ const timeout = (0, import_sleep.sleep)(s * 1e3);
13
37
  try {
14
38
  return await Promise.race([
15
39
  Promise.resolve(promise).then((value) => ({ ok: true, value })),
@@ -19,8 +43,9 @@ const withTimeout = async (promise, { s }) => {
19
43
  timeout.clear?.();
20
44
  }
21
45
  };
22
- export {
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
23
48
  throwOnTimeout,
24
49
  withTimeout
25
- };
50
+ });
26
51
  //# sourceMappingURL=wait.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/wait.ts"],
4
4
  "sourcesContent": ["import { createTerseError } from './error.js';\nimport { pluralise } from './logging.js';\nimport { sleep } from './sleep.js';\n\nexport const throwOnTimeout = async <T>(\n promise: PromiseLike<T>,\n { s }: { s: number },\n): Promise<T> => {\n const result = await withTimeout(promise, { s });\n\n if (!result.ok) {\n throw createTerseError(`Timed out after ${pluralise(s, 'second')}`);\n }\n\n return result.value;\n};\n\ntype TimeoutResult<T> = { ok: true; value: T } | { ok: false };\n\nexport const withTimeout = async <T>(\n promise: T | PromiseLike<T>,\n { s }: { s: number },\n): Promise<TimeoutResult<T>> => {\n const timeout = sleep(s * 1_000);\n\n try {\n return await Promise.race<TimeoutResult<T>>([\n Promise.resolve(promise).then((value) => ({ ok: true, value })),\n timeout.then(() => ({ ok: false })),\n ]);\n } finally {\n timeout.clear?.();\n }\n};\n"],
5
- "mappings": "AAAA,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAEf,MAAM,iBAAiB,OAC5B,SACA,EAAE,EAAE,MACW;AACf,QAAM,SAAS,MAAM,YAAY,SAAS,EAAE,EAAE,CAAC;AAE/C,MAAI,CAAC,OAAO,IAAI;AACd,UAAM,iBAAiB,mBAAmB,UAAU,GAAG,QAAQ,CAAC,EAAE;AAAA,EACpE;AAEA,SAAO,OAAO;AAChB;AAIO,MAAM,cAAc,OACzB,SACA,EAAE,EAAE,MAC0B;AAC9B,QAAM,UAAU,MAAM,IAAI,GAAK;AAE/B,MAAI;AACF,WAAO,MAAM,QAAQ,KAAuB;AAAA,MAC1C,QAAQ,QAAQ,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,MAC9D,QAAQ,KAAK,OAAO,EAAE,IAAI,MAAM,EAAE;AAAA,IACpC,CAAC;AAAA,EACH,UAAE;AACA,YAAQ,QAAQ;AAAA,EAClB;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,qBAA0B;AAC1B,mBAAsB;AAEf,MAAM,iBAAiB,OAC5B,SACA,EAAE,EAAE,MACW;AACf,QAAM,SAAS,MAAM,YAAY,SAAS,EAAE,EAAE,CAAC;AAE/C,MAAI,CAAC,OAAO,IAAI;AACd,cAAM,+BAAiB,uBAAmB,0BAAU,GAAG,QAAQ,CAAC,EAAE;AAAA,EACpE;AAEA,SAAO,OAAO;AAChB;AAIO,MAAM,cAAc,OACzB,SACA,EAAE,EAAE,MAC0B;AAC9B,QAAM,cAAU,oBAAM,IAAI,GAAK;AAE/B,MAAI;AACF,WAAO,MAAM,QAAQ,KAAuB;AAAA,MAC1C,QAAQ,QAAQ,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,MAAM,MAAM,EAAE;AAAA,MAC9D,QAAQ,KAAK,OAAO,EAAE,IAAI,MAAM,EAAE;AAAA,IACpC,CAAC;AAAA,EACH,UAAE;AACA,YAAQ,QAAQ;AAAA,EAClB;AACF;",
6
6
  "names": []
7
7
  }
@@ -12,9 +12,9 @@ export declare const postWorkerOutput: <Input, Output>(fn: (input: Input) => Pro
12
12
  prefixes: unknown[];
13
13
  suffixes: unknown[];
14
14
  };
15
- bold: import("chalk/index.js").Chalk;
16
- dim: import("chalk/index.js").Chalk;
17
- formatSubtle: import("chalk/index.js").Chalk;
15
+ bold: (text: string) => string;
16
+ dim: (text: string) => string;
17
+ formatSubtle: (text: string) => string;
18
18
  timing: (start: bigint, end: bigint) => string;
19
19
  debug: (...message: unknown[]) => void;
20
20
  subtle: (...message: unknown[]) => void;
@@ -1,11 +1,35 @@
1
- import { inspect } from "util";
2
- import { Worker, parentPort, workerData } from "worker_threads";
3
- import { log } from "./logging.js";
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 worker_exports = {};
20
+ __export(worker_exports, {
21
+ execWorkerThread: () => execWorkerThread,
22
+ postWorkerOutput: () => postWorkerOutput
23
+ });
24
+ module.exports = __toCommonJS(worker_exports);
25
+ var import_util = require("util");
26
+ var import_worker_threads = require("worker_threads");
27
+ var import_logging = require("./logging.js");
4
28
  const execWorkerThread = async (filepath, input) => {
5
29
  let output;
6
30
  let messageReceived = false;
7
31
  return new Promise(
8
- (resolve, reject) => new Worker(filepath, {
32
+ (resolve, reject) => new import_worker_threads.Worker(filepath, {
9
33
  workerData: input
10
34
  }).on("error", reject).on(
11
35
  "exit",
@@ -20,19 +44,20 @@ const execWorkerThread = async (filepath, input) => {
20
44
  }).on("messageerror", (err) => reject(err))
21
45
  );
22
46
  };
23
- const postWorkerOutput = (fn, logger = log) => {
24
- const port = parentPort;
47
+ const postWorkerOutput = (fn, logger = import_logging.log) => {
48
+ const port = import_worker_threads.parentPort;
25
49
  if (!port) {
26
50
  logger.err("`postWorkerOutput` called outside of a worker thread context");
27
51
  process.exit(1);
28
52
  }
29
- fn(workerData).then((output) => port.postMessage(output)).catch((err) => {
30
- logger.err(inspect(err));
53
+ fn(import_worker_threads.workerData).then((output) => port.postMessage(output)).catch((err) => {
54
+ logger.err((0, import_util.inspect)(err));
31
55
  process.exit(1);
32
56
  });
33
57
  };
34
- export {
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
35
60
  execWorkerThread,
36
61
  postWorkerOutput
37
- };
62
+ });
38
63
  //# sourceMappingURL=worker.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/worker.ts"],
4
4
  "sourcesContent": ["import { inspect } from 'util';\nimport { Worker, parentPort, workerData } from 'worker_threads';\n\nimport { log } from './logging.js';\n\n/**\n * Executes a script at `filepath` in a Node.js worker thread.\n */\nexport const execWorkerThread = async <Input, Output>(\n filepath: string,\n input: Input,\n) => {\n let output: Output;\n let messageReceived = false;\n\n return new Promise<Output>((resolve, reject) =>\n new Worker(filepath, {\n workerData: input,\n })\n .on('error', reject)\n .on('exit', (code) =>\n messageReceived\n ? resolve(output)\n : reject(\n new Error(\n code\n ? `Worker thread failed with exit code ${code}`\n : 'Worker thread exited without posting a message',\n ),\n ),\n )\n .on('message', (message: Output) => {\n // Defer promise resolution to `exit` so stdio can settle.\n output = message;\n messageReceived = true;\n })\n .on('messageerror', (err) => reject(err)),\n );\n};\n\n/**\n * Runs a function in a Node.js worker thread context, forwarding the result\n * to the parent thread.\n */\nexport const postWorkerOutput = <Input, Output>(\n fn: (input: Input) => Promise<Output>,\n logger = log,\n) => {\n const port = parentPort;\n\n if (!port) {\n logger.err('`postWorkerOutput` called outside of a worker thread context');\n\n process.exit(1);\n }\n\n fn(workerData as Input)\n .then((output) => port.postMessage(output))\n .catch((err) => {\n logger.err(inspect(err));\n\n process.exit(1);\n });\n};\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AACxB,SAAS,QAAQ,YAAY,kBAAkB;AAE/C,SAAS,WA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