skuba 14.0.0-migrate-to-inquirer-20251031060542 → 14.0.0-replace-global-vars-20251117052457

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 (384) hide show
  1. package/config/eslint.js +1 -1
  2. package/config/prettier.d.ts +8 -4
  3. package/config/prettier.js +10 -2
  4. package/lib/cli/adapter/eslint.js +11 -45
  5. package/lib/cli/adapter/eslint.js.map +3 -3
  6. package/lib/cli/adapter/prettier.js +39 -67
  7. package/lib/cli/adapter/prettier.js.map +2 -2
  8. package/lib/cli/build/args.js +8 -42
  9. package/lib/cli/build/args.js.map +2 -2
  10. package/lib/cli/build/assets.d.ts +3 -2
  11. package/lib/cli/build/assets.js +28 -60
  12. package/lib/cli/build/assets.js.map +3 -3
  13. package/lib/cli/build/esbuild.js +21 -45
  14. package/lib/cli/build/esbuild.js.map +2 -2
  15. package/lib/cli/build/index.js +21 -55
  16. package/lib/cli/build/index.js.map +3 -3
  17. package/lib/cli/build/tsc.js +23 -61
  18. package/lib/cli/build/tsc.js.map +3 -3
  19. package/lib/cli/buildPackage/index.js +8 -32
  20. package/lib/cli/buildPackage/index.js.map +1 -1
  21. package/lib/cli/configure/analyseConfiguration.js +16 -50
  22. package/lib/cli/configure/analyseConfiguration.js.map +2 -2
  23. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  24. package/lib/cli/configure/analyseDependencies.js +25 -59
  25. package/lib/cli/configure/analyseDependencies.js.map +3 -3
  26. package/lib/cli/configure/analysis/diff.js +5 -39
  27. package/lib/cli/configure/analysis/diff.js.map +3 -3
  28. package/lib/cli/configure/analysis/files.js +8 -42
  29. package/lib/cli/configure/analysis/files.js.map +2 -2
  30. package/lib/cli/configure/analysis/git.js +12 -46
  31. package/lib/cli/configure/analysis/git.js.map +2 -2
  32. package/lib/cli/configure/analysis/package.d.ts +2 -3
  33. package/lib/cli/configure/analysis/package.js +10 -45
  34. package/lib/cli/configure/analysis/package.js.map +3 -3
  35. package/lib/cli/configure/analysis/project.js +18 -50
  36. package/lib/cli/configure/analysis/project.js.map +2 -2
  37. package/lib/cli/configure/dependencies/index.js +7 -35
  38. package/lib/cli/configure/dependencies/index.js.map +1 -1
  39. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +4 -28
  40. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  41. package/lib/cli/configure/dependencies/seekKoala.js +4 -28
  42. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  43. package/lib/cli/configure/dependencies/skuba.js +4 -28
  44. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  45. package/lib/cli/configure/dependencies/skubaDeps.js +2 -26
  46. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  47. package/lib/cli/configure/dependencies/skubaDive.js +4 -29
  48. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  49. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  50. package/lib/cli/configure/ensureTemplateCompletion.js +35 -60
  51. package/lib/cli/configure/ensureTemplateCompletion.js.map +3 -3
  52. package/lib/cli/configure/getEntryPoint.d.ts +1 -1
  53. package/lib/cli/configure/getEntryPoint.js +14 -48
  54. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  55. package/lib/cli/configure/getProjectType.d.ts +1 -1
  56. package/lib/cli/configure/getProjectType.js +14 -35
  57. package/lib/cli/configure/getProjectType.js.map +2 -2
  58. package/lib/cli/configure/index.js +50 -84
  59. package/lib/cli/configure/index.js.map +3 -3
  60. package/lib/cli/configure/modules/eslint.js +10 -34
  61. package/lib/cli/configure/modules/eslint.js.map +1 -1
  62. package/lib/cli/configure/modules/ignore.js +8 -32
  63. package/lib/cli/configure/modules/ignore.js.map +1 -1
  64. package/lib/cli/configure/modules/index.js +18 -44
  65. package/lib/cli/configure/modules/index.js.map +2 -2
  66. package/lib/cli/configure/modules/nodemon.js +4 -28
  67. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  68. package/lib/cli/configure/modules/package.js +10 -34
  69. package/lib/cli/configure/modules/package.js.map +1 -1
  70. package/lib/cli/configure/modules/prettier.js +11 -35
  71. package/lib/cli/configure/modules/prettier.js.map +1 -1
  72. package/lib/cli/configure/modules/renovate.js +17 -40
  73. package/lib/cli/configure/modules/renovate.js.map +2 -2
  74. package/lib/cli/configure/modules/serverless.js +2 -26
  75. package/lib/cli/configure/modules/serverless.js.map +1 -1
  76. package/lib/cli/configure/modules/tslint.js +4 -28
  77. package/lib/cli/configure/modules/tslint.js.map +1 -1
  78. package/lib/cli/configure/processing/configFile.js +3 -39
  79. package/lib/cli/configure/processing/configFile.js.map +1 -1
  80. package/lib/cli/configure/processing/deleteFiles.js +2 -26
  81. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  82. package/lib/cli/configure/processing/javascript.js +2 -27
  83. package/lib/cli/configure/processing/javascript.js.map +1 -1
  84. package/lib/cli/configure/processing/json.js +6 -31
  85. package/lib/cli/configure/processing/json.js.map +1 -1
  86. package/lib/cli/configure/processing/loadFiles.js +2 -26
  87. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  88. package/lib/cli/configure/processing/module.js +4 -28
  89. package/lib/cli/configure/processing/module.js.map +1 -1
  90. package/lib/cli/configure/processing/package.d.ts +1 -67
  91. package/lib/cli/configure/processing/package.js +8 -45
  92. package/lib/cli/configure/processing/package.js.map +3 -3
  93. package/lib/cli/configure/processing/prettier.js +4 -38
  94. package/lib/cli/configure/processing/prettier.js.map +2 -2
  95. package/lib/cli/configure/processing/record.js +5 -41
  96. package/lib/cli/configure/processing/record.js.map +2 -2
  97. package/lib/cli/configure/processing/typescript.js +26 -63
  98. package/lib/cli/configure/processing/typescript.js.map +2 -2
  99. package/lib/cli/configure/types.d.ts +15 -4
  100. package/lib/cli/configure/types.js +0 -16
  101. package/lib/cli/configure/types.js.map +3 -3
  102. package/lib/cli/format/index.js +20 -54
  103. package/lib/cli/format/index.js.map +3 -3
  104. package/lib/cli/help/index.js +6 -30
  105. package/lib/cli/help/index.js.map +1 -1
  106. package/lib/cli/init/getConfig.d.ts +1 -1
  107. package/lib/cli/init/getConfig.js +76 -104
  108. package/lib/cli/init/getConfig.js.map +3 -3
  109. package/lib/cli/init/git.js +16 -51
  110. package/lib/cli/init/git.js.map +2 -2
  111. package/lib/cli/init/index.js +67 -98
  112. package/lib/cli/init/index.js.map +2 -2
  113. package/lib/cli/init/prompts.js +21 -42
  114. package/lib/cli/init/prompts.js.map +1 -1
  115. package/lib/cli/init/types.js +7 -41
  116. package/lib/cli/init/types.js.map +1 -1
  117. package/lib/cli/init/validation.js +2 -30
  118. package/lib/cli/init/validation.js.map +1 -1
  119. package/lib/cli/init/writePackageJson.js +8 -42
  120. package/lib/cli/init/writePackageJson.js.map +2 -2
  121. package/lib/cli/lint/annotate/buildkite/eslint.js +3 -37
  122. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  123. package/lib/cli/lint/annotate/buildkite/index.js +11 -45
  124. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  125. package/lib/cli/lint/annotate/buildkite/internal.js +3 -37
  126. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  127. package/lib/cli/lint/annotate/buildkite/prettier.js +3 -37
  128. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  129. package/lib/cli/lint/annotate/buildkite/tsc.js +3 -37
  130. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  131. package/lib/cli/lint/annotate/github/eslint.js +2 -26
  132. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  133. package/lib/cli/lint/annotate/github/index.js +11 -45
  134. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  135. package/lib/cli/lint/annotate/github/internal.js +2 -26
  136. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  137. package/lib/cli/lint/annotate/github/prettier.js +2 -26
  138. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  139. package/lib/cli/lint/annotate/github/tsc.js +4 -28
  140. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  141. package/lib/cli/lint/annotate/index.js +6 -30
  142. package/lib/cli/lint/annotate/index.js.map +1 -1
  143. package/lib/cli/lint/autofix.js +37 -73
  144. package/lib/cli/lint/autofix.js.map +1 -1
  145. package/lib/cli/lint/eslint.js +16 -51
  146. package/lib/cli/lint/eslint.js.map +3 -3
  147. package/lib/cli/lint/external.js +19 -51
  148. package/lib/cli/lint/external.js.map +2 -2
  149. package/lib/cli/lint/index.js +26 -52
  150. package/lib/cli/lint/index.js.map +2 -2
  151. package/lib/cli/lint/internal.js +20 -52
  152. package/lib/cli/lint/internal.js.map +3 -3
  153. package/lib/cli/lint/internalLints/detectBadCodeowners.js +8 -33
  154. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  155. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +12 -48
  156. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +3 -3
  157. package/lib/cli/lint/internalLints/patchRenovateConfig.js +21 -55
  158. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  159. package/lib/cli/lint/internalLints/refreshConfigFiles.js +33 -66
  160. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  161. package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -1
  162. package/lib/cli/lint/internalLints/upgrade/index.js +23 -56
  163. package/lib/cli/lint/internalLints/upgrade/index.js.map +3 -3
  164. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +4 -28
  165. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  166. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +11 -45
  167. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  168. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +6 -30
  169. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  170. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +37 -65
  171. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +3 -3
  172. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +11 -46
  173. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  174. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +4 -28
  175. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +1 -1
  176. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +23 -59
  177. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +2 -2
  178. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +4 -28
  179. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +1 -1
  180. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +11 -46
  181. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +2 -2
  182. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js +6 -30
  183. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +1 -1
  184. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +11 -46
  185. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +2 -2
  186. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +11 -46
  187. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +2 -2
  188. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js +4 -28
  189. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +1 -1
  190. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +11 -46
  191. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +2 -2
  192. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js +29 -67
  193. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/configureTsConfigForESM.js.map +2 -2
  194. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js +10 -34
  195. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/index.js.map +1 -1
  196. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js +11 -45
  197. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/patchApiDockerfiles.js.map +2 -2
  198. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.d.ts +4 -0
  199. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js +18 -63
  200. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/rewriteSrcImports.js.map +3 -3
  201. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js +15 -50
  202. package/lib/cli/lint/internalLints/upgrade/patches/12.4.1/updateLambdaConfigs.js.map +2 -2
  203. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.d.ts +2 -0
  204. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js +11 -0
  205. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/index.js.map +7 -0
  206. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.d.ts +5 -0
  207. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js +72 -0
  208. package/lib/cli/lint/internalLints/upgrade/patches/12.5.0/rewriteGlobalVars.js.map +7 -0
  209. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +17 -51
  210. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  211. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +10 -34
  212. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +1 -1
  213. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +10 -44
  214. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  215. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +12 -46
  216. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  217. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +4 -28
  218. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  219. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +15 -49
  220. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  221. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +11 -45
  222. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  223. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +10 -39
  224. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
  225. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +11 -45
  226. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  227. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +11 -45
  228. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  229. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +13 -47
  230. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  231. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +4 -28
  232. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  233. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +11 -45
  234. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  235. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +4 -28
  236. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +8 -32
  238. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +1 -1
  239. package/lib/cli/lint/prettier.js +15 -50
  240. package/lib/cli/lint/prettier.js.map +3 -3
  241. package/lib/cli/lint/tsc.js +4 -28
  242. package/lib/cli/lint/tsc.js.map +1 -1
  243. package/lib/cli/lint/types.js +0 -16
  244. package/lib/cli/lint/types.js.map +3 -3
  245. package/lib/cli/migrate/index.js +10 -34
  246. package/lib/cli/migrate/index.js.map +1 -1
  247. package/lib/cli/migrate/nodeVersion/checks.js +24 -61
  248. package/lib/cli/migrate/nodeVersion/checks.js.map +2 -2
  249. package/lib/cli/migrate/nodeVersion/index.js +25 -55
  250. package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
  251. package/lib/cli/node/index.js +20 -57
  252. package/lib/cli/node/index.js.map +3 -3
  253. package/lib/cli/release/index.js +4 -28
  254. package/lib/cli/release/index.js.map +1 -1
  255. package/lib/cli/start/index.js +16 -50
  256. package/lib/cli/start/index.js.map +3 -3
  257. package/lib/cli/test/index.js +4 -44
  258. package/lib/cli/test/index.js.map +2 -2
  259. package/lib/cli/version/index.js +6 -30
  260. package/lib/cli/version/index.js.map +1 -1
  261. package/lib/eslint.d.js +0 -1
  262. package/lib/index.d.ts +0 -1
  263. package/lib/index.js +6 -46
  264. package/lib/index.js.map +2 -2
  265. package/lib/skuba.js +26 -45
  266. package/lib/skuba.js.map +3 -3
  267. package/lib/utils/args.js +6 -43
  268. package/lib/utils/args.js.map +2 -2
  269. package/lib/utils/command.js +4 -42
  270. package/lib/utils/command.js.map +3 -3
  271. package/lib/utils/copy.js +20 -57
  272. package/lib/utils/copy.js.map +2 -2
  273. package/lib/utils/dir.js +32 -72
  274. package/lib/utils/dir.js.map +2 -2
  275. package/lib/utils/env.js +2 -26
  276. package/lib/utils/env.js.map +1 -1
  277. package/lib/utils/error.js +10 -47
  278. package/lib/utils/error.js.map +1 -1
  279. package/lib/utils/exec.d.ts +3 -2
  280. package/lib/utils/exec.js +24 -62
  281. package/lib/utils/exec.js.map +3 -3
  282. package/lib/utils/fs.js +6 -40
  283. package/lib/utils/fs.js.map +3 -3
  284. package/lib/utils/help.js +6 -30
  285. package/lib/utils/help.js.map +1 -1
  286. package/lib/utils/logging.d.ts +9 -10
  287. package/lib/utils/logging.js +11 -48
  288. package/lib/utils/logging.js.map +3 -3
  289. package/lib/utils/logo.js +28 -59
  290. package/lib/utils/logo.js.map +3 -3
  291. package/lib/utils/manifest.d.ts +3 -2
  292. package/lib/utils/manifest.js +8 -48
  293. package/lib/utils/manifest.js.map +3 -3
  294. package/lib/utils/npmrc.js +2 -26
  295. package/lib/utils/npmrc.js.map +1 -1
  296. package/lib/utils/packageManager.js +12 -49
  297. package/lib/utils/packageManager.js.map +2 -2
  298. package/lib/utils/port.js +4 -39
  299. package/lib/utils/port.js.map +2 -2
  300. package/lib/utils/sleep.js +2 -26
  301. package/lib/utils/sleep.js.map +1 -1
  302. package/lib/utils/template.js +18 -55
  303. package/lib/utils/template.js.map +3 -3
  304. package/lib/utils/validation.js +2 -31
  305. package/lib/utils/validation.js.map +1 -1
  306. package/lib/utils/version.js +9 -46
  307. package/lib/utils/version.js.map +2 -2
  308. package/lib/utils/wait.js +7 -32
  309. package/lib/utils/wait.js.map +1 -1
  310. package/lib/utils/worker.d.ts +3 -3
  311. package/lib/utils/worker.js +10 -35
  312. package/lib/utils/worker.js.map +1 -1
  313. package/lib/wrapper/function-arguments.d.js +0 -1
  314. package/lib/wrapper/functionHandler.js +18 -49
  315. package/lib/wrapper/functionHandler.js.map +2 -2
  316. package/lib/wrapper/http.d.ts +0 -6
  317. package/lib/wrapper/http.js +8 -51
  318. package/lib/wrapper/http.js.map +3 -3
  319. package/lib/wrapper/index.js +6 -7
  320. package/lib/wrapper/index.js.map +1 -1
  321. package/lib/wrapper/main.js +8 -42
  322. package/lib/wrapper/main.js.map +3 -3
  323. package/lib/wrapper/requestListener.js +13 -46
  324. package/lib/wrapper/requestListener.js.map +3 -3
  325. package/lib/wrapper/server.d.ts +7 -0
  326. package/lib/wrapper/server.js +11 -0
  327. package/lib/wrapper/server.js.map +7 -0
  328. package/package.json +17 -24
  329. package/template/base/_.prettierrc.js +1 -1
  330. package/template/base/_eslint.config.js +1 -1
  331. package/template/base/_pnpm-workspace.yaml +3 -2
  332. package/template/base/vitest.config.ts +25 -0
  333. package/template/express-rest-api/package.json +2 -1
  334. package/template/express-rest-api/skuba.template.js +1 -1
  335. package/template/express-rest-api/src/app.test.ts +1 -0
  336. package/template/greeter/package.json +4 -3
  337. package/template/greeter/skuba.template.js +1 -1
  338. package/template/greeter/src/app.test.ts +3 -1
  339. package/template/koa-rest-api/package.json +2 -1
  340. package/template/koa-rest-api/skuba.template.js +1 -1
  341. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -0
  342. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +2 -0
  343. package/template/koa-rest-api/src/app.test.ts +2 -0
  344. package/template/koa-rest-api/src/framework/server.test.ts +2 -2
  345. package/template/koa-rest-api/src/framework/validation.test.ts +2 -0
  346. package/template/koa-rest-api/src/testing/metrics.ts +2 -0
  347. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +15 -3
  348. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +11 -9
  349. package/template/lambda-sqs-worker-cdk/package.json +6 -5
  350. package/template/lambda-sqs-worker-cdk/skuba.template.js +1 -1
  351. package/template/lambda-sqs-worker-cdk/src/app.test.ts +22 -13
  352. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +1 -0
  353. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +33 -31
  354. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +8 -2
  355. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -2
  356. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +4 -3
  357. package/template/oss-npm-package/_package.json +1 -0
  358. package/template/oss-npm-package/skuba.template.js +1 -1
  359. package/template/oss-npm-package/src/index.test.ts +2 -0
  360. package/template/private-npm-package/_package.json +1 -0
  361. package/template/private-npm-package/skuba.template.js +1 -1
  362. package/template/private-npm-package/src/index.test.ts +2 -0
  363. package/config/jest.js +0 -1
  364. package/jest/moduleNameMapper.js +0 -64
  365. package/jest/transform.js +0 -62
  366. package/jest/tsConfig.js +0 -26
  367. package/jest-preset.js +0 -37
  368. package/lib/api/jest/index.d.ts +0 -15
  369. package/lib/api/jest/index.js +0 -59
  370. package/lib/api/jest/index.js.map +0 -7
  371. package/lib/cli/configure/modules/jest.d.ts +0 -2
  372. package/lib/cli/configure/modules/jest.js +0 -86
  373. package/lib/cli/configure/modules/jest.js.map +0 -7
  374. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +0 -2
  375. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +0 -144
  376. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +0 -7
  377. package/lib/cli/test/reporters/github/annotations.d.ts +0 -9
  378. package/lib/cli/test/reporters/github/annotations.js +0 -102
  379. package/lib/cli/test/reporters/github/annotations.js.map +0 -7
  380. package/lib/cli/test/reporters/github/index.d.ts +0 -5
  381. package/lib/cli/test/reporters/github/index.js +0 -74
  382. package/lib/cli/test/reporters/github/index.js.map +0 -7
  383. package/template/base/jest.config.ts +0 -19
  384. package/template/base/jest.setup.ts +0 -3
