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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/config/eslint.js +1 -1
  2. package/config/jest.js +1 -0
  3. package/config/prettier.d.ts +4 -8
  4. package/config/prettier.js +2 -10
  5. package/jest/moduleNameMapper.js +64 -0
  6. package/jest/transform.js +62 -0
  7. package/jest/tsConfig.js +26 -0
  8. package/jest-preset.js +37 -0
  9. package/lib/api/jest/index.d.ts +15 -0
  10. package/lib/api/jest/index.js +59 -0
  11. package/lib/api/jest/index.js.map +7 -0
  12. package/lib/cli/adapter/eslint.js +45 -11
  13. package/lib/cli/adapter/eslint.js.map +2 -2
  14. package/lib/cli/adapter/prettier.js +67 -39
  15. package/lib/cli/adapter/prettier.js.map +2 -2
  16. package/lib/cli/build/args.js +42 -8
  17. package/lib/cli/build/args.js.map +2 -2
  18. package/lib/cli/build/assets.js +60 -28
  19. package/lib/cli/build/assets.js.map +2 -2
  20. package/lib/cli/build/esbuild.js +45 -21
  21. package/lib/cli/build/esbuild.js.map +2 -2
  22. package/lib/cli/build/index.js +45 -21
  23. package/lib/cli/build/index.js.map +1 -1
  24. package/lib/cli/build/tsc.js +59 -22
  25. package/lib/cli/build/tsc.js.map +2 -2
  26. package/lib/cli/buildPackage/index.js +32 -8
  27. package/lib/cli/buildPackage/index.js.map +1 -1
  28. package/lib/cli/configure/analyseConfiguration.js +50 -16
  29. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  30. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  31. package/lib/cli/configure/analyseDependencies.js +59 -25
  32. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  33. package/lib/cli/configure/analysis/diff.js +29 -5
  34. package/lib/cli/configure/analysis/diff.js.map +1 -1
  35. package/lib/cli/configure/analysis/files.js +42 -8
  36. package/lib/cli/configure/analysis/files.js.map +2 -2
  37. package/lib/cli/configure/analysis/git.js +46 -12
  38. package/lib/cli/configure/analysis/git.js.map +2 -2
  39. package/lib/cli/configure/analysis/package.d.ts +3 -2
  40. package/lib/cli/configure/analysis/package.js +45 -10
  41. package/lib/cli/configure/analysis/package.js.map +3 -3
  42. package/lib/cli/configure/analysis/project.js +50 -18
  43. package/lib/cli/configure/analysis/project.js.map +2 -2
  44. package/lib/cli/configure/dependencies/index.js +35 -7
  45. package/lib/cli/configure/dependencies/index.js.map +1 -1
  46. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +28 -4
  47. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  48. package/lib/cli/configure/dependencies/seekKoala.js +28 -4
  49. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  50. package/lib/cli/configure/dependencies/skuba.js +28 -4
  51. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  52. package/lib/cli/configure/dependencies/skubaDeps.js +26 -2
  53. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  54. package/lib/cli/configure/dependencies/skubaDive.js +29 -4
  55. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  56. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  57. package/lib/cli/configure/ensureTemplateCompletion.js +61 -33
  58. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  59. package/lib/cli/configure/getEntryPoint.d.ts +1 -1
  60. package/lib/cli/configure/getEntryPoint.js +48 -14
  61. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  62. package/lib/cli/configure/getProjectType.d.ts +1 -1
  63. package/lib/cli/configure/getProjectType.js +35 -14
  64. package/lib/cli/configure/getProjectType.js.map +2 -2
  65. package/lib/cli/configure/index.js +84 -50
  66. package/lib/cli/configure/index.js.map +2 -2
  67. package/lib/cli/configure/modules/eslint.js +34 -10
  68. package/lib/cli/configure/modules/eslint.js.map +1 -1
  69. package/lib/cli/configure/modules/ignore.js +32 -8
  70. package/lib/cli/configure/modules/ignore.js.map +1 -1
  71. package/lib/cli/configure/modules/index.js +44 -18
  72. package/lib/cli/configure/modules/index.js.map +2 -2
  73. package/lib/cli/configure/modules/jest.d.ts +2 -0
  74. package/lib/cli/configure/modules/jest.js +86 -0
  75. package/lib/cli/configure/modules/jest.js.map +7 -0
  76. package/lib/cli/configure/modules/nodemon.js +28 -4
  77. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  78. package/lib/cli/configure/modules/package.js +34 -10
  79. package/lib/cli/configure/modules/package.js.map +1 -1
  80. package/lib/cli/configure/modules/prettier.js +35 -11
  81. package/lib/cli/configure/modules/prettier.js.map +1 -1
  82. package/lib/cli/configure/modules/renovate.js +40 -17
  83. package/lib/cli/configure/modules/renovate.js.map +2 -2
  84. package/lib/cli/configure/modules/serverless.js +26 -2
  85. package/lib/cli/configure/modules/serverless.js.map +1 -1
  86. package/lib/cli/configure/modules/tslint.js +28 -4
  87. package/lib/cli/configure/modules/tslint.js.map +1 -1
  88. package/lib/cli/configure/processing/configFile.js +39 -3
  89. package/lib/cli/configure/processing/configFile.js.map +1 -1
  90. package/lib/cli/configure/processing/deleteFiles.js +26 -2
  91. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  92. package/lib/cli/configure/processing/javascript.js +27 -2
  93. package/lib/cli/configure/processing/javascript.js.map +1 -1
  94. package/lib/cli/configure/processing/json.js +31 -6
  95. package/lib/cli/configure/processing/json.js.map +1 -1
  96. package/lib/cli/configure/processing/loadFiles.js +26 -2
  97. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  98. package/lib/cli/configure/processing/module.js +28 -4
  99. package/lib/cli/configure/processing/module.js.map +1 -1
  100. package/lib/cli/configure/processing/package.d.ts +67 -1
  101. package/lib/cli/configure/processing/package.js +45 -8
  102. package/lib/cli/configure/processing/package.js.map +3 -3
  103. package/lib/cli/configure/processing/prettier.js +38 -4
  104. package/lib/cli/configure/processing/prettier.js.map +2 -2
  105. package/lib/cli/configure/processing/record.js +41 -5
  106. package/lib/cli/configure/processing/record.js.map +2 -2
  107. package/lib/cli/configure/processing/typescript.js +63 -26
  108. package/lib/cli/configure/processing/typescript.js.map +2 -2
  109. package/lib/cli/configure/types.d.ts +4 -15
  110. package/lib/cli/configure/types.js +16 -0
  111. package/lib/cli/configure/types.js.map +3 -3
  112. package/lib/cli/format/index.js +44 -20
  113. package/lib/cli/format/index.js.map +1 -1
  114. package/lib/cli/help/index.js +30 -6
  115. package/lib/cli/help/index.js.map +1 -1
  116. package/lib/cli/init/getConfig.d.ts +1 -1
  117. package/lib/cli/init/getConfig.js +111 -76
  118. package/lib/cli/init/getConfig.js.map +3 -3
  119. package/lib/cli/init/git.d.ts +1 -0
  120. package/lib/cli/init/git.js +88 -16
  121. package/lib/cli/init/git.js.map +3 -3
  122. package/lib/cli/init/index.js +98 -67
  123. package/lib/cli/init/index.js.map +2 -2
  124. package/lib/cli/init/prompts.d.ts +6 -5
  125. package/lib/cli/init/prompts.js +54 -27
  126. package/lib/cli/init/prompts.js.map +2 -2
  127. package/lib/cli/init/types.js +41 -7
  128. package/lib/cli/init/types.js.map +1 -1
  129. package/lib/cli/init/validation.js +30 -2
  130. package/lib/cli/init/validation.js.map +1 -1
  131. package/lib/cli/init/writePackageJson.js +42 -8
  132. package/lib/cli/init/writePackageJson.js.map +2 -2
  133. package/lib/cli/lint/annotate/buildkite/eslint.js +37 -3
  134. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  135. package/lib/cli/lint/annotate/buildkite/index.js +45 -11
  136. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  137. package/lib/cli/lint/annotate/buildkite/internal.js +37 -3
  138. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  139. package/lib/cli/lint/annotate/buildkite/prettier.js +37 -3
  140. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  141. package/lib/cli/lint/annotate/buildkite/tsc.js +37 -3
  142. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  143. package/lib/cli/lint/annotate/github/eslint.js +26 -2
  144. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  145. package/lib/cli/lint/annotate/github/index.js +45 -11
  146. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  147. package/lib/cli/lint/annotate/github/internal.js +26 -2
  148. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  149. package/lib/cli/lint/annotate/github/prettier.js +26 -2
  150. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  151. package/lib/cli/lint/annotate/github/tsc.js +28 -4
  152. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  153. package/lib/cli/lint/annotate/index.js +30 -6
  154. package/lib/cli/lint/annotate/index.js.map +1 -1
  155. package/lib/cli/lint/autofix.js +73 -37
  156. package/lib/cli/lint/autofix.js.map +1 -1
  157. package/lib/cli/lint/eslint.js +51 -16
  158. package/lib/cli/lint/eslint.js.map +3 -3
  159. package/lib/cli/lint/external.js +51 -19
  160. package/lib/cli/lint/external.js.map +2 -2
  161. package/lib/cli/lint/index.js +49 -25
  162. package/lib/cli/lint/index.js.map +1 -1
  163. package/lib/cli/lint/internal.js +42 -18
  164. package/lib/cli/lint/internal.js.map +1 -1
  165. package/lib/cli/lint/internalLints/detectBadCodeowners.js +33 -8
  166. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  167. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +45 -11
  168. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +2 -2
  169. package/lib/cli/lint/internalLints/patchRenovateConfig.js +55 -21
  170. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  171. package/lib/cli/lint/internalLints/refreshConfigFiles.js +63 -32
  172. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
  173. package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
  174. package/lib/cli/lint/internalLints/upgrade/index.js +53 -22
  175. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  176. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +28 -4
  177. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  178. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +45 -11
  179. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  180. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +30 -6
  181. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  182. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +65 -34
  183. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  184. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +46 -11
  185. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  186. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +28 -4
  187. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  188. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +59 -23
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +28 -4
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +46 -11
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +30 -6
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +46 -11
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +46 -11
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +28 -4
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +46 -11
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +67 -29
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +34 -10
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +45 -11
  209. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  210. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +0 -4
  211. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +63 -18
  212. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
  213. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +50 -15
  214. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js +40 -0
  216. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  217. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  218. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
  219. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  220. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js +55 -0
  221. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  222. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +51 -17
  223. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  224. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +34 -10
  225. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  226. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +44 -10
  227. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  228. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +46 -12
  229. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  230. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +28 -4
  231. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  232. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +49 -15
  233. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  234. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +45 -11
  235. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  236. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +34 -10
  237. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +45 -11
  239. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  240. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +45 -11
  241. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  242. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +47 -13
  243. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  244. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +28 -4
  245. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  246. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +45 -11
  247. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  248. package/lib/cli/lint/prettier.js +50 -15
  249. package/lib/cli/lint/prettier.js.map +3 -3
  250. package/lib/cli/lint/tsc.js +28 -4
  251. package/lib/cli/lint/tsc.js.map +1 -1
  252. package/lib/cli/lint/types.js +16 -0
  253. package/lib/cli/lint/types.js.map +3 -3
  254. package/lib/cli/migrate/index.d.ts +5 -0
  255. package/lib/cli/migrate/index.js +79 -15
  256. package/lib/cli/migrate/index.js.map +2 -2
  257. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  258. package/lib/cli/migrate/nodeVersion/checks.js +51 -120
  259. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  260. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  261. package/lib/cli/migrate/nodeVersion/index.js +239 -65
  262. package/lib/cli/migrate/nodeVersion/index.js.map +3 -3
  263. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  264. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  265. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  266. package/lib/cli/node/index.js +57 -20
  267. package/lib/cli/node/index.js.map +3 -3
  268. package/lib/cli/release/index.js +28 -4
  269. package/lib/cli/release/index.js.map +1 -1
  270. package/lib/cli/start/index.js +50 -16
  271. package/lib/cli/start/index.js.map +3 -3
  272. package/lib/cli/test/index.js +44 -4
  273. package/lib/cli/test/index.js.map +2 -2
  274. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  275. package/lib/cli/test/reporters/github/annotations.js +102 -0
  276. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  277. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  278. package/lib/cli/test/reporters/github/index.js +74 -0
  279. package/lib/cli/test/reporters/github/index.js.map +7 -0
  280. package/lib/cli/version/index.js +30 -6
  281. package/lib/cli/version/index.js.map +1 -1
  282. package/lib/index.d.ts +1 -0
  283. package/lib/index.js +46 -6
  284. package/lib/index.js.map +2 -2
  285. package/lib/skuba.js +45 -26
  286. package/lib/skuba.js.map +3 -3
  287. package/lib/utils/args.js +43 -6
  288. package/lib/utils/args.js.map +2 -2
  289. package/lib/utils/command.js +42 -4
  290. package/lib/utils/command.js.map +3 -3
  291. package/lib/utils/copy.js +57 -20
  292. package/lib/utils/copy.js.map +2 -2
  293. package/lib/utils/dir.js +72 -32
  294. package/lib/utils/dir.js.map +2 -2
  295. package/lib/utils/env.js +26 -2
  296. package/lib/utils/env.js.map +1 -1
  297. package/lib/utils/error.js +47 -10
  298. package/lib/utils/error.js.map +1 -1
  299. package/lib/utils/exec.js +61 -23
  300. package/lib/utils/exec.js.map +3 -3
  301. package/lib/utils/fs.js +40 -6
  302. package/lib/utils/fs.js.map +2 -2
  303. package/lib/utils/help.js +30 -6
  304. package/lib/utils/help.js.map +1 -1
  305. package/lib/utils/logging.js +38 -11
  306. package/lib/utils/logging.js.map +1 -1
  307. package/lib/utils/logo.js +48 -24
  308. package/lib/utils/logo.js.map +1 -1
  309. package/lib/utils/manifest.d.ts +2 -3
  310. package/lib/utils/manifest.js +48 -8
  311. package/lib/utils/manifest.js.map +3 -3
  312. package/lib/utils/npmrc.js +26 -2
  313. package/lib/utils/npmrc.js.map +1 -1
  314. package/lib/utils/packageManager.js +49 -12
  315. package/lib/utils/packageManager.js.map +2 -2
  316. package/lib/utils/port.js +39 -4
  317. package/lib/utils/port.js.map +2 -2
  318. package/lib/utils/sleep.js +26 -2
  319. package/lib/utils/sleep.js.map +1 -1
  320. package/lib/utils/template.d.ts +1 -1
  321. package/lib/utils/template.js +60 -19
  322. package/lib/utils/template.js.map +3 -3
  323. package/lib/utils/validation.js +31 -2
  324. package/lib/utils/validation.js.map +1 -1
  325. package/lib/utils/version.js +46 -9
  326. package/lib/utils/version.js.map +2 -2
  327. package/lib/utils/wait.js +32 -7
  328. package/lib/utils/wait.js.map +1 -1
  329. package/lib/utils/worker.js +35 -10
  330. package/lib/utils/worker.js.map +1 -1
  331. package/lib/wrapper/function-arguments.d.js +1 -0
  332. package/lib/wrapper/functionHandler.js +49 -18
  333. package/lib/wrapper/functionHandler.js.map +2 -2
  334. package/lib/wrapper/http.js +43 -8
  335. package/lib/wrapper/http.js.map +2 -2
  336. package/lib/wrapper/index.js +7 -6
  337. package/lib/wrapper/index.js.map +1 -1
  338. package/lib/wrapper/main.js +42 -8
  339. package/lib/wrapper/main.js.map +3 -3
  340. package/lib/wrapper/requestListener.js +47 -13
  341. package/lib/wrapper/requestListener.js.map +2 -2
  342. package/lib/wrapper/server.js +28 -4
  343. package/lib/wrapper/server.js.map +1 -1
  344. package/package.json +42 -43
  345. package/template/base/_.prettierrc.js +1 -1
  346. package/template/base/_eslint.config.js +1 -1
  347. package/template/base/_pnpm-workspace.yaml +4 -3
  348. package/template/base/jest.config.ts +19 -0
  349. package/template/base/jest.setup.ts +3 -0
  350. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  351. package/template/express-rest-api/.nvmrc +1 -1
  352. package/template/express-rest-api/package.json +8 -9
  353. package/template/express-rest-api/skuba.template.js +1 -1
  354. package/template/express-rest-api/src/app.test.ts +0 -1
  355. package/template/greeter/.buildkite/pipeline.yml +1 -1
  356. package/template/greeter/.nvmrc +1 -1
  357. package/template/greeter/package.json +4 -5
  358. package/template/greeter/skuba.template.js +1 -1
  359. package/template/greeter/src/app.test.ts +1 -3
  360. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  361. package/template/koa-rest-api/.nvmrc +1 -1
  362. package/template/koa-rest-api/package.json +9 -11
  363. package/template/koa-rest-api/skuba.template.js +1 -1
  364. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +0 -2
  365. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +0 -2
  366. package/template/koa-rest-api/src/app.test.ts +0 -2
  367. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  368. package/template/koa-rest-api/src/framework/validation.test.ts +0 -2
  369. package/template/koa-rest-api/src/testing/metrics.ts +0 -2
  370. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  371. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  372. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +7 -19
  373. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +9 -11
  374. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  375. package/template/lambda-sqs-worker-cdk/infra/config.ts +2 -4
  376. package/template/lambda-sqs-worker-cdk/package.json +9 -9
  377. package/template/lambda-sqs-worker-cdk/skuba.template.js +13 -1
  378. package/template/lambda-sqs-worker-cdk/src/app.test.ts +13 -22
  379. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +0 -1
  380. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +31 -33
  381. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +2 -8
  382. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +2 -3
  383. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +3 -4
  384. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  385. package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
  386. package/template/oss-npm-package/.nvmrc +1 -1
  387. package/template/oss-npm-package/_package.json +0 -1
  388. package/template/oss-npm-package/skuba.template.js +1 -1
  389. package/template/oss-npm-package/src/index.test.ts +0 -2
  390. package/template/private-npm-package/.nvmrc +1 -1
  391. package/template/private-npm-package/_package.json +1 -2
  392. package/template/private-npm-package/skuba.template.js +2 -2
  393. package/template/private-npm-package/src/index.test.ts +0 -2
  394. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.d.ts +0 -6
  395. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js +0 -86
  396. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/addTypeModuleToPackageJson.js.map +0 -7
  397. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +0 -16
  398. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +0 -7
  399. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +0 -7
  400. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +0 -76
  401. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +0 -7
  402. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +0 -2
  403. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +0 -11
  404. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  405. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +0 -34
  406. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  407. package/lib/eslint.d.js +0 -1
  408. package/lib/eslint.d.js.map +0 -7
  409. package/template/base/vitest.config.ts +0 -25
  410. /package/lib/cli/lint/internalLints/upgrade/patches/{12.5.0 → 13.1.1}/index.d.ts +0 -0
  411. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
