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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/config/eslint.js +1 -1
  2. package/config/jest.js +1 -0
  3. package/config/prettier.d.ts +4 -8
  4. package/config/prettier.js +2 -10
  5. package/jest/moduleNameMapper.js +64 -0
  6. package/jest/transform.js +62 -0
  7. package/jest/tsConfig.js +26 -0
  8. package/jest-preset.js +37 -0
  9. package/lib/api/jest/index.d.ts +15 -0
  10. package/lib/api/jest/index.js +59 -0
  11. package/lib/api/jest/index.js.map +7 -0
  12. package/lib/cli/adapter/eslint.js +45 -11
  13. package/lib/cli/adapter/eslint.js.map +3 -3
  14. package/lib/cli/adapter/prettier.js +67 -39
  15. package/lib/cli/adapter/prettier.js.map +2 -2
  16. package/lib/cli/build/args.js +42 -8
  17. package/lib/cli/build/args.js.map +2 -2
  18. package/lib/cli/build/assets.d.ts +3 -2
  19. package/lib/cli/build/assets.js +60 -28
  20. package/lib/cli/build/assets.js.map +3 -3
  21. package/lib/cli/build/esbuild.d.ts +4 -2
  22. package/lib/cli/build/esbuild.js +64 -23
  23. package/lib/cli/build/esbuild.js.map +2 -2
  24. package/lib/cli/build/index.js +53 -21
  25. package/lib/cli/build/index.js.map +2 -2
  26. package/lib/cli/build/tsc.js +60 -24
  27. package/lib/cli/build/tsc.js.map +3 -3
  28. package/lib/cli/buildPackage/index.js +32 -8
  29. package/lib/cli/buildPackage/index.js.map +1 -1
  30. package/lib/cli/configure/analyseConfiguration.js +50 -16
  31. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  32. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  33. package/lib/cli/configure/analyseDependencies.js +59 -25
  34. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  35. package/lib/cli/configure/analysis/diff.js +29 -5
  36. package/lib/cli/configure/analysis/diff.js.map +2 -2
  37. package/lib/cli/configure/analysis/files.js +42 -8
  38. package/lib/cli/configure/analysis/files.js.map +2 -2
  39. package/lib/cli/configure/analysis/git.js +46 -12
  40. package/lib/cli/configure/analysis/git.js.map +2 -2
  41. package/lib/cli/configure/analysis/package.d.ts +3 -2
  42. package/lib/cli/configure/analysis/package.js +45 -10
  43. package/lib/cli/configure/analysis/package.js.map +3 -3
  44. package/lib/cli/configure/analysis/project.js +50 -18
  45. package/lib/cli/configure/analysis/project.js.map +2 -2
  46. package/lib/cli/configure/dependencies/index.js +35 -7
  47. package/lib/cli/configure/dependencies/index.js.map +1 -1
  48. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
  49. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  50. package/lib/cli/configure/dependencies/seekKoala.js +28 -4
  51. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  52. package/lib/cli/configure/dependencies/skuba.js +28 -4
  53. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  54. package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
  55. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  56. package/lib/cli/configure/dependencies/skubaDive.js +29 -4
  57. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  58. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  59. package/lib/cli/configure/ensureTemplateCompletion.js +63 -32
  60. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  61. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  62. package/lib/cli/configure/getEntryPoint.js +51 -19
  63. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  64. package/lib/cli/configure/getProjectType.d.ts +1 -1
  65. package/lib/cli/configure/getProjectType.js +36 -17
  66. package/lib/cli/configure/getProjectType.js.map +2 -2
  67. package/lib/cli/configure/index.js +91 -56
  68. package/lib/cli/configure/index.js.map +3 -3
  69. package/lib/cli/configure/modules/eslint.js +34 -10
  70. package/lib/cli/configure/modules/eslint.js.map +1 -1
  71. package/lib/cli/configure/modules/ignore.js +32 -8
  72. package/lib/cli/configure/modules/ignore.js.map +1 -1
  73. package/lib/cli/configure/modules/index.js +44 -18
  74. package/lib/cli/configure/modules/index.js.map +2 -2
  75. package/lib/cli/configure/modules/jest.d.ts +2 -0
  76. package/lib/cli/configure/modules/jest.js +86 -0
  77. package/lib/cli/configure/modules/jest.js.map +7 -0
  78. package/lib/cli/configure/modules/nodemon.js +28 -4
  79. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  80. package/lib/cli/configure/modules/package.js +34 -10
  81. package/lib/cli/configure/modules/package.js.map +1 -1
  82. package/lib/cli/configure/modules/prettier.js +35 -11
  83. package/lib/cli/configure/modules/prettier.js.map +1 -1
  84. package/lib/cli/configure/modules/renovate.js +40 -17
  85. package/lib/cli/configure/modules/renovate.js.map +2 -2
  86. package/lib/cli/configure/modules/serverless.js +26 -2
  87. package/lib/cli/configure/modules/serverless.js.map +1 -1
  88. package/lib/cli/configure/modules/tslint.js +28 -4
  89. package/lib/cli/configure/modules/tslint.js.map +1 -1
  90. package/lib/cli/configure/processing/configFile.js +39 -3
  91. package/lib/cli/configure/processing/configFile.js.map +1 -1
  92. package/lib/cli/configure/processing/deleteFiles.js +26 -2
  93. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  94. package/lib/cli/configure/processing/javascript.js +27 -2
  95. package/lib/cli/configure/processing/javascript.js.map +1 -1
  96. package/lib/cli/configure/processing/json.js +31 -6
  97. package/lib/cli/configure/processing/json.js.map +1 -1
  98. package/lib/cli/configure/processing/loadFiles.js +26 -2
  99. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  100. package/lib/cli/configure/processing/module.js +28 -4
  101. package/lib/cli/configure/processing/module.js.map +1 -1
  102. package/lib/cli/configure/processing/package.d.ts +67 -1
  103. package/lib/cli/configure/processing/package.js +45 -8
  104. package/lib/cli/configure/processing/package.js.map +3 -3
  105. package/lib/cli/configure/processing/prettier.js +38 -4
  106. package/lib/cli/configure/processing/prettier.js.map +2 -2
  107. package/lib/cli/configure/processing/record.js +41 -5
  108. package/lib/cli/configure/processing/record.js.map +2 -2
  109. package/lib/cli/configure/processing/typescript.js +63 -26
  110. package/lib/cli/configure/processing/typescript.js.map +2 -2
  111. package/lib/cli/configure/types.d.ts +4 -15
  112. package/lib/cli/configure/types.js +16 -0
  113. package/lib/cli/configure/types.js.map +3 -3
  114. package/lib/cli/format/index.js +44 -20
  115. package/lib/cli/format/index.js.map +2 -2
  116. package/lib/cli/help/index.js +30 -6
  117. package/lib/cli/help/index.js.map +1 -1
  118. package/lib/cli/init/getConfig.d.ts +2 -2
  119. package/lib/cli/init/getConfig.js +121 -102
  120. package/lib/cli/init/getConfig.js.map +3 -3
  121. package/lib/cli/init/git.js +51 -16
  122. package/lib/cli/init/git.js.map +2 -2
  123. package/lib/cli/init/index.js +98 -67
  124. package/lib/cli/init/index.js.map +2 -2
  125. package/lib/cli/init/prompts.d.ts +13 -10
  126. package/lib/cli/init/prompts.js +56 -35
  127. package/lib/cli/init/prompts.js.map +2 -2
  128. package/lib/cli/init/types.d.ts +1 -1
  129. package/lib/cli/init/types.js +41 -7
  130. package/lib/cli/init/types.js.map +1 -1
  131. package/lib/cli/init/validation.js +30 -2
  132. package/lib/cli/init/validation.js.map +1 -1
  133. package/lib/cli/init/writePackageJson.js +42 -8
  134. package/lib/cli/init/writePackageJson.js.map +2 -2
  135. package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
  136. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  137. package/lib/cli/lint/annotate/buildkite/index.js +45 -11
  138. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  139. package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
  140. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  141. package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
  142. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  143. package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
  144. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  145. package/lib/cli/lint/annotate/github/eslint.js +26 -2
  146. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  147. package/lib/cli/lint/annotate/github/index.js +45 -11
  148. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  149. package/lib/cli/lint/annotate/github/internal.js +26 -2
  150. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  151. package/lib/cli/lint/annotate/github/prettier.js +26 -2
  152. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  153. package/lib/cli/lint/annotate/github/tsc.js +28 -4
  154. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  155. package/lib/cli/lint/annotate/index.js +30 -6
  156. package/lib/cli/lint/annotate/index.js.map +1 -1
  157. package/lib/cli/lint/autofix.d.ts +5 -0
  158. package/lib/cli/lint/autofix.js +80 -40
  159. package/lib/cli/lint/autofix.js.map +2 -2
  160. package/lib/cli/lint/eslint.js +51 -16
  161. package/lib/cli/lint/eslint.js.map +3 -3
  162. package/lib/cli/lint/external.js +51 -19
  163. package/lib/cli/lint/external.js.map +2 -2
  164. package/lib/cli/lint/index.js +50 -28
  165. package/lib/cli/lint/index.js.map +2 -2
  166. package/lib/cli/lint/internal.js +44 -18
  167. package/lib/cli/lint/internal.js.map +2 -2
  168. package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
  169. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  170. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +46 -14
  171. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
  172. package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
  173. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  174. package/lib/cli/lint/internalLints/refreshConfigFiles.js +64 -35
  175. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  176. package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
  177. package/lib/cli/lint/internalLints/upgrade/index.js +105 -41
  178. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  179. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
  180. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  181. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
  182. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  183. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
  184. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  185. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
  186. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  187. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
  188. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  209. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
  210. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  211. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
  212. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  213. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -17
  214. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
  216. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  217. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
  218. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  219. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  220. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +149 -0
  221. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  222. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
  223. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  224. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
  225. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  226. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
  227. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  228. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
  229. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  230. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
  231. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  232. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
  233. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
  235. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  236. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
  237. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  238. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
  239. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  240. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
  241. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  242. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
  243. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  244. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
  245. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  246. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
  247. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  248. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
  249. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  250. package/lib/cli/lint/prettier.js +50 -15
  251. package/lib/cli/lint/prettier.js.map +3 -3
  252. package/lib/cli/lint/tsc.js +28 -4
  253. package/lib/cli/lint/tsc.js.map +1 -1
  254. package/lib/cli/lint/types.js +16 -0
  255. package/lib/cli/lint/types.js.map +3 -3
  256. package/lib/cli/migrate/index.d.ts +5 -0
  257. package/lib/cli/migrate/index.js +79 -15
  258. package/lib/cli/migrate/index.js.map +2 -2
  259. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  260. package/lib/cli/migrate/nodeVersion/checks.js +51 -120
  261. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  262. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  263. package/lib/cli/migrate/nodeVersion/index.js +239 -65
  264. package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
  265. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  266. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  267. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  268. package/lib/cli/node/index.js +57 -20
  269. package/lib/cli/node/index.js.map +3 -3
  270. package/lib/cli/release/index.js +28 -4
  271. package/lib/cli/release/index.js.map +1 -1
  272. package/lib/cli/start/index.js +50 -16
  273. package/lib/cli/start/index.js.map +3 -3
  274. package/lib/cli/test/index.js +44 -4
  275. package/lib/cli/test/index.js.map +2 -2
  276. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  277. package/lib/cli/test/reporters/github/annotations.js +102 -0
  278. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  279. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  280. package/lib/cli/test/reporters/github/index.js +74 -0
  281. package/lib/cli/test/reporters/github/index.js.map +7 -0
  282. package/lib/cli/version/index.js +30 -6
  283. package/lib/cli/version/index.js.map +1 -1
  284. package/lib/index.d.ts +1 -0
  285. package/lib/index.js +46 -6
  286. package/lib/index.js.map +2 -2
  287. package/lib/skuba.js +45 -26
  288. package/lib/skuba.js.map +3 -3
  289. package/lib/utils/args.js +43 -6
  290. package/lib/utils/args.js.map +2 -2
  291. package/lib/utils/command.js +42 -4
  292. package/lib/utils/command.js.map +3 -3
  293. package/lib/utils/copy.js +57 -20
  294. package/lib/utils/copy.js.map +2 -2
  295. package/lib/utils/dir.js +72 -32
  296. package/lib/utils/dir.js.map +2 -2
  297. package/lib/utils/env.js +26 -2
  298. package/lib/utils/env.js.map +1 -1
  299. package/lib/utils/error.js +47 -10
  300. package/lib/utils/error.js.map +1 -1
  301. package/lib/utils/exec.d.ts +3 -2
  302. package/lib/utils/exec.js +62 -24
  303. package/lib/utils/exec.js.map +3 -3
  304. package/lib/utils/fs.js +40 -6
  305. package/lib/utils/fs.js.map +2 -2
  306. package/lib/utils/help.js +30 -6
  307. package/lib/utils/help.js.map +1 -1
  308. package/lib/utils/logging.d.ts +9 -10
  309. package/lib/utils/logging.js +38 -11
  310. package/lib/utils/logging.js.map +2 -2
  311. package/lib/utils/logo.js +52 -25
  312. package/lib/utils/logo.js.map +2 -2
  313. package/lib/utils/manifest.d.ts +2 -3
  314. package/lib/utils/manifest.js +48 -8
  315. package/lib/utils/manifest.js.map +3 -3
  316. package/lib/utils/npmrc.js +26 -2
  317. package/lib/utils/npmrc.js.map +1 -1
  318. package/lib/utils/packageManager.js +49 -12
  319. package/lib/utils/packageManager.js.map +2 -2
  320. package/lib/utils/port.js +39 -4
  321. package/lib/utils/port.js.map +2 -2
  322. package/lib/utils/sleep.js +26 -2
  323. package/lib/utils/sleep.js.map +1 -1
  324. package/lib/utils/template.js +55 -18
  325. package/lib/utils/template.js.map +3 -3
  326. package/lib/utils/validation.js +31 -2
  327. package/lib/utils/validation.js.map +1 -1
  328. package/lib/utils/version.js +46 -9
  329. package/lib/utils/version.js.map +2 -2
  330. package/lib/utils/wait.js +32 -7
  331. package/lib/utils/wait.js.map +1 -1
  332. package/lib/utils/worker.d.ts +3 -3
  333. package/lib/utils/worker.js +35 -10
  334. package/lib/utils/worker.js.map +1 -1
  335. package/lib/wrapper/function-arguments.d.js +1 -0
  336. package/lib/wrapper/functionHandler.js +49 -18
  337. package/lib/wrapper/functionHandler.js.map +2 -2
  338. package/lib/wrapper/http.js +43 -8
  339. package/lib/wrapper/http.js.map +2 -2
  340. package/lib/wrapper/index.js +7 -6
  341. package/lib/wrapper/index.js.map +1 -1
  342. package/lib/wrapper/main.js +42 -8
  343. package/lib/wrapper/main.js.map +3 -3
  344. package/lib/wrapper/requestListener.js +47 -13
  345. package/lib/wrapper/requestListener.js.map +2 -2
  346. package/lib/wrapper/server.js +28 -4
  347. package/lib/wrapper/server.js.map +2 -2
  348. package/package.json +43 -45
  349. package/template/base/_.prettierrc.js +1 -1
  350. package/template/base/_eslint.config.js +1 -1
  351. package/template/base/_pnpm-workspace.yaml +4 -3
  352. package/template/base/jest.config.ts +19 -0
  353. package/template/base/jest.setup.ts +3 -0
  354. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  355. package/template/express-rest-api/.nvmrc +1 -1
  356. package/template/express-rest-api/package.json +8 -9
  357. package/template/express-rest-api/skuba.template.js +1 -1
  358. package/template/express-rest-api/src/app.test.ts +0 -1
  359. package/template/greeter/.buildkite/pipeline.yml +1 -1
  360. package/template/greeter/.nvmrc +1 -1
  361. package/template/greeter/package.json +4 -5
  362. package/template/greeter/skuba.template.js +1 -1
  363. package/template/greeter/src/app.test.ts +1 -3
  364. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  365. package/template/koa-rest-api/.nvmrc +1 -1
  366. package/template/koa-rest-api/package.json +9 -11
  367. package/template/koa-rest-api/skuba.template.js +1 -1
  368. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
  369. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
  370. package/template/koa-rest-api/src/app.test.ts +0 -2
  371. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  372. package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
  373. package/template/koa-rest-api/src/testing/metrics.ts +0 -2
  374. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  375. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  376. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -21
  377. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
  378. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  379. package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
  380. package/template/lambda-sqs-worker-cdk/package.json +9 -9
  381. package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
  382. package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
  383. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
  384. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
  385. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
  386. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
  387. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
  388. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  389. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  390. package/template/oss-npm-package/.nvmrc +1 -1
  391. package/template/oss-npm-package/_package.json +0 -1
  392. package/template/oss-npm-package/skuba.template.js +1 -1
  393. package/template/oss-npm-package/src/index.test.ts +0 -2
  394. package/template/private-npm-package/.nvmrc +1 -1
  395. package/template/private-npm-package/_package.json +1 -2
  396. package/template/private-npm-package/skuba.template.js +2 -2
  397. package/template/private-npm-package/src/index.test.ts +0 -2
  398. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
  399. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  400. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
  401. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  402. package/lib/enquirer.d.js +0 -1
  403. package/lib/enquirer.d.js.map +0 -7
  404. package/lib/eslint.d.js +0 -1
  405. package/lib/eslint.d.js.map +0 -7
  406. package/template/base/vitest.config.ts +0 -25
  407. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.d.ts +0 -0
  408. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