@@ -1,69 +1,35 @@
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 analyseConfiguration_exports = {};
30
- __export(analyseConfiguration_exports, {
31
- analyseConfiguration: () => analyseConfiguration
32
- });
33
- module.exports = __toCommonJS(analyseConfiguration_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_logging = require("../../utils/logging.js");
37
- var import_project = require("./analysis/project.js");
1
+ import path from "path";
2
+ import fs from "fs-extra";
3
+ import { log } from "../../utils/logging.js";
4
+ import { diffFiles } from "./analysis/project.js";
38
5
  const analyseConfiguration = async (props) => {
39
- import_logging.log.newline();
40
- import_logging.log.plain(import_logging.log.bold("Config:"));
41
- const files = await (0, import_project.diffFiles)(props);
6
+ log.newline();
7
+ log.plain(log.bold("Config:"));
8
+ const files = await diffFiles(props);
42
9
  if (Object.keys(files).length === 0) {
43
- import_logging.log.newline();
44
- import_logging.log.ok("\u2714 No changes");
10
+ log.newline();
11
+ log.ok("\u2714 No changes");
45
12
  return;
46
13
  }
47
- import_logging.log.newline();
48
- Object.entries(files).sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB)).forEach(([filename, { operation }]) => import_logging.log.plain(operation, filename));
14
+ log.newline();
15
+ Object.entries(files).sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB)).forEach(([filename, { operation }]) => log.plain(operation, filename));
49
16
  return async () => {
50
17
  const dirnames = [
51
- ...new Set(Object.keys(files).map((filename) => import_path.default.dirname(filename)))
18
+ ...new Set(Object.keys(files).map((filename) => path.dirname(filename)))
52
19
  ];
53
20
  await Promise.all(
54
21
  dirnames.map(
55
- (dirname) => import_fs_extra.default.promises.mkdir(dirname, { recursive: true })
22
+ (dirname) => fs.promises.mkdir(dirname, { recursive: true })
56
23
  )
57
24
  );
58
25
  await Promise.all(
59
26
  Object.entries(files).map(
60
- ([filename, { data }]) => data === void 0 ? import_fs_extra.default.promises.rm(filename) : import_fs_extra.default.promises.writeFile(filename, data)
27
+ ([filename, { data }]) => data === void 0 ? fs.promises.rm(filename) : fs.promises.writeFile(filename, data)
61
28
  )
62
29
  );
63
30
  };
