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,50 +1,17 @@
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 internal_exports = {};
30
- __export(internal_exports, {
31
- internalLint: () => internalLint
32
- });
33
- module.exports = __toCommonJS(internal_exports);
34
- var import_util = require("util");
35
- var import_chalk = __toESM(require("chalk"));
36
- var import_logging = require("../../utils/logging.js");
37
- var import_detectBadCodeowners = require("./internalLints/detectBadCodeowners.js");
38
- var import_noSkubaTemplateJs = require("./internalLints/noSkubaTemplateJs.js");
39
- var import_refreshConfigFiles = require("./internalLints/refreshConfigFiles.js");
40
- var import_upgrade = require("./internalLints/upgrade/index.js");
1
+ import { styleText } from "node:util";
2
+ import { inspect } from "util";
3
+ import { childLogger, createLogger } from "../../utils/logging.js";
4
+ import { tryDetectBadCodeowners } from "./internalLints/detectBadCodeowners.js";
5
+ import { noSkubaTemplateJs } from "./internalLints/noSkubaTemplateJs.js";
6
+ import { tryRefreshConfigFiles } from "./internalLints/refreshConfigFiles.js";
7
+ import { upgradeSkuba } from "./internalLints/upgrade/index.js";
41
8
  const lints = [
42
9
  // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling
43
- [{ name: "upgrade-skuba", lint: import_upgrade.upgradeSkuba }],
10
+ [{ name: "upgrade-skuba", lint: upgradeSkuba }],
44
11
  [
45
- { name: "no-skuba-template-js", lint: import_noSkubaTemplateJs.noSkubaTemplateJs },
46
- { name: "refresh-config-files", lint: import_refreshConfigFiles.tryRefreshConfigFiles },
47
- { name: "detect-bad-codeowners", lint: import_detectBadCodeowners.tryDetectBadCodeowners }
12
+ { name: "no-skuba-template-js", lint: noSkubaTemplateJs },
13
+ { name: "refresh-config-files", lint: tryRefreshConfigFiles },
14
+ { name: "detect-bad-codeowners", lint: tryDetectBadCodeowners }
48
15
  ]
49
16
  ];
