skuba 14.0.0-replace-global-vars-20251121010036 → 14.0.0-rfc-pnpm-config-skuba-20260106120954

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 (414) 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.d.ts +1 -1
  89. package/lib/cli/configure/processing/configFile.js +34 -43
  90. package/lib/cli/configure/processing/configFile.js.map +2 -2
  91. package/lib/cli/configure/processing/deleteFiles.js +26 -2
  92. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  93. package/lib/cli/configure/processing/javascript.js +27 -2
  94. package/lib/cli/configure/processing/javascript.js.map +1 -1
  95. package/lib/cli/configure/processing/json.js +31 -6
  96. package/lib/cli/configure/processing/json.js.map +1 -1
  97. package/lib/cli/configure/processing/loadFiles.js +26 -2
  98. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  99. package/lib/cli/configure/processing/module.js +28 -4
  100. package/lib/cli/configure/processing/module.js.map +1 -1
  101. package/lib/cli/configure/processing/package.d.ts +67 -1
  102. package/lib/cli/configure/processing/package.js +45 -8
  103. package/lib/cli/configure/processing/package.js.map +3 -3
  104. package/lib/cli/configure/processing/prettier.js +38 -4
  105. package/lib/cli/configure/processing/prettier.js.map +2 -2
  106. package/lib/cli/configure/processing/record.js +41 -5
  107. package/lib/cli/configure/processing/record.js.map +2 -2
  108. package/lib/cli/configure/processing/typescript.js +63 -26
  109. package/lib/cli/configure/processing/typescript.js.map +2 -2
  110. package/lib/cli/configure/types.d.ts +4 -15
  111. package/lib/cli/configure/types.js +16 -0
  112. package/lib/cli/configure/types.js.map +3 -3
  113. package/lib/cli/format/index.js +44 -20
  114. package/lib/cli/format/index.js.map +1 -1
  115. package/lib/cli/help/index.js +30 -6
  116. package/lib/cli/help/index.js.map +1 -1
  117. package/lib/cli/init/getConfig.d.ts +1 -1
  118. package/lib/cli/init/getConfig.js +100 -74
  119. package/lib/cli/init/getConfig.js.map +3 -3
  120. package/lib/cli/init/git.js +51 -16
  121. package/lib/cli/init/git.js.map +2 -2
  122. package/lib/cli/init/index.js +117 -68
  123. package/lib/cli/init/index.js.map +3 -3
  124. package/lib/cli/init/prompts.d.ts +4 -4
  125. package/lib/cli/init/prompts.js +48 -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.d.ts +1 -1
  172. package/lib/cli/lint/internalLints/refreshConfigFiles.js +65 -42
  173. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  174. package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
  175. package/lib/cli/lint/internalLints/upgrade/index.js +53 -22
  176. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  177. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
  178. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  179. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
  180. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  181. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
  182. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  183. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
  184. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  185. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
  186. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  187. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
  188. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  209. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
  210. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  211. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -4
  212. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -18
  213. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
  214. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
  215. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  216. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +45 -0
  217. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  218. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/migrateToPnpmConfig.d.ts +3 -0
  219. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/migrateToPnpmConfig.js +139 -0
  220. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/migrateToPnpmConfig.js.map +7 -0
  221. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  222. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
  223. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  224. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
  225. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  226. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
  227. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  228. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
  229. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  230. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
  231. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  232. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
  233. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  234. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
  235. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  236. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
  237. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  238. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
  239. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  240. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
  241. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  242. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
  243. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  244. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
  245. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  246. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
  247. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  248. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
  249. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  250. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
  251. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  252. package/lib/cli/lint/prettier.js +50 -15
  253. package/lib/cli/lint/prettier.js.map +3 -3
  254. package/lib/cli/lint/tsc.js +28 -4
  255. package/lib/cli/lint/tsc.js.map +1 -1
  256. package/lib/cli/lint/types.js +16 -0
  257. package/lib/cli/lint/types.js.map +3 -3
  258. package/lib/cli/migrate/index.d.ts +5 -0
  259. package/lib/cli/migrate/index.js +79 -15
  260. package/lib/cli/migrate/index.js.map +2 -2
  261. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  262. package/lib/cli/migrate/nodeVersion/checks.js +51 -120
  263. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  264. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  265. package/lib/cli/migrate/nodeVersion/index.js +239 -65
  266. package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
  267. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  268. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  269. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  270. package/lib/cli/node/index.js +57 -20
  271. package/lib/cli/node/index.js.map +3 -3
  272. package/lib/cli/release/index.js +28 -4
  273. package/lib/cli/release/index.js.map +1 -1
  274. package/lib/cli/start/index.js +50 -16
  275. package/lib/cli/start/index.js.map +3 -3
  276. package/lib/cli/test/index.js +44 -4
  277. package/lib/cli/test/index.js.map +2 -2
  278. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  279. package/lib/cli/test/reporters/github/annotations.js +102 -0
  280. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  281. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  282. package/lib/cli/test/reporters/github/index.js +74 -0
  283. package/lib/cli/test/reporters/github/index.js.map +7 -0
  284. package/lib/cli/version/index.js +30 -6
  285. package/lib/cli/version/index.js.map +1 -1
  286. package/lib/index.d.ts +1 -0
  287. package/lib/index.js +46 -6
  288. package/lib/index.js.map +2 -2
  289. package/lib/skuba.js +45 -26
  290. package/lib/skuba.js.map +3 -3
  291. package/lib/utils/args.js +43 -6
  292. package/lib/utils/args.js.map +2 -2
  293. package/lib/utils/command.js +42 -4
  294. package/lib/utils/command.js.map +3 -3
  295. package/lib/utils/copy.js +57 -20
  296. package/lib/utils/copy.js.map +2 -2
  297. package/lib/utils/dir.js +72 -32
  298. package/lib/utils/dir.js.map +2 -2
  299. package/lib/utils/env.js +26 -2
  300. package/lib/utils/env.js.map +1 -1
  301. package/lib/utils/error.js +47 -10
  302. package/lib/utils/error.js.map +1 -1
  303. package/lib/utils/exec.js +61 -23
  304. package/lib/utils/exec.js.map +3 -3
  305. package/lib/utils/fs.js +40 -6
  306. package/lib/utils/fs.js.map +2 -2
  307. package/lib/utils/help.js +30 -6
  308. package/lib/utils/help.js.map +1 -1
  309. package/lib/utils/logging.js +38 -11
  310. package/lib/utils/logging.js.map +1 -1
  311. package/lib/utils/logo.js +48 -24
  312. package/lib/utils/logo.js.map +1 -1
  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.js +35 -10
  333. package/lib/utils/worker.js.map +1 -1
  334. package/lib/wrapper/function-arguments.d.js +1 -0
  335. package/lib/wrapper/functionHandler.js +49 -18
  336. package/lib/wrapper/functionHandler.js.map +2 -2
  337. package/lib/wrapper/http.js +43 -8
  338. package/lib/wrapper/http.js.map +2 -2
  339. package/lib/wrapper/index.js +7 -6
  340. package/lib/wrapper/index.js.map +1 -1
  341. package/lib/wrapper/main.js +42 -8
  342. package/lib/wrapper/main.js.map +3 -3
  343. package/lib/wrapper/requestListener.js +47 -13
  344. package/lib/wrapper/requestListener.js.map +2 -2
  345. package/lib/wrapper/server.js +28 -4
  346. package/lib/wrapper/server.js.map +1 -1
  347. package/package.json +45 -45
  348. package/template/base/_.prettierrc.js +1 -1
  349. package/template/base/_eslint.config.js +1 -1
  350. package/template/base/_pnpm-workspace.yaml +0 -23
  351. package/template/base/jest.config.ts +19 -0
  352. package/template/base/jest.setup.ts +3 -0
  353. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  354. package/template/express-rest-api/.nvmrc +1 -1
  355. package/template/express-rest-api/package.json +8 -9
  356. package/template/express-rest-api/skuba.template.js +1 -1
  357. package/template/express-rest-api/src/app.test.ts +0 -1
  358. package/template/greeter/.buildkite/pipeline.yml +1 -1
  359. package/template/greeter/.nvmrc +1 -1
  360. package/template/greeter/package.json +4 -5
  361. package/template/greeter/skuba.template.js +1 -1
  362. package/template/greeter/src/app.test.ts +1 -3
  363. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  364. package/template/koa-rest-api/.nvmrc +1 -1
  365. package/template/koa-rest-api/package.json +9 -11
  366. package/template/koa-rest-api/skuba.template.js +1 -1
  367. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
  368. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
  369. package/template/koa-rest-api/src/app.test.ts +0 -2
  370. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  371. package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
  372. package/template/koa-rest-api/src/testing/metrics.ts +0 -2
  373. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  374. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  375. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -19
  376. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
  377. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  378. package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
  379. package/template/lambda-sqs-worker-cdk/package.json +9 -9
  380. package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
  381. package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
  382. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
  383. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
  384. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
  385. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
  386. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
  387. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  388. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  389. package/template/oss-npm-package/.nvmrc +1 -1
  390. package/template/oss-npm-package/_package.json +1 -2
  391. package/template/oss-npm-package/skuba.template.js +1 -1
  392. package/template/oss-npm-package/src/index.test.ts +0 -2
  393. package/template/private-npm-package/.nvmrc +1 -1
  394. package/template/private-npm-package/_package.json +2 -3
  395. package/template/private-npm-package/skuba.template.js +2 -2
  396. package/template/private-npm-package/src/index.test.ts +0 -2
  397. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.d.ts +0 -6
  398. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +0 -86
  399. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +0 -7
  400. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -16
  401. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +0 -7
  402. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +0 -7
  403. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -76
  404. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +0 -7
  405. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -2
  406. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
  407. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  408. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
  409. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  410. package/lib/eslint.d.js +0 -1
  411. package/lib/eslint.d.js.map +0 -7
  412. package/template/base/vitest.config.ts +0 -25
  413. /package/lib/cli/lint/internalLints/upgrade/patches/{12.5.0 → 13.1.1}/index.d.ts +0 -0
  414. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