64
31
  };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
32
+ export {
67
33
  analyseConfiguration
68
- });
34
+ };
69
35
  //# sourceMappingURL=analyseConfiguration.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/analyseConfiguration.ts"],
4
4
  "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport type { PackageManagerConfig } from '../../utils/packageManager.js';\n\nimport { diffFiles } from './analysis/project.js';\n\ninterface Props {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n packageManager: PackageManagerConfig;\n type: ProjectType;\n}\n\nexport const analyseConfiguration = async (\n props: Props,\n): Promise<undefined | (() => Promise<void>)> => {\n log.newline();\n log.plain(log.bold('Config:'));\n\n const files = await diffFiles(props);\n\n if (Object.keys(files).length === 0) {\n log.newline();\n log.ok('\u2714 No changes');\n return;\n }\n\n log.newline();\n Object.entries(files)\n .sort(([filenameA], [filenameB]) => filenameA.localeCompare(filenameB))\n .forEach(([filename, { operation }]) => log.plain(operation, filename));\n\n return async () => {\n const dirnames = [\n ...new Set(Object.keys(files).map((filename) => path.dirname(filename))),\n ];\n\n await Promise.all(\n dirnames.map((dirname) =>\n fs.promises.mkdir(dirname, { recursive: true }),\n ),\n );\n\n await Promise.all(\n Object.entries(files).map(([filename, { data }]) =>\n data === undefined\n ? fs.promises.rm(filename)\n : fs.promises.writeFile(filename, data),\n ),\n );\n };\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,qBAAoB;AAIpB,qBAA0B;AAUnB,MAAM,uBAAuB,OAClC,UAC+C;AAC/C,qBAAI,QAAQ;AACZ,qBAAI,MAAM,mBAAI,KAAK,SAAS,CAAC;AAE7B,QAAM,QAAQ,UAAM,0BAAU,KAAK;AAEnC,MAAI,OAAO,KAAK,KAAK,EAAE,WAAW,GAAG;AACnC,uBAAI,QAAQ;AACZ,uBAAI,GAAG,mBAAc;AACrB;AAAA,EACF;AAEA,qBAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,MAAM,UAAU,cAAc,SAAS,CAAC,EACrE,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,mBAAI,MAAM,WAAW,QAAQ,CAAC;AAExE,SAAO,YAAY;AACjB,UAAM,WAAW;AAAA,MACf,GAAG,IAAI,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,CAAC,aAAa,YAAAA,QAAK,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzE;AAEA,UAAM,QAAQ;AAAA,MACZ,SAAS;AAAA,QAAI,CAAC,YACZ,gBAAAC,QAAG,SAAS,MAAM,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,MAChD;AAAA,IACF;AAEA,UAAM,QAAQ;AAAA,MACZ,OAAO,QAAQ,KAAK,EAAE;AAAA,QAAI,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,MAC5C,SAAS,SACL,gBAAAA,QAAG,SAAS,GAAG,QAAQ,IACvB,gBAAAA,QAAG,SAAS,UAAU,UAAU,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": ["path", "fs"]
