skuba 0.0.0-master-20230318044948

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 (563) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -0
  3. package/config/eslint.js +3 -0
  4. package/config/jest.js +1 -0
  5. package/config/prettier.d.ts +3 -0
  6. package/config/prettier.js +5 -0
  7. package/config/tsconfig.json +9 -0
  8. package/jest/moduleNameMapper.js +58 -0
  9. package/jest/moduleNameMapper.test.ts +64 -0
  10. package/jest/transform.js +50 -0
  11. package/jest/transform.test.ts +11 -0
  12. package/jest/tsConfig.js +26 -0
  13. package/jest-preset.js +34 -0
  14. package/lib/api/buildkite/annotate.d.ts +26 -0
  15. package/lib/api/buildkite/annotate.js +49 -0
  16. package/lib/api/buildkite/annotate.js.map +7 -0
  17. package/lib/api/buildkite/index.d.ts +3 -0
  18. package/lib/api/buildkite/index.js +32 -0
  19. package/lib/api/buildkite/index.js.map +7 -0
  20. package/lib/api/buildkite/md.d.ts +6 -0
  21. package/lib/api/buildkite/md.js +33 -0
  22. package/lib/api/buildkite/md.js.map +7 -0
  23. package/lib/api/git/commit.d.ts +15 -0
  24. package/lib/api/git/commit.js +52 -0
  25. package/lib/api/git/commit.js.map +7 -0
  26. package/lib/api/git/commitAllChanges.d.ts +19 -0
  27. package/lib/api/git/commitAllChanges.js +65 -0
  28. package/lib/api/git/commitAllChanges.js.map +7 -0
  29. package/lib/api/git/currentBranch.d.ts +10 -0
  30. package/lib/api/git/currentBranch.js +58 -0
  31. package/lib/api/git/currentBranch.js.map +7 -0
  32. package/lib/api/git/getChangedFiles.d.ts +20 -0
  33. package/lib/api/git/getChangedFiles.js +63 -0
  34. package/lib/api/git/getChangedFiles.js.map +7 -0
  35. package/lib/api/git/index.d.ts +10 -0
  36. package/lib/api/git/index.js +55 -0
  37. package/lib/api/git/index.js.map +7 -0
  38. package/lib/api/git/log.d.ts +19 -0
  39. package/lib/api/git/log.js +71 -0
  40. package/lib/api/git/log.js.map +7 -0
  41. package/lib/api/git/pull.d.ts +35 -0
  42. package/lib/api/git/pull.js +69 -0
  43. package/lib/api/git/pull.js.map +7 -0
  44. package/lib/api/git/push.d.ts +43 -0
  45. package/lib/api/git/push.js +70 -0
  46. package/lib/api/git/push.js.map +7 -0
  47. package/lib/api/git/remote.d.ts +20 -0
  48. package/lib/api/git/remote.js +72 -0
  49. package/lib/api/git/remote.js.map +7 -0
  50. package/lib/api/git/reset.d.ts +12 -0
  51. package/lib/api/git/reset.js +62 -0
  52. package/lib/api/git/reset.js.map +7 -0
  53. package/lib/api/git/statusMatrix.d.ts +7 -0
  54. package/lib/api/git/statusMatrix.js +47 -0
  55. package/lib/api/git/statusMatrix.js.map +7 -0
  56. package/lib/api/github/checkRun.d.ts +44 -0
  57. package/lib/api/github/checkRun.js +81 -0
  58. package/lib/api/github/checkRun.js.map +7 -0
  59. package/lib/api/github/environment.d.ts +18 -0
  60. package/lib/api/github/environment.js +48 -0
  61. package/lib/api/github/environment.js.map +7 -0
  62. package/lib/api/github/index.d.ts +7 -0
  63. package/lib/api/github/index.js +48 -0
  64. package/lib/api/github/index.js.map +7 -0
  65. package/lib/api/github/issueComment.d.ts +59 -0
  66. package/lib/api/github/issueComment.js +83 -0
  67. package/lib/api/github/issueComment.js.map +7 -0
  68. package/lib/api/github/pullRequest.d.ts +21 -0
  69. package/lib/api/github/pullRequest.js +68 -0
  70. package/lib/api/github/pullRequest.js.map +7 -0
  71. package/lib/api/github/push.d.ts +79 -0
  72. package/lib/api/github/push.js +158 -0
  73. package/lib/api/github/push.js.map +7 -0
  74. package/lib/api/jest/index.d.ts +144 -0
  75. package/lib/api/jest/index.js +41 -0
  76. package/lib/api/jest/index.js.map +7 -0
  77. package/lib/api/net/compose.d.ts +4 -0
  78. package/lib/api/net/compose.js +50 -0
  79. package/lib/api/net/compose.js.map +7 -0
  80. package/lib/api/net/index.d.ts +1 -0
  81. package/lib/api/net/index.js +29 -0
  82. package/lib/api/net/index.js.map +7 -0
  83. package/lib/api/net/socket.d.ts +5 -0
  84. package/lib/api/net/socket.js +68 -0
  85. package/lib/api/net/socket.js.map +7 -0
  86. package/lib/api/net/waitFor.d.ts +22 -0
  87. package/lib/api/net/waitFor.js +40 -0
  88. package/lib/api/net/waitFor.js.map +7 -0
  89. package/lib/cli/adapter/eslint.d.ts +14 -0
  90. package/lib/cli/adapter/eslint.js +112 -0
  91. package/lib/cli/adapter/eslint.js.map +7 -0
  92. package/lib/cli/adapter/prettier.d.ts +45 -0
  93. package/lib/cli/adapter/prettier.js +171 -0
  94. package/lib/cli/adapter/prettier.js.map +7 -0
  95. package/lib/cli/build/args.d.ts +7 -0
  96. package/lib/cli/build/args.js +73 -0
  97. package/lib/cli/build/args.js.map +7 -0
  98. package/lib/cli/build/esbuild.d.ts +5 -0
  99. package/lib/cli/build/esbuild.js +133 -0
  100. package/lib/cli/build/esbuild.js.map +7 -0
  101. package/lib/cli/build/index.d.ts +1 -0
  102. package/lib/cli/build/index.js +73 -0
  103. package/lib/cli/build/index.js.map +7 -0
  104. package/lib/cli/build/tsc.d.ts +1 -0
  105. package/lib/cli/build/tsc.js +36 -0
  106. package/lib/cli/build/tsc.js.map +7 -0
  107. package/lib/cli/buildPackage.d.ts +1 -0
  108. package/lib/cli/buildPackage.js +56 -0
  109. package/lib/cli/buildPackage.js.map +7 -0
  110. package/lib/cli/configure/addEmptyExports.d.ts +6 -0
  111. package/lib/cli/configure/addEmptyExports.js +76 -0
  112. package/lib/cli/configure/addEmptyExports.js.map +7 -0
  113. package/lib/cli/configure/analyseConfiguration.d.ts +9 -0
  114. package/lib/cli/configure/analyseConfiguration.js +69 -0
  115. package/lib/cli/configure/analyseConfiguration.js.map +7 -0
  116. package/lib/cli/configure/analyseDependencies.d.ts +10 -0
  117. package/lib/cli/configure/analyseDependencies.js +136 -0
  118. package/lib/cli/configure/analyseDependencies.js.map +7 -0
  119. package/lib/cli/configure/analysis/diff.d.ts +1 -0
  120. package/lib/cli/configure/analysis/diff.js +45 -0
  121. package/lib/cli/configure/analysis/diff.js.map +7 -0
  122. package/lib/cli/configure/analysis/files.d.ts +1 -0
  123. package/lib/cli/configure/analysis/files.js +58 -0
  124. package/lib/cli/configure/analysis/files.js.map +7 -0
  125. package/lib/cli/configure/analysis/git.d.ts +1 -0
  126. package/lib/cli/configure/analysis/git.js +54 -0
  127. package/lib/cli/configure/analysis/git.js.map +7 -0
  128. package/lib/cli/configure/analysis/package.d.ts +13 -0
  129. package/lib/cli/configure/analysis/package.js +110 -0
  130. package/lib/cli/configure/analysis/package.js.map +7 -0
  131. package/lib/cli/configure/analysis/project.d.ts +3 -0
  132. package/lib/cli/configure/analysis/project.js +105 -0
  133. package/lib/cli/configure/analysis/project.js.map +7 -0
  134. package/lib/cli/configure/dependencies/index.d.ts +5 -0
  135. package/lib/cli/configure/dependencies/index.js +41 -0
  136. package/lib/cli/configure/dependencies/index.js.map +7 -0
  137. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -0
  138. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +59 -0
  139. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -0
  140. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -0
  141. package/lib/cli/configure/dependencies/seekKoala.js +56 -0
  142. package/lib/cli/configure/dependencies/seekKoala.js.map +7 -0
  143. package/lib/cli/configure/dependencies/skuba.d.ts +2 -0
  144. package/lib/cli/configure/dependencies/skuba.js +52 -0
  145. package/lib/cli/configure/dependencies/skuba.js.map +7 -0
  146. package/lib/cli/configure/dependencies/skubaDeps.d.ts +2 -0
  147. package/lib/cli/configure/dependencies/skubaDeps.js +56 -0
  148. package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -0
  149. package/lib/cli/configure/dependencies/skubaDive.d.ts +3 -0
  150. package/lib/cli/configure/dependencies/skubaDive.js +70 -0
  151. package/lib/cli/configure/dependencies/skubaDive.js.map +7 -0
  152. package/lib/cli/configure/ensureTemplateCompletion.d.ts +9 -0
  153. package/lib/cli/configure/ensureTemplateCompletion.js +77 -0
  154. package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -0
  155. package/lib/cli/configure/getEntryPoint.d.ts +11 -0
  156. package/lib/cli/configure/getEntryPoint.js +70 -0
  157. package/lib/cli/configure/getEntryPoint.js.map +7 -0
  158. package/lib/cli/configure/getProjectType.d.ts +9 -0
  159. package/lib/cli/configure/getProjectType.js +52 -0
  160. package/lib/cli/configure/getProjectType.js.map +7 -0
  161. package/lib/cli/configure/index.d.ts +1 -0
  162. package/lib/cli/configure/index.js +148 -0
  163. package/lib/cli/configure/index.js.map +7 -0
  164. package/lib/cli/configure/modules/eslint.d.ts +2 -0
  165. package/lib/cli/configure/modules/eslint.js +61 -0
  166. package/lib/cli/configure/modules/eslint.js.map +7 -0
  167. package/lib/cli/configure/modules/ignore.d.ts +2 -0
  168. package/lib/cli/configure/modules/ignore.js +40 -0
  169. package/lib/cli/configure/modules/ignore.js.map +7 -0
  170. package/lib/cli/configure/modules/index.d.ts +2 -0
  171. package/lib/cli/configure/modules/index.js +54 -0
  172. package/lib/cli/configure/modules/index.js.map +7 -0
  173. package/lib/cli/configure/modules/jest.d.ts +2 -0
  174. package/lib/cli/configure/modules/jest.js +86 -0
  175. package/lib/cli/configure/modules/jest.js.map +7 -0
  176. package/lib/cli/configure/modules/nodemon.d.ts +2 -0
  177. package/lib/cli/configure/modules/nodemon.js +30 -0
  178. package/lib/cli/configure/modules/nodemon.js.map +7 -0
  179. package/lib/cli/configure/modules/package.d.ts +2 -0
  180. package/lib/cli/configure/modules/package.js +117 -0
  181. package/lib/cli/configure/modules/package.js.map +7 -0
  182. package/lib/cli/configure/modules/prettier.d.ts +2 -0
  183. package/lib/cli/configure/modules/prettier.js +52 -0
  184. package/lib/cli/configure/modules/prettier.js.map +7 -0
  185. package/lib/cli/configure/modules/renovate.d.ts +3 -0
  186. package/lib/cli/configure/modules/renovate.js +69 -0
  187. package/lib/cli/configure/modules/renovate.js.map +7 -0
  188. package/lib/cli/configure/modules/serverless.d.ts +2 -0
  189. package/lib/cli/configure/modules/serverless.js +36 -0
  190. package/lib/cli/configure/modules/serverless.js.map +7 -0
  191. package/lib/cli/configure/modules/skubaDive.d.ts +2 -0
  192. package/lib/cli/configure/modules/skubaDive.js +72 -0
  193. package/lib/cli/configure/modules/skubaDive.js.map +7 -0
  194. package/lib/cli/configure/modules/tsconfig.d.ts +2 -0
  195. package/lib/cli/configure/modules/tsconfig.js +87 -0
  196. package/lib/cli/configure/modules/tsconfig.js.map +7 -0
  197. package/lib/cli/configure/modules/tslint.d.ts +2 -0
  198. package/lib/cli/configure/modules/tslint.js +30 -0
  199. package/lib/cli/configure/modules/tslint.js.map +7 -0
  200. package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
  201. package/lib/cli/configure/patchRenovateConfig.js +132 -0
  202. package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
  203. package/lib/cli/configure/processing/deleteFiles.d.ts +5 -0
  204. package/lib/cli/configure/processing/deleteFiles.js +31 -0
  205. package/lib/cli/configure/processing/deleteFiles.js.map +7 -0
  206. package/lib/cli/configure/processing/ignoreFile.d.ts +8 -0
  207. package/lib/cli/configure/processing/ignoreFile.js +74 -0
  208. package/lib/cli/configure/processing/ignoreFile.js.map +7 -0
  209. package/lib/cli/configure/processing/javascript.d.ts +2 -0
  210. package/lib/cli/configure/processing/javascript.js +38 -0
  211. package/lib/cli/configure/processing/javascript.js.map +7 -0
  212. package/lib/cli/configure/processing/json.d.ts +2 -0
  213. package/lib/cli/configure/processing/json.js +57 -0
  214. package/lib/cli/configure/processing/json.js.map +7 -0
  215. package/lib/cli/configure/processing/loadFiles.d.ts +5 -0
  216. package/lib/cli/configure/processing/loadFiles.js +31 -0
  217. package/lib/cli/configure/processing/loadFiles.js.map +7 -0
  218. package/lib/cli/configure/processing/module.d.ts +10 -0
  219. package/lib/cli/configure/processing/module.js +39 -0
  220. package/lib/cli/configure/processing/module.js.map +7 -0
  221. package/lib/cli/configure/processing/package.d.ts +73 -0
  222. package/lib/cli/configure/processing/package.js +87 -0
  223. package/lib/cli/configure/processing/package.js.map +7 -0
  224. package/lib/cli/configure/processing/prettier.d.ts +4 -0
  225. package/lib/cli/configure/processing/prettier.js +44 -0
  226. package/lib/cli/configure/processing/prettier.js.map +7 -0
  227. package/lib/cli/configure/processing/record.d.ts +11 -0
  228. package/lib/cli/configure/processing/record.js +65 -0
  229. package/lib/cli/configure/processing/record.js.map +7 -0
  230. package/lib/cli/configure/processing/typescript.d.ts +23 -0
  231. package/lib/cli/configure/processing/typescript.js +197 -0
  232. package/lib/cli/configure/processing/typescript.js.map +7 -0
  233. package/lib/cli/configure/refreshIgnoreFiles.d.ts +3 -0
  234. package/lib/cli/configure/refreshIgnoreFiles.js +78 -0
  235. package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -0
  236. package/lib/cli/configure/types.d.ts +26 -0
  237. package/lib/cli/configure/types.js +17 -0
  238. package/lib/cli/configure/types.js.map +7 -0
  239. package/lib/cli/format.d.ts +1 -0
  240. package/lib/cli/format.js +70 -0
  241. package/lib/cli/format.js.map +7 -0
  242. package/lib/cli/help.d.ts +1 -0
  243. package/lib/cli/help.js +34 -0
  244. package/lib/cli/help.js.map +7 -0
  245. package/lib/cli/init/getConfig.d.ts +26 -0
  246. package/lib/cli/init/getConfig.js +285 -0
  247. package/lib/cli/init/getConfig.js.map +7 -0
  248. package/lib/cli/init/git.d.ts +7 -0
  249. package/lib/cli/init/git.js +82 -0
  250. package/lib/cli/init/git.js.map +7 -0
  251. package/lib/cli/init/index.d.ts +1 -0
  252. package/lib/cli/init/index.js +146 -0
  253. package/lib/cli/init/index.js.map +7 -0
  254. package/lib/cli/init/prompts.d.ts +45 -0
  255. package/lib/cli/init/prompts.js +97 -0
  256. package/lib/cli/init/prompts.js.map +7 -0
  257. package/lib/cli/init/types.d.ts +28 -0
  258. package/lib/cli/init/types.js +65 -0
  259. package/lib/cli/init/types.js.map +7 -0
  260. package/lib/cli/init/validation.d.ts +8 -0
  261. package/lib/cli/init/validation.js +43 -0
  262. package/lib/cli/init/validation.js.map +7 -0
  263. package/lib/cli/init/writePackageJson.d.ts +13 -0
  264. package/lib/cli/init/writePackageJson.js +58 -0
  265. package/lib/cli/init/writePackageJson.js.map +7 -0
  266. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +2 -0
  267. package/lib/cli/lint/annotate/buildkite/eslint.js +40 -0
  268. package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -0
  269. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -0
  270. package/lib/cli/lint/annotate/buildkite/index.js +58 -0
  271. package/lib/cli/lint/annotate/buildkite/index.js.map +7 -0
  272. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +2 -0
  273. package/lib/cli/lint/annotate/buildkite/prettier.js +47 -0
  274. package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -0
  275. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +2 -0
  276. package/lib/cli/lint/annotate/buildkite/tsc.js +45 -0
  277. package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -0
  278. package/lib/cli/lint/annotate/github/eslint.d.ts +3 -0
  279. package/lib/cli/lint/annotate/github/eslint.js +45 -0
  280. package/lib/cli/lint/annotate/github/eslint.js.map +7 -0
  281. package/lib/cli/lint/annotate/github/index.d.ts +4 -0
  282. package/lib/cli/lint/annotate/github/index.js +63 -0
  283. package/lib/cli/lint/annotate/github/index.js.map +7 -0
  284. package/lib/cli/lint/annotate/github/prettier.d.ts +3 -0
  285. package/lib/cli/lint/annotate/github/prettier.js +39 -0
  286. package/lib/cli/lint/annotate/github/prettier.js.map +7 -0
  287. package/lib/cli/lint/annotate/github/tsc.d.ts +3 -0
  288. package/lib/cli/lint/annotate/github/tsc.js +63 -0
  289. package/lib/cli/lint/annotate/github/tsc.js.map +7 -0
  290. package/lib/cli/lint/annotate/index.d.ts +4 -0
  291. package/lib/cli/lint/annotate/index.js +36 -0
  292. package/lib/cli/lint/annotate/index.js.map +7 -0
  293. package/lib/cli/lint/autofix.d.ts +10 -0
  294. package/lib/cli/lint/autofix.js +189 -0
  295. package/lib/cli/lint/autofix.js.map +7 -0
  296. package/lib/cli/lint/eslint.d.ts +4 -0
  297. package/lib/cli/lint/eslint.js +55 -0
  298. package/lib/cli/lint/eslint.js.map +7 -0
  299. package/lib/cli/lint/external.d.ts +10 -0
  300. package/lib/cli/lint/external.js +120 -0
  301. package/lib/cli/lint/external.js.map +7 -0
  302. package/lib/cli/lint/index.d.ts +2 -0
  303. package/lib/cli/lint/index.js +49 -0
  304. package/lib/cli/lint/index.js.map +7 -0
  305. package/lib/cli/lint/internal.d.ts +1 -0
  306. package/lib/cli/lint/internal.js +64 -0
  307. package/lib/cli/lint/internal.js.map +7 -0
  308. package/lib/cli/lint/prettier.d.ts +4 -0
  309. package/lib/cli/lint/prettier.js +55 -0
  310. package/lib/cli/lint/prettier.js.map +7 -0
  311. package/lib/cli/lint/tsc.d.ts +2 -0
  312. package/lib/cli/lint/tsc.js +58 -0
  313. package/lib/cli/lint/tsc.js.map +7 -0
  314. package/lib/cli/lint/types.d.ts +34 -0
  315. package/lib/cli/lint/types.js +17 -0
  316. package/lib/cli/lint/types.js.map +7 -0
  317. package/lib/cli/node.d.ts +1 -0
  318. package/lib/cli/node.js +77 -0
  319. package/lib/cli/node.js.map +7 -0
  320. package/lib/cli/release.d.ts +1 -0
  321. package/lib/cli/release.js +32 -0
  322. package/lib/cli/release.js.map +7 -0
  323. package/lib/cli/start.d.ts +1 -0
  324. package/lib/cli/start.js +69 -0
  325. package/lib/cli/start.js.map +7 -0
  326. package/lib/cli/test/index.d.ts +1 -0
  327. package/lib/cli/test/index.js +37 -0
  328. package/lib/cli/test/index.js.map +7 -0
  329. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  330. package/lib/cli/test/reporters/github/annotations.js +102 -0
  331. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  332. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  333. package/lib/cli/test/reporters/github/index.js +77 -0
  334. package/lib/cli/test/reporters/github/index.js.map +7 -0
  335. package/lib/cli/version.d.ts +1 -0
  336. package/lib/cli/version.js +34 -0
  337. package/lib/cli/version.js.map +7 -0
  338. package/lib/enquirer.d.js +2 -0
  339. package/lib/enquirer.d.js.map +7 -0
  340. package/lib/index.d.ts +22 -0
  341. package/lib/index.js +51 -0
  342. package/lib/index.js.map +7 -0
  343. package/lib/skuba.d.ts +11 -0
  344. package/lib/skuba.js +55 -0
  345. package/lib/skuba.js.map +7 -0
  346. package/lib/utils/args.d.ts +43 -0
  347. package/lib/utils/args.js +114 -0
  348. package/lib/utils/args.js.map +7 -0
  349. package/lib/utils/command.d.ts +6 -0
  350. package/lib/utils/command.js +72 -0
  351. package/lib/utils/command.js.map +7 -0
  352. package/lib/utils/copy.d.ts +16 -0
  353. package/lib/utils/copy.js +100 -0
  354. package/lib/utils/copy.js.map +7 -0
  355. package/lib/utils/dir.d.ts +21 -0
  356. package/lib/utils/dir.js +91 -0
  357. package/lib/utils/dir.js.map +7 -0
  358. package/lib/utils/env.d.ts +5 -0
  359. package/lib/utils/env.js +29 -0
  360. package/lib/utils/env.js.map +7 -0
  361. package/lib/utils/error.d.ts +28 -0
  362. package/lib/utils/error.js +72 -0
  363. package/lib/utils/error.js.map +7 -0
  364. package/lib/utils/exec.d.ts +40 -0
  365. package/lib/utils/exec.js +166 -0
  366. package/lib/utils/exec.js.map +7 -0
  367. package/lib/utils/help.d.ts +1 -0
  368. package/lib/utils/help.js +34 -0
  369. package/lib/utils/help.js.map +7 -0
  370. package/lib/utils/logging.d.ts +27 -0
  371. package/lib/utils/logging.js +60 -0
  372. package/lib/utils/logging.js.map +7 -0
  373. package/lib/utils/logo.d.ts +9 -0
  374. package/lib/utils/logo.js +74 -0
  375. package/lib/utils/logo.js.map +7 -0
  376. package/lib/utils/manifest.d.ts +10 -0
  377. package/lib/utils/manifest.js +77 -0
  378. package/lib/utils/manifest.js.map +7 -0
  379. package/lib/utils/port.d.ts +2 -0
  380. package/lib/utils/port.js +48 -0
  381. package/lib/utils/port.js.map +7 -0
  382. package/lib/utils/template.d.ts +37 -0
  383. package/lib/utils/template.js +116 -0
  384. package/lib/utils/template.js.map +7 -0
  385. package/lib/utils/validation.d.ts +6 -0
  386. package/lib/utils/validation.js +44 -0
  387. package/lib/utils/validation.js.map +7 -0
  388. package/lib/utils/version.d.ts +13 -0
  389. package/lib/utils/version.js +89 -0
  390. package/lib/utils/version.js.map +7 -0
  391. package/lib/utils/wait.d.ts +17 -0
  392. package/lib/utils/wait.js +59 -0
  393. package/lib/utils/wait.js.map +7 -0
  394. package/lib/utils/worker.d.ts +20 -0
  395. package/lib/utils/worker.js +63 -0
  396. package/lib/utils/worker.js.map +7 -0
  397. package/lib/wrapper/function-arguments.d.js +2 -0
  398. package/lib/wrapper/function-arguments.d.js.map +7 -0
  399. package/lib/wrapper/functionHandler.d.ts +10 -0
  400. package/lib/wrapper/functionHandler.js +63 -0
  401. package/lib/wrapper/functionHandler.js.map +7 -0
  402. package/lib/wrapper/http.d.ts +20 -0
  403. package/lib/wrapper/http.js +79 -0
  404. package/lib/wrapper/http.js.map +7 -0
  405. package/lib/wrapper/index.d.ts +12 -0
  406. package/lib/wrapper/index.js +16 -0
  407. package/lib/wrapper/index.js.map +7 -0
  408. package/lib/wrapper/main.d.ts +1 -0
  409. package/lib/wrapper/main.js +47 -0
  410. package/lib/wrapper/main.js.map +7 -0
  411. package/lib/wrapper/requestListener.d.ts +11 -0
  412. package/lib/wrapper/requestListener.js +66 -0
  413. package/lib/wrapper/requestListener.js.map +7 -0
  414. package/package.json +167 -0
  415. package/template/base/.github/CODEOWNERS +5 -0
  416. package/template/base/.github/renovate.json5 +3 -0
  417. package/template/base/_.dockerignore +18 -0
  418. package/template/base/_.eslintignore +14 -0
  419. package/template/base/_.eslintrc.js +3 -0
  420. package/template/base/_.gitignore +23 -0
  421. package/template/base/_.prettierignore +20 -0
  422. package/template/base/_.prettierrc.js +1 -0
  423. package/template/base/jest.config.ts +15 -0
  424. package/template/base/jest.setup.ts +3 -0
  425. package/template/base/tsconfig.build.json +5 -0
  426. package/template/base/tsconfig.json +13 -0
  427. package/template/express-rest-api/.buildkite/pipeline.yml +103 -0
  428. package/template/express-rest-api/.env +1 -0
  429. package/template/express-rest-api/.gantry/common.yml +20 -0
  430. package/template/express-rest-api/.gantry/dev.yml +8 -0
  431. package/template/express-rest-api/.gantry/prod.yml +8 -0
  432. package/template/express-rest-api/.nvmrc +1 -0
  433. package/template/express-rest-api/Dockerfile +37 -0
  434. package/template/express-rest-api/Dockerfile.dev-deps +11 -0
  435. package/template/express-rest-api/README.md +106 -0
  436. package/template/express-rest-api/docker-compose.yml +22 -0
  437. package/template/express-rest-api/gantry.apply.yml +122 -0
  438. package/template/express-rest-api/gantry.build.yml +15 -0
  439. package/template/express-rest-api/package.json +30 -0
  440. package/template/express-rest-api/skuba.template.js +49 -0
  441. package/template/express-rest-api/src/api/healthCheck.ts +11 -0
  442. package/template/express-rest-api/src/api/smokeTest.ts +8 -0
  443. package/template/express-rest-api/src/app.test.ts +9 -0
  444. package/template/express-rest-api/src/app.ts +14 -0
  445. package/template/express-rest-api/src/config.ts +57 -0
  446. package/template/express-rest-api/src/framework/logging.ts +17 -0
  447. package/template/express-rest-api/src/listen.ts +23 -0
  448. package/template/express-rest-api/src/register.ts +1 -0
  449. package/template/greeter/.buildkite/pipeline.yml +37 -0
  450. package/template/greeter/.nvmrc +1 -0
  451. package/template/greeter/Dockerfile +11 -0
  452. package/template/greeter/README.md +96 -0
  453. package/template/greeter/docker-compose.yml +22 -0
  454. package/template/greeter/package.json +24 -0
  455. package/template/greeter/skuba.template.js +16 -0
  456. package/template/greeter/src/app.test.ts +5 -0
  457. package/template/greeter/src/app.ts +4 -0
  458. package/template/koa-rest-api/.buildkite/pipeline.yml +103 -0
  459. package/template/koa-rest-api/.env +1 -0
  460. package/template/koa-rest-api/.gantry/common.yml +20 -0
  461. package/template/koa-rest-api/.gantry/dev.yml +11 -0
  462. package/template/koa-rest-api/.gantry/prod.yml +11 -0
  463. package/template/koa-rest-api/.nvmrc +1 -0
  464. package/template/koa-rest-api/Dockerfile +37 -0
  465. package/template/koa-rest-api/Dockerfile.dev-deps +11 -0
  466. package/template/koa-rest-api/README.md +111 -0
  467. package/template/koa-rest-api/docker-compose.yml +22 -0
  468. package/template/koa-rest-api/gantry.apply.yml +129 -0
  469. package/template/koa-rest-api/gantry.build.yml +15 -0
  470. package/template/koa-rest-api/package.json +47 -0
  471. package/template/koa-rest-api/skuba.template.js +49 -0
  472. package/template/koa-rest-api/src/api/healthCheck.ts +13 -0
  473. package/template/koa-rest-api/src/api/index.ts +10 -0
  474. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +9 -0
  475. package/template/koa-rest-api/src/api/jobs/getJobs.ts +15 -0
  476. package/template/koa-rest-api/src/api/jobs/index.ts +10 -0
  477. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +34 -0
  478. package/template/koa-rest-api/src/api/jobs/postJob.ts +19 -0
  479. package/template/koa-rest-api/src/api/smokeTest.ts +11 -0
  480. package/template/koa-rest-api/src/app.test.ts +21 -0
  481. package/template/koa-rest-api/src/app.ts +8 -0
  482. package/template/koa-rest-api/src/config.ts +57 -0
  483. package/template/koa-rest-api/src/framework/logging.ts +25 -0
  484. package/template/koa-rest-api/src/framework/metrics.ts +11 -0
  485. package/template/koa-rest-api/src/framework/middleware.ts +3 -0
  486. package/template/koa-rest-api/src/framework/server.test.ts +260 -0
  487. package/template/koa-rest-api/src/framework/server.ts +51 -0
  488. package/template/koa-rest-api/src/framework/validation.test.ts +72 -0
  489. package/template/koa-rest-api/src/framework/validation.ts +77 -0
  490. package/template/koa-rest-api/src/listen.ts +24 -0
  491. package/template/koa-rest-api/src/register.ts +1 -0
  492. package/template/koa-rest-api/src/storage/jobs.ts +28 -0
  493. package/template/koa-rest-api/src/testing/logging.ts +16 -0
  494. package/template/koa-rest-api/src/testing/metrics.ts +29 -0
  495. package/template/koa-rest-api/src/testing/server.ts +31 -0
  496. package/template/koa-rest-api/src/testing/types.ts +24 -0
  497. package/template/koa-rest-api/src/tracing.ts +61 -0
  498. package/template/koa-rest-api/src/types/jobs.ts +17 -0
  499. package/template/koa-rest-api/src/types/koa.ts +8 -0
  500. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +96 -0
  501. package/template/lambda-sqs-worker/.env +1 -0
  502. package/template/lambda-sqs-worker/.nvmrc +1 -0
  503. package/template/lambda-sqs-worker/Dockerfile +12 -0
  504. package/template/lambda-sqs-worker/README.md +132 -0
  505. package/template/lambda-sqs-worker/docker-compose.yml +27 -0
  506. package/template/lambda-sqs-worker/package.json +44 -0
  507. package/template/lambda-sqs-worker/serverless.yml +202 -0
  508. package/template/lambda-sqs-worker/skuba.template.js +32 -0
  509. package/template/lambda-sqs-worker/src/app.test.ts +116 -0
  510. package/template/lambda-sqs-worker/src/app.ts +52 -0
  511. package/template/lambda-sqs-worker/src/config.ts +57 -0
  512. package/template/lambda-sqs-worker/src/framework/handler.test.ts +61 -0
  513. package/template/lambda-sqs-worker/src/framework/handler.ts +43 -0
  514. package/template/lambda-sqs-worker/src/framework/logging.ts +27 -0
  515. package/template/lambda-sqs-worker/src/framework/metrics.ts +14 -0
  516. package/template/lambda-sqs-worker/src/framework/validation.test.ts +84 -0
  517. package/template/lambda-sqs-worker/src/framework/validation.ts +10 -0
  518. package/template/lambda-sqs-worker/src/hooks.ts +96 -0
  519. package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +19 -0
  520. package/template/lambda-sqs-worker/src/services/aws.ts +5 -0
  521. package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +44 -0
  522. package/template/lambda-sqs-worker/src/services/jobScorer.ts +56 -0
  523. package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +40 -0
  524. package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +33 -0
  525. package/template/lambda-sqs-worker/src/testing/handler.ts +13 -0
  526. package/template/lambda-sqs-worker/src/testing/logging.ts +16 -0
  527. package/template/lambda-sqs-worker/src/testing/services.ts +28 -0
  528. package/template/lambda-sqs-worker/src/testing/types.ts +33 -0
  529. package/template/lambda-sqs-worker/src/types/jobScorer.ts +15 -0
  530. package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +21 -0
  531. package/template/lambda-sqs-worker/tsconfig.json +13 -0
  532. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +93 -0
  533. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -0
  534. package/template/lambda-sqs-worker-cdk/Dockerfile +13 -0
  535. package/template/lambda-sqs-worker-cdk/cdk.json +25 -0
  536. package/template/lambda-sqs-worker-cdk/docker-compose.yml +28 -0
  537. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +723 -0
  538. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +34 -0
  539. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +74 -0
  540. package/template/lambda-sqs-worker-cdk/infra/index.ts +14 -0
  541. package/template/lambda-sqs-worker-cdk/package.json +30 -0
  542. package/template/lambda-sqs-worker-cdk/shared/context-types.ts +21 -0
  543. package/template/lambda-sqs-worker-cdk/skuba.template.js +27 -0
  544. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -0
  545. package/template/lambda-sqs-worker-cdk/tsconfig.json +13 -0
  546. package/template/oss-npm-package/.github/workflows/release.yml +35 -0
  547. package/template/oss-npm-package/.github/workflows/validate.yml +31 -0
  548. package/template/oss-npm-package/.nvmrc +1 -0
  549. package/template/oss-npm-package/LICENSE +21 -0
  550. package/template/oss-npm-package/README.md +128 -0
  551. package/template/oss-npm-package/_package.json +41 -0
  552. package/template/oss-npm-package/skuba.template.js +22 -0
  553. package/template/oss-npm-package/src/index.test.ts +5 -0
  554. package/template/oss-npm-package/src/index.ts +7 -0
  555. package/template/oss-npm-package/tsconfig.json +10 -0
  556. package/template/private-npm-package/.buildkite/pipeline.yml +5 -0
  557. package/template/private-npm-package/.nvmrc +1 -0
  558. package/template/private-npm-package/README.md +109 -0
  559. package/template/private-npm-package/_package.json +41 -0
  560. package/template/private-npm-package/skuba.template.js +24 -0
  561. package/template/private-npm-package/src/index.test.ts +5 -0
  562. package/template/private-npm-package/src/index.ts +7 -0
  563. package/template/private-npm-package/tsconfig.json +10 -0
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var typescript_exports = {};
30
+ __export(typescript_exports, {
31
+ createPropAppender: () => createPropAppender,
32
+ createPropFilter: () => createPropFilter,
33
+ readModuleExports: () => readModuleExports,
34
+ transformModuleImportsAndExports: () => transformModuleImportsAndExports
35
+ });
36
+ module.exports = __toCommonJS(typescript_exports);
37
+ var import_typescript = __toESM(require("typescript"));
38
+ var import_prettier = require("./prettier");
39
+ const BLANK_LINE_PLACEHOLDER = " __BLANK_LINE_PLACEHOLDER__";
40
+ const BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, "g");
41
+ const withLeadingBlankLinePlaceholder = (node) => import_typescript.default.addSyntheticLeadingComment(
42
+ node,
43
+ import_typescript.default.SyntaxKind.SingleLineCommentTrivia,
44
+ BLANK_LINE_PLACEHOLDER,
45
+ true
46
+ );
47
+ const createExportDefaultObjectLiteralExpression = (factory, props, callExpression) => factory.createExportAssignment(
48
+ void 0,
49
+ void 0,
50
+ callExpression === void 0 ? factory.createObjectLiteralExpression(props, true) : factory.createCallExpression(callExpression, void 0, [
51
+ factory.createObjectLiteralExpression(props, true)
52
+ ])
53
+ );
54
+ const createImportFromExpression = (factory, moduleName, importNames) => {
55
+ const importClause = typeof importNames === "string" ? factory.createImportClause(
56
+ false,
57
+ factory.createIdentifier(importNames),
58
+ void 0
59
+ ) : factory.createImportClause(
60
+ false,
61
+ void 0,
62
+ factory.createNamedImports(
63
+ importNames.map(
64
+ (importName) => factory.createImportSpecifier(
65
+ false,
66
+ void 0,
67
+ factory.createIdentifier(importName)
68
+ )
69
+ )
70
+ )
71
+ );
72
+ return factory.createImportDeclaration(
73
+ void 0,
74
+ importClause,
75
+ factory.createStringLiteral(moduleName)
76
+ );
77
+ };
78
+ const getPropName = (prop) => import_typescript.default.isPropertyAssignment(prop) && import_typescript.default.isIdentifier(prop.name) ? prop.name.escapedText.toString() : void 0;
79
+ const expressionAsDefaultExport = (context, transformProps, expression) => withLeadingBlankLinePlaceholder(
80
+ (() => {
81
+ if (import_typescript.default.isObjectLiteralExpression(expression)) {
82
+ const props = transformProps(context, expression.properties);
83
+ return createExportDefaultObjectLiteralExpression(
84
+ context.factory,
85
+ props
86
+ );
87
+ }
88
+ if (import_typescript.default.isCallExpression(expression) && expression.arguments.length === 1) {
89
+ const [firstArgument] = expression.arguments;
90
+ if (import_typescript.default.isObjectLiteralExpression(firstArgument)) {
91
+ const props = transformProps(context, firstArgument.properties);
92
+ return createExportDefaultObjectLiteralExpression(
93
+ context.factory,
94
+ props,
95
+ expression.expression
96
+ );
97
+ }
98
+ }
99
+ return context.factory.createExportAssignment(
100
+ void 0,
101
+ void 0,
102
+ expression
103
+ );
104
+ })()
105
+ );
106
+ const requireImportsTransformer = (context) => (rootNode) => import_typescript.default.visitEachChild(
107
+ rootNode,
108
+ (node) => {
109
+ let declaration, moduleName;
110
+ if (import_typescript.default.isVariableStatement(node) && node.declarationList.declarations.length === 1 && import_typescript.default.isVariableDeclaration(
111
+ declaration = node.declarationList.declarations[0]
112
+ ) && declaration.initializer && import_typescript.default.isCallExpression(declaration.initializer) && declaration.initializer.arguments.length === 1 && import_typescript.default.isStringLiteral(
113
+ moduleName = declaration.initializer.arguments[0]
114
+ ) && import_typescript.default.isIdentifier(declaration.initializer.expression) && declaration.initializer.expression.text === "require") {
115
+ if (import_typescript.default.isIdentifier(declaration.name)) {
116
+ return createImportFromExpression(
117
+ context.factory,
118
+ moduleName.text,
119
+ declaration.name.text
120
+ );
121
+ }
122
+ if (import_typescript.default.isObjectBindingPattern(declaration.name)) {
123
+ return createImportFromExpression(
124
+ context.factory,
125
+ moduleName.text,
126
+ declaration.name.elements.flatMap(
127
+ (element) => import_typescript.default.isIdentifier(element.name) ? [element.name.text] : []
128
+ )
129
+ );
130
+ }
131
+ }
132
+ return node;
133
+ },
134
+ context
135
+ );
136
+ const createModuleExportsTransformer = (transformProps) => (context) => (rootNode) => import_typescript.default.visitEachChild(
137
+ rootNode,
138
+ (node) => {
139
+ if (import_typescript.default.isExpressionStatement(node) && import_typescript.default.isBinaryExpression(node.expression) && import_typescript.default.isPropertyAccessExpression(node.expression.left) && import_typescript.default.isIdentifier(node.expression.left.expression) && node.expression.left.expression.escapedText === "module" && node.expression.left.name.text === "exports" && node.expression.operatorToken.kind === import_typescript.default.SyntaxKind.EqualsToken) {
140
+ return expressionAsDefaultExport(
141
+ context,
142
+ transformProps,
143
+ node.expression.right
144
+ ) ?? node;
145
+ }
146
+ if (import_typescript.default.isExportAssignment(node)) {
147
+ return expressionAsDefaultExport(
148
+ context,
149
+ transformProps,
150
+ node.expression
151
+ ) ?? node;
152
+ }
153
+ return node;
154
+ },
155
+ context
156
+ );
157
+ const createPropFilter = (names) => (context, props) => {
158
+ const nameSet = new Set(names);
159
+ const factory = context?.factory ?? import_typescript.default.factory;
160
+ return factory.createNodeArray(
161
+ props.filter((prop) => nameSet.has(getPropName(prop)))
162
+ );
163
+ };
164
+ const createPropAppender = (appendingProps) => (context, props) => {
165
+ const nameSet = new Set(
166
+ props.map(getPropName).filter((prop) => typeof prop === "string")
167
+ );
168
+ const factory = context?.factory ?? import_typescript.default.factory;
169
+ return factory.createNodeArray([
170
+ ...props,
171
+ ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop)))
172
+ ]);
173
+ };
174
+ const readModuleExports = (inputFile) => {
175
+ let result;
176
+ transformModuleImportsAndExports(inputFile, (_, props) => result = props);
177
+ return result;
178
+ };
179
+ const transformModuleImportsAndExports = (inputFile, transformProps) => {
180
+ const sourceFile = import_typescript.default.createSourceFile("", inputFile, import_typescript.default.ScriptTarget.Latest);
181
+ const moduleExportsTransformer = createModuleExportsTransformer(transformProps);
182
+ const result = import_typescript.default.transform(sourceFile, [
183
+ requireImportsTransformer,
184
+ moduleExportsTransformer
185
+ ]);
186
+ const [transformedFile] = result.transformed;
187
+ const text = import_typescript.default.createPrinter().printNode(import_typescript.default.EmitHint.SourceFile, transformedFile, sourceFile).replace(BLANK_LINE_REGEXP, "");
188
+ return (0, import_prettier.formatPrettier)(text, { parser: "typescript" });
189
+ };
190
+ // Annotate the CommonJS export names for ESM import in node:
191
+ 0 && (module.exports = {
192
+ createPropAppender,
193
+ createPropFilter,
194
+ readModuleExports,
195
+ transformModuleImportsAndExports
196
+ });
197
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/configure/processing/typescript.ts"],
4
+ "sourcesContent": ["import ts from 'typescript';\n\nimport { formatPrettier } from './prettier';\n\ntype Props = ts.NodeArray<ts.ObjectLiteralElementLike>;\n\ntype Transformer<T> = (context: ts.TransformationContext | null, props: T) => T;\n\nconst BLANK_LINE_PLACEHOLDER = ' __BLANK_LINE_PLACEHOLDER__';\nconst BLANK_LINE_REGEXP = new RegExp(`//${BLANK_LINE_PLACEHOLDER}`, 'g');\n\n/**\n * Append a placeholder comment to the start of a node.\n *\n * Blank lines can be annotated and preserved through the TypeScript printer\n * when this is paired with a dodgy `String.prototype.replace` post-processor.\n */\nconst withLeadingBlankLinePlaceholder = <T extends ts.Node>(node: T) =>\n ts.addSyntheticLeadingComment(\n node,\n ts.SyntaxKind.SingleLineCommentTrivia,\n BLANK_LINE_PLACEHOLDER,\n true,\n );\n\n/**\n * Create the following expression:\n *\n * ```javascript\n * export default {};\n * ```\n */\nconst createExportDefaultObjectLiteralExpression = (\n factory: ts.NodeFactory,\n props: Props,\n callExpression?: ts.Expression,\n): ts.ExportAssignment =>\n factory.createExportAssignment(\n undefined,\n undefined,\n callExpression === undefined\n ? factory.createObjectLiteralExpression(props, true)\n : factory.createCallExpression(callExpression, undefined, [\n factory.createObjectLiteralExpression(props, true),\n ]),\n );\n\nconst createImportFromExpression = (\n factory: ts.NodeFactory,\n moduleName: string,\n importNames: string | string[],\n) => {\n const importClause =\n typeof importNames === 'string'\n ? factory.createImportClause(\n false,\n factory.createIdentifier(importNames),\n undefined,\n )\n : factory.createImportClause(\n false,\n undefined,\n factory.createNamedImports(\n importNames.map((importName) =>\n factory.createImportSpecifier(\n false,\n undefined,\n factory.createIdentifier(importName),\n ),\n ),\n ),\n );\n\n return factory.createImportDeclaration(\n undefined,\n importClause,\n factory.createStringLiteral(moduleName),\n );\n};\n\nconst getPropName = (prop: ts.ObjectLiteralElementLike) =>\n ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)\n ? prop.name.escapedText.toString()\n : undefined;\n\nconst expressionAsDefaultExport = (\n context: ts.TransformationContext,\n transformProps: Transformer<Props>,\n expression: ts.Expression,\n): ts.ExportAssignment | null =>\n withLeadingBlankLinePlaceholder(\n (() => {\n // {}\n if (ts.isObjectLiteralExpression(expression)) {\n const props = transformProps(context, expression.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n );\n }\n\n // fn({})\n if (\n ts.isCallExpression(expression) &&\n expression.arguments.length === 1\n ) {\n const [firstArgument] = expression.arguments;\n\n if (ts.isObjectLiteralExpression(firstArgument)) {\n const props = transformProps(context, firstArgument.properties);\n\n return createExportDefaultObjectLiteralExpression(\n context.factory,\n props,\n expression.expression,\n );\n }\n }\n\n // Anything else\n return context.factory.createExportAssignment(\n undefined,\n undefined,\n expression,\n );\n })(),\n );\n\n/**\n * Mutate `const x = require('')` into `import x from ''`:\n *\n * ```javascript\n * const x = require('');\n *\n * const { x } = require('');\n * ```\n *\n * There's no recursion needed here as we expect the import statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst requireImportsTransformer: ts.TransformerFactory<ts.Node> =\n (context) => (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n let declaration, moduleName;\n\n if (\n ts.isVariableStatement(node) &&\n node.declarationList.declarations.length === 1 &&\n ts.isVariableDeclaration(\n (declaration = node.declarationList.declarations[0]),\n ) &&\n declaration.initializer &&\n ts.isCallExpression(declaration.initializer) &&\n declaration.initializer.arguments.length === 1 &&\n ts.isStringLiteral(\n (moduleName = declaration.initializer.arguments[0]),\n ) &&\n ts.isIdentifier(declaration.initializer.expression) &&\n declaration.initializer.expression.text === 'require'\n ) {\n // const x\n if (ts.isIdentifier(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.text,\n );\n }\n\n // const { x }\n if (ts.isObjectBindingPattern(declaration.name)) {\n return createImportFromExpression(\n context.factory,\n moduleName.text,\n declaration.name.elements.flatMap((element) =>\n ts.isIdentifier(element.name) ? [element.name.text] : [],\n ),\n );\n }\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to mutate `module.exports` and `export default`:\n *\n * ```javascript\n * export default {};\n *\n * module.exports = {};\n * ```\n *\n * If the export is a call expression with a single argument, it will try to\n * transform the props of that argument.\n *\n * ```javascript\n * module.exports = fn({});\n * ```\n *\n * There's no recursion needed here as we expect the export statement to be a\n * top-level node and therefore an immediate child of the source file.\n */\nconst createModuleExportsTransformer =\n (transformProps: Transformer<Props>): ts.TransformerFactory<ts.Node> =>\n (context) =>\n (rootNode) =>\n ts.visitEachChild(\n rootNode,\n (node) => {\n // module.exports =\n if (\n ts.isExpressionStatement(node) &&\n ts.isBinaryExpression(node.expression) &&\n ts.isPropertyAccessExpression(node.expression.left) &&\n ts.isIdentifier(node.expression.left.expression) &&\n node.expression.left.expression.escapedText === 'module' &&\n node.expression.left.name.text === 'exports' &&\n node.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken\n ) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression.right,\n ) ?? node\n );\n }\n\n // export default\n if (ts.isExportAssignment(node)) {\n return (\n expressionAsDefaultExport(\n context,\n transformProps,\n node.expression,\n ) ?? node\n );\n }\n\n return node;\n },\n context,\n );\n\n/**\n * Create a transformer to filter out unspecified props from an object literal.\n */\nexport const createPropFilter =\n (names: string[]): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(names);\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray(\n props.filter((prop) => nameSet.has(getPropName(prop))),\n );\n };\n\nexport const createPropAppender =\n (appendingProps: Props): Transformer<Props> =>\n (context, props) => {\n const nameSet = new Set<unknown>(\n props.map(getPropName).filter((prop) => typeof prop === 'string'),\n );\n\n const factory = context?.factory ?? ts.factory;\n\n return factory.createNodeArray([\n ...props,\n ...appendingProps.filter((prop) => !nameSet.has(getPropName(prop))),\n ]);\n };\n\n/**\n * Read out `export default` or `module.exports` props from a source file.\n *\n * The props can then be used when transforming another source file.\n */\nexport const readModuleExports = (inputFile: string): Props | undefined => {\n let result: Props | undefined;\n\n transformModuleImportsAndExports(inputFile, (_, props) => (result = props));\n\n return result;\n};\n\n/**\n * Mutate imports and exports in a source file:\n *\n * - Convert `const x = require('')` into `import x from ''`\n * - Convert `module.exports =` into `export default`\n * - Run a transformer over the exported props\n */\nexport const transformModuleImportsAndExports = (\n inputFile: string,\n transformProps: Transformer<Props>,\n): string => {\n const sourceFile = ts.createSourceFile('', inputFile, ts.ScriptTarget.Latest);\n\n const moduleExportsTransformer =\n createModuleExportsTransformer(transformProps);\n\n const result = ts.transform(sourceFile, [\n requireImportsTransformer,\n moduleExportsTransformer,\n ]);\n\n const [transformedFile] = result.transformed;\n\n const text = ts\n .createPrinter()\n .printNode(ts.EmitHint.SourceFile, transformedFile, sourceFile)\n .replace(BLANK_LINE_REGEXP, '');\n\n return formatPrettier(text, { parser: 'typescript' });\n};\n"],
5
+ "mappings": "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",
6
+ "names": ["ts"]
7
+ }
@@ -0,0 +1,3 @@
1
+ export declare const REFRESHABLE_IGNORE_FILES: string[];
2
+ export declare const refreshIgnoreFiles: () => Promise<void>;
3
+ export declare const tryRefreshIgnoreFiles: () => Promise<void>;
@@ -0,0 +1,78 @@
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 refreshIgnoreFiles_exports = {};
30
+ __export(refreshIgnoreFiles_exports, {
31
+ REFRESHABLE_IGNORE_FILES: () => REFRESHABLE_IGNORE_FILES,
32
+ refreshIgnoreFiles: () => refreshIgnoreFiles,
33
+ tryRefreshIgnoreFiles: () => tryRefreshIgnoreFiles
34
+ });
35
+ module.exports = __toCommonJS(refreshIgnoreFiles_exports);
36
+ var import_path = __toESM(require("path"));
37
+ var import_util = require("util");
38
+ var import_fs_extra = __toESM(require("fs-extra"));
39
+ var import_logging = require("../../utils/logging");
40
+ var import_template = require("../../utils/template");
41
+ var import_package = require("./analysis/package");
42
+ var import_project = require("./analysis/project");
43
+ var import_ignoreFile = require("./processing/ignoreFile");
44
+ const REFRESHABLE_IGNORE_FILES = [
45
+ ".eslintignore",
46
+ ".gitignore",
47
+ ".prettierignore"
48
+ ];
49
+ const refreshIgnoreFiles = async () => {
50
+ const manifest = await (0, import_package.getDestinationManifest)();
51
+ const destinationRoot = import_path.default.dirname(manifest.path);
52
+ const readDestinationFile = (0, import_project.createDestinationFileReader)(destinationRoot);
53
+ const refreshIgnoreFile = async (filename) => {
54
+ const [inputFile, templateFile] = await Promise.all([
55
+ readDestinationFile(filename),
56
+ (0, import_template.readBaseTemplateFile)(`_${filename}`)
57
+ ]);
58
+ const data = inputFile ? (0, import_ignoreFile.mergeWithIgnoreFile)(templateFile)(inputFile) : templateFile;
59
+ const filepath = import_path.default.join(destinationRoot, filename);
60
+ await import_fs_extra.default.promises.writeFile(filepath, data);
61
+ };
62
+ await Promise.all(REFRESHABLE_IGNORE_FILES.map(refreshIgnoreFile));
63
+ };
64
+ const tryRefreshIgnoreFiles = async () => {
65
+ try {
66
+ await refreshIgnoreFiles();
67
+ } catch (err) {
68
+ import_logging.log.warn("Failed to refresh ignore files.");
69
+ import_logging.log.subtle((0, import_util.inspect)(err));
70
+ }
71
+ };
72
+ // Annotate the CommonJS export names for ESM import in node:
73
+ 0 && (module.exports = {
74
+ REFRESHABLE_IGNORE_FILES,
75
+ refreshIgnoreFiles,
76
+ tryRefreshIgnoreFiles
77
+ });
78
+ //# sourceMappingURL=refreshIgnoreFiles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/configure/refreshIgnoreFiles.ts"],
4
+ "sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport { log } from '../../utils/logging';\nimport { readBaseTemplateFile } from '../../utils/template';\n\nimport { getDestinationManifest } from './analysis/package';\nimport { createDestinationFileReader } from './analysis/project';\nimport { mergeWithIgnoreFile } from './processing/ignoreFile';\n\nexport const REFRESHABLE_IGNORE_FILES = [\n '.eslintignore',\n '.gitignore',\n '.prettierignore',\n];\n\nexport const refreshIgnoreFiles = async () => {\n const manifest = await getDestinationManifest();\n\n const destinationRoot = path.dirname(manifest.path);\n\n const readDestinationFile = createDestinationFileReader(destinationRoot);\n\n const refreshIgnoreFile = async (filename: string) => {\n const [inputFile, templateFile] = await Promise.all([\n readDestinationFile(filename),\n readBaseTemplateFile(`_${filename}`),\n ]);\n\n const data = inputFile\n ? mergeWithIgnoreFile(templateFile)(inputFile)\n : templateFile;\n\n const filepath = path.join(destinationRoot, filename);\n\n await fs.promises.writeFile(filepath, data);\n };\n\n await Promise.all(REFRESHABLE_IGNORE_FILES.map(refreshIgnoreFile));\n};\n\nexport const tryRefreshIgnoreFiles = async () => {\n try {\n await refreshIgnoreFiles();\n } catch (err) {\n log.warn('Failed to refresh ignore files.');\n log.subtle(inspect(err));\n }\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,sBAAe;AAEf,qBAAoB;AACpB,sBAAqC;AAErC,qBAAuC;AACvC,qBAA4C;AAC5C,wBAAoC;AAE7B,MAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,qBAAqB,YAAY;AAC5C,QAAM,WAAW,UAAM,uCAAuB;AAE9C,QAAM,kBAAkB,YAAAA,QAAK,QAAQ,SAAS,IAAI;AAElD,QAAM,0BAAsB,4CAA4B,eAAe;AAEvE,QAAM,oBAAoB,OAAO,aAAqB;AACpD,UAAM,CAAC,WAAW,YAAY,IAAI,MAAM,QAAQ,IAAI;AAAA,MAClD,oBAAoB,QAAQ;AAAA,UAC5B,sCAAqB,IAAI,UAAU;AAAA,IACrC,CAAC;AAED,UAAM,OAAO,gBACT,uCAAoB,YAAY,EAAE,SAAS,IAC3C;AAEJ,UAAM,WAAW,YAAAA,QAAK,KAAK,iBAAiB,QAAQ;AAEpD,UAAM,gBAAAC,QAAG,SAAS,UAAU,UAAU,IAAI;AAAA,EAC5C;AAEA,QAAM,QAAQ,IAAI,yBAAyB,IAAI,iBAAiB,CAAC;AACnE;AAEO,MAAM,wBAAwB,YAAY;AAC/C,MAAI;AACF,UAAM,mBAAmB;AAAA,EAC3B,SAAS,KAAP;AACA,uBAAI,KAAK,iCAAiC;AAC1C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AACF;",
6
+ "names": ["path", "fs"]
7
+ }
@@ -0,0 +1,26 @@
1
+ import type { PackageJson as TypeFestPackageJson } from 'type-fest';
2
+ import type { ProjectType } from '../../utils/manifest';
3
+ export type { TsConfigJson } from 'type-fest';
4
+ export type PackageJson = TypeFestPackageJson & Record<string, unknown>;
5
+ export interface DependencySet {
6
+ dependencies: Record<string, string>;
7
+ devDependencies: Record<string, string>;
8
+ type: ProjectType;
9
+ }
10
+ export type DependencyDiff = Record<string, {
11
+ operation: string;
12
+ version: string;
13
+ }>;
14
+ type FileProcessor = (file: string | undefined, files: Files, initialFiles: Readonly<Files>) => string | undefined;
15
+ export type FileDiff = Record<string, {
16
+ data: string | undefined;
17
+ operation: string;
18
+ }>;
19
+ export type Files = Record<string, string | undefined>;
20
+ export type Module = Record<string, FileProcessor>;
21
+ export interface Options {
22
+ destinationRoot: string;
23
+ entryPoint: string;
24
+ firstRun: boolean;
25
+ type: ProjectType;
26
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/configure/types.ts"],
4
+ "sourcesContent": ["import type { PackageJson as TypeFestPackageJson } from 'type-fest';\n\nimport type { ProjectType } from '../../utils/manifest';\n\nexport type { TsConfigJson } from 'type-fest';\n\nexport type PackageJson = TypeFestPackageJson & Record<string, unknown>;\n\nexport interface DependencySet {\n dependencies: Record<string, string>;\n devDependencies: Record<string, string>;\n type: ProjectType;\n}\n\nexport type DependencyDiff = Record<\n string,\n { operation: string; version: string }\n>;\n\ntype FileProcessor = (\n file: string | undefined,\n files: Files,\n initialFiles: Readonly<Files>,\n) => string | undefined;\n\nexport type FileDiff = Record<\n string,\n { data: string | undefined; operation: string }\n>;\n\nexport type Files = Record<string, string | undefined>;\n\nexport type Module = Record<string, FileProcessor>;\n\nexport interface Options {\n destinationRoot: string;\n entryPoint: string;\n firstRun: boolean;\n type: ProjectType;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export declare const format: (args?: string[]) => Promise<void>;
@@ -0,0 +1,70 @@
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 format_exports = {};
30
+ __export(format_exports, {
31
+ format: () => format
32
+ });
33
+ module.exports = __toCommonJS(format_exports);
34
+ var import_chalk = __toESM(require("chalk"));
35
+ var import_args = require("../utils/args");
36
+ var import_logging = require("../utils/logging");
37
+ var import_eslint = require("./adapter/eslint");
38
+ var import_prettier = require("./adapter/prettier");
39
+ var import_addEmptyExports = require("./configure/addEmptyExports");
40
+ var import_patchRenovateConfig = require("./configure/patchRenovateConfig");
41
+ var import_refreshIgnoreFiles = require("./configure/refreshIgnoreFiles");
42
+ const format = async (args = process.argv.slice(2)) => {
43
+ await Promise.all([
44
+ (0, import_addEmptyExports.tryAddEmptyExports)(),
45
+ (0, import_patchRenovateConfig.tryPatchRenovateConfig)(),
46
+ (0, import_refreshIgnoreFiles.tryRefreshIgnoreFiles)()
47
+ ]);
48
+ const debug = (0, import_args.hasDebugFlag)(args);
49
+ const logger = (0, import_logging.createLogger)(debug);
50
+ import_logging.log.plain(import_chalk.default.magenta("ESLint"));
51
+ const eslint = await (0, import_eslint.runESLint)("format", logger);
52
+ import_logging.log.newline();
53
+ import_logging.log.plain(import_chalk.default.cyan("Prettier"));
54
+ const prettier = await (0, import_prettier.runPrettier)("format", logger);
55
+ if (eslint.ok && prettier.ok) {
56
+ return;
57
+ }
58
+ const tools = [
59
+ ...eslint.ok ? [] : ["ESLint"],
60
+ ...prettier.ok ? [] : ["Prettier"]
61
+ ];
62
+ import_logging.log.newline();
63
+ import_logging.log.err(tools.join(", "), "found issues that require triage.");
64
+ process.exitCode = 1;
65
+ };
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ format
69
+ });
70
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cli/format.ts"],
4
+ "sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../utils/args';\nimport { createLogger, log } from '../utils/logging';\n\nimport { runESLint } from './adapter/eslint';\nimport { runPrettier } from './adapter/prettier';\nimport { tryAddEmptyExports } from './configure/addEmptyExports';\nimport { tryPatchRenovateConfig } from './configure/patchRenovateConfig';\nimport { tryRefreshIgnoreFiles } from './configure/refreshIgnoreFiles';\n\nexport const format = async (args = process.argv.slice(2)): Promise<void> => {\n await Promise.all([\n tryAddEmptyExports(),\n tryPatchRenovateConfig(),\n tryRefreshIgnoreFiles(),\n ]);\n\n const debug = hasDebugFlag(args);\n const logger = createLogger(debug);\n\n log.plain(chalk.magenta('ESLint'));\n\n const eslint = await runESLint('format', logger);\n\n log.newline();\n log.plain(chalk.cyan('Prettier'));\n\n const prettier = await runPrettier('format', logger);\n\n if (eslint.ok && prettier.ok) {\n return;\n }\n\n const tools = [\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ];\n\n log.newline();\n log.err(tools.join(', '), 'found issues that require triage.');\n\n process.exitCode = 1;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAkC;AAElC,oBAA0B;AAC1B,sBAA4B;AAC5B,6BAAmC;AACnC,iCAAuC;AACvC,gCAAsC;AAE/B,MAAM,SAAS,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAqB;AAC3E,QAAM,QAAQ,IAAI;AAAA,QAChB,2CAAmB;AAAA,QACnB,mDAAuB;AAAA,QACvB,iDAAsB;AAAA,EACxB,CAAC;AAED,QAAM,YAAQ,0BAAa,IAAI;AAC/B,QAAM,aAAS,6BAAa,KAAK;AAEjC,qBAAI,MAAM,aAAAA,QAAM,QAAQ,QAAQ,CAAC;AAEjC,QAAM,SAAS,UAAM,yBAAU,UAAU,MAAM;AAE/C,qBAAI,QAAQ;AACZ,qBAAI,MAAM,aAAAA,QAAM,KAAK,UAAU,CAAC;AAEhC,QAAM,WAAW,UAAM,6BAAY,UAAU,MAAM;AAEnD,MAAI,OAAO,MAAM,SAAS,IAAI;AAC5B;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;AAAA,IAC9B,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,UAAU;AAAA,EACpC;AAEA,qBAAI,QAAQ;AACZ,qBAAI,IAAI,MAAM,KAAK,IAAI,GAAG,mCAAmC;AAE7D,UAAQ,WAAW;AACrB;",
6
+ "names": ["chalk"]
7
+ }
@@ -0,0 +1 @@
1
+ export declare const help: () => Promise<void>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var help_exports = {};
20
+ __export(help_exports, {
21
+ help: () => help
22
+ });
23
+ module.exports = __toCommonJS(help_exports);
24
+ var import_help = require("../utils/help");
25
+ var import_logo = require("../utils/logo");
26
+ const help = async () => {
27
+ await (0, import_logo.showLogoAndVersionInfo)();
28
+ (0, import_help.showHelp)();
29
+ };
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ help
33
+ });
34
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cli/help.ts"],
4
+ "sourcesContent": ["import { showHelp } from '../utils/help';\nimport { showLogoAndVersionInfo } from '../utils/logo';\n\nexport const help = async () => {\n await showLogoAndVersionInfo();\n\n showHelp();\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AACzB,kBAAuC;AAEhC,MAAM,OAAO,YAAY;AAC9B,YAAM,oCAAuB;AAE7B,4BAAS;AACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ import { TemplateConfig } from '../../utils/template';
2
+ import type { InitConfig } from './types';
3
+ import type { FormChoice } from 'enquirer';
4
+ export declare const runForm: <T = Record<string, string>>(props: {
5
+ choices: Readonly<FormChoice[]>;
6
+ message: string;
7
+ name: string;
8
+ }) => Promise<T>;
9
+ export declare const getTemplateConfig: (dir: string) => TemplateConfig;
10
+ export declare const configureFromPrompt: () => Promise<InitConfig>;
11
+ export declare const getConfig: () => Promise<{
12
+ templateName: string;
13
+ destinationDir: string;
14
+ templateComplete: boolean;
15
+ templateData: {
16
+ port: string;
17
+ orgName: string;
18
+ repoName: string;
19
+ ownerName: string;
20
+ teamName: string;
21
+ } & {
22
+ [x: string]: string;
23
+ };
24
+ type?: "package" | "application" | undefined;
25
+ entryPoint?: string | undefined;
26
+ }>;