skuba 14.0.0-replace-global-vars-20251121010036 → 14.0.0-test-private-templates-20260103062459

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 (411) 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 +2 -2
  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.js +60 -28
  19. package/lib/cli/build/assets.js.map +2 -2
  20. package/lib/cli/build/esbuild.js +45 -21
  21. package/lib/cli/build/esbuild.js.map +2 -2
  22. package/lib/cli/build/index.js +45 -21
  23. package/lib/cli/build/index.js.map +1 -1
  24. package/lib/cli/build/tsc.js +59 -22
  25. package/lib/cli/build/tsc.js.map +2 -2
  26. package/lib/cli/buildPackage/index.js +32 -8
  27. package/lib/cli/buildPackage/index.js.map +1 -1
  28. package/lib/cli/configure/analyseConfiguration.js +50 -16
  29. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  30. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  31. package/lib/cli/configure/analyseDependencies.js +59 -25
  32. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  33. package/lib/cli/configure/analysis/diff.js +29 -5
  34. package/lib/cli/configure/analysis/diff.js.map +1 -1
  35. package/lib/cli/configure/analysis/files.js +42 -8
  36. package/lib/cli/configure/analysis/files.js.map +2 -2
  37. package/lib/cli/configure/analysis/git.js +46 -12
  38. package/lib/cli/configure/analysis/git.js.map +2 -2
  39. package/lib/cli/configure/analysis/package.d.ts +3 -2
  40. package/lib/cli/configure/analysis/package.js +45 -10
  41. package/lib/cli/configure/analysis/package.js.map +3 -3
  42. package/lib/cli/configure/analysis/project.js +50 -18
  43. package/lib/cli/configure/analysis/project.js.map +2 -2
  44. package/lib/cli/configure/dependencies/index.js +35 -7
  45. package/lib/cli/configure/dependencies/index.js.map +1 -1
  46. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
  47. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  48. package/lib/cli/configure/dependencies/seekKoala.js +28 -4
  49. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  50. package/lib/cli/configure/dependencies/skuba.js +28 -4
  51. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  52. package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
  53. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  54. package/lib/cli/configure/dependencies/skubaDive.js +29 -4
  55. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  56. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  57. package/lib/cli/configure/ensureTemplateCompletion.js +61 -33
  58. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  59. package/lib/cli/configure/getEntryPoint.d.ts +1 -1
  60. package/lib/cli/configure/getEntryPoint.js +48 -14
  61. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  62. package/lib/cli/configure/getProjectType.d.ts +1 -1
  63. package/lib/cli/configure/getProjectType.js +35 -14
  64. package/lib/cli/configure/getProjectType.js.map +2 -2
  65. package/lib/cli/configure/index.js +84 -50
  66. package/lib/cli/configure/index.js.map +2 -2
  67. package/lib/cli/configure/modules/eslint.js +34 -10
  68. package/lib/cli/configure/modules/eslint.js.map +1 -1
  69. package/lib/cli/configure/modules/ignore.js +32 -8
  70. package/lib/cli/configure/modules/ignore.js.map +1 -1
  71. package/lib/cli/configure/modules/index.js +44 -18
  72. package/lib/cli/configure/modules/index.js.map +2 -2
  73. package/lib/cli/configure/modules/jest.d.ts +2 -0
  74. package/lib/cli/configure/modules/jest.js +86 -0
  75. package/lib/cli/configure/modules/jest.js.map +7 -0
  76. package/lib/cli/configure/modules/nodemon.js +28 -4
  77. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  78. package/lib/cli/configure/modules/package.js +34 -10
  79. package/lib/cli/configure/modules/package.js.map +1 -1
  80. package/lib/cli/configure/modules/prettier.js +35 -11
  81. package/lib/cli/configure/modules/prettier.js.map +1 -1
  82. package/lib/cli/configure/modules/renovate.js +40 -17
  83. package/lib/cli/configure/modules/renovate.js.map +2 -2
  84. package/lib/cli/configure/modules/serverless.js +26 -2
  85. package/lib/cli/configure/modules/serverless.js.map +1 -1
  86. package/lib/cli/configure/modules/tslint.js +28 -4
  87. package/lib/cli/configure/modules/tslint.js.map +1 -1
  88. package/lib/cli/configure/processing/configFile.js +39 -3
  89. package/lib/cli/configure/processing/configFile.js.map +1 -1
  90. package/lib/cli/configure/processing/deleteFiles.js +26 -2
  91. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  92. package/lib/cli/configure/processing/javascript.js +27 -2
  93. package/lib/cli/configure/processing/javascript.js.map +1 -1
  94. package/lib/cli/configure/processing/json.js +31 -6
  95. package/lib/cli/configure/processing/json.js.map +1 -1
  96. package/lib/cli/configure/processing/loadFiles.js +26 -2
  97. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  98. package/lib/cli/configure/processing/module.js +28 -4
  99. package/lib/cli/configure/processing/module.js.map +1 -1
  100. package/lib/cli/configure/processing/package.d.ts +67 -1
  101. package/lib/cli/configure/processing/package.js +45 -8
  102. package/lib/cli/configure/processing/package.js.map +3 -3
  103. package/lib/cli/configure/processing/prettier.js +38 -4
  104. package/lib/cli/configure/processing/prettier.js.map +2 -2
  105. package/lib/cli/configure/processing/record.js +41 -5
  106. package/lib/cli/configure/processing/record.js.map +2 -2
  107. package/lib/cli/configure/processing/typescript.js +63 -26
  108. package/lib/cli/configure/processing/typescript.js.map +2 -2
  109. package/lib/cli/configure/types.d.ts +4 -15
  110. package/lib/cli/configure/types.js +16 -0
  111. package/lib/cli/configure/types.js.map +3 -3
  112. package/lib/cli/format/index.js +44 -20
  113. package/lib/cli/format/index.js.map +1 -1
  114. package/lib/cli/help/index.js +30 -6
  115. package/lib/cli/help/index.js.map +1 -1
  116. package/lib/cli/init/getConfig.d.ts +1 -1
  117. package/lib/cli/init/getConfig.js +111 -76
  118. package/lib/cli/init/getConfig.js.map +3 -3
  119. package/lib/cli/init/git.d.ts +1 -0
  120. package/lib/cli/init/git.js +88 -16
  121. package/lib/cli/init/git.js.map +3 -3
  122. package/lib/cli/init/index.js +98 -67
  123. package/lib/cli/init/index.js.map +2 -2
  124. package/lib/cli/init/prompts.d.ts +6 -5
  125. package/lib/cli/init/prompts.js +54 -27
  126. package/lib/cli/init/prompts.js.map +2 -2
  127. package/lib/cli/init/types.js +41 -7
  128. package/lib/cli/init/types.js.map +1 -1
  129. package/lib/cli/init/validation.js +30 -2
  130. package/lib/cli/init/validation.js.map +1 -1
  131. package/lib/cli/init/writePackageJson.js +42 -8
  132. package/lib/cli/init/writePackageJson.js.map +2 -2
  133. package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
  134. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  135. package/lib/cli/lint/annotate/buildkite/index.js +45 -11
  136. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  137. package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
  138. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  139. package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
  140. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  141. package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
  142. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  143. package/lib/cli/lint/annotate/github/eslint.js +26 -2
  144. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  145. package/lib/cli/lint/annotate/github/index.js +45 -11
  146. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  147. package/lib/cli/lint/annotate/github/internal.js +26 -2
  148. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  149. package/lib/cli/lint/annotate/github/prettier.js +26 -2
  150. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  151. package/lib/cli/lint/annotate/github/tsc.js +28 -4
  152. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  153. package/lib/cli/lint/annotate/index.js +30 -6
  154. package/lib/cli/lint/annotate/index.js.map +1 -1
  155. package/lib/cli/lint/autofix.js +73 -37
  156. package/lib/cli/lint/autofix.js.map +1 -1
  157. package/lib/cli/lint/eslint.js +51 -16
  158. package/lib/cli/lint/eslint.js.map +3 -3
  159. package/lib/cli/lint/external.js +51 -19
  160. package/lib/cli/lint/external.js.map +2 -2
  161. package/lib/cli/lint/index.js +49 -25
  162. package/lib/cli/lint/index.js.map +1 -1
  163. package/lib/cli/lint/internal.js +42 -18
  164. package/lib/cli/lint/internal.js.map +1 -1
  165. package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
  166. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  167. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +45 -11
  168. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +2 -2
  169. package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
  170. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  171. package/lib/cli/lint/internalLints/refreshConfigFiles.js +63 -32
  172. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
  173. package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
  174. package/lib/cli/lint/internalLints/upgrade/index.js +53 -22
  175. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  176. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
  177. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  178. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
  179. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  180. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
  181. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  182. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
  183. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  184. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
  185. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  186. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
  187. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  188. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
  209. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  210. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -4
  211. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -18
  212. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
  213. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
  214. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
  216. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  217. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  218. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
  219. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  220. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
  221. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  222. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
  223. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  224. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
  225. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  226. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
  227. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  228. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
  229. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  230. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
  231. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  232. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
  233. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  234. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
  235. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  236. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
  237. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
  239. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  240. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
  241. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  242. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
  243. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  244. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
  245. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  246. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
  247. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  248. package/lib/cli/lint/prettier.js +50 -15
  249. package/lib/cli/lint/prettier.js.map +3 -3
  250. package/lib/cli/lint/tsc.js +28 -4
  251. package/lib/cli/lint/tsc.js.map +1 -1
  252. package/lib/cli/lint/types.js +16 -0
  253. package/lib/cli/lint/types.js.map +3 -3
  254. package/lib/cli/migrate/index.d.ts +5 -0
  255. package/lib/cli/migrate/index.js +79 -15
  256. package/lib/cli/migrate/index.js.map +2 -2
  257. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  258. package/lib/cli/migrate/nodeVersion/checks.js +51 -120
  259. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  260. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  261. package/lib/cli/migrate/nodeVersion/index.js +239 -65
  262. package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
  263. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  264. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  265. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  266. package/lib/cli/node/index.js +57 -20
  267. package/lib/cli/node/index.js.map +3 -3
  268. package/lib/cli/release/index.js +28 -4
  269. package/lib/cli/release/index.js.map +1 -1
  270. package/lib/cli/start/index.js +50 -16
  271. package/lib/cli/start/index.js.map +3 -3
  272. package/lib/cli/test/index.js +44 -4
  273. package/lib/cli/test/index.js.map +2 -2
  274. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  275. package/lib/cli/test/reporters/github/annotations.js +102 -0
  276. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  277. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  278. package/lib/cli/test/reporters/github/index.js +74 -0
  279. package/lib/cli/test/reporters/github/index.js.map +7 -0
  280. package/lib/cli/version/index.js +30 -6
  281. package/lib/cli/version/index.js.map +1 -1
  282. package/lib/index.d.ts +1 -0
  283. package/lib/index.js +46 -6
  284. package/lib/index.js.map +2 -2
  285. package/lib/skuba.js +45 -26
  286. package/lib/skuba.js.map +3 -3
  287. package/lib/utils/args.js +43 -6
  288. package/lib/utils/args.js.map +2 -2
  289. package/lib/utils/command.js +42 -4
  290. package/lib/utils/command.js.map +3 -3
  291. package/lib/utils/copy.js +57 -20
  292. package/lib/utils/copy.js.map +2 -2
  293. package/lib/utils/dir.js +72 -32
  294. package/lib/utils/dir.js.map +2 -2
  295. package/lib/utils/env.js +26 -2
  296. package/lib/utils/env.js.map +1 -1
  297. package/lib/utils/error.js +47 -10
  298. package/lib/utils/error.js.map +1 -1
  299. package/lib/utils/exec.js +61 -23
  300. package/lib/utils/exec.js.map +3 -3
  301. package/lib/utils/fs.js +40 -6
  302. package/lib/utils/fs.js.map +2 -2
  303. package/lib/utils/help.js +30 -6
  304. package/lib/utils/help.js.map +1 -1
  305. package/lib/utils/logging.js +38 -11
  306. package/lib/utils/logging.js.map +1 -1
  307. package/lib/utils/logo.js +48 -24
  308. package/lib/utils/logo.js.map +1 -1
  309. package/lib/utils/manifest.d.ts +2 -3
  310. package/lib/utils/manifest.js +48 -8
  311. package/lib/utils/manifest.js.map +3 -3
  312. package/lib/utils/npmrc.js +26 -2
  313. package/lib/utils/npmrc.js.map +1 -1
  314. package/lib/utils/packageManager.js +49 -12
  315. package/lib/utils/packageManager.js.map +2 -2
  316. package/lib/utils/port.js +39 -4
  317. package/lib/utils/port.js.map +2 -2
  318. package/lib/utils/sleep.js +26 -2
  319. package/lib/utils/sleep.js.map +1 -1
  320. package/lib/utils/template.d.ts +1 -1
  321. package/lib/utils/template.js +60 -19
  322. package/lib/utils/template.js.map +3 -3
  323. package/lib/utils/validation.js +31 -2
  324. package/lib/utils/validation.js.map +1 -1
  325. package/lib/utils/version.js +46 -9
  326. package/lib/utils/version.js.map +2 -2
  327. package/lib/utils/wait.js +32 -7
  328. package/lib/utils/wait.js.map +1 -1
  329. package/lib/utils/worker.js +35 -10
  330. package/lib/utils/worker.js.map +1 -1
  331. package/lib/wrapper/function-arguments.d.js +1 -0
  332. package/lib/wrapper/functionHandler.js +49 -18
  333. package/lib/wrapper/functionHandler.js.map +2 -2
  334. package/lib/wrapper/http.js +43 -8
  335. package/lib/wrapper/http.js.map +2 -2
  336. package/lib/wrapper/index.js +7 -6
  337. package/lib/wrapper/index.js.map +1 -1
  338. package/lib/wrapper/main.js +42 -8
  339. package/lib/wrapper/main.js.map +3 -3
  340. package/lib/wrapper/requestListener.js +47 -13
  341. package/lib/wrapper/requestListener.js.map +2 -2
  342. package/lib/wrapper/server.js +28 -4
  343. package/lib/wrapper/server.js.map +1 -1
  344. package/package.json +42 -43
  345. package/template/base/_.prettierrc.js +1 -1
  346. package/template/base/_eslint.config.js +1 -1
  347. package/template/base/_pnpm-workspace.yaml +4 -3
  348. package/template/base/jest.config.ts +19 -0
  349. package/template/base/jest.setup.ts +3 -0
  350. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  351. package/template/express-rest-api/.nvmrc +1 -1
  352. package/template/express-rest-api/package.json +8 -9
  353. package/template/express-rest-api/skuba.template.js +1 -1
  354. package/template/express-rest-api/src/app.test.ts +0 -1
  355. package/template/greeter/.buildkite/pipeline.yml +1 -1
  356. package/template/greeter/.nvmrc +1 -1
  357. package/template/greeter/package.json +4 -5
  358. package/template/greeter/skuba.template.js +1 -1
  359. package/template/greeter/src/app.test.ts +1 -3
  360. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  361. package/template/koa-rest-api/.nvmrc +1 -1
  362. package/template/koa-rest-api/package.json +9 -11
  363. package/template/koa-rest-api/skuba.template.js +1 -1
  364. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
  365. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
  366. package/template/koa-rest-api/src/app.test.ts +0 -2
  367. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  368. package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
  369. package/template/koa-rest-api/src/testing/metrics.ts +0 -2
  370. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  371. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  372. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -19
  373. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
  374. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  375. package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
  376. package/template/lambda-sqs-worker-cdk/package.json +9 -9
  377. package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
  378. package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
  379. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
  380. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
  381. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
  382. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
  383. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
  384. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  385. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  386. package/template/oss-npm-package/.nvmrc +1 -1
  387. package/template/oss-npm-package/_package.json +0 -1
  388. package/template/oss-npm-package/skuba.template.js +1 -1
  389. package/template/oss-npm-package/src/index.test.ts +0 -2
  390. package/template/private-npm-package/.nvmrc +1 -1
  391. package/template/private-npm-package/_package.json +1 -2
  392. package/template/private-npm-package/skuba.template.js +2 -2
  393. package/template/private-npm-package/src/index.test.ts +0 -2
  394. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.d.ts +0 -6
  395. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +0 -86
  396. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +0 -7
  397. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -16
  398. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +0 -7
  399. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +0 -7
  400. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -76
  401. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +0 -7
  402. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -2
  403. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
  404. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  405. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
  406. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  407. package/lib/eslint.d.js +0 -1
  408. package/lib/eslint.d.js.map +0 -7
  409. package/template/base/vitest.config.ts +0 -25
  410. /package/lib/cli/lint/internalLints/upgrade/patches/{12.5.0 → 13.1.1}/index.d.ts +0 -0
  411. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