5
+ "mappings": "AAAA,OAAO,UAAU;AAEjB,OAAO,QAAQ;AAEf,SAAS,WAAW;AAIpB,SAAS,iBAAiB;AAUnB,MAAM,uBAAuB,OAClC,UAC+C;AAC/C,MAAI,QAAQ;AACZ,MAAI,MAAM,IAAI,KAAK,SAAS,CAAC;AAE7B,QAAM,QAAQ,MAAM,UAAU,KAAK;AAEnC,MAAI,OAAO,KAAK,KAAK,EAAE,WAAW,GAAG;AACnC,QAAI,QAAQ;AACZ,QAAI,GAAG,mBAAc;AACrB;AAAA,EACF;AAEA,MAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,MAAM,UAAU,cAAc,SAAS,CAAC,EACrE,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,IAAI,MAAM,WAAW,QAAQ,CAAC;AAExE,SAAO,YAAY;AACjB,UAAM,WAAW;AAAA,MACf,GAAG,IAAI,IAAI,OAAO,KAAK,KAAK,EAAE,IAAI,CAAC,aAAa,KAAK,QAAQ,QAAQ,CAAC,CAAC;AAAA,IACzE;AAEA,UAAM,QAAQ;AAAA,MACZ,SAAS;AAAA,QAAI,CAAC,YACZ,GAAG,SAAS,MAAM,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,MAChD;AAAA,IACF;AAEA,UAAM,QAAQ;AAAA,MACZ,OAAO,QAAQ,KAAK,EAAE;AAAA,QAAI,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,MAC5C,SAAS,SACL,GAAG,SAAS,GAAG,QAAQ,IACvB,GAAG,SAAS,UAAU,UAAU,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import type { ReadResult } from 'read-pkg-up';
2
1
  import type { ProjectType } from '../../utils/manifest.js';