@@ -1,76 +1,110 @@
1
- import path from "path";
2
- import enquirer from "enquirer";
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";
17
- const shouldApply = async (name) => {
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");
50
+ const shouldApply = async () => {
18
51
  if (!process.stdin.isTTY) {
19
52
  return "yes";
20
53
  }
21
- const prompt = new enquirer.Select({
22
- choices: ["yes", "no"],
54
+ const result = await (0, import_prompts.select)({
23
55
  message: "Apply changes?",
24
- name
56
+ choices: [
57
+ { name: "Yes", value: "yes" },
58
+ { name: "No", value: "no" }
59
+ ]
25
60
  });
26
- const result = await prompt.run();
27
61
  return result === "yes";
28
62
  };
29
63
  const configure = async () => {
30
- await showLogoAndVersionInfo();
64
+ await (0, import_logo.showLogoAndVersionInfo)();
31
65
  const [manifest, packageManager] = await Promise.all([
32
- getDestinationManifest(),
33
- detectPackageManager()
66
+ (0, import_package.getDestinationManifest)(),
67
+ (0, import_packageManager.detectPackageManager)()
34
68
  ]);
35
- await ensureCommands(packageManager.command);
36
- const destinationRoot = path.dirname(manifest.path);
37
- 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));
38
72
  const [include] = await Promise.all([
39
- createInclusionFilter([
40
- path.join(destinationRoot, ".gitignore"),
41
- 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")
42
76
  ]),
43
- auditWorkingTree(destinationRoot)
77
+ (0, import_git.auditWorkingTree)(destinationRoot)
44
78
  ]);
45
- const templateConfig = await ensureTemplateCompletion({
79
+ const templateConfig = await (0, import_ensureTemplateCompletion.ensureTemplateCompletion)({
46
80
  destinationRoot,
47
81
  include,
48
82
  manifest
49
83
  });
50
- const type = await getProjectType({
84
+ const type = await (0, import_getProjectType.getProjectType)({
51
85
  manifest,
52
86
  templateConfig
53
87
  });
54
- const entryPoint = await getEntryPoint({
88
+ const entryPoint = await (0, import_getEntryPoint.getEntryPoint)({
55
89
  destinationRoot,
56
90
  manifest,
57
91
  templateConfig,
58
92
  type
59
93
  });
60
- const fixDependencies = await analyseDependencies({
94
+ const fixDependencies = await (0, import_analyseDependencies.analyseDependencies)({
61
95
  destinationRoot,
62
96
  include,
63
97
  manifest,
64
98
  type
65
99
  });
66
100
  if (fixDependencies) {
67
- log.newline();
68
- if (await shouldApply("fixDependencies")) {
101
+ import_logging.log.newline();
102
+ if (await shouldApply()) {
69
103
  await fixDependencies();
70
104
  }
71
105
  }
72
- const firstRun = hasProp(manifest.packageJson, "skuba");
73
- const fixConfiguration = await analyseConfiguration({
106
+ const firstRun = (0, import_validation.hasProp)(manifest.packageJson, "skuba");
107
+ const fixConfiguration = await (0, import_analyseConfiguration.analyseConfiguration)({
74
108
  destinationRoot,
75
109
  entryPoint,
76
110
  firstRun,
@@ -78,39 +112,40 @@ const configure = async () => {
78
112
  type
79
113
  });
80
114
  if (fixConfiguration) {
81
- log.newline();
82
- if (await shouldApply("fixConfiguration")) {
115
+ import_logging.log.newline();
116
+ if (await shouldApply()) {
83
117
  await fixConfiguration();
84
118
  }
85
119
  }
86
120
  if (fixDependencies) {
87
- const exec = createExec({
121
+ const exec = (0, import_exec.createExec)({
88
122
  stdio: "pipe",
89
123
  streamStdio: packageManager.command
90
124
  });
91
- log.newline();
125
+ import_logging.log.newline();
92
126
  try {
93
127
  await exec(packageManager.command, "install");
94
128
  } catch {
95
- log.newline();
96
- log.warn(log.bold("\u2717 Failed to install dependencies. Resume with:"));
97
- log.newline();
98
- log.plain(log.bold(packageManager.command, "install"));
99
- log.plain(log.bold(packageManager.command, "format"));
100
- 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();
101
135
  process.exitCode = 1;
102
136
  return;
103
137
  }
104
138
  }
105
139
  if (fixConfiguration ?? fixDependencies) {
106
- log.newline();
107
- log.ok(log.bold("\u2714 All done! Try running:"));
108
- log.newline();
109
- 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`));
110
144
  }
111
- log.newline();
145
+ import_logging.log.newline();
112
146
  };
113
- export {
147
+ // Annotate the CommonJS export names for ESM import in node:
148
+ 0 && (module.exports = {
114
149
  configure
115
- };
150
+ });
116
151
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/index.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport enquirer from 'enquirer';\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 (name: string) => {\n if (!process.stdin.isTTY) {\n return 'yes';\n }\n const prompt = new enquirer.Select({\n choices: ['yes', 'no'] as const,\n message: 'Apply changes?',\n name,\n });\n\n const result = await prompt.run();\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('fixDependencies')) {\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('fixConfiguration')) {\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": []
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": ["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
  }