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
@@ -1,24 +1,57 @@
1
- import path from "path";
2
- import { select } from "@inquirer/prompts";
3
- import { createInclusionFilter } from "../../utils/dir.js";
4
- import { createExec, ensureCommands } from "../../utils/exec.js";
5
- import { log } from "../../utils/logging.js";
6
- import { showLogoAndVersionInfo } from "../../utils/logo.js";
7
- import { detectPackageManager } from "../../utils/packageManager.js";
8
- import { BASE_TEMPLATE_DIR } from "../../utils/template.js";
9
- import { hasProp } from "../../utils/validation.js";
10
- import { analyseConfiguration } from "./analyseConfiguration.js";
11
- import { analyseDependencies } from "./analyseDependencies.js";
12
- import { auditWorkingTree } from "./analysis/git.js";
13
- import { getDestinationManifest } from "./analysis/package.js";
14
- import { ensureTemplateCompletion } from "./ensureTemplateCompletion.js";
15
- import { getEntryPoint } from "./getEntryPoint.js";
16
- import { getProjectType } from "./getProjectType.js";
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var configure_exports = {};
30
+ __export(configure_exports, {
31
+ configure: () => configure
32
+ });
33
+ module.exports = __toCommonJS(configure_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_prompts = require("@inquirer/prompts");
36
+ var import_dir = require("../../utils/dir.js");
37
+ var import_exec = require("../../utils/exec.js");
38
+ var import_logging = require("../../utils/logging.js");
39
+ var import_logo = require("../../utils/logo.js");
40
+ var import_packageManager = require("../../utils/packageManager.js");
41
+ var import_template = require("../../utils/template.js");
42
+ var import_validation = require("../../utils/validation.js");
43
+ var import_analyseConfiguration = require("./analyseConfiguration.js");
44
+ var import_analyseDependencies = require("./analyseDependencies.js");
45
+ var import_git = require("./analysis/git.js");
46
+ var import_package = require("./analysis/package.js");
47
+ var import_ensureTemplateCompletion = require("./ensureTemplateCompletion.js");
48
+ var import_getEntryPoint = require("./getEntryPoint.js");
49
+ var import_getProjectType = require("./getProjectType.js");
17
50
  const shouldApply = async () => {
18
51
  if (!process.stdin.isTTY) {
19
52
  return "yes";
20
53
  }
21
- const result = await select({
54
+ const result = await (0, import_prompts.select)({
22
55
  message: "Apply changes?",
23
56
  choices: [
24
57
  { name: "Yes", value: "yes" },
@@ -28,50 +61,50 @@ const shouldApply = async () => {
28
61
  return result === "yes";
29
62
  };
30
63
  const configure = async () => {
31
- await showLogoAndVersionInfo();
64
+ await (0, import_logo.showLogoAndVersionInfo)();
32
65
  const [manifest, packageManager] = await Promise.all([
33
- getDestinationManifest(),
34
- detectPackageManager()
66
+ (0, import_package.getDestinationManifest)(),
67
+ (0, import_packageManager.detectPackageManager)()
35
68
  ]);
36
- await ensureCommands(packageManager.command);
37
- const destinationRoot = path.dirname(manifest.path);
38
- log.plain("Detected project root:", log.bold(destinationRoot));
69
+ await (0, import_exec.ensureCommands)(packageManager.command);
70
+ const destinationRoot = import_path.default.dirname(manifest.path);
71
+ import_logging.log.plain("Detected project root:", import_logging.log.bold(destinationRoot));
39
72
  const [include] = await Promise.all([
40
- createInclusionFilter([
41
- path.join(destinationRoot, ".gitignore"),
42
- path.join(BASE_TEMPLATE_DIR, "_.gitignore")
73
+ (0, import_dir.createInclusionFilter)([
74
+ import_path.default.join(destinationRoot, ".gitignore"),
75
+ import_path.default.join(import_template.BASE_TEMPLATE_DIR, "_.gitignore")
43
76
  ]),
44
- auditWorkingTree(destinationRoot)
77
+ (0, import_git.auditWorkingTree)(destinationRoot)
45
78
  ]);
46
- const templateConfig = await ensureTemplateCompletion({
79
+ const templateConfig = await (0, import_ensureTemplateCompletion.ensureTemplateCompletion)({
47
80
  destinationRoot,
48
81
  include,
49
82
  manifest
50
83
  });
51
- const type = await getProjectType({
84
+ const type = await (0, import_getProjectType.getProjectType)({
52
85
  manifest,
53
86
  templateConfig
54
87
  });
55
- const entryPoint = await getEntryPoint({
88
+ const entryPoint = await (0, import_getEntryPoint.getEntryPoint)({
56
89
  destinationRoot,
57
90
  manifest,
58
91
  templateConfig,
59
92
  type
60
93
  });
61
- const fixDependencies = await analyseDependencies({
94
+ const fixDependencies = await (0, import_analyseDependencies.analyseDependencies)({
62
95
  destinationRoot,
63
96
  include,
64
97
  manifest,
65
98
  type
66
99
  });
67
100
  if (fixDependencies) {
68
- log.newline();
101
+ import_logging.log.newline();
69
102
  if (await shouldApply()) {
70
103
  await fixDependencies();
71
104
  }
72
105
  }
73
- const firstRun = hasProp(manifest.packageJson, "skuba");
74
- const fixConfiguration = await analyseConfiguration({
106
+ const firstRun = (0, import_validation.hasProp)(manifest.packageJson, "skuba");
107
+ const fixConfiguration = await (0, import_analyseConfiguration.analyseConfiguration)({
75
108
  destinationRoot,
76
109
  entryPoint,
77
110
  firstRun,
@@ -79,39 +112,40 @@ const configure = async () => {
79
112
  type
80
113
  });
81
114
  if (fixConfiguration) {
82
- log.newline();
115
+ import_logging.log.newline();
83
116
  if (await shouldApply()) {
84
117
  await fixConfiguration();
85
118
  }
86
119
  }
87
120
  if (fixDependencies) {
88
- const exec = createExec({
121
+ const exec = (0, import_exec.createExec)({
89
122
  stdio: "pipe",
90
123
  streamStdio: packageManager.command
91
124
  });
92
- log.newline();
125
+ import_logging.log.newline();
93
126
  try {
94
127
  await exec(packageManager.command, "install");
95
128
  } catch {
96
- log.newline();
97
- log.warn(log.bold("\u2717 Failed to install dependencies. Resume with:"));
98
- log.newline();
99
- log.plain(log.bold(`${packageManager.command} install`));
100
- log.plain(log.bold(`${packageManager.command} format`));
101
- log.newline();
129
+ import_logging.log.newline();
130
+ import_logging.log.warn(import_logging.log.bold("\u2717 Failed to install dependencies. Resume with:"));
131
+ import_logging.log.newline();
132
+ import_logging.log.plain(import_logging.log.bold(`${packageManager.command} install`));
133
+ import_logging.log.plain(import_logging.log.bold(`${packageManager.command} format`));
134
+ import_logging.log.newline();
102
135
  process.exitCode = 1;
103
136
  return;
104
137
  }
105
138
  }
106
139
  if (fixConfiguration ?? fixDependencies) {
107
- log.newline();
108
- log.ok(log.bold("\u2714 All done! Try running:"));
109
- log.newline();
110
- log.plain(log.bold(`${packageManager.command} format`));
140
+ import_logging.log.newline();
141
+ import_logging.log.ok(import_logging.log.bold("\u2714 All done! Try running:"));
142
+ import_logging.log.newline();
143
+ import_logging.log.plain(import_logging.log.bold(`${packageManager.command} format`));
111
144
  }
112
- log.newline();
145
+ import_logging.log.newline();
113
146
  };
114
- export {
147
+ // Annotate the CommonJS export names for ESM import in node:
148
+ 0 && (module.exports = {
115
149
  configure
116
- };
150
+ });
117
151
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/index.ts"],
4
4
  "sourcesContent": ["import path from 'path';\n\nimport { select } from '@inquirer/prompts';\n\nimport { createInclusionFilter } from '../../utils/dir.js';\nimport { createExec, ensureCommands } from '../../utils/exec.js';\nimport { log } from '../../utils/logging.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\nimport { detectPackageManager } from '../../utils/packageManager.js';\nimport { BASE_TEMPLATE_DIR } from '../../utils/template.js';\nimport { hasProp } from '../../utils/validation.js';\n\nimport { analyseConfiguration } from './analyseConfiguration.js';\nimport { analyseDependencies } from './analyseDependencies.js';\nimport { auditWorkingTree } from './analysis/git.js';\nimport { getDestinationManifest } from './analysis/package.js';\nimport { ensureTemplateCompletion } from './ensureTemplateCompletion.js';\nimport { getEntryPoint } from './getEntryPoint.js';\nimport { getProjectType } from './getProjectType.js';\n\nconst shouldApply = async () => {\n if (!process.stdin.isTTY) {\n return 'yes';\n }\n\n const result = await select({\n message: 'Apply changes?',\n choices: [\n { name: 'Yes', value: 'yes' },\n { name: 'No', value: 'no' },\n ],\n });\n\n return result === 'yes';\n};\n\nexport const configure = async () => {\n await showLogoAndVersionInfo();\n\n const [manifest, packageManager] = await Promise.all([\n getDestinationManifest(),\n detectPackageManager(),\n ]);\n\n await ensureCommands(packageManager.command);\n\n const destinationRoot = path.dirname(manifest.path);\n\n log.plain('Detected project root:', log.bold(destinationRoot));\n\n const [include] = await Promise.all([\n createInclusionFilter([\n path.join(destinationRoot, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]),\n\n auditWorkingTree(destinationRoot),\n ]);\n\n const templateConfig = await ensureTemplateCompletion({\n destinationRoot,\n include,\n manifest,\n });\n\n const type = await getProjectType({\n manifest,\n templateConfig,\n });\n\n const entryPoint = await getEntryPoint({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n });\n\n const fixDependencies = await analyseDependencies({\n destinationRoot,\n include,\n manifest,\n type,\n });\n\n if (fixDependencies) {\n log.newline();\n\n if (await shouldApply()) {\n await fixDependencies();\n }\n }\n\n const firstRun = hasProp(manifest.packageJson, 'skuba');\n\n const fixConfiguration = await analyseConfiguration({\n destinationRoot,\n entryPoint,\n firstRun,\n packageManager,\n type,\n });\n\n if (fixConfiguration) {\n log.newline();\n\n if (await shouldApply()) {\n await fixConfiguration();\n }\n }\n\n if (fixDependencies) {\n const exec = createExec({\n stdio: 'pipe',\n streamStdio: packageManager.command,\n });\n\n log.newline();\n try {\n await exec(packageManager.command, 'install');\n } catch {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies. Resume with:'));\n\n log.newline();\n log.plain(log.bold(`${packageManager.command} install`));\n log.plain(log.bold(`${packageManager.command} format`));\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n }\n\n if (fixConfiguration ?? fixDependencies) {\n log.newline();\n log.ok(log.bold('\u2714 All done! Try running:'));\n\n log.newline();\n log.plain(log.bold(`${packageManager.command} format`));\n }\n\n log.newline();\n};\n"],
5
- "mappings": "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",
6
- "names": []
5
+ "mappings": "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",
6
+ "names": ["path"]
7
7
  }
@@ -1,11 +1,34 @@
1
- import { readBaseTemplateFile } from "../../../utils/template.js";
2
- import { deleteFiles } from "../processing/deleteFiles.js";
3
- import { withPackage } from "../processing/package.js";
4
- import { formatPrettier } from "../processing/prettier.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 eslint_exports = {};
20
+ __export(eslint_exports, {
21
+ eslintModule: () => eslintModule
22
+ });
23
+ module.exports = __toCommonJS(eslint_exports);
24
+ var import_template = require("../../../utils/template.js");
25
+ var import_deleteFiles = require("../processing/deleteFiles.js");
26
+ var import_package = require("../processing/package.js");
27
+ var import_prettier = require("../processing/prettier.js");
5
28
  const eslintModule = async () => {
6
- const configFile = await readBaseTemplateFile("_eslint.config.js");
29
+ const configFile = await (0, import_template.readBaseTemplateFile)("_eslint.config.js");
7
30
  return {
8
- ...deleteFiles(
31
+ ...(0, import_deleteFiles.deleteFiles)(
9
32
  ".eslintrc.cjs",
10
33
  ".eslintrc.yaml",
11
34
  ".eslintrc.yml",
@@ -20,14 +43,15 @@ const eslintModule = async () => {
20
43
  /require.resolve\(['"](@seek\/)?skuba\/config\/eslint['"]\)/,
21
44
  "'skuba'"
22
45
  );
23
- return formatPrettier(processedFile, { parser: "typescript" });
46
+ return (0, import_prettier.formatPrettier)(processedFile, { parser: "typescript" });
24
47
  }
25
48
  return configFile;
26
49
  },
27
- "package.json": withPackage(({ eslintConfig, ...data }) => data)
50
+ "package.json": (0, import_package.withPackage)(({ eslintConfig, ...data }) => data)
28
51
  };
29
52
  };
30
- export {
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
31
55
  eslintModule
32
- };
56
+ });
33
57
  //# sourceMappingURL=eslint.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/modules/eslint.ts"],
4
4
  "sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template.js';\nimport { deleteFiles } from '../processing/deleteFiles.js';\nimport { withPackage } from '../processing/package.js';\nimport { formatPrettier } from '../processing/prettier.js';\nimport type { Module } from '../types.js';\n\nexport const eslintModule = async (): Promise<Module> => {\n const configFile = await readBaseTemplateFile('_eslint.config.js');\n\n return {\n ...deleteFiles(\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n '.eslintrc',\n '.eslintignore',\n ),\n\n // allow customised ESLint configs that extend skuba\n 'eslint.config.js': (inputFile) => {\n if (inputFile?.includes('skuba')) {\n const processedFile = inputFile.replace(\n /require.resolve\\(['\"](@seek\\/)?skuba\\/config\\/eslint['\"]\\)/,\n \"'skuba'\",\n );\n\n return formatPrettier(processedFile, { parser: 'typescript' });\n }\n\n return configFile;\n },\n\n 'package.json': withPackage(({ eslintConfig, ...data }) => data),\n };\n};\n"],
5
- "mappings": "AAAA,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAGxB,MAAM,eAAe,YAA6B;AACvD,QAAM,aAAa,MAAM,qBAAqB,mBAAmB;AAEjE,SAAO;AAAA,IACL,GAAG;AAAA,MACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA;AAAA,IAGA,oBAAoB,CAAC,cAAc;AACjC,UAAI,WAAW,SAAS,OAAO,GAAG;AAChC,cAAM,gBAAgB,UAAU;AAAA,UAC9B;AAAA,UACA;AAAA,QACF;AAEA,eAAO,eAAe,eAAe,EAAE,QAAQ,aAAa,CAAC;AAAA,MAC/D;AAEA,aAAO;AAAA,IACT;AAAA,IAEA,gBAAgB,YAAY,CAAC,EAAE,cAAc,GAAG,KAAK,MAAM,IAAI;AAAA,EACjE;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,yBAA4B;AAC5B,qBAA4B;AAC5B,sBAA+B;AAGxB,MAAM,eAAe,YAA6B;AACvD,QAAM,aAAa,UAAM,sCAAqB,mBAAmB;AAEjE,SAAO;AAAA,IACL,OAAG;AAAA,MACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA;AAAA,IAGA,oBAAoB,CAAC,cAAc;AACjC,UAAI,WAAW,SAAS,OAAO,GAAG;AAChC,cAAM,gBAAgB,UAAU;AAAA,UAC9B;AAAA,UACA;AAAA,QACF;AAEA,mBAAO,gCAAe,eAAe,EAAE,QAAQ,aAAa,CAAC;AAAA,MAC/D;AAEA,aAAO;AAAA,IACT;AAAA,IAEA,oBAAgB,4BAAY,CAAC,EAAE,cAAc,GAAG,KAAK,MAAM,IAAI;AAAA,EACjE;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,40 @@
1
- import { readBaseTemplateFile } from "../../../utils/template.js";
2
- import { mergeWithConfigFile } from "../processing/configFile.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 ignore_exports = {};
20
+ __export(ignore_exports, {
21
+ ignoreModule: () => ignoreModule
22
+ });
23
+ module.exports = __toCommonJS(ignore_exports);
24
+ var import_template = require("../../../utils/template.js");
25
+ var import_configFile = require("../processing/configFile.js");
3
26
  const ignoreModule = async () => {
4
27
  const [dockerFile, gitFile] = await Promise.all([
5
- readBaseTemplateFile("_.dockerignore"),
6
- readBaseTemplateFile("_.gitignore")
28
+ (0, import_template.readBaseTemplateFile)("_.dockerignore"),
29
+ (0, import_template.readBaseTemplateFile)("_.gitignore")
7
30
  ]);
8
31
  return {
9
- ".dockerignore": mergeWithConfigFile(dockerFile),
10
- ".gitignore": mergeWithConfigFile(gitFile)
32
+ ".dockerignore": (0, import_configFile.mergeWithConfigFile)(dockerFile),
33
+ ".gitignore": (0, import_configFile.mergeWithConfigFile)(gitFile)
11
34
  };
12
35
  };
13
- export {
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
14
38
  ignoreModule
15
- };
39
+ });
16
40
  //# sourceMappingURL=ignore.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/modules/ignore.ts"],
4
4
  "sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template.js';\nimport { mergeWithConfigFile } from '../processing/configFile.js';\nimport type { Module } from '../types.js';\n\nexport const ignoreModule = async (): Promise<Module> => {\n const [dockerFile, gitFile] = await Promise.all([\n readBaseTemplateFile('_.dockerignore'),\n readBaseTemplateFile('_.gitignore'),\n ]);\n\n return {\n '.dockerignore': mergeWithConfigFile(dockerFile),\n\n '.gitignore': mergeWithConfigFile(gitFile),\n };\n};\n"],
5
- "mappings": "AAAA,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AAG7B,MAAM,eAAe,YAA6B;AACvD,QAAM,CAAC,YAAY,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC9C,qBAAqB,gBAAgB;AAAA,IACrC,qBAAqB,aAAa;AAAA,EACpC,CAAC;AAED,SAAO;AAAA,IACL,iBAAiB,oBAAoB,UAAU;AAAA,IAE/C,cAAc,oBAAoB,OAAO;AAAA,EAC3C;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,wBAAoC;AAG7B,MAAM,eAAe,YAA6B;AACvD,QAAM,CAAC,YAAY,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC9C,sCAAqB,gBAAgB;AAAA,QACrC,sCAAqB,aAAa;AAAA,EACpC,CAAC;AAED,SAAO;AAAA,IACL,qBAAiB,uCAAoB,UAAU;AAAA,IAE/C,kBAAc,uCAAoB,OAAO;AAAA,EAC3C;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,50 @@
1
- import { eslintModule } from "./eslint.js";
2
- import { ignoreModule } from "./ignore.js";
3
- import { nodemonModule } from "./nodemon.js";
4
- import { packageModule } from "./package.js";
5
- import { prettierModule } from "./prettier.js";
6
- import { renovateModule } from "./renovate.js";
7
- import { serverlessModule } from "./serverless.js";
8
- import { tslintModule } from "./tslint.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 modules_exports = {};
20
+ __export(modules_exports, {
21
+ loadModules: () => loadModules
22
+ });
23
+ module.exports = __toCommonJS(modules_exports);
24
+ var import_eslint = require("./eslint.js");
25
+ var import_ignore = require("./ignore.js");
26
+ var import_jest = require("./jest.js");
27
+ var import_nodemon = require("./nodemon.js");
28
+ var import_package = require("./package.js");
29
+ var import_prettier = require("./prettier.js");
30
+ var import_renovate = require("./renovate.js");
31
+ var import_serverless = require("./serverless.js");
32
+ var import_tslint = require("./tslint.js");
9
33
  const loadModules = (opts) => Promise.all(
10
34
  [
11
- eslintModule,
12
- ignoreModule,
13
- nodemonModule,
14
- packageModule,
15
- prettierModule,
16
- renovateModule,
17
- serverlessModule,
18
- tslintModule
35
+ import_eslint.eslintModule,
36
+ import_ignore.ignoreModule,
37
+ import_jest.jestModule,
38
+ import_nodemon.nodemonModule,
39
+ import_package.packageModule,
40
+ import_prettier.prettierModule,
41
+ import_renovate.renovateModule,
42
+ import_serverless.serverlessModule,
43
+ import_tslint.tslintModule
19
44
  ].map(async (createModule) => createModule(opts))
20
45
  );
21
- export {
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
22
48
  loadModules
23
- };
49
+ });
24
50
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/modules/index.ts"],
4
- "sourcesContent": ["import type { Module, Options } from '../types.js';\n\nimport { eslintModule } from './eslint.js';\nimport { ignoreModule } from './ignore.js';\nimport { nodemonModule } from './nodemon.js';\nimport { packageModule } from './package.js';\nimport { prettierModule } from './prettier.js';\nimport { renovateModule } from './renovate.js';\nimport { serverlessModule } from './serverless.js';\nimport { tslintModule } from './tslint.js';\n\nexport const loadModules = (opts: Options): Promise<Module[]> =>\n Promise.all(\n [\n eslintModule,\n ignoreModule,\n nodemonModule,\n packageModule,\n prettierModule,\n renovateModule,\n serverlessModule,\n tslintModule,\n ].map(async (createModule) => createModule(opts)),\n );\n"],
5
- "mappings": "AAEA,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAEtB,MAAM,cAAc,CAAC,SAC1B,QAAQ;AAAA,EACN;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,IAAI,OAAO,iBAAiB,aAAa,IAAI,CAAC;AAClD;",
4
+ "sourcesContent": ["import type { Module, Options } from '../types.js';\n\nimport { eslintModule } from './eslint.js';\nimport { ignoreModule } from './ignore.js';\nimport { jestModule } from './jest.js';\nimport { nodemonModule } from './nodemon.js';\nimport { packageModule } from './package.js';\nimport { prettierModule } from './prettier.js';\nimport { renovateModule } from './renovate.js';\nimport { serverlessModule } from './serverless.js';\nimport { tslintModule } from './tslint.js';\n\nexport const loadModules = (opts: Options): Promise<Module[]> =>\n Promise.all(\n [\n eslintModule,\n ignoreModule,\n jestModule,\n nodemonModule,\n packageModule,\n prettierModule,\n renovateModule,\n serverlessModule,\n tslintModule,\n ].map(async (createModule) => createModule(opts)),\n );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA6B;AAC7B,oBAA6B;AAC7B,kBAA2B;AAC3B,qBAA8B;AAC9B,qBAA8B;AAC9B,sBAA+B;AAC/B,sBAA+B;AAC/B,wBAAiC;AACjC,oBAA6B;AAEtB,MAAM,cAAc,CAAC,SAC1B,QAAQ;AAAA,EACN;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,IAAI,OAAO,iBAAiB,aAAa,IAAI,CAAC;AAClD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,2 @@
1
+ import type { Module } from '../types.js';
2
+ export declare const jestModule: () => Promise<Module>;
@@ -0,0 +1,86 @@
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 jest_exports = {};
20
+ __export(jest_exports, {
21
+ jestModule: () => jestModule
22
+ });
23
+ module.exports = __toCommonJS(jest_exports);
24
+ var import_template = require("../../../utils/template.js");
25
+ var import_deleteFiles = require("../processing/deleteFiles.js");
26
+ var import_package = require("../processing/package.js");
27
+ var import_typescript = require("../processing/typescript.js");
28
+ const OUTDATED_ISOLATED_MODULES_CONFIG_SNIPPETS = [
29
+ `
30
+ globals: {
31
+ 'ts-jest': {
32
+ // seek-oss/skuba#626
33
+ isolatedModules: true,
34
+ },
35
+ },`,
36
+ `
37
+ globals: {
38
+ 'ts-jest': {
39
+ isolatedModules: true,
40
+ },
41
+ },`
42
+ ];
43
+ const filterProps = (0, import_typescript.createPropFilter)([
44
+ "collectCoverageFrom",
45
+ "coverageThreshold",
46
+ "globalSetup",
47
+ "globalTeardown",
48
+ "setupFiles",
49
+ "setupFilesAfterEnv"
50
+ ]);
51
+ const jestModule = async () => {
52
+ const [configFile, setupFile] = await Promise.all([
53
+ (0, import_template.readBaseTemplateFile)("jest.config.ts"),
54
+ (0, import_template.readBaseTemplateFile)("jest.setup.ts")
55
+ ]);
56
+ return {
57
+ ...(0, import_deleteFiles.deleteFiles)("jest.config.js", "jest.setup.js"),
58
+ "jest.config.ts": async (tsFile, currentFiles, initialFiles) => {
59
+ if (tsFile?.includes("skuba")) {
60
+ return OUTDATED_ISOLATED_MODULES_CONFIG_SNIPPETS.reduce(
61
+ (acc, snippet) => acc.replace(snippet, ""),
62
+ tsFile
63
+ );
64
+ }
65
+ const jsFile = initialFiles["jest.config.js"];
66
+ if (jsFile?.includes("skuba")) {
67
+ return (0, import_typescript.transformModuleImportsAndExports)(jsFile, (_, p) => p);
68
+ }
69
+ currentFiles["jest.setup.ts"] ??= initialFiles["jest.setup.js"] ?? setupFile;
70
+ const inputFile = tsFile ?? jsFile;
71
+ const props = inputFile === void 0 ? void 0 : await (0, import_typescript.readModuleExports)(inputFile);
72
+ if (props === void 0) {
73
+ return configFile;
74
+ }
75
+ const filteredProps = filterProps(null, props);
76
+ const appendProps = (0, import_typescript.createPropAppender)(filteredProps);
77
+ return (0, import_typescript.transformModuleImportsAndExports)(configFile, appendProps);
78
+ },
79
+ "package.json": (0, import_package.withPackage)(({ jest, ...data }) => data)
80
+ };
81
+ };
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ jestModule
85
+ });
86
+ //# sourceMappingURL=jest.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/configure/modules/jest.ts"],
4
+ "sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template.js';\nimport { deleteFiles } from '../processing/deleteFiles.js';\nimport { withPackage } from '../processing/package.js';\nimport {\n createPropAppender,\n createPropFilter,\n readModuleExports,\n transformModuleImportsAndExports,\n} from '../processing/typescript.js';\nimport type { Module } from '../types.js';\n\nconst OUTDATED_ISOLATED_MODULES_CONFIG_SNIPPETS = [\n `\n globals: {\n 'ts-jest': {\n // seek-oss/skuba#626\n isolatedModules: true,\n },\n },`,\n `\n globals: {\n 'ts-jest': {\n isolatedModules: true,\n },\n },`,\n];\n\n// Jest options to preserve during migration\nconst filterProps = createPropFilter([\n 'collectCoverageFrom',\n 'coverageThreshold',\n 'globalSetup',\n 'globalTeardown',\n 'setupFiles',\n 'setupFilesAfterEnv',\n]);\n\nexport const jestModule = async (): Promise<Module> => {\n const [configFile, setupFile] = await Promise.all([\n readBaseTemplateFile('jest.config.ts'),\n readBaseTemplateFile('jest.setup.ts'),\n ]);\n\n return {\n ...deleteFiles('jest.config.js', 'jest.setup.js'),\n\n 'jest.config.ts': async (tsFile, currentFiles, initialFiles) => {\n // Allow customised TS Jest config that extends skuba\n if (tsFile?.includes('skuba')) {\n return OUTDATED_ISOLATED_MODULES_CONFIG_SNIPPETS.reduce(\n (acc, snippet) => acc.replace(snippet, ''),\n tsFile,\n );\n }\n\n const jsFile = initialFiles['jest.config.js'];\n\n // Migrate a JS config that extends skuba, retaining all existing props\n if (jsFile?.includes('skuba')) {\n return transformModuleImportsAndExports(jsFile, (_, p) => p);\n }\n\n currentFiles['jest.setup.ts'] ??=\n initialFiles['jest.setup.js'] ?? setupFile;\n\n const inputFile = tsFile ?? jsFile;\n\n const props =\n inputFile === undefined\n ? undefined\n : await readModuleExports(inputFile);\n\n if (props === undefined) {\n return configFile;\n }\n\n const filteredProps = filterProps(null, props);\n\n const appendProps = createPropAppender(filteredProps);\n\n // Append a subset of custom props to our base `jest.config.ts`\n return transformModuleImportsAndExports(configFile, appendProps);\n },\n\n 'package.json': withPackage(({ jest, ...data }) => data),\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,yBAA4B;AAC5B,qBAA4B;AAC5B,wBAKO;AAGP,MAAM,4CAA4C;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF;AAGA,MAAM,kBAAc,oCAAiB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,MAAM,aAAa,YAA6B;AACrD,QAAM,CAAC,YAAY,SAAS,IAAI,MAAM,QAAQ,IAAI;AAAA,QAChD,sCAAqB,gBAAgB;AAAA,QACrC,sCAAqB,eAAe;AAAA,EACtC,CAAC;AAED,SAAO;AAAA,IACL,OAAG,gCAAY,kBAAkB,eAAe;AAAA,IAEhD,kBAAkB,OAAO,QAAQ,cAAc,iBAAiB;AAE9D,UAAI,QAAQ,SAAS,OAAO,GAAG;AAC7B,eAAO,0CAA0C;AAAA,UAC/C,CAAC,KAAK,YAAY,IAAI,QAAQ,SAAS,EAAE;AAAA,UACzC;AAAA,QACF;AAAA,MACF;AAEA,YAAM,SAAS,aAAa,gBAAgB;AAG5C,UAAI,QAAQ,SAAS,OAAO,GAAG;AAC7B,mBAAO,oDAAiC,QAAQ,CAAC,GAAG,MAAM,CAAC;AAAA,MAC7D;AAEA,mBAAa,eAAe,MAC1B,aAAa,eAAe,KAAK;AAEnC,YAAM,YAAY,UAAU;AAE5B,YAAM,QACJ,cAAc,SACV,SACA,UAAM,qCAAkB,SAAS;AAEvC,UAAI,UAAU,QAAW;AACvB,eAAO;AAAA,MACT;AAEA,YAAM,gBAAgB,YAAY,MAAM,KAAK;AAE7C,YAAM,kBAAc,sCAAmB,aAAa;AAGpD,iBAAO,oDAAiC,YAAY,WAAW;AAAA,IACjE;AAAA,IAEA,oBAAgB,4BAAY,CAAC,EAAE,MAAM,GAAG,KAAK,MAAM,IAAI;AAAA,EACzD;AACF;",
6
+ "names": []
7
+ }
@@ -1,6 +1,30 @@
1
- import { deleteFiles } from "../processing/deleteFiles.js";
2
- const nodemonModule = () => deleteFiles("nodemon.json");
3
- export {
4
- nodemonModule
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;
5
17
  };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var nodemon_exports = {};
20
+ __export(nodemon_exports, {
21
+ nodemonModule: () => nodemonModule
22
+ });
23
+ module.exports = __toCommonJS(nodemon_exports);
24
+ var import_deleteFiles = require("../processing/deleteFiles.js");
25
+ const nodemonModule = () => (0, import_deleteFiles.deleteFiles)("nodemon.json");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ nodemonModule
29
+ });
6
30
  //# sourceMappingURL=nodemon.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/modules/nodemon.ts"],
4
4
  "sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const nodemonModule = (): Module => deleteFiles('nodemon.json');\n"],
5
- "mappings": "AAAA,SAAS,mBAAmB;AAGrB,MAAM,gBAAgB,MAAc,YAAY,cAAc;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,gBAAgB,UAAc,gCAAY,cAAc;",
6
6
  "names": []
7
7
  }