2
+ import type { ReadResult } from './types.js';
3
3
  interface Props {
4
4
  destinationRoot: string;
5
5
  include: (pathname: string) => boolean;
@@ -1,59 +1,26 @@
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 analyseDependencies_exports = {};
30
- __export(analyseDependencies_exports, {
31
- analyseDependencies: () => analyseDependencies
32
- });
33
- module.exports = __toCommonJS(analyseDependencies_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_copy = require("../../utils/copy.js");
37
- var import_logging = require("../../utils/logging.js");
38
- var import_version = require("../../utils/version.js");
39
- var import_package = require("./analysis/package.js");
40
- var dependencyMutators = __toESM(require("./dependencies/index.js"));
41
- var import_package2 = require("./processing/package.js");
1
+ import path from "path";
2
+ import fs from "fs-extra";
3
+ import { copyFiles } from "../../utils/copy.js";
4
+ import { log } from "../../utils/logging.js";
5
+ import { getLatestNpmVersion, getSkubaVersion } from "../../utils/version.js";
6
+ import { diffDependencies } from "./analysis/package.js";
7
+ import * as dependencyMutators from "./dependencies/index.js";
8
+ import { formatPackage } from "./processing/package.js";
42
9
  const logDiff = (diff) => {
43
10
  const entries = Object.entries(diff);
44
11
  if (entries.length === 0) {
45
- import_logging.log.ok("\u2714 No changes");
12
+ log.ok("\u2714 No changes");
46
13
  return false;
47
14
  }
48
15
  Object.entries(diff).sort(([nameA], [nameB]) => nameA.localeCompare(nameB)).forEach(
49
- ([name, { operation, version }]) => import_logging.log.plain(operation, name, import_logging.log.formatSubtle(version))
16
+ ([name, { operation, version }]) => log.plain(operation, name, log.formatSubtle(version))
50
17
  );
51
18
  return true;
52
19
  };
53
20
  const pinUnspecifiedVersions = async (dependencies) => {
54
21
  const updates = await Promise.all(
55
22
  Object.entries(dependencies).filter(([, version]) => version === "*").map(async ([name]) => {
56
- const version = await (name === "skuba" ? (0, import_version.getSkubaVersion)() : (0, import_version.getLatestNpmVersion)(name));
23
+ const version = await (name === "skuba" ? getSkubaVersion() : getLatestNpmVersion(name));
57
24
  if (version === null) {
58
25
  throw new Error(`Failed to fetch latest version of ${name}`);
59
26
  }
@@ -92,37 +59,37 @@ const analyseDependencies = async ({
92
59
  pinUnspecifiedVersions(output.dependencies),
93
60
  pinUnspecifiedVersions(output.devDependencies)
94
61
  ]);
95
- const dependencyDiff = (0, import_package.diffDependencies)({
62
+ const dependencyDiff = diffDependencies({
96
63
  old: input.dependencies,
97
64
  new: output.dependencies
98
65
  });
99
- import_logging.log.newline();
100
- import_logging.log.plain(import_logging.log.bold("Dependencies:"));
101
- import_logging.log.newline();
66
+ log.newline();
67
+ log.plain(log.bold("Dependencies:"));
68
+ log.newline();
102
69
  const hasDependencyDiff = logDiff(dependencyDiff);
103
- const devDependencyDiff = (0, import_package.diffDependencies)({
70
+ const devDependencyDiff = diffDependencies({
104
71
  old: input.devDependencies,
105
72
  new: output.devDependencies
106
73
  });
107
- import_logging.log.newline();
108
- import_logging.log.plain(import_logging.log.bold("Dev dependencies:"));
109
- import_logging.log.newline();
74
+ log.newline();
75
+ log.plain(log.bold("Dev dependencies:"));
76
+ log.newline();
110
77
  const hasDevDependencyDiff = logDiff(devDependencyDiff);
111
- const packageJsonFilepath = import_path.default.join(destinationRoot, "package.json");
78
+ const packageJsonFilepath = path.join(destinationRoot, "package.json");
112
79
  if (!hasDependencyDiff && !hasDevDependencyDiff) {
113
80
  return;
114
81
  }
115
82
  return async () => {
116
- const updatedPackageJson = await (0, import_package2.formatPackage)({
83
+ const updatedPackageJson = await formatPackage({
117
84
  ...packageJson,
118
85
  dependencies: output.dependencies,
119
86
  devDependencies: output.devDependencies
120
87
  });
121
- await import_fs_extra.default.promises.writeFile(packageJsonFilepath, updatedPackageJson);
88
+ await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);
122
89
  if (processors.length === 0) {
123
90
  return;
124
91
  }
125
- await (0, import_copy.copyFiles)({
92
+ await copyFiles({
126
93
  sourceRoot: destinationRoot,
127
94
  destinationRoot,
128
95
  include,
@@ -130,8 +97,7 @@ const analyseDependencies = async ({
130
97
  });
131
98
  };
132
99
  };
133
- // Annotate the CommonJS export names for ESM import in node:
134
- 0 && (module.exports = {
100
+ export {
135
101
  analyseDependencies
136
- });
102
+ };
137
103
  //# sourceMappingURL=analyseDependencies.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/configure/analyseDependencies.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\n\nimport { type TextProcessor, copyFiles } from '../../utils/copy.js';\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport { getLatestNpmVersion, getSkubaVersion } from '../../utils/version.js';\n\nimport { diffDependencies } from './analysis/package.js';\nimport * as dependencyMutators from './dependencies/index.js';\nimport { formatPackage } from './processing/package.js';\nimport type { DependencyDiff } from './types.js';\n\nconst logDiff = (diff: DependencyDiff): boolean => {\n const entries = Object.entries(diff);\n\n if (entries.length === 0) {\n log.ok('\u2714 No changes');\n\n return false;\n }\n\n Object.entries(diff)\n .sort(([nameA], [nameB]) => nameA.localeCompare(nameB))\n .forEach(([name, { operation, version }]) =>\n log.plain(operation, name, log.formatSubtle(version)),\n );\n\n return true;\n};\n\nconst pinUnspecifiedVersions = async (\n dependencies: Record<string, string>,\n): Promise<void> => {\n const updates = await Promise.all(\n Object.entries(dependencies)\n .filter(([, version]) => version === '*')\n .map(async ([name]) => {\n const version = await (name === 'skuba'\n ? getSkubaVersion()\n : getLatestNpmVersion(name));\n\n if (version === null) {\n throw new Error(`Failed to fetch latest version of ${name}`);\n }\n\n return [name, version] as const;\n }),\n );\n\n updates.forEach(([name, version]) => {\n dependencies[name] = version;\n });\n};\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: ReadResult;\n type: ProjectType;\n}\n\nexport const analyseDependencies = async ({\n destinationRoot,\n include,\n manifest: { packageJson },\n type,\n}: Props): Promise<undefined | (() => Promise<void>)> => {\n const input = {\n dependencies: packageJson.dependencies ?? {},\n devDependencies: packageJson.devDependencies ?? {},\n type,\n };\n\n const output = {\n dependencies: { ...input.dependencies },\n devDependencies: { ...input.devDependencies },\n type,\n };\n\n const processors = Object.values(dependencyMutators).reduce<TextProcessor[]>(\n (acc, mutate) => {\n const newProcessors = mutate(output);\n acc.push(...newProcessors);\n return acc;\n },\n [],\n );\n\n await Promise.all([\n pinUnspecifiedVersions(output.dependencies),\n pinUnspecifiedVersions(output.devDependencies),\n ]);\n\n const dependencyDiff = diffDependencies({\n old: input.dependencies,\n new: output.dependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dependencies:'));\n\n log.newline();\n const hasDependencyDiff = logDiff(dependencyDiff);\n\n const devDependencyDiff = diffDependencies({\n old: input.devDependencies,\n new: output.devDependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dev dependencies:'));\n\n log.newline();\n const hasDevDependencyDiff = logDiff(devDependencyDiff);\n\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n\n if (!hasDependencyDiff && !hasDevDependencyDiff) {\n return;\n }\n\n return async () => {\n const updatedPackageJson = await formatPackage({\n ...packageJson,\n dependencies: output.dependencies,\n devDependencies: output.devDependencies,\n });\n\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n if (processors.length === 0) {\n return;\n }\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors,\n });\n };\n};\n"],
5
- "mappings": "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",
6
- "names": ["import_package", "path", "fs"]
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { type TextProcessor, copyFiles } from '../../utils/copy.js';\nimport { log } from '../../utils/logging.js';\nimport type { ProjectType } from '../../utils/manifest.js';\nimport { getLatestNpmVersion, getSkubaVersion } from '../../utils/version.js';\n\nimport { diffDependencies } from './analysis/package.js';\nimport * as dependencyMutators from './dependencies/index.js';\nimport { formatPackage } from './processing/package.js';\nimport type { DependencyDiff, PackageJson, ReadResult } from './types.js';\n\nconst logDiff = (diff: DependencyDiff): boolean => {\n const entries = Object.entries(diff);\n\n if (entries.length === 0) {\n log.ok('\u2714 No changes');\n\n return false;\n }\n\n Object.entries(diff)\n .sort(([nameA], [nameB]) => nameA.localeCompare(nameB))\n .forEach(([name, { operation, version }]) =>\n log.plain(operation, name, log.formatSubtle(version)),\n );\n\n return true;\n};\n\nconst pinUnspecifiedVersions = async (\n dependencies: Record<string, string | undefined>,\n): Promise<void> => {\n const updates = await Promise.all(\n Object.entries(dependencies)\n .filter(([, version]) => version === '*')\n .map(async ([name]) => {\n const version = await (name === 'skuba'\n ? getSkubaVersion()\n : getLatestNpmVersion(name));\n\n if (version === null) {\n throw new Error(`Failed to fetch latest version of ${name}`);\n }\n\n return [name, version] as const;\n }),\n );\n\n updates.forEach(([name, version]) => {\n dependencies[name] = version;\n });\n};\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: ReadResult;\n type: ProjectType;\n}\n\nexport const analyseDependencies = async ({\n destinationRoot,\n include,\n manifest: { packageJson },\n type,\n}: Props): Promise<undefined | (() => Promise<void>)> => {\n const input = {\n dependencies: packageJson.dependencies ?? {},\n devDependencies: packageJson.devDependencies ?? {},\n type,\n };\n\n const output = {\n dependencies: { ...input.dependencies },\n devDependencies: { ...input.devDependencies },\n type,\n };\n\n const processors = Object.values(dependencyMutators).reduce<TextProcessor[]>(\n (acc, mutate) => {\n const newProcessors = mutate(output);\n acc.push(...newProcessors);\n return acc;\n },\n [],\n );\n\n await Promise.all([\n pinUnspecifiedVersions(output.dependencies),\n pinUnspecifiedVersions(output.devDependencies),\n ]);\n\n const dependencyDiff = diffDependencies({\n old: input.dependencies,\n new: output.dependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dependencies:'));\n\n log.newline();\n const hasDependencyDiff = logDiff(dependencyDiff);\n\n const devDependencyDiff = diffDependencies({\n old: input.devDependencies,\n new: output.devDependencies,\n });\n\n log.newline();\n log.plain(log.bold('Dev dependencies:'));\n\n log.newline();\n const hasDevDependencyDiff = logDiff(devDependencyDiff);\n\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n\n if (!hasDependencyDiff && !hasDevDependencyDiff) {\n return;\n }\n\n return async () => {\n const updatedPackageJson = await formatPackage({\n ...packageJson,\n dependencies: output.dependencies,\n devDependencies: output.devDependencies,\n } as PackageJson);\n\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n if (processors.length === 0) {\n return;\n }\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors,\n });\n };\n};\n"],
5
+ "mappings": "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",
6
+ "names": []
7
7
  }
@@ -1,45 +1,11 @@
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 diff_exports = {};
30
- __export(diff_exports, {
31
- determineOperation: () => determineOperation
32
- });
33
- module.exports = __toCommonJS(diff_exports);
34
- var import_chalk = __toESM(require("chalk"));
1
+ import { styleText } from "node:util";
35
2
  const determineOperation = (oldData, newData) => {
36
3
  if (oldData === void 0) {
37
- return import_chalk.default.green("A");
4
+ return styleText("green", "A");
38
5
  }
39
- return newData === void 0 ? import_chalk.default.red("D") : import_chalk.default.yellow("M");
6
+ return newData === void 0 ? styleText("red", "D") : styleText("yellow", "M");
40
7
  };
41
- // Annotate the CommonJS export names for ESM import in node:
42
- 0 && (module.exports = {
8
+ export {
43
9
  determineOperation
44
- });
10
+ };
45
11
  //# sourceMappingURL=diff.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/analysis/diff.ts"],
4
- "sourcesContent": ["import chalk from 'chalk';\n\nexport const determineOperation = (\n oldData?: string,\n newData?: string,\n): string => {\n if (oldData === undefined) {\n return chalk.green('A');\n }\n\n return newData === undefined ? chalk.red('D') : chalk.yellow('M');\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAEX,MAAM,qBAAqB,CAChC,SACA,YACW;AACX,MAAI,YAAY,QAAW;AACzB,WAAO,aAAAA,QAAM,MAAM,GAAG;AAAA,EACxB;AAEA,SAAO,YAAY,SAAY,aAAAA,QAAM,IAAI,GAAG,IAAI,aAAAA,QAAM,OAAO,GAAG;AAClE;",
6
- "names": ["chalk"]
4
+ "sourcesContent": ["import { styleText } from 'node:util';\n\nexport const determineOperation = (\n oldData?: string,\n newData?: string,\n): string => {\n if (oldData === undefined) {\n return styleText('green', 'A');\n }\n\n return newData === undefined\n ? styleText('red', 'D')\n : styleText('yellow', 'M');\n};\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,qBAAqB,CAChC,SACA,YACW;AACX,MAAI,YAAY,QAAW;AACzB,WAAO,UAAU,SAAS,GAAG;AAAA,EAC/B;AAEA,SAAO,YAAY,SACf,UAAU,OAAO,GAAG,IACpB,UAAU,UAAU,GAAG;AAC7B;",
6
+ "names": []
7
7
  }
@@ -1,58 +1,24 @@
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 files_exports = {};
30
- __export(files_exports, {
31
- tsFileExists: () => tsFileExists
32
- });
33
- module.exports = __toCommonJS(files_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_error = require("../../../utils/error.js");
1
+ import path from "path";
2
+ import fs from "fs-extra";
3
+ import { isErrorWithCode } from "../../../utils/error.js";
37
4
  const tsFileExists = async (filePath) => {
38
- const ext = import_path.default.extname(filePath);
5
+ const ext = path.extname(filePath);
39
6
  if (ext !== "" && ext !== ".ts") {
40
7
  return false;
41
8
  }
42
9
  try {
43
- const stats = await import_fs_extra.default.promises.lstat(
10
+ const stats = await fs.promises.lstat(
44
11
  ext === "" ? `${filePath}.ts` : filePath
45
12
  );
46
13
  return stats.isFile();
47
14
  } catch (err) {
48
- if ((0, import_error.isErrorWithCode)(err, "ENOENT")) {
15
+ if (isErrorWithCode(err, "ENOENT")) {
49
16
  return false;
50
17
  }
51
18
  throw err;
52
19
  }
53
20
  };
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
21
+ export {
56
22
  tsFileExists
57
- });
23
+ };
58
24
  //# sourceMappingURL=files.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/analysis/files.ts"],
4
4
  "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { isErrorWithCode } from '../../../utils/error.js';\n\nexport const tsFileExists = async (filePath: string) => {\n const ext = path.extname(filePath);\n\n if (ext !== '' && ext !== '.ts') {\n return false;\n }\n\n try {\n const stats = await fs.promises.lstat(\n ext === '' ? `${filePath}.ts` : filePath,\n );\n\n return stats.isFile();\n } catch (err) {\n if (isErrorWithCode(err, 'ENOENT')) {\n return false;\n }\n\n throw err;\n }\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,mBAAgC;AAEzB,MAAM,eAAe,OAAO,aAAqB;AACtD,QAAM,MAAM,YAAAA,QAAK,QAAQ,QAAQ;AAEjC,MAAI,QAAQ,MAAM,QAAQ,OAAO;AAC/B,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,QAAQ,MAAM,gBAAAC,QAAG,SAAS;AAAA,MAC9B,QAAQ,KAAK,GAAG,QAAQ,QAAQ;AAAA,IAClC;AAEA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,KAAK;AACZ,YAAI,8BAAgB,KAAK,QAAQ,GAAG;AAClC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
6
- "names": ["path", "fs"]
5
+ "mappings": "AAAA,OAAO,UAAU;AAEjB,OAAO,QAAQ;AAEf,SAAS,uBAAuB;AAEzB,MAAM,eAAe,OAAO,aAAqB;AACtD,QAAM,MAAM,KAAK,QAAQ,QAAQ;AAEjC,MAAI,QAAQ,MAAM,QAAQ,OAAO;AAC/B,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,QAAQ,MAAM,GAAG,SAAS;AAAA,MAC9B,QAAQ,KAAK,GAAG,QAAQ,QAAQ;AAAA,IAClC;AAEA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,KAAK;AACZ,QAAI,gBAAgB,KAAK,QAAQ,GAAG;AAClC,aAAO;AAAA,IACT;AAEA,UAAM;AAAA,EACR;AACF;",
6
+ "names": []
7
7
  }
@@ -1,47 +1,14 @@
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 git_exports = {};
30
- __export(git_exports, {
31
- auditWorkingTree: () => auditWorkingTree
32
- });
33
- module.exports = __toCommonJS(git_exports);
34
- var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
- var import_dir = require("../../../utils/dir.js");
37
- var import_logging = require("../../../utils/logging.js");
1
+ import fs from "fs-extra";
2
+ import git from "isomorphic-git";
3
+ import { crawlDirectory } from "../../../utils/dir.js";
4
+ import { log } from "../../../utils/logging.js";
38
5
  const auditWorkingTree = async (dir) => {
39
- const filepaths = await (0, import_dir.crawlDirectory)(dir);
6
+ const filepaths = await crawlDirectory(dir);
40
7
  let anyFailed = false;
41
8
  const statuses = await Promise.all(
42
9
  filepaths.map(async (filepath) => {
43
10
  try {
44
- return await import_isomorphic_git.default.status({ dir, fs: import_fs_extra.default, filepath });
11
+ return await git.status({ dir, fs, filepath });
45
12
  } catch {
46
13
  anyFailed = true;
47
14
  return "absent";
@@ -51,17 +18,16 @@ const auditWorkingTree = async (dir) => {
51
18
  if (statuses.some(
52
19
  (status) => status !== "absent" && status !== "ignored" && status !== "unmodified"
53
20
  )) {
54
- import_logging.log.newline();
55
- import_logging.log.warn("You have dirty/untracked files that may be overwritten.");
21
+ log.newline();
22
+ log.warn("You have dirty/untracked files that may be overwritten.");
56
23
  } else if (anyFailed) {
57
- import_logging.log.newline();
58
- import_logging.log.warn(
24
+ log.newline();
25
+ log.warn(
59
26
  "Some files failed to be read. Check that you don't have any dirty/untracked files that may be overwritten."
60
27
  );
61
28
  }
62
29
  };
63
- // Annotate the CommonJS export names for ESM import in node:
64
- 0 && (module.exports = {
30
+ export {
65
31
  auditWorkingTree
66
- });
32
+ };
67
33
  //# sourceMappingURL=git.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/configure/analysis/git.ts"],
4
4
  "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { crawlDirectory } from '../../../utils/dir.js';\nimport { log } from '../../../utils/logging.js';\n\nexport const auditWorkingTree = async (dir: string) => {\n const filepaths = await crawlDirectory(dir);\n\n let anyFailed = false;\n\n const statuses = await Promise.all(\n filepaths.map(async (filepath) => {\n try {\n return await git.status({ dir, fs, filepath });\n } catch {\n // TODO: Why does isomorphic-git sometimes just _fail_?\n anyFailed = true;\n return 'absent';\n }\n }),\n );\n\n if (\n statuses.some(\n (status) =>\n status !== 'absent' && status !== 'ignored' && status !== 'unmodified',\n )\n ) {\n log.newline();\n log.warn('You have dirty/untracked files that may be overwritten.');\n } else if (anyFailed) {\n log.newline();\n log.warn(\n \"Some files failed to be read. Check that you don't have any dirty/untracked files that may be overwritten.\",\n );\n }\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAEhB,iBAA+B;AAC/B,qBAAoB;AAEb,MAAM,mBAAmB,OAAO,QAAgB;AACrD,QAAM,YAAY,UAAM,2BAAe,GAAG;AAE1C,MAAI,YAAY;AAEhB,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,UAAU,IAAI,OAAO,aAAa;AAChC,UAAI;AACF,eAAO,MAAM,sBAAAA,QAAI,OAAO,EAAE,KAAK,oBAAAC,SAAI,SAAS,CAAC;AAAA,MAC/C,QAAQ;AAEN,oBAAY;AACZ,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MACE,SAAS;AAAA,IACP,CAAC,WACC,WAAW,YAAY,WAAW,aAAa,WAAW;AAAA,EAC9D,GACA;AACA,uBAAI,QAAQ;AACZ,uBAAI,KAAK,yDAAyD;AAAA,EACpE,WAAW,WAAW;AACpB,uBAAI,QAAQ;AACZ,uBAAI;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": ["git", "fs"]
5
+ "mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,SAAS;AAEhB,SAAS,sBAAsB;AAC/B,SAAS,WAAW;AAEb,MAAM,mBAAmB,OAAO,QAAgB;AACrD,QAAM,YAAY,MAAM,eAAe,GAAG;AAE1C,MAAI,YAAY;AAEhB,QAAM,WAAW,MAAM,QAAQ;AAAA,IAC7B,UAAU,IAAI,OAAO,aAAa;AAChC,UAAI;AACF,eAAO,MAAM,IAAI,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;AAAA,MAC/C,QAAQ;AAEN,oBAAY;AACZ,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AAEA,MACE,SAAS;AAAA,IACP,CAAC,WACC,WAAW,YAAY,WAAW,aAAa,WAAW;AAAA,EAC9D,GACA;AACA,QAAI,QAAQ;AACZ,QAAI,KAAK,yDAAyD;AAAA,EACpE,WAAW,WAAW;AACpB,QAAI,QAAQ;AACZ,QAAI;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
7
  }
@@ -1,9 +1,8 @@
1
- import readPkgUp from 'read-pkg-up';
2
- import type { DependencyDiff } from '../types.js';
1
+ import type { DependencyDiff, ReadResult } from '../types.js';
3
2
  interface GetDestinationManifestProps {
4
3
  cwd?: string;
5
4
  }
6
- export declare const getDestinationManifest: (props?: GetDestinationManifestProps) => Promise<readPkgUp.ReadResult>;
5
+ export declare const getDestinationManifest: (props?: GetDestinationManifestProps) => Promise<ReadResult>;
7
6
  interface DiffDependenciesProps {
8
7
  old: Record<string, string | undefined>;
9
8
  new: Record<string, string | undefined>;
@@ -1,46 +1,12 @@
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
- diffDependencies: () => diffDependencies,
32
- getDestinationManifest: () => getDestinationManifest
33
- });
34
- module.exports = __toCommonJS(package_exports);
35
- var import_read_pkg_up = __toESM(require("read-pkg-up"));
36
- var import_logging = require("../../../utils/logging.js");
37
- var import_diff = require("./diff.js");
1
+ import { readPackageUp } from "read-package-up";
2
+ import { log } from "../../../utils/logging.js";
3
+ import { determineOperation } from "./diff.js";
38
4
  const getDestinationManifest = async (props) => {
39
- const result = await (0, import_read_pkg_up.default)({ ...props, normalize: false });
5
+ const result = await readPackageUp({ ...props, normalize: false });
40
6
  if (result === void 0) {
41
- import_logging.log.err(
7
+ log.err(
42
8
  "Could not find a",
43
- import_logging.log.bold("package.json"),
9
+ log.bold("package.json"),
44
10
  "in your working directory."
45
11
  );
46
12
  process.exit(1);
@@ -55,7 +21,7 @@ const diffDependencies = (props) => {
55
21
  return [];
56
22
  }
57
23
  const newVersion = props.new[name];
58
- const operation = (0, import_diff.determineOperation)(oldVersion, newVersion);
24
+ const operation = determineOperation(oldVersion, newVersion);
59
25
  const version = joinVersions(oldVersion, newVersion);
60
26
  return [[name, { operation, version }]];
61
27
  })
@@ -66,7 +32,7 @@ const diffDependencies = (props) => {
66
32
  return [];
67
33
  }
68
34
  const oldVersion = props.old[name];
69
- const operation = (0, import_diff.determineOperation)(oldVersion, version);
35
+ const operation = determineOperation(oldVersion, version);
70
36
  return [[name, { operation, version }]];
71
37
  })
72
38
  );
@@ -75,9 +41,8 @@ const diffDependencies = (props) => {
75
41
  ...additions
76
42
  };
77
43
  };
78
- // Annotate the CommonJS export names for ESM import in node:
79
- 0 && (module.exports = {
44
+ export {
80
45
  diffDependencies,
81
46
  getDestinationManifest
82
- });
47
+ };
83
48
  //# sourceMappingURL=package.js.map