50
17
  const lintSerially = async (mode, logger, additionalFlags) => {
@@ -54,7 +21,7 @@ const lintSerially = async (mode, logger, additionalFlags) => {
54
21
  results.push(
55
22
  await lint(
56
23
  mode,
57
- (0, import_logging.childLogger)(logger, { suffixes: [import_chalk.default.dim(name)] }),
24
+ childLogger(logger, { suffixes: [styleText("dim", name)] }),
58
25
  additionalFlags
59
26
  )
60
27
  );
@@ -70,7 +37,7 @@ const lintConcurrently = async (mode, logger, additionalFlags) => {
70
37
  lintGroup.map(
71
38
  async ({ name, lint }) => lint(
72
39
  mode,
73
- (0, import_logging.childLogger)(logger, { suffixes: [import_chalk.default.dim(name)] }),
40
+ childLogger(logger, { suffixes: [styleText("dim", name)] }),
74
41
  additionalFlags
75
42
  )
76
43
  )
@@ -85,9 +52,11 @@ const selectLintFunction = (input) => {
85
52
  };
86
53
  const internalLint = async (mode, input) => {
87
54
  const start = process.hrtime.bigint();
88
- const logger = (0, import_logging.createLogger)({
55
+ const logger = createLogger({
89
56
  debug: input?.debug ?? false,
90
- prefixes: [...mode === "lint" ? [import_chalk.default.blueBright("skuba \u2502")] : []]
57
+ prefixes: [
58
+ ...mode === "lint" ? [styleText("blueBright", "skuba \u2502")] : []
59
+ ]
91
60
  });
92
61
  try {
93
62
  const lint = selectLintFunction(input);
@@ -98,7 +67,7 @@ const internalLint = async (mode, input) => {
98
67
  return result;
99
68
  } catch (err) {
100
69
  logger.err(logger.bold("Failed to run skuba lints."));
101
- logger.subtle((0, import_util.inspect)(err));
70
+ logger.subtle(inspect(err));
102
71
  process.exitCode = 1;
103
72
  return { ok: false, fixable: false, annotations: [] };
104
73
  }
@@ -111,8 +80,7 @@ const combineResults = (results) => results.reduce(
111
80
  }),
112
81
  { ok: true, fixable: false }
113
82
  );
114
- // Annotate the CommonJS export names for ESM import in node:
115
- 0 && (module.exports = {
83
+ export {
116
84
  internalLint
117
- });
85
+ };
118
86
  //# sourceMappingURL=internal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/lint/internal.ts"],
4
- "sourcesContent": ["import { inspect } from 'util';\n\nimport chalk from 'chalk';\n\nimport { type Logger, childLogger, createLogger } from '../../utils/logging.js';\n\nimport { tryDetectBadCodeowners } from './internalLints/detectBadCodeowners.js';\nimport { noSkubaTemplateJs } from './internalLints/noSkubaTemplateJs.js';\nimport { tryRefreshConfigFiles } from './internalLints/refreshConfigFiles.js';\nimport { upgradeSkuba } from './internalLints/upgrade/index.js';\nimport type { Input } from './types.js';\n\nexport type InternalLintResult = {\n ok: boolean;\n fixable: boolean;\n annotations?: Array<{\n start_line?: number;\n end_line?: number;\n path: string;\n message: string;\n }>;\n};\n\nconst lints: Array<\n Array<{\n name: string;\n lint: (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n ) => Promise<InternalLintResult>;\n }>\n> = [\n // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling\n [{ name: 'upgrade-skuba', lint: upgradeSkuba }],\n [\n { name: 'no-skuba-template-js', lint: noSkubaTemplateJs },\n { name: 'refresh-config-files', lint: tryRefreshConfigFiles },\n { name: 'detect-bad-codeowners', lint: tryDetectBadCodeowners },\n ],\n];\n\nconst lintSerially = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n for (const lintGroup of lints) {\n for (const { lint, name } of lintGroup) {\n results.push(\n await lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n );\n }\n }\n return results;\n};\n\nconst lintConcurrently = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n\n for (const lintGroup of lints) {\n results.push(\n ...(await Promise.all(\n lintGroup.map(async ({ name, lint }) =>\n lint(\n mode,\n childLogger(logger, { suffixes: [chalk.dim(name)] }),\n additionalFlags,\n ),\n ),\n )),\n );\n }\n\n return results;\n};\n\nconst selectLintFunction = (input?: Input) => {\n const isSerial = input?.debug || input?.serial;\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const internalLint = async (\n mode: 'format' | 'lint',\n input?: Input,\n): Promise<InternalLintResult> => {\n const start = process.hrtime.bigint();\n const logger = createLogger({\n debug: input?.debug ?? false,\n prefixes: [...(mode === 'lint' ? [chalk.blueBright('skuba \u2502')] : [])],\n });\n\n try {\n const lint = selectLintFunction(input);\n const results = await lint(mode, logger, input?.additionalFlags ?? []);\n const result = combineResults(results);\n const end = process.hrtime.bigint();\n logger.plain(`Processed skuba lints in ${logger.timing(start, end)}.`);\n return result;\n } catch (err) {\n logger.err(logger.bold('Failed to run skuba lints.'));\n logger.subtle(inspect(err));\n\n process.exitCode = 1;\n\n return { ok: false, fixable: false, annotations: [] };\n }\n};\n\nconst combineResults = (results: InternalLintResult[]): InternalLintResult =>\n results.reduce(\n (cur, next) => ({\n ok: cur.ok && next.ok,\n fixable: cur.fixable || next.fixable,\n annotations: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AkB;AAC5C,QAAM,WAAW,OAAO,SAAS,OAAO;AACxC,SAAO,WAAW,eAAe;AACnC;AAEO,MAAM,eAAe,OAC1B,MACA,UACgC;AAChC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AACpC,QAAM,aAAS,6BAAa;AAAA,IAC1B,OAAO,OAAO,SAAS;AAAA,IACvB,UAAU,CAAC,GAAI,SAAS,SAAS,CAAC,aAAAA,QAAM,WAAW,iBAAY,CAAC,IAAI,CAAC,CAAE;AAAA,EACzE,CAAC;AAED,MAAI;AACF,UAAM,OAAO,mBAAmB,KAAK;AACrC,UAAM,UAAU,MAAM,KAAK,MAAM,QAAQ,OAAO,mBAAmB,CAAC,CAAC;AACrE,UAAM,SAAS,eAAe,OAAO;AACrC,UAAM,MAAM,QAAQ,OAAO,OAAO;AAClC,WAAO,MAAM,4BAA4B,OAAO,OAAO,OAAO,GAAG,CAAC,GAAG;AACrE,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,WAAO,IAAI,OAAO,KAAK,4BAA4B,CAAC;AACpD,WAAO,WAAO,qBAAQ,GAAG,CAAC;AAE1B,YAAQ,WAAW;AAEnB,WAAO,EAAE,IAAI,OAAO,SAAS,OAAO,aAAa,CAAC,EAAE;AAAA,EACtD;AACF;AAEA,MAAM,iBAAiB,CAAC,YACtB,QAAQ;AAAA,EACN,CAAC,KAAK,UAAU;AAAA,IACd,IAAI,IAAI,MAAM,KAAK;AAAA,IACnB,SAAS,IAAI,WAAW,KAAK;AAAA,IAC7B,aAAa,CAAC,GAAI,IAAI,eAAe,CAAC,GAAI,GAAI,KAAK,eAAe,CAAC,CAAE;AAAA,EACvE;AAAA,EACA,EAAE,IAAI,MAAM,SAAS,MAAM;AAC7B;",
6
- "names": ["chalk"]
4
+ "sourcesContent": ["import { styleText } from 'node:util';\nimport { inspect } from 'util';\n\nimport { type Logger, childLogger, createLogger } from '../../utils/logging.js';\n\nimport { tryDetectBadCodeowners } from './internalLints/detectBadCodeowners.js';\nimport { noSkubaTemplateJs } from './internalLints/noSkubaTemplateJs.js';\nimport { tryRefreshConfigFiles } from './internalLints/refreshConfigFiles.js';\nimport { upgradeSkuba } from './internalLints/upgrade/index.js';\nimport type { Input } from './types.js';\n\nexport type InternalLintResult = {\n ok: boolean;\n fixable: boolean;\n annotations?: Array<{\n start_line?: number;\n end_line?: number;\n path: string;\n message: string;\n }>;\n};\n\nconst lints: Array<\n Array<{\n name: string;\n lint: (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n ) => Promise<InternalLintResult>;\n }>\n> = [\n // Run upgradeSkuba first, in particular before refreshConfigFiles, for npmrc handling\n [{ name: 'upgrade-skuba', lint: upgradeSkuba }],\n [\n { name: 'no-skuba-template-js', lint: noSkubaTemplateJs },\n { name: 'refresh-config-files', lint: tryRefreshConfigFiles },\n { name: 'detect-bad-codeowners', lint: tryDetectBadCodeowners },\n ],\n];\n\nconst lintSerially = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n for (const lintGroup of lints) {\n for (const { lint, name } of lintGroup) {\n results.push(\n await lint(\n mode,\n childLogger(logger, { suffixes: [styleText('dim', name)] }),\n additionalFlags,\n ),\n );\n }\n }\n return results;\n};\n\nconst lintConcurrently = async (\n mode: 'format' | 'lint',\n logger: Logger,\n additionalFlags: string[],\n) => {\n const results: InternalLintResult[] = [];\n\n for (const lintGroup of lints) {\n results.push(\n ...(await Promise.all(\n lintGroup.map(async ({ name, lint }) =>\n lint(\n mode,\n childLogger(logger, { suffixes: [styleText('dim', name)] }),\n additionalFlags,\n ),\n ),\n )),\n );\n }\n\n return results;\n};\n\nconst selectLintFunction = (input?: Input) => {\n const isSerial = input?.debug || input?.serial;\n return isSerial ? lintSerially : lintConcurrently;\n};\n\nexport const internalLint = async (\n mode: 'format' | 'lint',\n input?: Input,\n): Promise<InternalLintResult> => {\n const start = process.hrtime.bigint();\n const logger = createLogger({\n debug: input?.debug ?? false,\n prefixes: [\n ...(mode === 'lint' ? [styleText('blueBright', 'skuba \u2502')] : []),\n ],\n });\n\n try {\n const lint = selectLintFunction(input);\n const results = await lint(mode, logger, input?.additionalFlags ?? []);\n const result = combineResults(results);\n const end = process.hrtime.bigint();\n logger.plain(`Processed skuba lints in ${logger.timing(start, end)}.`);\n return result;\n } catch (err) {\n logger.err(logger.bold('Failed to run skuba lints.'));\n logger.subtle(inspect(err));\n\n process.exitCode = 1;\n\n return { ok: false, fixable: false, annotations: [] };\n }\n};\n\nconst combineResults = (results: InternalLintResult[]): InternalLintResult =>\n results.reduce(\n (cur, next) => ({\n ok: cur.ok && next.ok,\n fixable: cur.fixable || next.fixable,\n annotations: [...(cur.annotations ?? []), ...(next.annotations ?? [])],\n }),\n { ok: true, fixable: false },\n );\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AAExB,SAAsB,aAAa,oBAAoB;AAEvD,SAAS,8BAA8B;AACvC,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAc7B,MAAM,QASF;AAAA;AAAA,EAEF,CAAC,EAAE,MAAM,iBAAiB,MAAM,aAAa,CAAC;AAAA,EAC9C;AAAA,IACE,EAAE,MAAM,wBAAwB,MAAM,kBAAkB;AAAA,IACxD,EAAE,MAAM,wBAAwB,MAAM,sBAAsB;AAAA,IAC5D,EAAE,MAAM,yBAAyB,MAAM,uBAAuB;AAAA,EAChE;AACF;AAEA,MAAM,eAAe,OACnB,MACA,QACA,oBACG;AACH,QAAM,UAAgC,CAAC;AACvC,aAAW,aAAa,OAAO;AAC7B,eAAW,EAAE,MAAM,KAAK,KAAK,WAAW;AACtC,cAAQ;AAAA,QACN,MAAM;AAAA,UACJ;AAAA,UACA,YAAY,QAAQ,EAAE,UAAU,CAAC,UAAU,OAAO,IAAI,CAAC,EAAE,CAAC;AAAA,UAC1D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MA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AAU;AAAA,IACd,IAAI,IAAI,MAAM,KAAK;AAAA,IACnB,SAAS,IAAI,WAAW,KAAK;AAAA,IAC7B,aAAa,CAAC,GAAI,IAAI,eAAe,CAAC,GAAI,GAAI,KAAK,eAAe,CAAC,CAAE;AAAA,EACvE;AAAA,EACA,EAAE,IAAI,MAAM,SAAS,MAAM;AAC7B;",
6
+ "names": []
7
7
  }
@@ -1,33 +1,9 @@
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 detectBadCodeowners_exports = {};
20
- __export(detectBadCodeowners_exports, {
21
- detectBadCodeowners: () => detectBadCodeowners,
22
- tryDetectBadCodeowners: () => tryDetectBadCodeowners
23
- });
24
- module.exports = __toCommonJS(detectBadCodeowners_exports);
25
- var import_util = require("util");
26
- var import__ = require("../../../index.js");
27
- var import_project = require("../../configure/analysis/project.js");
1
+ import { inspect } from "util";
2
+ import { Git } from "../../../index.js";
3
+ import { createDestinationFileReader } from "../../configure/analysis/project.js";
28
4
  const detectBadCodeowners = async (logger) => {
29
- const gitRoot = await import__.Git.findRoot({ dir: process.cwd() });
30
- const reader = (0, import_project.createDestinationFileReader)(gitRoot ?? process.cwd());
5
+ const gitRoot = await Git.findRoot({ dir: process.cwd() });
6
+ const reader = createDestinationFileReader(gitRoot ?? process.cwd());
31
7
  const annotations = (await Promise.all(
32
8
  [".github/CODEOWNERS", "CODEOWNERS", "docs/CODEOWNERS"].map(
33
9
  async (filename) => {
@@ -58,7 +34,7 @@ const tryDetectBadCodeowners = async (_mode, logger) => {
58
34
  return await detectBadCodeowners(logger);
59
35
  } catch (err) {
60
36
  logger.warn("Failed to detect bad CODEOWNERS.");
61
- logger.subtle((0, import_util.inspect)(err));
37
+ logger.subtle(inspect(err));
62
38
  return {
63
39
  ok: false,
64
40
  fixable: false,
@@ -66,9 +42,8 @@ const tryDetectBadCodeowners = async (_mode, logger) => {
66
42
  };
67
43
  }
68
44
  };
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
45
+ export {
71
46
  detectBadCodeowners,
72
47
  tryDetectBadCodeowners
73
- });
48
+ };
74
49
  //# sourceMappingURL=detectBadCodeowners.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/lint/internalLints/detectBadCodeowners.ts"],
4
4
  "sourcesContent": ["import { inspect } from 'util';\n\nimport { Git } from '../../../index.js';\nimport type { Logger } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\nimport type { InternalLintResult } from '../internal.js';\n\nexport const detectBadCodeowners = async (\n logger: Logger,\n): Promise<InternalLintResult> => {\n const gitRoot = await Git.findRoot({ dir: process.cwd() });\n const reader = createDestinationFileReader(gitRoot ?? process.cwd());\n\n const annotations = (\n await Promise.all(\n ['.github/CODEOWNERS', 'CODEOWNERS', 'docs/CODEOWNERS'].map(\n async (filename) => {\n const lines = (await reader(filename))?.split('\\n');\n\n if (lines?.some((line) => line.startsWith('- '))) {\n return [\n {\n message:\n 'CODEOWNERS file has a line starting with `- `. This is probably an autoformatting mistake, where your editor thinks this file is a markdown file and is trying to format a list item. Did you mean to use `*` instead?',\n path: filename,\n },\n ];\n }\n\n return [];\n },\n ),\n )\n )\n .flat()\n .toSorted((a, b) => a.path.localeCompare(b.path));\n\n annotations.forEach(({ path, message }) => {\n logger.warn(`${path}: ${message}`);\n });\n\n return {\n ok: annotations.length === 0,\n fixable: false,\n annotations,\n };\n};\n\nexport const tryDetectBadCodeowners = async (\n _mode: 'format' | 'lint',\n logger: Logger,\n): Promise<InternalLintResult> => {\n try {\n return await detectBadCodeowners(logger);\n } catch (err) {\n logger.warn('Failed to detect bad CODEOWNERS.');\n logger.subtle(inspect(err));\n\n return {\n ok: false,\n fixable: false,\n annotations: [],\n };\n }\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,eAAoB;AAEpB,qBAA4C;AAGrC,MAAM,sBAAsB,OACjC,WACgC;AAChC,QAAM,UAAU,MAAM,aAAI,SAAS,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC;AACzD,QAAM,aAAS,4CAA4B,WAAW,QAAQ,IAAI,CAAC;AAEnE,QAAM,eACJ,MAAM,QAAQ;AAAA,IACZ,CAAC,sBAAsB,cAAc,iBAAiB,EAAE;AAAA,MACtD,OAAO,aAAa;AAClB,cAAM,SAAS,MAAM,OAAO,QAAQ,IAAI,MAAM,IAAI;AAElD,YAAI,OAAO,KAAK,CAAC,SAAS,KAAK,WAAW,IAAI,CAAC,GAAG;AAChD,iBAAO;AAAA,YACL;AAAA,cACE,SACE;AAAA,cACF,MAAM;AAAA,YACR;AAAA,UACF;AAAA,QACF;AAEA,eAAO,CAAC;AAAA,MACV;AAAA,IACF;AAAA,EACF,GAEC,KAAK,EACL,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAElD,cAAY,QAAQ,CAAC,EAAE,MAAM,QAAQ,MAAM;AACzC,WAAO,KAAK,GAAG,IAAI,KAAK,OAAO,EAAE;AAAA,EACnC,CAAC;AAED,SAAO;AAAA,IACL,IAAI,YAAY,WAAW;AAAA,IAC3B,SAAS;AAAA,IACT;AAAA,EACF;AACF;AAEO,M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AS,KAAK;AACZ,WAAO,KAAK,kCAAkC;AAC9C,WAAO,OAAO,QAAQ,GAAG,CAAC;AAE1B,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,aAAa,CAAC;AAAA,IAChB;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,58 +1,23 @@
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 noSkubaTemplateJs_exports = {};
30
- __export(noSkubaTemplateJs_exports, {
31
- noSkubaTemplateJs: () => noSkubaTemplateJs
32
- });
33
- module.exports = __toCommonJS(noSkubaTemplateJs_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs = require("../../../utils/fs.js");
36
- var import_manifest = require("../../../utils/manifest.js");
37
- var import_packageManager = require("../../../utils/packageManager.js");
1
+ import path from "path";
2
+ import { pathExists } from "../../../utils/fs.js";
3
+ import { getConsumerManifest } from "../../../utils/manifest.js";
4
+ import { detectPackageManager } from "../../../utils/packageManager.js";
38
5
  const noSkubaTemplateJs = async (_mode, logger) => {
39
6
  const [manifest, packageManager] = await Promise.all([
40
- (0, import_manifest.getConsumerManifest)(),
41
- (0, import_packageManager.detectPackageManager)()
7
+ getConsumerManifest(),
8
+ detectPackageManager()
42
9
  ]);
43
10
  if (!manifest) {
44
11
  return { ok: true, fixable: false };
45
12
  }
46
- const templateConfigPath = import_path.default.join(
47
- import_path.default.dirname(manifest.path),
13
+ const templateConfigPath = path.join(
14
+ path.dirname(manifest.path),
48
15
  "skuba.template.js"
49
16
  );
50
- if (await (0, import_fs.pathExists)(templateConfigPath)) {
17
+ if (await pathExists(templateConfigPath)) {
51
18
  logger.err(
52
19
  `Template is incomplete; run ${logger.bold(
53
- packageManager.print.exec,
54
- "skuba",
55
- "configure"
20
+ `${packageManager.print.exec} skuba configure`
56
21
  )}. ${logger.dim("no-skuba-template-js")}`
57
22
  );
58
23
  return {
@@ -68,8 +33,7 @@ const noSkubaTemplateJs = async (_mode, logger) => {
68
33
  }
69
34
  return { ok: true, fixable: false };
70
35
  };
71
- // Annotate the CommonJS export names for ESM import in node:
72
- 0 && (module.exports = {
36
+ export {
73
37
  noSkubaTemplateJs
74
- });
38
+ };
75
39
  //# sourceMappingURL=noSkubaTemplateJs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/lint/internalLints/noSkubaTemplateJs.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport { pathExists } from '../../../utils/fs.js';\nimport type { Logger } from '../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../utils/manifest.js';\nimport { detectPackageManager } from '../../../utils/packageManager.js';\nimport type { InternalLintResult } from '../internal.js';\n\nexport const noSkubaTemplateJs = async (\n _mode: 'format' | 'lint',\n logger: Logger,\n): Promise<InternalLintResult> => {\n const [manifest, packageManager] = await Promise.all([\n getConsumerManifest(),\n detectPackageManager(),\n ]);\n\n if (!manifest) {\n // This will throw elsewhere\n return { ok: true, fixable: false };\n }\n\n const templateConfigPath = path.join(\n path.dirname(manifest.path),\n 'skuba.template.js',\n );\n\n if (await pathExists(templateConfigPath)) {\n logger.err(\n `Template is incomplete; run ${logger.bold(\n packageManager.print.exec,\n 'skuba',\n 'configure',\n )}. ${logger.dim('no-skuba-template-js')}`,\n );\n\n return {\n ok: false,\n fixable: false,\n annotations: [\n {\n path: 'skuba.template.js',\n message: `Template is incomplete; run ${packageManager.print.exec} skuba configure.`,\n },\n ],\n };\n }\n\n return { ok: true, fixable: false };\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,gBAA2B;AAE3B,sBAAoC;AACpC,4BAAqC;AAG9B,MAAM,oBAAoB,OAC/B,OACA,WACgC;AAChC,QAAM,CAAC,UAAU,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,QACnD,qCAAoB;AAAA,QACpB,4CAAqB;AAAA,EACvB,CAAC;AAED,MAAI,CAAC,UAAU;AAEb,WAAO,EAAE,IAAI,MAAM,SAAS,MAAM;AAAA,EACpC;AAEA,QAAM,qBAAqB,YAAAA,QAAK;AAAA,IAC9B,YAAAA,QAAK,QAAQ,SAAS,IAAI;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,UAAM,sBAAW,kBAAkB,GAAG;AACxC,WAAO;AAAA,MACL,+BAA+B,OAAO;AAAA,QACpC,eAAe,MAAM;AAAA,QACrB;AAAA,QACA;AAAA,MACF,CAAC,KAAK,OAAO,IAAI,sBAAsB,CAAC;AAAA,IAC1C;AAEA,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,QACX;AAAA,UACE,MAAM;AAAA,UACN,SAAS,+BAA+B,eAAe,MAAM,IAAI;AAAA,QACnE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,MAAM,SAAS,MAAM;AACpC;",
6
- "names": ["path"]
4
+ "sourcesContent": ["import path from 'path';\n\nimport { pathExists } from '../../../utils/fs.js';\nimport type { Logger } from '../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../utils/manifest.js';\nimport { detectPackageManager } from '../../../utils/packageManager.js';\nimport type { InternalLintResult } from '../internal.js';\n\nexport const noSkubaTemplateJs = async (\n _mode: 'format' | 'lint',\n logger: Logger,\n): Promise<InternalLintResult> => {\n const [manifest, packageManager] = await Promise.all([\n getConsumerManifest(),\n detectPackageManager(),\n ]);\n\n if (!manifest) {\n // This will throw elsewhere\n return { ok: true, fixable: false };\n }\n\n const templateConfigPath = path.join(\n path.dirname(manifest.path),\n 'skuba.template.js',\n );\n\n if (await pathExists(templateConfigPath)) {\n logger.err(\n `Template is incomplete; run ${logger.bold(\n `${packageManager.print.exec} skuba configure`,\n )}. ${logger.dim('no-skuba-template-js')}`,\n );\n\n return {\n ok: false,\n fixable: false,\n annotations: [\n {\n path: 'skuba.template.js',\n message: `Template is incomplete; run ${packageManager.print.exec} skuba configure.`,\n },\n ],\n };\n }\n\n return { ok: true, fixable: false };\n};\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AAEjB,SAAS,kBAAkB;AAE3B,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AAG9B,MAAM,oBAAoB,OAC/B,OACA,WACgC;AAChC,QAAM,CAAC,UAAU,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,IACnD,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,EACvB,CAAC;AAED,MAAI,CAAC,UAAU;AAEb,WAAO,EAAE,IAAI,MAAM,SAAS,MAAM;AAAA,EACpC;AAEA,QAAM,qBAAqB,KAAK;AAAA,IAC9B,KAAK,QAAQ,SAAS,IAAI;AAAA,IAC1B;AAAA,EACF;AAEA,MAAI,MAAM,WAAW,kBAAkB,GAAG;AACxC,WAAO;AAAA,MACL,+BAA+B,OAAO;AAAA,QACpC,GAAG,eAAe,MAAM,IAAI;AAAA,MAC9B,CAAC,KAAK,OAAO,IAAI,sBAAsB,CAAC;AAAA,IAC1C;AAEA,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,QACX;AAAA,UACE,MAAM;AAAA,UACN,SAAS,+BAA+B,eAAe,MAAM,IAAI;AAAA,QACnE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,IAAI,MAAM,SAAS,MAAM;AACpC;",
6
+ "names": []
7
7
  }
@@ -1,46 +1,13 @@
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 patchRenovateConfig_exports = {};
30
- __export(patchRenovateConfig_exports, {
31
- tryPatchRenovateConfig: () => tryPatchRenovateConfig
32
- });
33
- module.exports = __toCommonJS(patchRenovateConfig_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_util = require("util");
36
- var import_fs_extra = __toESM(require("fs-extra"));
37
- var fleece = __toESM(require("golden-fleece"));
38
- var z = __toESM(require("zod/v4"));
39
- var import_logging = require("../../../utils/logging.js");
40
- var import_project = require("../../configure/analysis/project.js");
41
- var import_renovate = require("../../configure/modules/renovate.js");
42
- var import_prettier = require("../../configure/processing/prettier.js");
43
- var Git = __toESM(require("@skuba-lib/api/git"));
1
+ import path from "path";
2
+ import { inspect } from "util";
3
+ import fs from "fs-extra";
4
+ import * as fleece from "golden-fleece";
5
+ import * as z from "zod/v4";
6
+ import { log } from "../../../utils/logging.js";
7
+ import { createDestinationFileReader } from "../../configure/analysis/project.js";
8
+ import { RENOVATE_CONFIG_FILENAMES } from "../../configure/modules/renovate.js";
9
+ import { formatPrettier } from "../../configure/processing/prettier.js";
10
+ import * as Git from "@skuba-lib/api/git";
44
11
  const EXISTING_REPO_PRESET_REGEX = /(github|local)>(seek-jobs|seekasia)\//;
45
12
  const renovateConfigSchema = z.object({
46
13
  extends: z.array(z.string())
@@ -63,9 +30,9 @@ const patchJson = async ({ filepath, input, presetToAdd }) => {
63
30
  return;
64
31
  }
65
32
  config.data.extends.unshift(presetToAdd);
66
- await import_fs_extra.default.promises.writeFile(
33
+ await fs.promises.writeFile(
67
34
  filepath,
68
- await (0, import_prettier.formatPrettier)(JSON.stringify(config.data), { parser: "json" })
35
+ await formatPrettier(JSON.stringify(config.data), { parser: "json" })
69
36
  );
70
37
  return;
71
38
  };
@@ -76,9 +43,9 @@ const patchJson5 = async ({ filepath, input, presetToAdd }) => {
76
43
  return;
77
44
  }
78
45
  config.data.extends.unshift(presetToAdd);
79
- await import_fs_extra.default.promises.writeFile(
46
+ await fs.promises.writeFile(
80
47
  filepath,
81
- await (0, import_prettier.formatPrettier)(fleece.patch(input, config.data), { parser: "json5" })
48
+ await formatPrettier(fleece.patch(input, config.data), { parser: "json5" })
82
49
  );
83
50
  return;
84
51
  };
@@ -87,7 +54,7 @@ const patchByFiletype = {
87
54
  json5: patchJson5
88
55
  };
89
56
  const patchRenovateConfig = async (mode, dir) => {
90
- const readFile = (0, import_project.createDestinationFileReader)(dir);
57
+ const readFile = createDestinationFileReader(dir);
91
58
  const { owner } = await Git.getOwnerAndRepo({ dir });
92
59
  const presetToAdd = ownerToRenovatePreset(owner);
93
60
  if (!presetToAdd) {
@@ -97,7 +64,7 @@ const patchRenovateConfig = async (mode, dir) => {
97
64
  };
98
65
  }
99
66
  const maybeConfigs = await Promise.all(
100
- import_renovate.RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({
67
+ RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({
101
68
  input: await readFile(filepath),
102
69
  filepath
103
70
  }))
@@ -123,7 +90,7 @@ const patchRenovateConfig = async (mode, dir) => {
123
90
  const filetype = config.filepath.toLowerCase().endsWith(".json5") ? "json5" : "json";
124
91
  const patchFile = patchByFiletype[filetype];
125
92
  await patchFile({
126
- filepath: import_path.default.resolve(dir, config.filepath),
93
+ filepath: path.resolve(dir, config.filepath),
127
94
  input: config.input,
128
95
  presetToAdd
129
96
  });
@@ -140,13 +107,12 @@ const tryPatchRenovateConfig = (async ({
140
107
  }
141
108
  return await patchRenovateConfig(mode, gitRoot);
142
109
  } catch (err) {
143
- import_logging.log.warn("Failed to patch Renovate config.");
144
- import_logging.log.subtle((0, import_util.inspect)(err));
110
+ log.warn("Failed to patch Renovate config.");
111
+ log.subtle(inspect(err));
145
112
  return { result: "skip", reason: "due to an error" };
146
113
  }
147
114
  });
148
- // Annotate the CommonJS export names for ESM import in node:
149
- 0 && (module.exports = {
115
+ export {
150
116
  tryPatchRenovateConfig
151
- });
117
+ };
152
118
  //# sourceMappingURL=patchRenovateConfig.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cli/lint/internalLints/patchRenovateConfig.ts"],
4
4
  "sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\nimport * as fleece from 'golden-fleece';\nimport * as z from 'zod/v4';\n\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\nimport { RENOVATE_CONFIG_FILENAMES } from '../../configure/modules/renovate.js';\nimport { formatPrettier } from '../../configure/processing/prettier.js';\n\nimport type { PatchFunction, PatchReturnType } from './upgrade/index.js';\n\nimport * as Git from '@skuba-lib/api/git';\n\nconst EXISTING_REPO_PRESET_REGEX = /(github|local)>(seek-jobs|seekasia)\\//;\n\ntype RenovateFiletype = 'json' | 'json5';\n\ntype RenovatePreset =\n | 'local>seekasia/renovate-config'\n | 'local>seek-jobs/renovate-config';\n\nconst renovateConfigSchema = z.object({\n extends: z.array(z.string()),\n});\n\nconst ownerToRenovatePreset = (owner: string): RenovatePreset | undefined => {\n const lowercaseOwner = owner.toLowerCase();\n\n switch (lowercaseOwner) {\n case 'seekasia':\n return 'local>seekasia/renovate-config';\n\n case 'seek-jobs':\n return 'local>seek-jobs/renovate-config';\n\n default:\n return;\n }\n};\n\ntype PatchFile = (props: {\n filepath: string;\n input: string;\n presetToAdd: RenovatePreset;\n}) => Promise<void>;\n\nconst patchJson: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const json: unknown = JSON.parse(input);\n\n const config = renovateConfigSchema.safeParse(json);\n\n if (!config.success) {\n return;\n }\n\n config.data.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n await formatPrettier(JSON.stringify(config.data), { parser: 'json' }),\n );\n\n return;\n};\n\nconst patchJson5: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const json: unknown = fleece.evaluate(input);\n\n const config = renovateConfigSchema.safeParse(json);\n\n if (!config.success) {\n return;\n }\n\n config.data.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n await formatPrettier(fleece.patch(input, config.data), { parser: 'json5' }),\n );\n\n return;\n};\n\nconst patchByFiletype: Record<RenovateFiletype, PatchFile> = {\n json: patchJson,\n json5: patchJson5,\n};\n\nconst patchRenovateConfig = async (\n mode: 'format' | 'lint',\n dir: string,\n): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(dir);\n\n const { owner } = await Git.getOwnerAndRepo({ dir });\n\n const presetToAdd = ownerToRenovatePreset(owner);\n\n if (!presetToAdd) {\n return {\n result: 'skip',\n reason: 'owner does not map to a SEEK preset',\n };\n }\n\n const maybeConfigs = await Promise.all(\n RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({\n input: await readFile(filepath),\n filepath,\n })),\n );\n\n const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));\n if (!config?.input) {\n return { result: 'skip', reason: 'no config found' };\n }\n\n if (\n // The file appears to mention the baseline preset for the configured Git\n // owner. This is a naive check for simplicity.\n config.input.includes(presetToAdd) ||\n // Ignore any renovate configuration which already extends a SEEK-Jobs or seekasia config\n EXISTING_REPO_PRESET_REGEX.exec(config.input)\n ) {\n return {\n result: 'skip',\n reason: 'config already has a SEEK preset',\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n const filetype: RenovateFiletype = config.filepath\n .toLowerCase()\n .endsWith('.json5')\n ? 'json5'\n : 'json';\n\n const patchFile = patchByFiletype[filetype];\n\n await patchFile({\n filepath: path.resolve(dir, config.filepath),\n input: config.input,\n presetToAdd,\n });\n\n return { result: 'apply' };\n};\n\nexport const tryPatchRenovateConfig = (async ({\n mode,\n dir = process.cwd(),\n}) => {\n try {\n // In a monorepo we may be invoked within a subdirectory, but we are working\n // with Renovate config that should be relative to the repository root.\n const gitRoot = await Git.findRoot({ dir });\n if (!gitRoot) {\n return { result: 'skip', reason: 'no Git root found' };\n }\n\n return await patchRenovateConfig(mode, gitRoot);\n } catch (err) {\n log.warn('Failed to patch Renovate config.');\n log.subtle(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