@@ -1,10 +1,46 @@
1
- import ts from "typescript";
2
- import { formatPrettier } from "./prettier.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 typescript_exports = {};
30
+ __export(typescript_exports, {
31
+ createPropAppender: () => createPropAppender,
32
+ createPropFilter: () => createPropFilter,
33
+ readModuleExports: () => readModuleExports,
34
+ transformModuleImportsAndExports: () => transformModuleImportsAndExports
35
+ });
36
+ module.exports = __toCommonJS(typescript_exports);
37
+ var import_typescript = __toESM(require("typescript"));
38
+ var import_prettier = require("./prettier.js");
3
39
  const BLANK_LINE_PLACEHOLDER = " __BLANK_LINE_PLACEHOLDER__";
4
40
  const BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, "g");
5
- const withLeadingBlankLinePlaceholder = (node) => ts.addSyntheticLeadingComment(
41
+ const withLeadingBlankLinePlaceholder = (node) => import_typescript.default.addSyntheticLeadingComment(
6
42
  node,
7
- ts.SyntaxKind.SingleLineCommentTrivia,
43
+ import_typescript.default.SyntaxKind.SingleLineCommentTrivia,
8
44
  BLANK_LINE_PLACEHOLDER,
9
45
  true
10
46
  );
@@ -39,19 +75,19 @@ const createImportFromExpression = (factory, moduleName, importNames) => {
39
75
  factory.createStringLiteral(moduleName)
40
76
  );
41
77
  };