@@ -1,7 +1,31 @@
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 loadFiles_exports = {};
20
+ __export(loadFiles_exports, {
21
+ loadFiles: () => loadFiles
22
+ });
23
+ module.exports = __toCommonJS(loadFiles_exports);
1
24
  const loadFiles = (...filenames) => Object.fromEntries(
2
25
  filenames.map((filename) => [filename, (file) => file])
3
26
  );
4
- export {
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
5
29
  loadFiles
6
- };
30
+ });
7
31
  //# sourceMappingURL=loadFiles.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/loadFiles.ts"],
4
4
  "sourcesContent": ["import type { Module } from '../types.js';\n\n/**\n * Load files into cache to perform side effects in another module.\n */\nexport const loadFiles = (...filenames: string[]): Module =>\n Object.fromEntries(\n filenames.map((filename) => [filename, (file?: string) => file] as const),\n );\n"],
5
- "mappings": "AAKO,MAAM,YAAY,IAAI,cAC3B,OAAO;AAAA,EACL,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAkB,IAAI,CAAU;AAC1E;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,YAAY,IAAI,cAC3B,OAAO;AAAA,EACL,UAAU,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,SAAkB,IAAI,CAAU;AAC1E;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,28 @@
1
- import { createStringReplacer } from "../../../utils/copy.js";
2
- const replacePackageReferences = (props) => createStringReplacer([
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 module_exports = {};
20
+ __export(module_exports, {
21
+ replacePackageReferences: () => replacePackageReferences
22
+ });
23
+ module.exports = __toCommonJS(module_exports);
24
+ var import_copy = require("../../../utils/copy.js");
25
+ const replacePackageReferences = (props) => (0, import_copy.createStringReplacer)([
3
26
  {
4
27
  input: new RegExp(`(['"])${props.old.packageName}(['"/])`, "g"),
5
28
  output: `$1${props.new.packageName}$2`
@@ -9,7 +32,8 @@ const replacePackageReferences = (props) => createStringReplacer([
9
32
  output: props.new.repoSlug
10
33
  }
11
34
  ]);
12
- export {
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
13
37
  replacePackageReferences
14
- };
38
+ });
15
39
  //# sourceMappingURL=module.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/module.ts"],
4
4
  "sourcesContent": ["import { createStringReplacer } from '../../../utils/copy.js';\n\nexport const replacePackageReferences = (props: {\n old: {\n packageName: string;\n repoSlug: string;\n };\n new: {\n packageName: string;\n repoSlug: string;\n };\n}) =>\n createStringReplacer([\n {\n input: new RegExp(`(['\"])${props.old.packageName}(['\"/])`, 'g'),\n output: `$1${props.new.packageName}$2`,\n },\n {\n input: new RegExp(props.old.repoSlug, 'ig'),\n output: props.new.repoSlug,\n },\n ]);\n"],
5
- "mappings": "AAAA,SAAS,4BAA4B;AAE9B,MAAM,2BAA2B,CAAC,UAUvC,qBAAqB;AAAA,EACnB;AAAA,IACE,OAAO,IAAI,OAAO,SAAS,MAAM,IAAI,WAAW,WAAW,GAAG;AAAA,IAC9D,QAAQ,KAAK,MAAM,IAAI,WAAW;AAAA,EACpC;AAAA,EACA;AAAA,IACE,OAAO,IAAI,OAAO,MAAM,IAAI,UAAU,IAAI;AAAA,IAC1C,QAAQ,MAAM,IAAI;AAAA,EACpB;AACF,CAAC;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqC;AAE9B,MAAM,2BAA2B,CAAC,cAUvC,kCAAqB;AAAA,EACnB;AAAA,IACE,OAAO,IAAI,OAAO,SAAS,MAAM,IAAI,WAAW,WAAW,GAAG;AAAA,IAC9D,QAAQ,KAAK,MAAM,IAAI,WAAW;AAAA,EACpC;AAAA,EACA;AAAA,IACE,OAAO,IAAI,OAAO,MAAM,IAAI,UAAU,IAAI;AAAA,IAC1C,QAAQ,MAAM,IAAI;AAAA,EACpB;AACF,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,71 @@
1
1
  import type { PackageJson } from '../types.js';
2
2
  export declare const formatPackage: (rawData: PackageJson) => Promise<string>;
3
3
  export declare const parsePackage: (input: string | undefined) => PackageJson | undefined;
4
- export declare const createDependencyFilter: (names: readonly string[], type: "dependencies" | "devDependencies") => (data: PackageJson) => PackageJson;
4
+ export declare const createDependencyFilter: (names: readonly string[], type: "dependencies" | "devDependencies") => (data: PackageJson) => {
5
+ [x: string]: unknown;
6
+ name?: string;
7
+ version?: string;
8
+ description?: string;
9
+ keywords?: string[];
10
+ homepage?: import("type-fest").LiteralUnion<".", string>;
11
+ bugs?: import("type-fest").PackageJson.BugsLocation;
12
+ license?: string;
13
+ licenses?: Array<{
14
+ type?: string;
15
+ url?: string;
16
+ }>;
17
+ author?: import("type-fest").PackageJson.Person;
18
+ contributors?: import("type-fest").PackageJson.Person[];
19
+ maintainers?: import("type-fest").PackageJson.Person[];
20
+ files?: string[];
21
+ type?: "module" | "commonjs";
22
+ main?: string;
23
+ exports?: import("type-fest").PackageJson.Exports;
24
+ imports?: import("type-fest").PackageJson.Imports;
25
+ bin?: string | Partial<Record<string, string>>;
26
+ man?: string | string[];
27
+ directories?: import("type-fest").PackageJson.DirectoryLocations;
28
+ repository?: string | {
29
+ type: string;
30
+ url: string;
31
+ directory?: string;
32
+ };
33
+ scripts?: import("type-fest").PackageJson.Scripts;
34
+ config?: Record<string, unknown>;
35
+ dependencies?: import("type-fest").PackageJson.Dependency;
36
+ devDependencies?: import("type-fest").PackageJson.Dependency;
37
+ optionalDependencies?: import("type-fest").PackageJson.Dependency;
38
+ peerDependencies?: import("type-fest").PackageJson.Dependency;
39
+ peerDependenciesMeta?: Partial<Record<string, {
40
+ optional: true;
41
+ }>>;
42
+ bundledDependencies?: string[];
43
+ bundleDependencies?: string[];
44
+ engines?: { [EngineName in "npm" | "node" | string]?: string; };
45
+ engineStrict?: boolean;
46
+ os?: Array<import("type-fest").LiteralUnion<"aix" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "!aix" | "!darwin" | "!freebsd" | "!linux" | "!openbsd" | "!sunos" | "!win32", string>>;
47
+ cpu?: Array<import("type-fest").LiteralUnion<"arm" | "arm64" | "ia32" | "mips" | "mipsel" | "ppc" | "ppc64" | "s390" | "s390x" | "x32" | "x64" | "!arm" | "!arm64" | "!ia32" | "!mips" | "!mipsel" | "!ppc" | "!ppc64" | "!s390" | "!s390x" | "!x32" | "!x64", string>>;
48
+ preferGlobal?: boolean;
49
+ private?: boolean;
50
+ publishConfig?: import("type-fest").PackageJson.PublishConfig;
51
+ funding?: string | {
52
+ type?: import("type-fest").LiteralUnion<"github" | "opencollective" | "patreon" | "individual" | "foundation" | "corporation", string>;
53
+ url: string;
54
+ };
55
+ module?: string;
56
+ esnext?: string | {
57
+ [moduleName: string]: string | undefined;
58
+ main?: string;
59
+ browser?: string;
60
+ };
61
+ browser?: string | Partial<Record<string, string | false>>;
62
+ sideEffects?: boolean | string[];
63
+ types?: string;
64
+ typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
65
+ typings?: string;
66
+ workspaces?: import("type-fest").PackageJson.WorkspacePattern[] | import("type-fest").PackageJson.WorkspaceConfig;
67
+ flat?: boolean;
68
+ resolutions?: import("type-fest").PackageJson.Dependency;
69
+ jspm?: import("type-fest").PackageJson;
70
+ };
5
71
  export declare const withPackage: (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => Promise<string>;
@@ -1,9 +1,45 @@
1
- import normalizeData from "normalize-package-data";
2
- import { parseObject } from "./json.js";
3
- 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 package_exports = {};
30
+ __export(package_exports, {
31
+ createDependencyFilter: () => createDependencyFilter,
32
+ formatPackage: () => formatPackage,
33
+ parsePackage: () => parsePackage,
34
+ withPackage: () => withPackage
35
+ });
36
+ module.exports = __toCommonJS(package_exports);
37
+ var import_normalize_package_data = __toESM(require("normalize-package-data"));
38
+ var import_json = require("./json.js");
39
+ var import_prettier = require("./prettier.js");
4
40
  const normalizeDataWithoutThrowing = (rawData) => {
5
41
  try {
6
- normalizeData(rawData);
42
+ (0, import_normalize_package_data.default)(rawData);
7
43
  } catch {
8
44
  }
9
45
  };
@@ -19,12 +55,12 @@ const formatPackage = async (rawData) => {
19
55
  if (rawData.version === "") {
20
56
  delete rawData.version;
21
57
  }
22
- return formatPrettier(JSON.stringify(rawData), {
58
+ return (0, import_prettier.formatPrettier)(JSON.stringify(rawData), {
23
59
  filepath: "package.json"
24
60
  });
25
61
  };
26
62
  const parsePackage = (input) => {
27
- const data = parseObject(input);
63
+ const data = (0, import_json.parseObject)(input);
28
64
  if (data === void 0) {
29
65
  return;
30
66
  }
@@ -45,10 +81,11 @@ const withPackage = (fn) => (input) => {
45
81
  const outputObject = fn(inputObject ?? {});
46
82
  return formatPackage(outputObject);
47
83
  };
48
- export {
84
+ // Annotate the CommonJS export names for ESM import in node:
85
+ 0 && (module.exports = {
49
86
  createDependencyFilter,
50
87
  formatPackage,
51
88
  parsePackage,
52
89
  withPackage
53
- };
90
+ });
54
91
  //# sourceMappingURL=package.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/package.ts"],
4
- "sourcesContent": ["import normalizeData from 'normalize-package-data';\n\nimport type { PackageJson } from '../types.js';\n\nimport { parseObject } from './json.js';\nimport { formatPrettier } from './prettier.js';\n\nconst normalizeDataWithoutThrowing = (rawData: PackageJson) => {\n try {\n normalizeData(rawData);\n } catch {\n // `normalize-package-data` can be picky about e.g. the `name` being valid.\n // This creates issues for partially-init-ed projects.\n }\n};\n\nexport const formatPackage = async (rawData: PackageJson) => {\n normalizeDataWithoutThrowing(rawData);\n\n // normalize-package-data fields that aren't useful for applications\n\n delete rawData._id;\n\n if (rawData.name === '') {\n delete rawData.name;\n }\n\n if (rawData.readme === 'ERROR: No README data found!') {\n delete rawData.readme;\n }\n\n if (rawData.version === '') {\n delete rawData.version;\n }\n\n return formatPrettier(JSON.stringify(rawData), {\n filepath: 'package.json',\n });\n};\n\nexport const parsePackage = (\n input: string | undefined,\n): PackageJson | undefined => {\n const data = parseObject(input) as PackageJson | undefined;\n\n if (data === undefined) {\n return;\n }\n\n normalizeDataWithoutThrowing(data);\n\n return data;\n};\n\nexport const createDependencyFilter = (\n names: readonly string[],\n type: 'dependencies' | 'devDependencies',\n) => {\n const set = new Set(names);\n\n return (data: PackageJson) =>\n ({\n ...data,\n [type]: Object.fromEntries(\n Object.entries(data[type] ?? {}).filter(([name]) => !set.has(name)),\n ),\n }) as PackageJson;\n};\n\nexport const withPackage =\n (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => {\n const inputObject = parsePackage(input);\n\n const outputObject = fn(inputObject ?? {});\n\n return formatPackage(outputObject);\n };\n"],
5
- "mappings": "AAAA,OAAO,mBAAmB;AAI1B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,MAAM,+BAA+B,CAAC,YAAyB;AAC7D,MAAI;AACF,kBAAc,OAAO;AAAA,EACvB,QAAQ;AAAA,EAGR;AACF;AAEO,MAAM,gBAAgB,OAAO,YAAyB;AAC3D,+BAA6B,OAAO;AAIpC,SAAO,QAAQ;AAEf,MAAI,QAAQ,SAAS,IAAI;AACvB,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,WAAW,gCAAgC;AACrD,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,YAAY,IAAI;AAC1B,WAAO,QAAQ;AAAA,EACjB;AAEA,SAAO,eAAe,KAAK,UAAU,OAAO,GAAG;AAAA,IAC7C,UAAU;AAAA,EACZ,CAAC;AACH;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,OAAO,YAAY,KAAK;AAE9B,MAAI,SAAS,QAAW;AACtB;AAAA,EACF;AAEA,+BAA6B,IAAI;AAEjC,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,OACA,SACG;AACH,QAAM,MAAM,IAAI,IAAI,KAAK;AAEzB,SAAO,CAAC,UACL;AAAA,IACC,GAAG;AAAA,IACH,CAAC,IAAI,GAAG,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;AAAA,IACpE;AAAA,EACF;AACJ;AAEO,MAAM,cACX,CAAC,OAA2C,CAAC,UAA8B;AACzE,QAAM,cAAc,aAAa,KAAK;AAEtC,QAAM,eAAe,GAAG,eAAe,CAAC,CAAC;AAEzC,SAAO,cAAc,YAAY;AACnC;",
6
- "names": []
4
+ "sourcesContent": ["import normalizeData from 'normalize-package-data';\n\nimport type { PackageJson } from '../types.js';\n\nimport { parseObject } from './json.js';\nimport { formatPrettier } from './prettier.js';\n\nconst normalizeDataWithoutThrowing = (rawData: PackageJson) => {\n try {\n normalizeData(rawData);\n } catch {\n // `normalize-package-data` can be picky about e.g. the `name` being valid.\n // This creates issues for partially-init-ed projects.\n }\n};\n\nexport const formatPackage = async (rawData: PackageJson) => {\n normalizeDataWithoutThrowing(rawData);\n\n // normalize-package-data fields that aren't useful for applications\n\n delete rawData._id;\n\n if (rawData.name === '') {\n delete rawData.name;\n }\n\n if (rawData.readme === 'ERROR: No README data found!') {\n delete rawData.readme;\n }\n\n if (rawData.version === '') {\n delete rawData.version;\n }\n\n return formatPrettier(JSON.stringify(rawData), {\n filepath: 'package.json',\n });\n};\n\nexport const parsePackage = (\n input: string | undefined,\n): PackageJson | undefined => {\n const data = parseObject(input);\n\n if (data === undefined) {\n return;\n }\n\n normalizeDataWithoutThrowing(data);\n\n return data;\n};\n\nexport const createDependencyFilter = (\n names: readonly string[],\n type: 'dependencies' | 'devDependencies',\n) => {\n const set = new Set(names);\n\n return (data: PackageJson) => ({\n ...data,\n [type]: Object.fromEntries(\n Object.entries(data[type] ?? {}).filter(([name]) => !set.has(name)),\n ),\n });\n};\n\nexport const withPackage =\n (fn: (data: PackageJson) => PackageJson) => (input: string | undefined) => {\n const inputObject = parsePackage(input);\n\n const outputObject = fn(inputObject ?? {});\n\n return formatPackage(outputObject);\n };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAA0B;AAI1B,kBAA4B;AAC5B,sBAA+B;AAE/B,MAAM,+BAA+B,CAAC,YAAyB;AAC7D,MAAI;AACF,sCAAAA,SAAc,OAAO;AAAA,EACvB,QAAQ;AAAA,EAGR;AACF;AAEO,MAAM,gBAAgB,OAAO,YAAyB;AAC3D,+BAA6B,OAAO;AAIpC,SAAO,QAAQ;AAEf,MAAI,QAAQ,SAAS,IAAI;AACvB,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,WAAW,gCAAgC;AACrD,WAAO,QAAQ;AAAA,EACjB;AAEA,MAAI,QAAQ,YAAY,IAAI;AAC1B,WAAO,QAAQ;AAAA,EACjB;AAEA,aAAO,gCAAe,KAAK,UAAU,OAAO,GAAG;AAAA,IAC7C,UAAU;AAAA,EACZ,CAAC;AACH;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,WAAO,yBAAY,KAAK;AAE9B,MAAI,SAAS,QAAW;AACtB;AAAA,EACF;AAEA,+BAA6B,IAAI;AAEjC,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,OACA,SACG;AACH,QAAM,MAAM,IAAI,IAAI,KAAK;AAEzB,SAAO,CAAC,UAAuB;AAAA,IAC7B,GAAG;AAAA,IACH,CAAC,IAAI,GAAG,OAAO;AAAA,MACb,OAAO,QAAQ,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;AAAA,IACpE;AAAA,EACF;AACF;AAEO,MAAM,cACX,CAAC,OAA2C,CAAC,UAA8B;AACzE,QAAM,cAAc,aAAa,KAAK;AAEtC,QAAM,eAAe,GAAG,eAAe,CAAC,CAAC;AAEzC,SAAO,cAAc,YAAY;AACnC;",
6
+ "names": ["normalizeData"]
7
7
  }
@@ -1,12 +1,46 @@
1
- import prettierConfig from "../../../../config/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 prettier_exports = {};
30
+ __export(prettier_exports, {
31
+ formatPrettier: () => formatPrettier
32
+ });
33
+ module.exports = __toCommonJS(prettier_exports);
34
+ var import_prettier = __toESM(require("../../../../config/prettier.js"));
2
35
  const formatPrettier = async (source, options) => {
3
36
  const prettier = await import("prettier");
4
37
  return prettier.format(source, {
5
38
  ...options,
6
- ...prettierConfig
39
+ ...import_prettier.default
7
40
  });
8
41
  };
9
- export {
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
10
44
  formatPrettier
11
- };
45
+ });
12
46
  //# sourceMappingURL=prettier.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/prettier.ts"],
4
4
  "sourcesContent": ["import type prettier from 'prettier';\n\nimport prettierConfig from '../../../../config/prettier.js';\n\ntype Options = Pick<prettier.Options, 'filepath' | 'parser'>;\n\nexport const formatPrettier = async (source: string, options: Options) => {\n const prettier = await import('prettier');\n return prettier.format(source, {\n ...options,\n ...prettierConfig,\n });\n};\n"],
5
- "mappings": "AAEA,OAAO,oBAAoB;AAIpB,MAAM,iBAAiB,OAAO,QAAgB,YAAqB;AACxE,QAAM,WAAW,MAAM,OAAO,UAAU;AACxC,SAAO,SAAS,OAAO,QAAQ;AAAA,IAC7B,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACH;",
6
- "names": []
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAA2B;AAIpB,MAAM,iBAAiB,OAAO,QAAgB,YAAqB;AACxE,QAAM,WAAW,MAAM,OAAO,UAAU;AACxC,SAAO,SAAS,OAAO,QAAQ;AAAA,IAC7B,GAAG;AAAA,IACH,GAAG,gBAAAA;AAAA,EACL,CAAC;AACH;",
6
+ "names": ["prettierConfig"]
7
7
  }
@@ -1,4 +1,39 @@
1
- import mergeWith from "lodash.mergewith";
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 record_exports = {};
30
+ __export(record_exports, {
31
+ getFirstDefined: () => getFirstDefined,
32
+ merge: () => merge,
33
+ mergeRaw: () => mergeRaw
34
+ });
35
+ module.exports = __toCommonJS(record_exports);
36
+ var import_lodash = __toESM(require("lodash.mergewith"));
2
37
  const isArray = (value) => Array.isArray(value);
3
38
  const getFirstDefined = (record, keys) => {
4
39
  for (const key of keys) {
@@ -9,21 +44,22 @@ const getFirstDefined = (record, keys) => {
9
44
  }
10
45
  return;
11
46
  };
12
- const merge = (obj, src) => mergeWith({}, obj, src, (objValue, srcValue) => {
47
+ const merge = (obj, src) => (0, import_lodash.default)({}, obj, src, (objValue, srcValue) => {
13
48
  if (isArray(objValue) && isArray(srcValue)) {
14
49
  return [...new Set(objValue.concat(srcValue))].sort();
15
50
  }
16
51
  return;
17
52
  });
18
- const mergeRaw = (obj, src) => mergeWith(
53
+ const mergeRaw = (obj, src) => (0, import_lodash.default)(
19
54
  {},
20
55
  obj,
21
56
  src,
22
57
  (objValue, srcValue) => isArray(objValue) && isArray(srcValue) ? objValue.concat(srcValue) : void 0
23
58
  );
24
- export {
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
25
61
  getFirstDefined,
26
62
  merge,
27
63
  mergeRaw
28
- };
64
+ });
29
65
  //# sourceMappingURL=record.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/processing/record.ts"],
4
4
  "sourcesContent": ["import mergeWith from 'lodash.mergewith';\n\nconst isArray = (value: unknown): value is unknown[] => Array.isArray(value);\n\nexport const getFirstDefined = <T>(\n record: Record<string, T | undefined>,\n keys: string[],\n): T | undefined => {\n for (const key of keys) {\n const value = record[key];\n if (value !== undefined) {\n return value;\n }\n }\n\n return;\n};\n\n/**\n * Merge two objects together.\n *\n * Array properties are sorted and deduped.\n */\nexport const merge = <A, B>(obj: A, src: B) =>\n mergeWith({}, obj, src, (objValue: unknown, srcValue: unknown) => {\n if (isArray(objValue) && isArray(srcValue)) {\n return [...new Set(objValue.concat(srcValue))].sort();\n }\n\n return;\n });\n\n/**\n * Like `merge`, but arrays are not deduped or sorted to preserve order.\n */\nexport const mergeRaw = <A, B>(obj: A, src: B) =>\n mergeWith({}, obj, src, (objValue: unknown, srcValue: unknown) =>\n isArray(objValue) && isArray(srcValue)\n ? objValue.concat(srcValue)\n : undefined,\n );\n"],
5
- "mappings": "AAAA,OAAO,eAAe;AAEtB,MAAM,UAAU,CAAC,UAAuC,MAAM,QAAQ,KAAK;AAEpE,MAAM,kBAAkB,CAC7B,QACA,SACkB;AAClB,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,UAAU,QAAW;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AAEA;AACF;AAOO,MAAM,QAAQ,CAAO,KAAQ,QAClC,UAAU,CAAC,GAAG,KAAK,KAAK,CAAC,UAAmB,aAAsB;AAChE,MAAI,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,GAAG;AAC1C,WAAO,CAAC,GAAG,IAAI,IAAI,SAAS,OAAO,QAAQ,CAAC,CAAC,EAAE,KAAK;AAAA,EACtD;AAEA;AACF,CAAC;AAKI,MAAM,WAAW,CAAO,KAAQ,QACrC;AAAA,EAAU,CAAC;AAAA,EAAG;AAAA,EAAK;AAAA,EAAK,CAAC,UAAmB,aAC1C,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,IACjC,SAAS,OAAO,QAAQ,IACxB;AACN;",
6
- "names": []
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAsB;AAEtB,MAAM,UAAU,CAAC,UAAuC,MAAM,QAAQ,KAAK;AAEpE,MAAM,kBAAkB,CAC7B,QACA,SACkB;AAClB,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,OAAO,GAAG;AACxB,QAAI,UAAU,QAAW;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AAEA;AACF;AAOO,MAAM,QAAQ,CAAO,KAAQ,YAClC,cAAAA,SAAU,CAAC,GAAG,KAAK,KAAK,CAAC,UAAmB,aAAsB;AAChE,MAAI,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,GAAG;AAC1C,WAAO,CAAC,GAAG,IAAI,IAAI,SAAS,OAAO,QAAQ,CAAC,CAAC,EAAE,KAAK;AAAA,EACtD;AAEA;AACF,CAAC;AAKI,MAAM,WAAW,CAAO,KAAQ,YACrC,cAAAA;AAAA,EAAU,CAAC;AAAA,EAAG;AAAA,EAAK;AAAA,EAAK,CAAC,UAAmB,aAC1C,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,IACjC,SAAS,OAAO,QAAQ,IACxB;AACN;",
6
+ "names": ["mergeWith"]
7
7
  }
@@ -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