@@ -19,7 +19,7 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
19
19
  import { config } from './config.js';
20
20
 
21
21
  // Updated by https://github.com/seek-oss/rynovate
22
- const DATADOG_EXTENSION_LAYER_VERSION = 88;
22
+ const DATADOG_EXTENSION_LAYER_VERSION = 91;
23
23
 
24
24
  // Updated by https://github.com/seek-oss/rynovate
25
25
  const DATADOG_NODE_LAYER_VERSION = 126;
@@ -86,7 +86,7 @@ export class AppStack extends Stack {
86
86
 
87
87
  const worker = new aws_lambda_nodejs.NodejsFunction(this, 'worker', {
88
88
  architecture: aws_lambda.Architecture[architecture],
89
- runtime: aws_lambda.Runtime.NODEJS_22_X,
89
+ runtime: aws_lambda.Runtime.NODEJS_24_X,
90
90
  memorySize: 512,
91
91
  environmentEncryption: kmsKey,
92
92
  // aws-sdk-v3 sets this to true by default, so it is not necessary to set the environment variable
@@ -96,7 +96,7 @@ export class AppStack extends Stack {
96
96
  timeout: Duration.seconds(30),
97
97
  bundling: {
98
98
  sourceMap: true,
99
- target: 'node22',
99
+ target: 'node24',
100
100
  // aws-sdk-v3 is set as an external module by default, but we want it to be bundled with the function
101
101
  externalModules: [],
102
102
  esbuildArgs: {
@@ -40,8 +40,7 @@ const configs: Record<Deployment, Config> = {
40
40
  },
41
41
  },
42
42
 
43
- datadogApiKeySecretArn:
44
- 'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
43
+ datadogApiKeySecretArn: '<%- devDataDogApiKeySecretArn %>',
45
44
  sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
46
45
  },
47
46
  prod: {
@@ -57,8 +56,7 @@ const configs: Record<Deployment, Config> = {
57
56
  },
58
57
  },
59
58
 
60
- datadogApiKeySecretArn:
61
- 'arn:aws:secretsmanager:<Region>:<AccountId>:secret:TODO_SECRET_NAME',
59
+ datadogApiKeySecretArn: '<%- prodDataDogApiKeySecretArn %>',
62
60
  sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
63
61
  },
64
62
  };
@@ -2,7 +2,6 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
- "type": "module",
6
5
  "imports": {
7
6
  "#src/*": {
8
7
  "@seek/<%- serviceName %>/source": "./src/*",
@@ -21,10 +20,11 @@
21
20
  "dependencies": {
22
21
  "@aws-sdk/client-codedeploy": "^3.363.0",
23
22
  "@aws-sdk/client-lambda": "^3.363.0",
23
+ "@aws-sdk/client-secrets-manager": "^3.363.0",
24
24
  "@aws-sdk/client-sns": "^3.363.0",
25
25
  "@seek/aws-codedeploy-hooks": "^2.0.0",
26
26
  "@seek/logger": "^11.1.0",
27
- "skuba-dive": "3.0.0-replace-global-vars-20251121010036",
27
+ "skuba-dive": "4.0.0-test-private-templates-20260103062459",
28
28
  "zod": "^4.0.0"
29
29
  },
30
30
  "devDependencies": {
@@ -33,19 +33,19 @@
33
33
  "@types/chance": "^1.1.3",
34
34
  "@types/node": "^22.13.10",
35
35
  "aws-cdk": "^2.1010.0",
36
- "aws-cdk-lib": "^2.190.0",
37
- "aws-sdk-client-mock": "^4.1.0",
38
- "aws-sdk-client-mock-vitest": "^6.2.1",
36
+ "aws-cdk-lib": "^2.232.1",
37
+ "aws-sdk-client-mock": "^4.0.0",
38
+ "aws-sdk-client-mock-jest": "^4.0.0",
39
39
  "chance": "^1.1.8",
40
40
  "constructs": "^10.0.17",
41
- "datadog-cdk-constructs-v2": "^3.0.0",
41
+ "datadog-cdk-constructs-v2": "^3.4.0",
42
42
  "datadog-lambda-js": "^12.0.0",
43
43
  "dd-trace": "^5.0.0",
44
44
  "pino-pretty": "^13.0.0",
45
- "skuba": "14.0.0-replace-global-vars-20251121010036"
45
+ "skuba": "14.0.0-test-private-templates-20260103062459"
46
46
  },
47
- "packageManager": "pnpm@10.20.0",
47
+ "packageManager": "pnpm@10.26.2",
48
48
  "engines": {
49
- "node": ">=22"
49
+ "node": ">=24"
50
50
  }
51
51
  }
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- export default {
5
+ module.exports = {
6
6
  entryPoint: 'src/app.ts#handler',
7
7
  fields: [
8
8
  {
@@ -22,6 +22,18 @@ export default {
22
22
  initial: 'my-team-aws-account-prod:cicd',
23
23
  validate: (value) => /^.+:.+$/.test(value),
24
24
  },
25
+ {
26
+ name: 'devDataDogApiKeySecretArn',
27
+ message: 'Dev DataDog API Key Secret ARN',
28
+ initial:
29
+ 'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
30
+ },
31
+ {
32
+ name: 'prodDataDogApiKeySecretArn',
33
+ message: 'Prod DataDog API Key Secret ARN',
34
+ initial:
35
+ 'arn:aws:secretsmanager:<Region>:<AccountId>:secret:datadog-api-key',
36
+ },
25
37
  ],
26
38
  packageManager: 'pnpm',
27
39
  type: 'application',
@@ -1,14 +1,5 @@
1
1
  import { PublishCommand } from '@aws-sdk/client-sns';
2
2
  import type { SQSBatchResponse } from 'aws-lambda';
3
- import {
4
- afterEach,
5
- beforeAll,
6
- beforeEach,
7
- describe,
8
- expect,
9
- it,
10
- vi,
11
- } from 'vitest';
12
3
 
13
4
  import * as app from './app.js';
14
5
  import { stdoutMock } from './framework/logging.js';
@@ -29,7 +20,7 @@ describe('handler', () => {
29
20
 
30
21
  const score = chance.floating({ max: 1, min: 0 });
31
22
 
32
- const distribution = vi
23
+ const distribution = jest
33
24
  .spyOn(metricsClient, 'distribution')
34
25
  .mockReturnValue();
35
26
 
@@ -50,9 +41,9 @@ describe('handler', () => {
50
41
  it('handles one record', async () => {
51
42
  const event = createSqsEvent([JSON.stringify(jobPublished)]);
52
43
 
53
- await expect(app.handler(event, ctx)).resolves.toEqual({
44
+ await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
54
45
  batchItemFailures: [],
55
- } satisfies SQSBatchResponse);
46
+ });
56
47
 
57
48
  expect(scoringService.request).toHaveBeenCalledTimes(1);
58
49
 
@@ -81,9 +72,9 @@ describe('handler', () => {
81
72
  JSON.stringify(jobPublished),
82
73
  ]);
83
74
 
84
- await expect(app.handler(event, ctx)).resolves.toEqual({
75
+ await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
85
76
  batchItemFailures: [],
86
- } satisfies SQSBatchResponse);
77
+ });
87
78
 
88
79
  expect(stdoutMock.calls).toMatchObject([
89
80
  { count: 2, level: 20, msg: 'Received jobs' },
@@ -109,9 +100,9 @@ describe('handler', () => {
109
100
  JSON.stringify(jobPublished),
110
101
  ]);
111
102
 
112
- await expect(app.handler(event, ctx)).resolves.toEqual({
103
+ await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
113
104
  batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
114
- } satisfies SQSBatchResponse);
105
+ });
115
106
 
116
107
  expect(stdoutMock.calls).toMatchObject([
117
108
  { count: 2, level: 20, msg: 'Received jobs' },
@@ -137,13 +128,13 @@ describe('handler', () => {
137
128
  it('returns a batchItemFailure on invalid input', () => {
138
129
  const event = createSqsEvent(['}']);
139
130
 
140
- return expect(app.handler(event, ctx)).resolves.toEqual({
131
+ return expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
141
132
  batchItemFailures: [
142
133
  {
143
134
  itemIdentifier: event.Records[0]!.messageId,
144
135
  },
145
136
  ],
146
- } satisfies SQSBatchResponse);
137
+ });
147
138
  });
148
139
 
149
140
  it('bubbles up scoring service error', async () => {
@@ -153,9 +144,9 @@ describe('handler', () => {
153
144
 
154
145
  const event = createSqsEvent([JSON.stringify(jobPublished)]);
155
146
 
156
- await expect(app.handler(event, ctx)).resolves.toEqual({
147
+ await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
157
148
  batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
158
- } satisfies SQSBatchResponse);
149
+ });
159
150
 
160
151
  expect(stdoutMock.calls).toMatchObject([
161
152
  { count: 1, level: 20, msg: 'Received jobs' },
@@ -179,9 +170,9 @@ describe('handler', () => {
179
170
 
180
171
  const event = createSqsEvent([JSON.stringify(jobPublished)]);
181
172
 
182
- await expect(app.handler(event, ctx)).resolves.toEqual({
173
+ await expect(app.handler(event, ctx)).resolves.toEqual<SQSBatchResponse>({
183
174
  batchItemFailures: [{ itemIdentifier: event.Records[0]!.messageId }],
184
- } satisfies SQSBatchResponse);
175
+ });
185
176
 
186
177
  expect(stdoutMock.calls).toMatchObject([
187
178
  {
@@ -1,5 +1,4 @@
1
1
  import type { SQSEvent } from 'aws-lambda';
2
- import { afterEach, describe, expect, it } from 'vitest';
3
2
 
4
3
  import { createHandler } from './handler.js';
5
4
  import { logger, stdoutMock } from './logging.js';
@@ -1,5 +1,3 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
1
  import { validateJson } from './validation.js';
4
2
 
5
3
  import {
@@ -32,17 +30,17 @@ describe('validateJson', () => {
32
30
 
33
31
  expect(() => validateJson(input, IdDescriptionSchema))
34
32
  .toThrowErrorMatchingInlineSnapshot(`
35
- [ZodError: [
36
- {
37
- "expected": "string",
38
- "code": "invalid_type",
39
- "path": [
40
- "id"
41
- ],
42
- "message": "Invalid input: expected string, received null"
43
- }
44
- ]]
45
- `);
33
+ "[
34
+ {
35
+ "expected": "string",
36
+ "code": "invalid_type",
37
+ "path": [
38
+ "id"
39
+ ],
40
+ "message": "Invalid input: expected string, received null"
41
+ }
42
+ ]"
43
+ `);
46
44
  });
47
45
 
48
46
  it('blocks missing prop', () => {
@@ -50,25 +48,25 @@ describe('validateJson', () => {
50
48
 
51
49
  expect(() => validateJson(input, IdDescriptionSchema))
52
50
  .toThrowErrorMatchingInlineSnapshot(`
53
- [ZodError: [
54
- {
55
- "expected": "string",
56
- "code": "invalid_type",
57
- "path": [
58
- "id"
59
- ],
60
- "message": "Invalid input: expected string, received undefined"
61
- },
62
- {
63
- "expected": "string",
64
- "code": "invalid_type",
65
- "path": [
66
- "description"
67
- ],
68
- "message": "Invalid input: expected string, received undefined"
69
- }
70
- ]]
71
- `);
51
+ "[
52
+ {
53
+ "expected": "string",
54
+ "code": "invalid_type",
55
+ "path": [
56
+ "id"
57
+ ],
58
+ "message": "Invalid input: expected string, received undefined"
59
+ },
60
+ {
61
+ "expected": "string",
62
+ "code": "invalid_type",
63
+ "path": [
64
+ "description"
65
+ ],
66
+ "message": "Invalid input: expected string, received undefined"
67
+ }
68
+ ]"
69
+ `);
72
70
  });
73
71
 
74
72
  it('blocks invalid JSON', () => {
@@ -77,7 +75,7 @@ describe('validateJson', () => {
77
75
  expect(() =>
78
76
  validateJson(input, IdDescriptionSchema),
79
77
  ).toThrowErrorMatchingInlineSnapshot(
80
- `[SyntaxError: Unexpected token '}', "}" is not valid JSON]`,
78
+ `"Unexpected token '}', "}" is not valid JSON"`,
81
79
  );
82
80
  });
83
81
  });
@@ -1,18 +1,12 @@
1
- import { afterEach, beforeAll, describe, expect, it } from 'vitest';
2
-
3
1
  import * as jobScorer from './jobScorer.js';
4
2
 
5
3
  import { scoringService } from '#src/testing/services.js';
6
4
  import { chance, mockJobPublishedEvent } from '#src/testing/types.js';
7
5
 
8
6
  describe('scoreJobPublishedEvent', () => {
9
- beforeAll(() => {
10
- scoringService.spy();
11
- });
7
+ beforeAll(scoringService.spy);
12
8
 
13
- afterEach(() => {
14
- scoringService.clear();
15
- });
9
+ afterEach(scoringService.clear);
16
10
 
17
11
  it('scores an event', async () => {
18
12
  const score = chance.floating({ max: 1, min: 0 });
@@ -1,5 +1,4 @@
1
1
  import { PublishCommand } from '@aws-sdk/client-sns';
2
- import { afterEach, describe, expect, it, vi } from 'vitest';
3
2
 
4
3
  import { sendPipelineEvent } from './pipelineEventSender.js';
5
4
 
@@ -8,7 +7,7 @@ import { chance } from '#src/testing/types.js';
8
7
 
9
8
  describe('sendPipelineEvent', () => {
10
9
  afterEach(() => {
11
- vi.clearAllMocks();
10
+ jest.clearAllMocks();
12
11
  });
13
12
 
14
13
  it('handles happy path', async () => {
@@ -35,7 +34,7 @@ describe('sendPipelineEvent', () => {
35
34
  return expect(
36
35
  sendPipelineEvent({}),
37
36
  ).rejects.toThrowErrorMatchingInlineSnapshot(
38
- `[Error: SNS did not return a message ID]`,
37
+ `"SNS did not return a message ID"`,
39
38
  );
40
39
  });
41
40
  });
@@ -1,19 +1,18 @@
1
- import 'aws-sdk-client-mock-vitest/extend';
1
+ import 'aws-sdk-client-mock-jest';
2
2
 
3
3
  import { PublishCommand } from '@aws-sdk/client-sns';
4
4
  import { mockClient } from 'aws-sdk-client-mock';
5
- import { vi } from 'vitest';
6
5
 
7
6
  import { sns as snsClient } from '#src/services/aws.js';
8
7
  import * as jobScorer from '#src/services/jobScorer.js';
9
8
 
10
9
  export const scoringService = {
11
- request: vi.fn(),
10
+ request: jest.fn(),
12
11
 
13
12
  clear: () => scoringService.request.mockClear(),
14
13
 
15
14
  spy: () =>
16
- vi
15
+ jest
17
16
  .spyOn(jobScorer.scoringService, 'request')
18
17
  .mockImplementation(scoringService.request),
19
18
  };
@@ -18,7 +18,7 @@ jobs:
18
18
  timeout-minutes: 20
19
19
  steps:
20
20
  - name: Check out repo
21
- uses: actions/checkout@v5
21
+ uses: actions/checkout@v6
22
22
  with:
23
23
  fetch-depth: 0
24
24
 
@@ -16,7 +16,7 @@ jobs:
16
16
  timeout-minutes: 20
17
17
  steps:
18
18
  - name: Check out repo
19
- uses: actions/checkout@v5
19
+ uses: actions/checkout@v6
20
20
 
21
21
  - name: Set up pnpm
22
22
  uses: pnpm/action-setup@v4
@@ -1 +1 @@
1
- 22
1
+ 24
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "license": "MIT",
16
16
  "sideEffects": false,
17
- "type": "module",
18
17
  "main": "./lib-commonjs/index.js",
19
18
  "module": "./lib-es2015/index.js",
20
19
  "types": "./lib-types/index.d.ts",
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- export default {
5
+ module.exports = {
6
6
  entryPoint: 'src/index.ts',
7
7
  fields: [
8
8
  {
@@ -1,5 +1,3 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
1
  import { log } from './index.js';
4
2
 
5
3
  describe('app', () => {
@@ -1 +1 @@
1
- 22
1
+ 24
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "license": "UNLICENSED",
16
16
  "sideEffects": false,
17
- "type": "module",
18
17
  "main": "./lib-commonjs/index.js",
19
18
  "module": "./lib-es2015/index.js",
20
19
  "types": "./lib-types/index.d.ts",
@@ -47,6 +46,6 @@
47
46
  },
48
47
  "packageManager": "pnpm@10.7.0",
49
48
  "engines": {
50
- "node": ">=22"
49
+ "node": ">=20"
51
50
  }
52
51
  }
@@ -2,7 +2,7 @@
2
2
  * Run `skuba configure` to finish templating and remove this file.
3
3
  */
4
4
 
5
- export default {
5
+ module.exports = {
6
6
  entryPoint: 'src/index.ts',
7
7
  fields: [
8
8
  {
@@ -10,7 +10,7 @@ export default {
10
10
  message: 'Module name',
11
11
  initial: '@seek/my-first-module',
12
12
  validate: (value) =>
13
- /^@seek\/.+$/.test(value) || 'must start with an @seek/ scope',
13
+ /^@seek\/.+$/.test(value) || 'Must start with @seek/ scope',
14
14
  },
15
15
  {
16
16
  name: 'description',
@@ -1,5 +1,3 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
1
  import { log } from './index.js';
4
2
 
5
3
  describe('app', () => {
@@ -1,6 +0,0 @@
1
- import type { PatchFunction } from '../../index.js';
2
- export declare const hasDirNameRegex: RegExp;
3
- export declare const hasFileNameRegex: RegExp;
4
- export declare const addTypeModule: (cwd: string, originalContent: string) => Promise<string>;
5
- export declare const tryAddTypeModuleToPackageJson: PatchFunction;
6
- export declare const addTypeModuleToPackageJson: PatchFunction;
@@ -1,86 +0,0 @@
1
- import { inspect } from "util";
2
- import { glob } from "fast-glob";
3
- import fs from "fs-extra";
4
- import { readPackageUp } from "read-package-up";
5
- import { log } from "../../../../../../utils/logging.js";
6
- import { formatPackage } from "../../../../../configure/processing/package.js";
7
- const hasDirNameRegex = /__dirname\b/;
8
- const hasFileNameRegex = /__filename\b/;
9
- const addTypeModule = async (cwd, originalContent) => {
10
- const manifest = await readPackageUp({ cwd, normalize: false });
11
- if (manifest === void 0) {
12
- return originalContent;
13
- }
14
- if (manifest.packageJson.type !== "module") {
15
- manifest.packageJson.type = "module";
16
- return await formatPackage(manifest.packageJson);
17
- }
18
- return originalContent;
19
- };
20
- const fetchFiles = async (files) => Promise.all(
21
- files.map(async (file) => {
22
- const contents = await fs.promises.readFile(file, "utf8");
23
- return {
24
- file,
25
- contents
26
- };
27
- })
28
- );
29
- const tryAddTypeModuleToPackageJson = async ({
30
- mode
31
- }) => {
32
- const fileNames = await glob(["**/*package.json"]);
33
- if (!fileNames.length) {
34
- return {
35
- result: "skip",
36
- reason: "no package.json file found"
37
- };
38
- }
39
- const packageJsonFiles = await fetchFiles(fileNames);
40
- const filesWithTypeModuleAdded = await Promise.all(
41
- packageJsonFiles.map(async ({ file, contents }) => ({
42
- file,
43
- before: contents,
44
- after: await addTypeModule(file, contents)
45
- }))
46
- );
47
- const hasChanges = filesWithTypeModuleAdded.some(
48
- ({ before, after }) => before !== after
49
- );
50
- if (!hasChanges) {
51
- return {
52
- result: "skip",
53
- reason: "type module already present in package.json"
54
- };
55
- }
56
- if (mode === "lint") {
57
- return {
58
- result: "apply"
59
- };
60
- }
61
- await Promise.all(
62
- filesWithTypeModuleAdded.map(async ({ file, before, after }) => {
63
- if (before !== after) {
64
- await fs.promises.writeFile(file, after);
65
- }
66
- })
67
- );
68
- return { result: "apply" };
69
- };
70
- const addTypeModuleToPackageJson = async (config) => {
71
- try {
72
- return await tryAddTypeModuleToPackageJson(config);
73
- } catch (err) {
74
- log.warn("Failed to add module type to package.json");
75
- log.subtle(inspect(err));
76
- return { result: "skip", reason: "due to an error" };
77
- }
78
- };
79
- export {
80
- addTypeModule,
81
- addTypeModuleToPackageJson,
82
- hasDirNameRegex,
83
- hasFileNameRegex,
84
- tryAddTypeModuleToPackageJson
85
- };
86
- //# sourceMappingURL=addTypeModuleToPackageJson.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.ts"],
4
- "sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\nimport { readPackageUp } from 'read-package-up';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { formatPackage } from '../../../../../configure/processing/package.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nexport const hasDirNameRegex = /__dirname\\b/;\nexport const hasFileNameRegex = /__filename\\b/;\n\nexport const addTypeModule = async (cwd: string, originalContent: string) => {\n const manifest = await readPackageUp({ cwd, normalize: false });\n\n if (manifest === undefined) {\n return originalContent;\n }\n\n if (manifest.packageJson.type !== 'module') {\n manifest.packageJson.type = 'module';\n return await formatPackage(manifest.packageJson);\n }\n\n return originalContent;\n};\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const tryAddTypeModuleToPackageJson: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const fileNames = await glob(['**/*package.json']);\n\n if (!fileNames.length) {\n return {\n result: 'skip',\n reason: 'no package.json file found',\n };\n }\n\n const packageJsonFiles = await fetchFiles(fileNames);\n\n const filesWithTypeModuleAdded = await Promise.all(\n packageJsonFiles.map(async ({ file, contents }) => ({\n file,\n before: contents,\n after: await addTypeModule(file, contents),\n })),\n );\n\n const hasChanges = filesWithTypeModuleAdded.some(\n ({ before, after }) => before !== after,\n );\n\n if (!hasChanges) {\n return {\n result: 'skip',\n reason: 'type module already present in package.json',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n filesWithTypeModuleAdded.map(async ({ file, before, after }) => {\n if (before !== after) {\n await fs.promises.writeFile(file, after);\n }\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const addTypeModuleToPackageJson: PatchFunction = async (config) => {\n try {\n return await tryAddTypeModuleToPackageJson(config);\n } catch (err) {\n log.warn('Failed to add module type to package.json');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AAExB,SAAS,YAAY;AACrB,OAAO,QAAQ;AACf,SAAS,qBAAqB;AAE9B,SAAS,WAAW;AACpB,SAAS,qBAAqB;AAGvB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAEzB,MAAM,gBAAgB,OAAO,KAAa,oBAA4B;AAC3E,QAAM,WAAW,MAAM,cAAc,EAAE,KAAK,WAAW,MAAM,CAAC;AAE9D,MAAI,aAAa,QAAW;AAC1B,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,YAAY,SAAS,UAAU;AAC1C,aAAS,YAAY,OAAO;AAC5B,WAAO,MAAM,cAAc,SAAS,WAAW;AAAA,EACjD;AAEA,SAAO;AACT;AAEA,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,GAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEK,MAAM,gCAA+C,OAAO;AAAA,EACjE;AACF,MAAgC;AAC9B,QAAM,YAAY,MAAM,KAAK,CAAC,kBAAkB,CAAC;AAEjD,MAAI,CAAC,UAAU,QAAQ;AACrB,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,mBAAmB,MAAM,WAAW,SAAS;AAEnD,QAAM,2BAA2B,MAAM,QAAQ;AAAA,IAC7C,iBAAiB,IAAI,OAAO,EAAE,MAAM,SAAS,OAAO;AAAA,MAClD;AAAA,MACA,QAAQ;AAAA,MACR,OAAO,MAAM,cAAc,MAAM,QAAQ;AAAA,IAC3C,EAAE;AAAA,EACJ;AAEA,QAAM,aAAa,yBAAyB;AAAA,IAC1C,CAAC,EAAE,QAAQ,MAAM,MAAM,WAAW;AAAA,EACpC;AAEA,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,yBAAyB,IAAI,OAAO,EAAE,MAAM,QAAQ,MAAM,MAAM;AAC9D,UAAI,WAAW,OAAO;AACpB,cAAM,GAAG,SAAS,UAAU,MAAM,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,6BAA4C,OAAO,WAAW;AACzE,MAAI;AACF,WAAO,MAAM,8BAA8B,MAAM;AAAA,EACnD,SAAS,KAAK;AACZ,QAAI,KAAK,2CAA2C;AACpD,QAAI,OAAO,QAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- import { addTypeModuleToPackageJson } from "./addTypeModuleToPackageJson.js";
2
- import { rewriteGlobalVars } from "./rewriteGlobalVars.js";
3
- const patches = [
4
- {
5
- apply: addTypeModuleToPackageJson,
6
- description: "Add module type to package.json to support ESM"
7
- },
8
- {
9
- apply: rewriteGlobalVars,
10
- description: "Replace __dirname and __filename with import.meta equivalents"
11
- }
12
- ];
13
- export {
14
- patches
15
- };
16
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.5.0/index.ts"],
4
- "sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { addTypeModuleToPackageJson } from './addTypeModuleToPackageJson.js';\nimport { rewriteGlobalVars } from './rewriteGlobalVars.js';\n\nexport const patches: Patches = [\n {\n apply: addTypeModuleToPackageJson,\n description: 'Add module type to package.json to support ESM',\n },\n {\n apply: rewriteGlobalVars,\n description:\n 'Replace __dirname and __filename with import.meta equivalents',\n },\n];\n"],
5
- "mappings": "AAEA,SAAS,kCAAkC;AAC3C,SAAS,yBAAyB;AAE3B,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- import type { PatchFunction } from '../../index.js';
2
- export declare const hasDirNameRegex: RegExp;
3
- export declare const hasDirNameVariableRegex: RegExp;
4
- export declare const hasFileNameRegex: RegExp;
5
- export declare const hasFileNameVariableRegex: RegExp;
6
- export declare const tryRewriteGlobalVars: PatchFunction;
7
- export declare const rewriteGlobalVars: PatchFunction;