42
- const getPropName = (prop) => ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) ? prop.name.escapedText.toString() : void 0;
78
+ const getPropName = (prop) => import_typescript.default.isPropertyAssignment(prop) && import_typescript.default.isIdentifier(prop.name) ? prop.name.escapedText.toString() : void 0;
43
79
  const expressionAsDefaultExport = (context, transformProps, expression) => withLeadingBlankLinePlaceholder(
44
80
  (() => {
45
- if (ts.isObjectLiteralExpression(expression)) {
81
+ if (import_typescript.default.isObjectLiteralExpression(expression)) {
46
82
  const props = transformProps(context, expression.properties);
47
83
  return createExportDefaultObjectLiteralExpression(
48
84
  context.factory,
49
85
  props
50
86
  );
51
87
  }
52
- if (ts.isCallExpression(expression) && expression.arguments.length === 1 && expression.arguments[0]) {
88
+ if (import_typescript.default.isCallExpression(expression) && expression.arguments.length === 1 && expression.arguments[0]) {
53
89
  const [firstArgument] = expression.arguments;
54
- if (ts.isObjectLiteralExpression(firstArgument)) {
90
+ if (import_typescript.default.isObjectLiteralExpression(firstArgument)) {
55
91
  const props = transformProps(context, firstArgument.properties);
56
92
  return createExportDefaultObjectLiteralExpression(
57
93
  context.factory,
@@ -67,28 +103,28 @@ const expressionAsDefaultExport = (context, transformProps, expression) => withL
67
103
  );
68
104
  })()
69
105
  );
70
- const requireImportsTransformer = (context) => (rootNode) => ts.visitEachChild(
106
+ const requireImportsTransformer = (context) => (rootNode) => import_typescript.default.visitEachChild(
71
107
  rootNode,
72
108
  (node) => {
73
109
  let declaration, moduleName;
74
- if (ts.isVariableStatement(node) && node.declarationList.declarations.length === 1 && node.declarationList.declarations[0] && ts.isVariableDeclaration(
110
+ if (import_typescript.default.isVariableStatement(node) && node.declarationList.declarations.length === 1 && node.declarationList.declarations[0] && import_typescript.default.isVariableDeclaration(
75
111
  declaration = node.declarationList.declarations[0]
76
- ) && declaration.initializer && ts.isCallExpression(declaration.initializer) && declaration.initializer.arguments.length === 1 && declaration.initializer.arguments[0] && ts.isStringLiteral(
112
+ ) && declaration.initializer && import_typescript.default.isCallExpression(declaration.initializer) && declaration.initializer.arguments.length === 1 && declaration.initializer.arguments[0] && import_typescript.default.isStringLiteral(
77
113
  moduleName = declaration.initializer.arguments[0]
78
- ) && ts.isIdentifier(declaration.initializer.expression) && declaration.initializer.expression.text === "require") {
79
- if (ts.isIdentifier(declaration.name)) {
114
+ ) && import_typescript.default.isIdentifier(declaration.initializer.expression) && declaration.initializer.expression.text === "require") {
115
+ if (import_typescript.default.isIdentifier(declaration.name)) {
80
116
  return createImportFromExpression(
81
117
  context.factory,
82
118
  moduleName.text,
83
119
  declaration.name.text
84
120
  );
85
121
  }
86
- if (ts.isObjectBindingPattern(declaration.name)) {
122
+ if (import_typescript.default.isObjectBindingPattern(declaration.name)) {
87
123
  return createImportFromExpression(
88
124
  context.factory,
89
125
  moduleName.text,
90
126
  declaration.name.elements.flatMap(
91
- (element) => ts.isIdentifier(element.name) ? [element.name.text] : []
127
+ (element) => import_typescript.default.isIdentifier(element.name) ? [element.name.text] : []
92
128
  )
93
129
  );
94
130
  }
@@ -97,17 +133,17 @@ const requireImportsTransformer = (context) => (rootNode) => ts.visitEachChild(
97
133
  },
98
134
  context
99
135
  );
100
- const createModuleExportsTransformer = (transformProps) => (context) => (rootNode) => ts.visitEachChild(
136
+ const createModuleExportsTransformer = (transformProps) => (context) => (rootNode) => import_typescript.default.visitEachChild(
101
137
  rootNode,
102
138
  (node) => {
103
- if (ts.isExpressionStatement(node) && ts.isBinaryExpression(node.expression) && ts.isPropertyAccessExpression(node.expression.left) && ts.isIdentifier(node.expression.left.expression) && node.expression.left.expression.escapedText.toString() === "module" && node.expression.left.name.text === "exports" && node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
139
+ if (import_typescript.default.isExpressionStatement(node) && import_typescript.default.isBinaryExpression(node.expression) && import_typescript.default.isPropertyAccessExpression(node.expression.left) && import_typescript.default.isIdentifier(node.expression.left.expression) && node.expression.left.expression.escapedText.toString() === "module" && node.expression.left.name.text === "exports" && node.expression.operatorToken.kind === import_typescript.default.SyntaxKind.EqualsToken) {
104
140
  return expressionAsDefaultExport(
105
141
  context,
106
142
  transformProps,
107
143
  node.expression.right
108
144
  ) ?? node;
109
145
  }
110
- if (ts.isExportAssignment(node)) {
146
+ if (import_typescript.default.isExportAssignment(node)) {
111
147
  return expressionAsDefaultExport(
112
148
  context,
113
149
  transformProps,
@@ -120,7 +156,7 @@ const createModuleExportsTransformer = (transformProps) => (context) => (rootNod
120
156
  );
121
157
  const createPropFilter = (names) => (context, props) => {
122
158
  const nameSet = new Set(names);
123
- const factory = context?.factory ?? ts.factory;
159
+ const factory = context?.factory ?? import_typescript.default.factory;
124
160
  return factory.createNodeArray(
125
161
  props.filter((prop) => nameSet.has(getPropName(prop)))
126
162
  );
@@ -129,7 +165,7 @@ const createPropAppender = (appendingProps) => (context, props) => {
129
165
  const nameSet = new Set(
130
166
  props.map(getPropName).filter((prop) => typeof prop === "string")
131
167
  );
132
- const factory = context?.factory ?? ts.factory;
168
+ const factory = context?.factory ?? import_typescript.default.factory;
133
169
  return factory.createNodeArray([
134
170
  ...props,
135
171
  ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop)))
@@ -144,9 +180,9 @@ const readModuleExports = async (inputFile) => {
144
180
  return result;
145
181
  };
146
182
  const transformModuleImportsAndExports = async (inputFile, transformProps) => {
147
- const sourceFile = ts.createSourceFile("", inputFile, ts.ScriptTarget.Latest);
183
+ const sourceFile = import_typescript.default.createSourceFile("", inputFile, import_typescript.default.ScriptTarget.Latest);
148
184
  const moduleExportsTransformer = createModuleExportsTransformer(transformProps);
149
- const result = ts.transform(sourceFile, [
185
+ const result = import_typescript.default.transform(sourceFile, [
150
186
  requireImportsTransformer,
151
187
  moduleExportsTransformer
152
188
  ]);
@@ -156,13 +192,14 @@ const transformModuleImportsAndExports = async (inputFile, transformProps) => {
156
192
  `Could not get transformed result for ${JSON.stringify(result)}`
157
193
  );
158
194
  }
159
- const text = ts.createPrinter().printNode(ts.EmitHint.SourceFile, transformedFile, sourceFile).replace(BLANK_LINE_REGEXP, "");
160
- return formatPrettier(text, { parser: "typescript" });
195
+ const text = import_typescript.default.createPrinter().printNode(import_typescript.default.EmitHint.SourceFile, transformedFile, sourceFile).replace(BLANK_LINE_REGEXP, "");
196
+ return (0, import_prettier.formatPrettier)(text, { parser: "typescript" });
161
197
  };
162
- export {
198
+ // Annotate the CommonJS export names for ESM import in node:
199
+ 0 && (module.exports = {
163
200
  createPropAppender,
164
201
  createPropFilter,
165
202
  readModuleExports,
166
203
  transformModuleImportsAndExports
167
- };
204
+ });
168
205
  //# sourceMappingURL=typescript.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/typescript.ts"],
4
4
  "sourcesContent": ["import ts from 'typescript';\n\nimport { formatPrettier } from './prettier.js';\n\ntype Props = ts.NodeArray<ts.ObjectLiteralElementLike>;\n\ntype Transformer<T> = (context: ts.TransformationContext | null, props: T) => T;\n\nconst BLANK_LINE_PLACEHOLDER = ' __BLANK_LINE_PLACEHOLDER__';\nconst BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, 'g');\n\n/**\n * Append a placeholder comment to the start of a node.\n *\n * Blank lines can be annotated and preserved through the TypeScript printer\n * when this is paired with a dodgy `String.prototype.replace` post-processor.\n */\nconst withLeadingBlankLinePlaceholder = <T extends ts.Node>(node: T) =>\n ts.addSyntheticLeadingComment(\n node,\n ts.SyntaxKind.SingleLineCommentTrivia,\n BLANK_LINE_PLACEHOLDER,\n true,\n );\n\n/**\n * Create the following expression:\n *\n * ```javascript\n * export default {};\n * ```\n */\nconst createExportDefaultObjectLiteralExpression = (\n factory: ts.NodeFactory,\n props: Props,\n callExpression?: ts.Expression,\n): ts.ExportAssignment =>\n factory.createExportAssignment(\n undefined,\n undefined,\n callExpression === undefined\n ? factory.createObjectLiteralExpression(props, true)\n : factory.createCallExpression(callExpression, undefined, [\n factory.createObjectLiteralExpression(props, true),\n ]),\n );\n\nconst createImportFromExpression = (\n factory: ts.NodeFactory,\n moduleName: string,\n importNames: string | string[],\n) => {\n const importClause =\n typeof importNames === 'string'\n ? factory.createImportClause(\n false,\n factory.createIdentifier(importNames),\n undefined,\n )\n : factory.createImportClause(\n false,\n undefined,\n factory.createNamedImports(\n importNames.map((importName) =>\n factory.createImportSpecifier(\n false,\n undefined,\n factory.createIdentifier(importName),\n ),\n ),\n ),\n );\n\n return factory.createImportDeclaration(\n undefined,\n importClause,\n factory.createStringLiteral(moduleName),\n );\n};\n\nconst getPropName = (prop: ts.ObjectLiteralElementLike) =>\n ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)\n ? prop.name.escapedText.toString()\n : undefined;\n\nconst expressionAsDefaultExport = (\n context: ts.TransformationContext,\n transformProps: Transformer<Props>,\n expression: ts.Expression,\n): ts.ExportAssignment | null =>\n withLeadingBlankLinePlaceholder(\n (() => {\n // {}\n if (ts.isObjectLiteralExpression(expression)) {\n const props = transformProps(context, expression.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n );\n }\n\n // fn({})\n if (\n ts.isCallExpression(expression) &&\n expression.arguments.length === 1 &&\n expression.arguments[0]\n ) {\n const [firstArgument] = expression.arguments;\n\n if (ts.isObjectLiteralExpression(firstArgument)) {\n const props = transformProps(context, firstArgument.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n expression.expression,\n );\n }\n }\n\n // Anything else\n return context.factory.createExportAssignment(\n undefined,\n undefined,\n expression,\n );\n })(),\n );\n\n/**\n * Mutate `const x = require('')` into `import x from ''`:\n *\n * ```javascript\n * const x = require('');\n *\n * const { x } = require('');\n * ```\n *\n * There's no recursion needed here as we expect the import statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst requireImportsTransformer: ts.TransformerFactory<ts.Node> =\n (context) => (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n let declaration, moduleName;\n\n if (\n ts.isVariableStatement(node) &&\n node.declarationList.declarations.length === 1 &&\n node.declarationList.declarations[0] &&\n ts.isVariableDeclaration(\n (declaration = node.declarationList.declarations[0]),\n ) &&\n declaration.initializer &&\n ts.isCallExpression(declaration.initializer) &&\n declaration.initializer.arguments.length === 1 &&\n declaration.initializer.arguments[0] &&\n ts.isStringLiteral(\n (moduleName = declaration.initializer.arguments[0]),\n ) &&\n ts.isIdentifier(declaration.initializer.expression) &&\n declaration.initializer.expression.text === 'require'\n ) {\n // const x\n if (ts.isIdentifier(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.text,\n );\n }\n\n // const { x }\n if (ts.isObjectBindingPattern(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.elements.flatMap((element) =>\n ts.isIdentifier(element.name) ? [element.name.text] : [],\n ),\n );\n }\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to mutate `module.exports` and `export default`:\n *\n * ```javascript\n * export default {};\n *\n * module.exports = {};\n * ```\n *\n * If the export is a call expression with a single argument, it will try to\n * transform the props of that argument.\n *\n * ```javascript\n * module.exports = fn({});\n * ```\n *\n * There's no recursion needed here as we expect the export statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst createModuleExportsTransformer =\n (transformProps: Transformer<Props>): ts.TransformerFactory<ts.Node> =>\n (context) =>\n (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n // module.exports =\n if (\n ts.isExpressionStatement(node) &&\n ts.isBinaryExpression(node.expression) &&\n ts.isPropertyAccessExpression(node.expression.left) &&\n ts.isIdentifier(node.expression.left.expression) &&\n node.expression.left.expression.escapedText.toString() === 'module' &&\n node.expression.left.name.text === 'exports' &&\n node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken\n ) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression.right,\n ) ?? node\n );\n }\n\n // export default\n if (ts.isExportAssignment(node)) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression,\n ) ?? node\n );\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to filter out unspecified props from an object literal.\n */\nexport const createPropFilter =\n (names: string[]): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(names);\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray(\n props.filter((prop) => nameSet.has(getPropName(prop))),\n );\n };\n\nexport const createPropAppender =\n (appendingProps: Props): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(\n props.map(getPropName).filter((prop) => typeof prop === 'string'),\n );\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray([\n ...props,\n ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop))),\n ]);\n };\n\n/**\n * Read out `export default` or `module.exports` props from a source file.\n *\n * The props can then be used when transforming another source file.\n */\nexport const readModuleExports = async (\n inputFile: string,\n): Promise<Props | undefined> => {\n let result: Props | undefined;\n\n await transformModuleImportsAndExports(\n inputFile,\n (_, props) => (result = props),\n );\n\n return result;\n};\n\n/**\n * Mutate imports and exports in a source file:\n *\n * - Convert `const x = require('')` into `import x from ''`\n * - Convert `module.exports =` into `export default`\n * - Run a transformer over the exported props\n */\nexport const transformModuleImportsAndExports = async (\n inputFile: string,\n transformProps: Transformer<Props>,\n): Promise<string> => {\n const sourceFile = ts.createSourceFile('', inputFile, ts.ScriptTarget.Latest);\n\n const moduleExportsTransformer =\n createModuleExportsTransformer(transformProps);\n\n const result = ts.transform(sourceFile, [\n requireImportsTransformer,\n moduleExportsTransformer,\n ]);\n\n const [transformedFile] = result.transformed;\n\n if (!transformedFile) {\n throw new Error(\n `Could not get transformed result for ${JSON.stringify(result)}`,\n );\n }\n\n const text = ts\n .createPrinter()\n .printNode(ts.EmitHint.SourceFile, transformedFile, sourceFile)\n .replace(BLANK_LINE_REGEXP, '');\n\n return formatPrettier(text, { parser: 'typescript' });\n};\n"],
5
- "mappings": "AAAA,OAAO,QAAQ;AAEf,SAAS,sBAAsB;AAM/B,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB,IAAI,OAAO,KAAK,sBAAsB,IAAI,GAAG;AAQvE,MAAM,kCAAkC,CAAoB,SAC1D,GAAG;AAAA,EACD;AAAA,EACA,GAAG,WAAW;AAAA,EACd;AAAA,EACA;AACF;AASF,MAAM,6CAA6C,CACjD,SACA,OACA,mBAEA,QAAQ;AAAA,EACN;AAAA,EACA;AAAA,EACA,mBAAmB,SACf,QAAQ,8BAA8B,OAAO,IAAI,IACjD,QAAQ,qBAAqB,gBAAgB,QAAW;AAAA,IACtD,QAAQ,8BAA8B,OAAO,IAAI;AAAA,EACnD,CAAC;AACP;AAEF,MAAM,6BAA6B,CACjC,SACA,YACA,gBACG;AACH,QAAM,eACJ,OAAO,gBAAgB,WACnB,QAAQ;AAAA,IACN;AAAA,IACA,QAAQ,iBAAiB,WAAW;AAAA,IACpC;AAAA,EACF,IACA,QAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,MACN,YA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AAAA,EACvD;AACF;AAEK,MAAM,qBACX,CAAC,mBACD,CAAC,SAAS,UAAU;AAClB,QAAM,UAAU,IAAI;AAAA,IAClB,MAAM,IAAI,WAAW,EAAE,OAAO,CAAC,SAAS,OAAO,SAAS,QAAQ;AAAA,EAClE;AAEA,QAAM,UAAU,SAAS,WAAW,kBAAAA,QAAG;AAEvC,SAAO,QAAQ,gBAAgB;AAAA,IAC7B,GAAG;AAAA,IACH,GAAG,eAAe,OAAO,CAAC,SAAS,CAAC,QAAQ,IAAI,YAAY,IAAI,CAAC,CAAC;AAAA,EACpE,CAAC;AACH;AAOK,MAAM,oBAAoB,OAC/B,cAC+B;AAC/B,MAAI;AAEJ,QAAM;AAAA,IACJ;AAAA,IACA,CAAC,GAAG,UAAW,SAAS;AAAA,EAC1B;AAEA,SAAO;AACT;AASO,MAAM,mCAAmC,OAC9C,WACA,mBACoB;AACpB,QAAM,aAAa,kBAAAA,QAAG,iBAAiB,IAAI,WAAW,kBAAAA,QAAG,aAAa,MAAM;AAE5E,QAAM,2BACJ,+BAA+B,cAAc;AAE/C,QAAM,SAAS,kBAAAA,QAAG,UAAU,YAAY;AAAA,IACtC;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,CAAC,eAAe,IAAI,OAAO;AAEjC,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI;AAAA,MACR,wCAAwC,KAAK,UAAU,MAAM,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,QAAM,OAAO,kBAAAA,QACV,cAAc,EACd,UAAU,kBAAAA,QAAG,SAAS,YAAY,iBAAiB,UAAU,EAC7D,QAAQ,mBAAmB,EAAE;AAEhC,aAAO,gCAAe,MAAM,EAAE,QAAQ,aAAa,CAAC;AACtD;",
6
+ "names": ["ts"]
7
7
  }
@@ -1,22 +1,11 @@
1
- import type { PackageJson as ReadPackageUpPackageJson } from 'read-package-up';
1
+ import type { PackageJson as TypeFestPackageJson } from 'type-fest';
2
2
  import type { ProjectType } from '../../utils/manifest.js';
3
3
  import type { PackageManagerConfig } from '../../utils/packageManager.js';
4
4
  export type { TsConfigJson } from 'type-fest';
5
- export type PackageJson = ReadPackageUpPackageJson & Record<string, unknown> & {
6
- skuba?: {
7
- entryPoint?: string | null;
8
- template?: string;
9
- type?: string;
10
- version: string;
11
- };
12
- };
13
- export type ReadResult = {
14
- packageJson: PackageJson;
15
- path: string;
16
- };
5
+ export type PackageJson = TypeFestPackageJson & Record<string, unknown>;
17
6
  export interface DependencySet {
18
- dependencies: Record<string, string | undefined>;
19
- devDependencies: Record<string, string | undefined>;
7
+ dependencies: Record<string, string>;
8
+ devDependencies: Record<string, string>;
20
9
  type: ProjectType;
21
10
  }
22
11
  export type DependencyDiff = Record<string, {
@@ -1 +1,17 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
1
17
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
3
+ "sources": ["../../../src/cli/configure/types.ts"],
4
+ "sourcesContent": ["import type { PackageJson as TypeFestPackageJson } from 'type-fest';\n\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { PackageManagerConfig } from '../../utils/packageManager.js';\n\nexport type { TsConfigJson } from 'type-fest';\n\nexport type PackageJson = TypeFestPackageJson & Record<string, unknown>;\n\nexport interface DependencySet {\n dependencies: Record<string, string>;\n devDependencies: Record<string, string>;\n type: ProjectType;\n}\n\nexport type DependencyDiff = Record<\n string,\n { operation: string; version: string }\n>;\n\ntype FileProcessor = (\n file: string | undefined,\n files: Files,\n initialFiles: Readonly<Files>,\n) => Promise<string | undefined> | string | undefined;\n\nexport type FileDiff = Record<\n string,\n { data: string | undefined; operation: string }\n>;\n\nexport type Files = Record<string, string | undefined>;\n\nexport type Module = Record<string, FileProcessor>;\n\nexport interface Options {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n packageManager: PackageManagerConfig;\n type: ProjectType;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,47 @@
1
- import { styleText } from "node:util";
2
- import { hasDebugFlag } from "../../utils/args.js";
3
- import { createLogger, log } from "../../utils/logging.js";
4
- import { runESLint } from "../adapter/eslint.js";
5
- import { runPrettier } from "../adapter/prettier.js";
6
- import { internalLint } from "../lint/internal.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 format_exports = {};
20
+ __export(format_exports, {
21
+ format: () => format
22
+ });
23
+ module.exports = __toCommonJS(format_exports);
24
+ var import_node_util = require("node:util");
25
+ var import_args = require("../../utils/args.js");
26
+ var import_logging = require("../../utils/logging.js");
27
+ var import_eslint = require("../adapter/eslint.js");
28
+ var import_prettier = require("../adapter/prettier.js");
29
+ var import_internal = require("../lint/internal.js");
7
30
  const format = async (args = process.argv.slice(2), overrideConfigFile) => {
8
- const debug = hasDebugFlag(args);
9
- log.plain(styleText("blueBright", "skuba lints"));
10
- const internal = await internalLint("format", {
31
+ const debug = (0, import_args.hasDebugFlag)(args);
32
+ import_logging.log.plain((0, import_node_util.styleText)("blueBright", "skuba lints"));
33
+ const internal = await (0, import_internal.internalLint)("format", {
11
34
  debug,
12
35
  additionalFlags: args.includes("--force-apply-all-patches") ? ["--force-apply-all-patches"] : [],
13
36
  serial: true
14
37
  });
15
- const logger = createLogger({ debug });
16
- log.newline();
17
- log.plain(styleText("magenta", "ESLint"));
18
- const eslint = await runESLint("format", logger, overrideConfigFile);
19
- log.newline();
20
- log.plain(styleText("cyan", "Prettier"));
21
- const prettier = await runPrettier("format", logger);
38
+ const logger = (0, import_logging.createLogger)({ debug });
39
+ import_logging.log.newline();
40
+ import_logging.log.plain((0, import_node_util.styleText)("magenta", "ESLint"));
41
+ const eslint = await (0, import_eslint.runESLint)("format", logger, overrideConfigFile);
42
+ import_logging.log.newline();
43
+ import_logging.log.plain((0, import_node_util.styleText)("cyan", "Prettier"));
44
+ const prettier = await (0, import_prettier.runPrettier)("format", logger);
22
45
  if (eslint.ok && prettier.ok && internal.ok) {
23
46
  return;
24
47
  }
@@ -27,11 +50,12 @@ const format = async (args = process.argv.slice(2), overrideConfigFile) => {
27
50
  ...prettier.ok ? [] : ["Prettier"],
28
51
  ...internal.ok ? [] : ["skuba"]
29
52
  ];
30
- log.newline();
31
- log.err(tools.join(", "), "found issues that require triage.");
53
+ import_logging.log.newline();
54
+ import_logging.log.err(tools.join(", "), "found issues that require triage.");
32
55
  process.exitCode = 1;
33
56
  };
34
- export {
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
35
59
  format
36
- };
60
+ });
37
61
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/format/index.ts"],
4
4
  "sourcesContent": ["import { styleText } from 'node:util';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { createLogger, log } from '../../utils/logging.js';\nimport { runESLint } from '../adapter/eslint.js';\nimport { runPrettier } from '../adapter/prettier.js';\nimport { internalLint } from '../lint/internal.js';\n\nexport const format = async (\n args = process.argv.slice(2),\n overrideConfigFile?: string,\n): Promise<void> => {\n const debug = hasDebugFlag(args);\n\n log.plain(styleText('blueBright', 'skuba lints'));\n\n const internal = await internalLint('format', {\n debug,\n additionalFlags: args.includes('--force-apply-all-patches')\n ? ['--force-apply-all-patches']\n : [],\n serial: true,\n });\n\n const logger = createLogger({ debug });\n\n log.newline();\n log.plain(styleText('magenta', 'ESLint'));\n\n const eslint = await runESLint('format', logger, overrideConfigFile);\n\n log.newline();\n log.plain(styleText('cyan', 'Prettier'));\n\n const prettier = await runPrettier('format', logger);\n\n if (eslint.ok && prettier.ok && internal.ok) {\n return;\n }\n\n const tools = [\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ...(internal.ok ? [] : ['skuba']),\n ];\n\n log.newline();\n log.err(tools.join(', '), 'found issues that require triage.');\n\n process.exitCode = 1;\n};\n"],
5
- "mappings": "AAAA,SAAS,iBAAiB;AAE1B,SAAS,oBAAoB;AAC7B,SAAS,cAAc,WAAW;AAClC,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAEtB,MAAM,SAAS,OACpB,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,uBACkB;AAClB,QAAM,QAAQ,aAAa,IAAI;AAE/B,MAAI,MAAM,UAAU,cAAc,aAAa,CAAC;AAEhD,QAAM,WAAW,MAAM,aAAa,UA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BAAa,EAAE,MAAM,CAAC;AAErC,qBAAI,QAAQ;AACZ,qBAAI,UAAM,4BAAU,WAAW,QAAQ,CAAC;AAExC,QAAM,SAAS,UAAM,yBAAU,UAAU,QAAQ,kBAAkB;AAEnE,qBAAI,QAAQ;AACZ,qBAAI,UAAM,4BAAU,QAAQ,UAAU,CAAC;AAEvC,QAAM,WAAW,UAAM,6BAAY,UAAU,MAAM;AAEnD,MAAI,OAAO,MAAM,SAAS,MAAM,SAAS,IAAI;AAC3C;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;AAAA,IAC9B,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,UAAU;AAAA,IAClC,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,OAAO;AAAA,EACjC;AAEA,qBAAI,QAAQ;AACZ,qBAAI,IAAI,MAAM,KAAK,IAAI,GAAG,mCAAmC;AAE7D,UAAQ,WAAW;AACrB;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,34 @@
1
- import { showHelp } from "../../utils/help.js";
2
- import { showLogoAndVersionInfo } from "../../utils/logo.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 help_exports = {};
20
+ __export(help_exports, {
21
+ help: () => help
22
+ });
23
+ module.exports = __toCommonJS(help_exports);
24
+ var import_help = require("../../utils/help.js");
25
+ var import_logo = require("../../utils/logo.js");
3
26
  const help = async () => {
4
- await showLogoAndVersionInfo();
5
- showHelp();
27
+ await (0, import_logo.showLogoAndVersionInfo)();
28
+ (0, import_help.showHelp)();
6
29
  };
7
- export {
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
8
32
  help
9
- };
33
+ });
10
34
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/help/index.ts"],
4
4
  "sourcesContent": ["import { showHelp } from '../../utils/help.js';\nimport { showLogoAndVersionInfo } from '../../utils/logo.js';\n\nexport const help = async () => {\n await showLogoAndVersionInfo();\n\n showHelp();\n};\n"],
5
- "mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AAEhC,MAAM,OAAO,YAAY;AAC9B,QAAM,uBAAuB;AAE7B,WAAS;AACX;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AACzB,kBAAuC;AAEhC,MAAM,OAAO,YAAY;AAC9B,YAAM,oCAAuB;AAE7B,4BAAS;AACX;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,7 @@ export declare const runForm: <T = Record<string, string>>(props: {
6
6
  message: string;
7
7
  name: string;
8
8
  }) => Promise<T>;
9
- export declare const getTemplateConfig: (dir: string) => Promise<TemplateConfig>;
9
+ export declare const getTemplateConfig: (dir: string) => TemplateConfig;
10
10
  export declare const configureFromPrompt: () => Promise<InitConfig>;
11
11
  export declare const readJSONFromStdIn: () => Promise<unknown>;
12
12
  export declare const getConfig: () => Promise<{