skuba 0.0.0-beta-20231002015947

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 (579) 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 +4 -0
  6. package/config/prettier.js +6 -0
  7. package/config/tsconfig.json +11 -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 +40 -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 +79 -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 +59 -0
  31. package/lib/api/git/currentBranch.js.map +7 -0
  32. package/lib/api/git/findRoot.d.ts +9 -0
  33. package/lib/api/git/findRoot.js +52 -0
  34. package/lib/api/git/findRoot.js.map +7 -0
  35. package/lib/api/git/getChangedFiles.d.ts +20 -0
  36. package/lib/api/git/getChangedFiles.js +63 -0
  37. package/lib/api/git/getChangedFiles.js.map +7 -0
  38. package/lib/api/git/index.d.ts +11 -0
  39. package/lib/api/git/index.js +58 -0
  40. package/lib/api/git/index.js.map +7 -0
  41. package/lib/api/git/log.d.ts +19 -0
  42. package/lib/api/git/log.js +71 -0
  43. package/lib/api/git/log.js.map +7 -0
  44. package/lib/api/git/pull.d.ts +35 -0
  45. package/lib/api/git/pull.js +69 -0
  46. package/lib/api/git/pull.js.map +7 -0
  47. package/lib/api/git/push.d.ts +43 -0
  48. package/lib/api/git/push.js +70 -0
  49. package/lib/api/git/push.js.map +7 -0
  50. package/lib/api/git/remote.d.ts +20 -0
  51. package/lib/api/git/remote.js +73 -0
  52. package/lib/api/git/remote.js.map +7 -0
  53. package/lib/api/git/reset.d.ts +12 -0
  54. package/lib/api/git/reset.js +62 -0
  55. package/lib/api/git/reset.js.map +7 -0
  56. package/lib/api/git/statusMatrix.d.ts +7 -0
  57. package/lib/api/git/statusMatrix.js +47 -0
  58. package/lib/api/git/statusMatrix.js.map +7 -0
  59. package/lib/api/github/checkRun.d.ts +44 -0
  60. package/lib/api/github/checkRun.js +81 -0
  61. package/lib/api/github/checkRun.js.map +7 -0
  62. package/lib/api/github/environment.d.ts +18 -0
  63. package/lib/api/github/environment.js +48 -0
  64. package/lib/api/github/environment.js.map +7 -0
  65. package/lib/api/github/index.d.ts +7 -0
  66. package/lib/api/github/index.js +48 -0
  67. package/lib/api/github/index.js.map +7 -0
  68. package/lib/api/github/issueComment.d.ts +59 -0
  69. package/lib/api/github/issueComment.js +83 -0
  70. package/lib/api/github/issueComment.js.map +7 -0
  71. package/lib/api/github/pullRequest.d.ts +21 -0
  72. package/lib/api/github/pullRequest.js +69 -0
  73. package/lib/api/github/pullRequest.js.map +7 -0
  74. package/lib/api/github/push.d.ts +79 -0
  75. package/lib/api/github/push.js +167 -0
  76. package/lib/api/github/push.js.map +7 -0
  77. package/lib/api/jest/index.d.ts +147 -0
  78. package/lib/api/jest/index.js +41 -0
  79. package/lib/api/jest/index.js.map +7 -0
  80. package/lib/api/net/compose.d.ts +4 -0
  81. package/lib/api/net/compose.js +50 -0
  82. package/lib/api/net/compose.js.map +7 -0
  83. package/lib/api/net/index.d.ts +1 -0
  84. package/lib/api/net/index.js +29 -0
  85. package/lib/api/net/index.js.map +7 -0
  86. package/lib/api/net/socket.d.ts +5 -0
  87. package/lib/api/net/socket.js +68 -0
  88. package/lib/api/net/socket.js.map +7 -0
  89. package/lib/api/net/waitFor.d.ts +22 -0
  90. package/lib/api/net/waitFor.js +40 -0
  91. package/lib/api/net/waitFor.js.map +7 -0
  92. package/lib/cli/adapter/eslint.d.ts +14 -0
  93. package/lib/cli/adapter/eslint.js +99 -0
  94. package/lib/cli/adapter/eslint.js.map +7 -0
  95. package/lib/cli/adapter/prettier.d.ts +52 -0
  96. package/lib/cli/adapter/prettier.js +176 -0
  97. package/lib/cli/adapter/prettier.js.map +7 -0
  98. package/lib/cli/build/args.d.ts +7 -0
  99. package/lib/cli/build/args.js +73 -0
  100. package/lib/cli/build/args.js.map +7 -0
  101. package/lib/cli/build/assets.d.ts +10 -0
  102. package/lib/cli/build/assets.js +107 -0
  103. package/lib/cli/build/assets.js.map +7 -0
  104. package/lib/cli/build/esbuild.d.ts +5 -0
  105. package/lib/cli/build/esbuild.js +98 -0
  106. package/lib/cli/build/esbuild.js.map +7 -0
  107. package/lib/cli/build/index.d.ts +1 -0
  108. package/lib/cli/build/index.js +83 -0
  109. package/lib/cli/build/index.js.map +7 -0
  110. package/lib/cli/build/tsc.d.ts +4 -0
  111. package/lib/cli/build/tsc.js +102 -0
  112. package/lib/cli/build/tsc.js.map +7 -0
  113. package/lib/cli/buildPackage.d.ts +1 -0
  114. package/lib/cli/buildPackage.js +69 -0
  115. package/lib/cli/buildPackage.js.map +7 -0
  116. package/lib/cli/configure/addEmptyExports.d.ts +6 -0
  117. package/lib/cli/configure/addEmptyExports.js +76 -0
  118. package/lib/cli/configure/addEmptyExports.js.map +7 -0
  119. package/lib/cli/configure/analyseConfiguration.d.ts +9 -0
  120. package/lib/cli/configure/analyseConfiguration.js +69 -0
  121. package/lib/cli/configure/analyseConfiguration.js.map +7 -0
  122. package/lib/cli/configure/analyseDependencies.d.ts +10 -0
  123. package/lib/cli/configure/analyseDependencies.js +136 -0
  124. package/lib/cli/configure/analyseDependencies.js.map +7 -0
  125. package/lib/cli/configure/analysis/diff.d.ts +1 -0
  126. package/lib/cli/configure/analysis/diff.js +45 -0
  127. package/lib/cli/configure/analysis/diff.js.map +7 -0
  128. package/lib/cli/configure/analysis/files.d.ts +1 -0
  129. package/lib/cli/configure/analysis/files.js +58 -0
  130. package/lib/cli/configure/analysis/files.js.map +7 -0
  131. package/lib/cli/configure/analysis/git.d.ts +1 -0
  132. package/lib/cli/configure/analysis/git.js +54 -0
  133. package/lib/cli/configure/analysis/git.js.map +7 -0
  134. package/lib/cli/configure/analysis/package.d.ts +13 -0
  135. package/lib/cli/configure/analysis/package.js +110 -0
  136. package/lib/cli/configure/analysis/package.js.map +7 -0
  137. package/lib/cli/configure/analysis/project.d.ts +3 -0
  138. package/lib/cli/configure/analysis/project.js +109 -0
  139. package/lib/cli/configure/analysis/project.js.map +7 -0
  140. package/lib/cli/configure/dependencies/index.d.ts +5 -0
  141. package/lib/cli/configure/dependencies/index.js +41 -0
  142. package/lib/cli/configure/dependencies/index.js.map +7 -0
  143. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -0
  144. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +59 -0
  145. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -0
  146. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -0
  147. package/lib/cli/configure/dependencies/seekKoala.js +56 -0
  148. package/lib/cli/configure/dependencies/seekKoala.js.map +7 -0
  149. package/lib/cli/configure/dependencies/skuba.d.ts +2 -0
  150. package/lib/cli/configure/dependencies/skuba.js +52 -0
  151. package/lib/cli/configure/dependencies/skuba.js.map +7 -0
  152. package/lib/cli/configure/dependencies/skubaDeps.d.ts +2 -0
  153. package/lib/cli/configure/dependencies/skubaDeps.js +56 -0
  154. package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -0
  155. package/lib/cli/configure/dependencies/skubaDive.d.ts +3 -0
  156. package/lib/cli/configure/dependencies/skubaDive.js +70 -0
  157. package/lib/cli/configure/dependencies/skubaDive.js.map +7 -0
  158. package/lib/cli/configure/ensureTemplateCompletion.d.ts +9 -0
  159. package/lib/cli/configure/ensureTemplateCompletion.js +77 -0
  160. package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -0
  161. package/lib/cli/configure/getEntryPoint.d.ts +11 -0
  162. package/lib/cli/configure/getEntryPoint.js +73 -0
  163. package/lib/cli/configure/getEntryPoint.js.map +7 -0
  164. package/lib/cli/configure/getProjectType.d.ts +9 -0
  165. package/lib/cli/configure/getProjectType.js +52 -0
  166. package/lib/cli/configure/getProjectType.js.map +7 -0
  167. package/lib/cli/configure/index.d.ts +1 -0
  168. package/lib/cli/configure/index.js +148 -0
  169. package/lib/cli/configure/index.js.map +7 -0
  170. package/lib/cli/configure/modules/eslint.d.ts +2 -0
  171. package/lib/cli/configure/modules/eslint.js +61 -0
  172. package/lib/cli/configure/modules/eslint.js.map +7 -0
  173. package/lib/cli/configure/modules/ignore.d.ts +2 -0
  174. package/lib/cli/configure/modules/ignore.js +40 -0
  175. package/lib/cli/configure/modules/ignore.js.map +7 -0
  176. package/lib/cli/configure/modules/index.d.ts +2 -0
  177. package/lib/cli/configure/modules/index.js +54 -0
  178. package/lib/cli/configure/modules/index.js.map +7 -0
  179. package/lib/cli/configure/modules/jest.d.ts +2 -0
  180. package/lib/cli/configure/modules/jest.js +86 -0
  181. package/lib/cli/configure/modules/jest.js.map +7 -0
  182. package/lib/cli/configure/modules/nodemon.d.ts +2 -0
  183. package/lib/cli/configure/modules/nodemon.js +30 -0
  184. package/lib/cli/configure/modules/nodemon.js.map +7 -0
  185. package/lib/cli/configure/modules/package.d.ts +2 -0
  186. package/lib/cli/configure/modules/package.js +117 -0
  187. package/lib/cli/configure/modules/package.js.map +7 -0
  188. package/lib/cli/configure/modules/prettier.d.ts +2 -0
  189. package/lib/cli/configure/modules/prettier.js +52 -0
  190. package/lib/cli/configure/modules/prettier.js.map +7 -0
  191. package/lib/cli/configure/modules/renovate.d.ts +3 -0
  192. package/lib/cli/configure/modules/renovate.js +69 -0
  193. package/lib/cli/configure/modules/renovate.js.map +7 -0
  194. package/lib/cli/configure/modules/serverless.d.ts +2 -0
  195. package/lib/cli/configure/modules/serverless.js +36 -0
  196. package/lib/cli/configure/modules/serverless.js.map +7 -0
  197. package/lib/cli/configure/modules/skubaDive.d.ts +2 -0
  198. package/lib/cli/configure/modules/skubaDive.js +72 -0
  199. package/lib/cli/configure/modules/skubaDive.js.map +7 -0
  200. package/lib/cli/configure/modules/tsconfig.d.ts +2 -0
  201. package/lib/cli/configure/modules/tsconfig.js +87 -0
  202. package/lib/cli/configure/modules/tsconfig.js.map +7 -0
  203. package/lib/cli/configure/modules/tslint.d.ts +2 -0
  204. package/lib/cli/configure/modules/tslint.js +30 -0
  205. package/lib/cli/configure/modules/tslint.js.map +7 -0
  206. package/lib/cli/configure/patchDockerfile.d.ts +1 -0
  207. package/lib/cli/configure/patchDockerfile.js +65 -0
  208. package/lib/cli/configure/patchDockerfile.js.map +7 -0
  209. package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
  210. package/lib/cli/configure/patchRenovateConfig.js +138 -0
  211. package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
  212. package/lib/cli/configure/patchServerListener.d.ts +3 -0
  213. package/lib/cli/configure/patchServerListener.js +87 -0
  214. package/lib/cli/configure/patchServerListener.js.map +7 -0
  215. package/lib/cli/configure/processing/deleteFiles.d.ts +5 -0
  216. package/lib/cli/configure/processing/deleteFiles.js +31 -0
  217. package/lib/cli/configure/processing/deleteFiles.js.map +7 -0
  218. package/lib/cli/configure/processing/ignoreFile.d.ts +8 -0
  219. package/lib/cli/configure/processing/ignoreFile.js +74 -0
  220. package/lib/cli/configure/processing/ignoreFile.js.map +7 -0
  221. package/lib/cli/configure/processing/javascript.d.ts +2 -0
  222. package/lib/cli/configure/processing/javascript.js +38 -0
  223. package/lib/cli/configure/processing/javascript.js.map +7 -0
  224. package/lib/cli/configure/processing/json.d.ts +2 -0
  225. package/lib/cli/configure/processing/json.js +57 -0
  226. package/lib/cli/configure/processing/json.js.map +7 -0
  227. package/lib/cli/configure/processing/loadFiles.d.ts +5 -0
  228. package/lib/cli/configure/processing/loadFiles.js +31 -0
  229. package/lib/cli/configure/processing/loadFiles.js.map +7 -0
  230. package/lib/cli/configure/processing/module.d.ts +10 -0
  231. package/lib/cli/configure/processing/module.js +39 -0
  232. package/lib/cli/configure/processing/module.js.map +7 -0
  233. package/lib/cli/configure/processing/package.d.ts +73 -0
  234. package/lib/cli/configure/processing/package.js +85 -0
  235. package/lib/cli/configure/processing/package.js.map +7 -0
  236. package/lib/cli/configure/processing/prettier.d.ts +4 -0
  237. package/lib/cli/configure/processing/prettier.js +44 -0
  238. package/lib/cli/configure/processing/prettier.js.map +7 -0
  239. package/lib/cli/configure/processing/record.d.ts +11 -0
  240. package/lib/cli/configure/processing/record.js +65 -0
  241. package/lib/cli/configure/processing/record.js.map +7 -0
  242. package/lib/cli/configure/processing/typescript.d.ts +23 -0
  243. package/lib/cli/configure/processing/typescript.js +205 -0
  244. package/lib/cli/configure/processing/typescript.js.map +7 -0
  245. package/lib/cli/configure/refreshIgnoreFiles.d.ts +3 -0
  246. package/lib/cli/configure/refreshIgnoreFiles.js +78 -0
  247. package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -0
  248. package/lib/cli/configure/types.d.ts +26 -0
  249. package/lib/cli/configure/types.js +17 -0
  250. package/lib/cli/configure/types.js.map +7 -0
  251. package/lib/cli/format.d.ts +1 -0
  252. package/lib/cli/format.js +74 -0
  253. package/lib/cli/format.js.map +7 -0
  254. package/lib/cli/help.d.ts +1 -0
  255. package/lib/cli/help.js +34 -0
  256. package/lib/cli/help.js.map +7 -0
  257. package/lib/cli/init/getConfig.d.ts +26 -0
  258. package/lib/cli/init/getConfig.js +286 -0
  259. package/lib/cli/init/getConfig.js.map +7 -0
  260. package/lib/cli/init/git.d.ts +7 -0
  261. package/lib/cli/init/git.js +82 -0
  262. package/lib/cli/init/git.js.map +7 -0
  263. package/lib/cli/init/index.d.ts +1 -0
  264. package/lib/cli/init/index.js +146 -0
  265. package/lib/cli/init/index.js.map +7 -0
  266. package/lib/cli/init/prompts.d.ts +45 -0
  267. package/lib/cli/init/prompts.js +97 -0
  268. package/lib/cli/init/prompts.js.map +7 -0
  269. package/lib/cli/init/types.d.ts +28 -0
  270. package/lib/cli/init/types.js +65 -0
  271. package/lib/cli/init/types.js.map +7 -0
  272. package/lib/cli/init/validation.d.ts +8 -0
  273. package/lib/cli/init/validation.js +43 -0
  274. package/lib/cli/init/validation.js.map +7 -0
  275. package/lib/cli/init/writePackageJson.d.ts +13 -0
  276. package/lib/cli/init/writePackageJson.js +58 -0
  277. package/lib/cli/init/writePackageJson.js.map +7 -0
  278. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +2 -0
  279. package/lib/cli/lint/annotate/buildkite/eslint.js +40 -0
  280. package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -0
  281. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -0
  282. package/lib/cli/lint/annotate/buildkite/index.js +58 -0
  283. package/lib/cli/lint/annotate/buildkite/index.js.map +7 -0
  284. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +2 -0
  285. package/lib/cli/lint/annotate/buildkite/prettier.js +47 -0
  286. package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -0
  287. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +2 -0
  288. package/lib/cli/lint/annotate/buildkite/tsc.js +45 -0
  289. package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -0
  290. package/lib/cli/lint/annotate/github/eslint.d.ts +3 -0
  291. package/lib/cli/lint/annotate/github/eslint.js +45 -0
  292. package/lib/cli/lint/annotate/github/eslint.js.map +7 -0
  293. package/lib/cli/lint/annotate/github/index.d.ts +4 -0
  294. package/lib/cli/lint/annotate/github/index.js +63 -0
  295. package/lib/cli/lint/annotate/github/index.js.map +7 -0
  296. package/lib/cli/lint/annotate/github/prettier.d.ts +3 -0
  297. package/lib/cli/lint/annotate/github/prettier.js +39 -0
  298. package/lib/cli/lint/annotate/github/prettier.js.map +7 -0
  299. package/lib/cli/lint/annotate/github/tsc.d.ts +3 -0
  300. package/lib/cli/lint/annotate/github/tsc.js +63 -0
  301. package/lib/cli/lint/annotate/github/tsc.js.map +7 -0
  302. package/lib/cli/lint/annotate/index.d.ts +4 -0
  303. package/lib/cli/lint/annotate/index.js +36 -0
  304. package/lib/cli/lint/annotate/index.js.map +7 -0
  305. package/lib/cli/lint/autofix.d.ts +10 -0
  306. package/lib/cli/lint/autofix.js +214 -0
  307. package/lib/cli/lint/autofix.js.map +7 -0
  308. package/lib/cli/lint/eslint.d.ts +4 -0
  309. package/lib/cli/lint/eslint.js +55 -0
  310. package/lib/cli/lint/eslint.js.map +7 -0
  311. package/lib/cli/lint/external.d.ts +10 -0
  312. package/lib/cli/lint/external.js +117 -0
  313. package/lib/cli/lint/external.js.map +7 -0
  314. package/lib/cli/lint/index.d.ts +2 -0
  315. package/lib/cli/lint/index.js +51 -0
  316. package/lib/cli/lint/index.js.map +7 -0
  317. package/lib/cli/lint/internal.d.ts +1 -0
  318. package/lib/cli/lint/internal.js +64 -0
  319. package/lib/cli/lint/internal.js.map +7 -0
  320. package/lib/cli/lint/prettier.d.ts +4 -0
  321. package/lib/cli/lint/prettier.js +55 -0
  322. package/lib/cli/lint/prettier.js.map +7 -0
  323. package/lib/cli/lint/tsc.d.ts +2 -0
  324. package/lib/cli/lint/tsc.js +58 -0
  325. package/lib/cli/lint/tsc.js.map +7 -0
  326. package/lib/cli/lint/types.d.ts +34 -0
  327. package/lib/cli/lint/types.js +17 -0
  328. package/lib/cli/lint/types.js.map +7 -0
  329. package/lib/cli/node.d.ts +1 -0
  330. package/lib/cli/node.js +77 -0
  331. package/lib/cli/node.js.map +7 -0
  332. package/lib/cli/release.d.ts +1 -0
  333. package/lib/cli/release.js +32 -0
  334. package/lib/cli/release.js.map +7 -0
  335. package/lib/cli/start.d.ts +1 -0
  336. package/lib/cli/start.js +69 -0
  337. package/lib/cli/start.js.map +7 -0
  338. package/lib/cli/test/index.d.ts +1 -0
  339. package/lib/cli/test/index.js +36 -0
  340. package/lib/cli/test/index.js.map +7 -0
  341. package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
  342. package/lib/cli/test/reporters/github/annotations.js +102 -0
  343. package/lib/cli/test/reporters/github/annotations.js.map +7 -0
  344. package/lib/cli/test/reporters/github/index.d.ts +5 -0
  345. package/lib/cli/test/reporters/github/index.js +75 -0
  346. package/lib/cli/test/reporters/github/index.js.map +7 -0
  347. package/lib/cli/test/reporters/prettier/index.d.ts +4 -0
  348. package/lib/cli/test/reporters/prettier/index.js +67 -0
  349. package/lib/cli/test/reporters/prettier/index.js.map +7 -0
  350. package/lib/cli/version.d.ts +1 -0
  351. package/lib/cli/version.js +34 -0
  352. package/lib/cli/version.js.map +7 -0
  353. package/lib/enquirer.d.js +2 -0
  354. package/lib/enquirer.d.js.map +7 -0
  355. package/lib/index.d.ts +22 -0
  356. package/lib/index.js +51 -0
  357. package/lib/index.js.map +7 -0
  358. package/lib/skuba.d.ts +11 -0
  359. package/lib/skuba.js +53 -0
  360. package/lib/skuba.js.map +7 -0
  361. package/lib/utils/args.d.ts +43 -0
  362. package/lib/utils/args.js +114 -0
  363. package/lib/utils/args.js.map +7 -0
  364. package/lib/utils/command.d.ts +6 -0
  365. package/lib/utils/command.js +72 -0
  366. package/lib/utils/command.js.map +7 -0
  367. package/lib/utils/copy.d.ts +17 -0
  368. package/lib/utils/copy.js +105 -0
  369. package/lib/utils/copy.js.map +7 -0
  370. package/lib/utils/dir.d.ts +22 -0
  371. package/lib/utils/dir.js +91 -0
  372. package/lib/utils/dir.js.map +7 -0
  373. package/lib/utils/env.d.ts +5 -0
  374. package/lib/utils/env.js +29 -0
  375. package/lib/utils/env.js.map +7 -0
  376. package/lib/utils/error.d.ts +28 -0
  377. package/lib/utils/error.js +72 -0
  378. package/lib/utils/error.js.map +7 -0
  379. package/lib/utils/exec.d.ts +39 -0
  380. package/lib/utils/exec.js +163 -0
  381. package/lib/utils/exec.js.map +7 -0
  382. package/lib/utils/help.d.ts +1 -0
  383. package/lib/utils/help.js +34 -0
  384. package/lib/utils/help.js.map +7 -0
  385. package/lib/utils/logging.d.ts +27 -0
  386. package/lib/utils/logging.js +60 -0
  387. package/lib/utils/logging.js.map +7 -0
  388. package/lib/utils/logo.d.ts +9 -0
  389. package/lib/utils/logo.js +74 -0
  390. package/lib/utils/logo.js.map +7 -0
  391. package/lib/utils/manifest.d.ts +10 -0
  392. package/lib/utils/manifest.js +83 -0
  393. package/lib/utils/manifest.js.map +7 -0
  394. package/lib/utils/port.d.ts +2 -0
  395. package/lib/utils/port.js +48 -0
  396. package/lib/utils/port.js.map +7 -0
  397. package/lib/utils/template.d.ts +37 -0
  398. package/lib/utils/template.js +116 -0
  399. package/lib/utils/template.js.map +7 -0
  400. package/lib/utils/validation.d.ts +6 -0
  401. package/lib/utils/validation.js +44 -0
  402. package/lib/utils/validation.js.map +7 -0
  403. package/lib/utils/version.d.ts +13 -0
  404. package/lib/utils/version.js +89 -0
  405. package/lib/utils/version.js.map +7 -0
  406. package/lib/utils/wait.d.ts +17 -0
  407. package/lib/utils/wait.js +59 -0
  408. package/lib/utils/wait.js.map +7 -0
  409. package/lib/utils/worker.d.ts +20 -0
  410. package/lib/utils/worker.js +63 -0
  411. package/lib/utils/worker.js.map +7 -0
  412. package/lib/wrapper/function-arguments.d.js +2 -0
  413. package/lib/wrapper/function-arguments.d.js.map +7 -0
  414. package/lib/wrapper/functionHandler.d.ts +10 -0
  415. package/lib/wrapper/functionHandler.js +63 -0
  416. package/lib/wrapper/functionHandler.js.map +7 -0
  417. package/lib/wrapper/http.d.ts +20 -0
  418. package/lib/wrapper/http.js +79 -0
  419. package/lib/wrapper/http.js.map +7 -0
  420. package/lib/wrapper/index.d.ts +12 -0
  421. package/lib/wrapper/index.js +16 -0
  422. package/lib/wrapper/index.js.map +7 -0
  423. package/lib/wrapper/main.d.ts +1 -0
  424. package/lib/wrapper/main.js +47 -0
  425. package/lib/wrapper/main.js.map +7 -0
  426. package/lib/wrapper/requestListener.d.ts +11 -0
  427. package/lib/wrapper/requestListener.js +69 -0
  428. package/lib/wrapper/requestListener.js.map +7 -0
  429. package/package.json +170 -0
  430. package/template/base/.github/CODEOWNERS +1 -0
  431. package/template/base/.github/renovate.json5 +3 -0
  432. package/template/base/_.dockerignore +18 -0
  433. package/template/base/_.eslintignore +14 -0
  434. package/template/base/_.eslintrc.js +3 -0
  435. package/template/base/_.gitignore +23 -0
  436. package/template/base/_.prettierignore +8 -0
  437. package/template/base/_.prettierrc.js +1 -0
  438. package/template/base/jest.config.ts +15 -0
  439. package/template/base/jest.setup.ts +3 -0
  440. package/template/base/tsconfig.build.json +5 -0
  441. package/template/base/tsconfig.json +13 -0
  442. package/template/express-rest-api/.buildkite/pipeline.yml +105 -0
  443. package/template/express-rest-api/.env +1 -0
  444. package/template/express-rest-api/.gantry/common.yml +20 -0
  445. package/template/express-rest-api/.gantry/dev.yml +8 -0
  446. package/template/express-rest-api/.gantry/prod.yml +8 -0
  447. package/template/express-rest-api/.nvmrc +1 -0
  448. package/template/express-rest-api/Dockerfile +37 -0
  449. package/template/express-rest-api/Dockerfile.dev-deps +11 -0
  450. package/template/express-rest-api/README.md +106 -0
  451. package/template/express-rest-api/docker-compose.yml +22 -0
  452. package/template/express-rest-api/gantry.apply.yml +120 -0
  453. package/template/express-rest-api/gantry.build.yml +15 -0
  454. package/template/express-rest-api/package.json +30 -0
  455. package/template/express-rest-api/skuba.template.js +49 -0
  456. package/template/express-rest-api/src/api/healthCheck.ts +11 -0
  457. package/template/express-rest-api/src/api/smokeTest.ts +8 -0
  458. package/template/express-rest-api/src/app.test.ts +9 -0
  459. package/template/express-rest-api/src/app.ts +14 -0
  460. package/template/express-rest-api/src/config.ts +57 -0
  461. package/template/express-rest-api/src/framework/logging.ts +17 -0
  462. package/template/express-rest-api/src/listen.ts +23 -0
  463. package/template/express-rest-api/src/register.ts +1 -0
  464. package/template/greeter/.buildkite/pipeline.yml +37 -0
  465. package/template/greeter/.nvmrc +1 -0
  466. package/template/greeter/Dockerfile +11 -0
  467. package/template/greeter/README.md +96 -0
  468. package/template/greeter/docker-compose.yml +22 -0
  469. package/template/greeter/package.json +24 -0
  470. package/template/greeter/skuba.template.js +16 -0
  471. package/template/greeter/src/app.test.ts +5 -0
  472. package/template/greeter/src/app.ts +4 -0
  473. package/template/koa-rest-api/.buildkite/pipeline.yml +105 -0
  474. package/template/koa-rest-api/.env +1 -0
  475. package/template/koa-rest-api/.gantry/common.yml +20 -0
  476. package/template/koa-rest-api/.gantry/dev.yml +11 -0
  477. package/template/koa-rest-api/.gantry/prod.yml +11 -0
  478. package/template/koa-rest-api/.nvmrc +1 -0
  479. package/template/koa-rest-api/Dockerfile +37 -0
  480. package/template/koa-rest-api/Dockerfile.dev-deps +11 -0
  481. package/template/koa-rest-api/README.md +111 -0
  482. package/template/koa-rest-api/docker-compose.yml +22 -0
  483. package/template/koa-rest-api/gantry.apply.yml +127 -0
  484. package/template/koa-rest-api/gantry.build.yml +15 -0
  485. package/template/koa-rest-api/package.json +47 -0
  486. package/template/koa-rest-api/skuba.template.js +49 -0
  487. package/template/koa-rest-api/src/api/healthCheck.ts +13 -0
  488. package/template/koa-rest-api/src/api/index.ts +10 -0
  489. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +9 -0
  490. package/template/koa-rest-api/src/api/jobs/getJobs.ts +15 -0
  491. package/template/koa-rest-api/src/api/jobs/index.ts +10 -0
  492. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +34 -0
  493. package/template/koa-rest-api/src/api/jobs/postJob.ts +19 -0
  494. package/template/koa-rest-api/src/api/smokeTest.ts +11 -0
  495. package/template/koa-rest-api/src/app.test.ts +21 -0
  496. package/template/koa-rest-api/src/app.ts +8 -0
  497. package/template/koa-rest-api/src/config.ts +57 -0
  498. package/template/koa-rest-api/src/framework/logging.ts +25 -0
  499. package/template/koa-rest-api/src/framework/metrics.ts +11 -0
  500. package/template/koa-rest-api/src/framework/middleware.ts +3 -0
  501. package/template/koa-rest-api/src/framework/server.test.ts +260 -0
  502. package/template/koa-rest-api/src/framework/server.ts +51 -0
  503. package/template/koa-rest-api/src/framework/validation.test.ts +72 -0
  504. package/template/koa-rest-api/src/framework/validation.ts +77 -0
  505. package/template/koa-rest-api/src/listen.ts +24 -0
  506. package/template/koa-rest-api/src/register.ts +1 -0
  507. package/template/koa-rest-api/src/storage/jobs.ts +28 -0
  508. package/template/koa-rest-api/src/testing/logging.ts +16 -0
  509. package/template/koa-rest-api/src/testing/metrics.ts +29 -0
  510. package/template/koa-rest-api/src/testing/server.ts +31 -0
  511. package/template/koa-rest-api/src/testing/types.ts +24 -0
  512. package/template/koa-rest-api/src/tracing.ts +56 -0
  513. package/template/koa-rest-api/src/types/jobs.ts +17 -0
  514. package/template/koa-rest-api/src/types/koa.ts +8 -0
  515. package/template/koa-rest-api/tsconfig.json +18 -0
  516. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +98 -0
  517. package/template/lambda-sqs-worker/.env +1 -0
  518. package/template/lambda-sqs-worker/.nvmrc +1 -0
  519. package/template/lambda-sqs-worker/Dockerfile +12 -0
  520. package/template/lambda-sqs-worker/README.md +132 -0
  521. package/template/lambda-sqs-worker/docker-compose.yml +27 -0
  522. package/template/lambda-sqs-worker/package.json +44 -0
  523. package/template/lambda-sqs-worker/serverless.yml +202 -0
  524. package/template/lambda-sqs-worker/skuba.template.js +32 -0
  525. package/template/lambda-sqs-worker/src/app.test.ts +116 -0
  526. package/template/lambda-sqs-worker/src/app.ts +57 -0
  527. package/template/lambda-sqs-worker/src/config.ts +57 -0
  528. package/template/lambda-sqs-worker/src/framework/handler.test.ts +61 -0
  529. package/template/lambda-sqs-worker/src/framework/handler.ts +43 -0
  530. package/template/lambda-sqs-worker/src/framework/logging.ts +27 -0
  531. package/template/lambda-sqs-worker/src/framework/metrics.ts +14 -0
  532. package/template/lambda-sqs-worker/src/framework/validation.test.ts +84 -0
  533. package/template/lambda-sqs-worker/src/framework/validation.ts +10 -0
  534. package/template/lambda-sqs-worker/src/hooks.ts +96 -0
  535. package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +22 -0
  536. package/template/lambda-sqs-worker/src/services/aws.ts +5 -0
  537. package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +44 -0
  538. package/template/lambda-sqs-worker/src/services/jobScorer.ts +59 -0
  539. package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +40 -0
  540. package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +33 -0
  541. package/template/lambda-sqs-worker/src/testing/handler.ts +13 -0
  542. package/template/lambda-sqs-worker/src/testing/logging.ts +19 -0
  543. package/template/lambda-sqs-worker/src/testing/services.ts +28 -0
  544. package/template/lambda-sqs-worker/src/testing/types.ts +33 -0
  545. package/template/lambda-sqs-worker/src/types/jobScorer.ts +15 -0
  546. package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +21 -0
  547. package/template/lambda-sqs-worker/tsconfig.json +13 -0
  548. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +95 -0
  549. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -0
  550. package/template/lambda-sqs-worker-cdk/Dockerfile +13 -0
  551. package/template/lambda-sqs-worker-cdk/cdk.json +25 -0
  552. package/template/lambda-sqs-worker-cdk/docker-compose.yml +28 -0
  553. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +723 -0
  554. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +34 -0
  555. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +74 -0
  556. package/template/lambda-sqs-worker-cdk/infra/index.ts +14 -0
  557. package/template/lambda-sqs-worker-cdk/package.json +30 -0
  558. package/template/lambda-sqs-worker-cdk/shared/context-types.ts +21 -0
  559. package/template/lambda-sqs-worker-cdk/skuba.template.js +27 -0
  560. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -0
  561. package/template/lambda-sqs-worker-cdk/tsconfig.json +13 -0
  562. package/template/oss-npm-package/.github/workflows/release.yml +36 -0
  563. package/template/oss-npm-package/.github/workflows/validate.yml +31 -0
  564. package/template/oss-npm-package/.nvmrc +1 -0
  565. package/template/oss-npm-package/LICENSE +21 -0
  566. package/template/oss-npm-package/README.md +128 -0
  567. package/template/oss-npm-package/_package.json +47 -0
  568. package/template/oss-npm-package/skuba.template.js +22 -0
  569. package/template/oss-npm-package/src/index.test.ts +5 -0
  570. package/template/oss-npm-package/src/index.ts +7 -0
  571. package/template/oss-npm-package/tsconfig.json +10 -0
  572. package/template/private-npm-package/.buildkite/pipeline.yml +5 -0
  573. package/template/private-npm-package/.nvmrc +1 -0
  574. package/template/private-npm-package/README.md +109 -0
  575. package/template/private-npm-package/_package.json +44 -0
  576. package/template/private-npm-package/skuba.template.js +24 -0
  577. package/template/private-npm-package/src/index.test.ts +5 -0
  578. package/template/private-npm-package/src/index.ts +7 -0
  579. package/template/private-npm-package/tsconfig.json +10 -0
@@ -0,0 +1,146 @@
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 init_exports = {};
30
+ __export(init_exports, {
31
+ init: () => init
32
+ });
33
+ module.exports = __toCommonJS(init_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_git = require("../../api/git");
36
+ var import_copy = require("../../utils/copy");
37
+ var import_dir = require("../../utils/dir");
38
+ var import_exec = require("../../utils/exec");
39
+ var import_logging = require("../../utils/logging");
40
+ var import_logo = require("../../utils/logo");
41
+ var import_template = require("../../utils/template");
42
+ var import_patchRenovateConfig = require("../configure/patchRenovateConfig");
43
+ var import_getConfig = require("./getConfig");
44
+ var import_git2 = require("./git");
45
+ var import_writePackageJson = require("./writePackageJson");
46
+ const init = async () => {
47
+ const skubaVersionInfo = await (0, import_logo.showLogoAndVersionInfo)();
48
+ await (0, import_exec.ensureCommands)("yarn");
49
+ const {
50
+ destinationDir,
51
+ entryPoint,
52
+ templateComplete,
53
+ templateData,
54
+ templateName,
55
+ type
56
+ } = await (0, import_getConfig.getConfig)();
57
+ const include = await (0, import_dir.createInclusionFilter)([
58
+ import_path.default.join(destinationDir, ".gitignore"),
59
+ import_path.default.join(import_template.BASE_TEMPLATE_DIR, "_.gitignore")
60
+ ]);
61
+ const processors = [(0, import_copy.createEjsRenderer)(templateData)];
62
+ await (0, import_copy.copyFiles)({
63
+ sourceRoot: import_template.BASE_TEMPLATE_DIR,
64
+ destinationRoot: destinationDir,
65
+ include,
66
+ // prefer template-specific files
67
+ overwrite: false,
68
+ processors,
69
+ // base template has files like _.eslintrc.js
70
+ stripUnderscorePrefix: true
71
+ });
72
+ await (0, import_copy.copyFiles)({
73
+ sourceRoot: destinationDir,
74
+ destinationRoot: destinationDir,
75
+ include,
76
+ processors
77
+ });
78
+ await Promise.all([
79
+ templateComplete ? (0, import_template.ensureTemplateConfigDeletion)(destinationDir) : Promise.resolve(),
80
+ (0, import_writePackageJson.writePackageJson)({
81
+ cwd: destinationDir,
82
+ entryPoint,
83
+ template: templateName,
84
+ type,
85
+ version: skubaVersionInfo.local
86
+ })
87
+ ]);
88
+ const exec = (0, import_exec.createExec)({
89
+ cwd: destinationDir,
90
+ stdio: "pipe",
91
+ streamStdio: "yarn"
92
+ });
93
+ import_logging.log.newline();
94
+ await (0, import_git2.initialiseRepo)(destinationDir, templateData);
95
+ await (0, import_patchRenovateConfig.tryPatchRenovateConfig)(destinationDir);
96
+ const skubaSlug = `skuba@${skubaVersionInfo.local}`;
97
+ let depsInstalled = false;
98
+ try {
99
+ await exec("yarn", "add", "--dev", skubaSlug);
100
+ depsInstalled = true;
101
+ await exec("npx", "yarn-deduplicate", "--strategy=highest");
102
+ } catch {
103
+ }
104
+ await (0, import_git.commitAllChanges)({
105
+ dir: destinationDir,
106
+ message: `Clone ${templateName}`
107
+ });
108
+ const logGitHubRepoCreation = () => {
109
+ import_logging.log.plain(
110
+ "Next, create an empty",
111
+ import_logging.log.bold(`${templateData.orgName}/${templateData.repoName}`),
112
+ "repository:"
113
+ );
114
+ import_logging.log.ok("https://github.com/new");
115
+ };
116
+ if (!depsInstalled) {
117
+ import_logging.log.newline();
118
+ import_logging.log.warn(import_logging.log.bold("\u2717 Failed to install dependencies."));
119
+ import_logging.log.newline();
120
+ logGitHubRepoCreation();
121
+ import_logging.log.newline();
122
+ import_logging.log.plain("Then, resume initialisation:");
123
+ import_logging.log.ok("cd", destinationDir);
124
+ import_logging.log.ok("yarn add --dev", skubaSlug);
125
+ import_logging.log.ok("git add --all");
126
+ import_logging.log.ok("git commit --message", `'Pin ${skubaSlug}'`);
127
+ import_logging.log.ok("git push --set-upstream origin master");
128
+ import_logging.log.newline();
129
+ process.exitCode = 1;
130
+ return;
131
+ }
132
+ import_logging.log.newline();
133
+ import_logging.log.ok(import_logging.log.bold("\u2714 Project initialised!"));
134
+ import_logging.log.newline();
135
+ logGitHubRepoCreation();
136
+ import_logging.log.newline();
137
+ import_logging.log.plain("Then, push your local changes:");
138
+ import_logging.log.ok("cd", destinationDir);
139
+ import_logging.log.ok("git push --set-upstream origin master");
140
+ import_logging.log.newline();
141
+ };
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ init
145
+ });
146
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/index.ts"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport { commitAllChanges } from '../../api/git';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { tryPatchRenovateConfig } from '../configure/patchRenovateConfig';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async () => {\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n await ensureCommands('yarn');\n\n const {\n destinationDir,\n entryPoint,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _.eslintrc.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: 'yarn',\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig(destinationDir);\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n await exec('yarn', 'add', '--dev', skubaSlug);\n depsInstalled = true;\n await exec('npx', 'yarn-deduplicate', '--strategy=highest');\n } catch {}\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n log.ok('yarn add --dev', skubaSlug);\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,iBAAiC;AACjC,kBAA6C;AAC7C,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAoB;AACpB,kBAAuC;AACvC,sBAGO;AACP,iCAAuC;AAEvC,uBAA0B;AAC1B,IAAAA,cAA+B;AAC/B,8BAAiC;AAE1B,MAAM,OAAO,YAAY;AAC9B,QAAM,mBAAmB,UAAM,oCAAuB;AAEtD,YAAM,4BAAe,MAAM;AAE3B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,UAAM,4BAAU;AAEpB,QAAM,UAAU,UAAM,kCAAsB;AAAA,IAC1C,YAAAC,QAAK,KAAK,gBAAgB,YAAY;AAAA,IACtC,YAAAA,QAAK,KAAK,mCAAmB,aAAa;AAAA,EAC5C,CAAC;AAED,QAAM,aAAa,KAAC,+BAAkB,YAAY,CAAC;AAEnD,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA;AAAA,IAEA,WAAW;AAAA,IACX;AAAA;AAAA,IAEA,uBAAuB;AAAA,EACzB,CAAC;AAED,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,IAAI;AAAA,IAChB,uBACI,8CAA6B,cAAc,IAC3C,QAAQ,QAAQ;AAAA,QAEpB,0CAAiB;AAAA,MACf,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,SAAS,iBAAiB;AAAA,IAC5B,CAAC;AAAA,EACH,CAAC;AAED,QAAM,WAAO,wBAAW;AAAA,IACtB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,EACf,CAAC;AAED,qBAAI,QAAQ;AACZ,YAAM,4BAAe,gBAAgB,YAAY;AAGjD,YAAM,mDAAuB,cAAc;AAE3C,QAAM,YAAY,SAAS,iBAAiB,KAAK;AAEjD,MAAI,gBAAgB;AACpB,MAAI;AACF,UAAM,KAAK,QAAQ,OAAO,SAAS,SAAS;AAC5C,oBAAgB;AAChB,UAAM,KAAK,OAAO,oBAAoB,oBAAoB;AAAA,EAC5D,QAAQ;AAAA,EAAC;AAET,YAAM,6BAAiB;AAAA,IACrB,KAAK;AAAA,IACL,SAAS,SAAS,YAAY;AAAA,EAChC,CAAC;AAED,QAAM,wBAAwB,MAAM;AAClC,uBAAI;AAAA,MACF;AAAA,MACA,mBAAI,KAAK,GAAG,aAAa,OAAO,IAAI,aAAa,QAAQ,EAAE;AAAA,MAC3D;AAAA,IACF;AACA,uBAAI,GAAG,wBAAwB;AAAA,EACjC;AAEA,MAAI,CAAC,eAAe;AAClB,uBAAI,QAAQ;AACZ,uBAAI,KAAK,mBAAI,KAAK,wCAAmC,CAAC;AAEtD,uBAAI,QAAQ;AACZ,0BAAsB;AAEtB,uBAAI,QAAQ;AACZ,uBAAI,MAAM,8BAA8B;AACxC,uBAAI,GAAG,MAAM,cAAc;AAC3B,uBAAI,GAAG,kBAAkB,SAAS;AAClC,uBAAI,GAAG,eAAe;AACtB,uBAAI,GAAG,wBAAwB,QAAQ,SAAS,GAAG;AACnD,uBAAI,GAAG,uCAAuC;AAE9C,uBAAI,QAAQ;AACZ,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,qBAAI,QAAQ;AACZ,qBAAI,GAAG,mBAAI,KAAK,6BAAwB,CAAC;AAEzC,qBAAI,QAAQ;AACZ,wBAAsB;AAEtB,qBAAI,QAAQ;AACZ,qBAAI,MAAM,gCAAgC;AAC1C,qBAAI,GAAG,MAAM,cAAc;AAC3B,qBAAI,GAAG,uCAAuC;AAE9C,qBAAI,QAAQ;AACd;",
6
+ "names": ["import_git", "path"]
7
+ }
@@ -0,0 +1,45 @@
1
+ import { type Platform } from './validation';
2
+ import { Input, Select } from 'enquirer';
3
+ export type BaseFields = Record<(typeof BASE_CHOICES)[number]['name'], string> & {
4
+ platformName: Platform;
5
+ };
6
+ declare const BASE_CHOICES: readonly [{
7
+ readonly name: "ownerName";
8
+ readonly message: "Owner";
9
+ readonly initial: "SEEK-Jobs/my-team";
10
+ readonly validate: (value: unknown) => true | "required" | "fails GitHub validation";
11
+ }, {
12
+ readonly name: "repoName";
13
+ readonly message: "Repo";
14
+ readonly initial: "my-repo";
15
+ readonly validate: (value: unknown) => Promise<string | true>;
16
+ }, {
17
+ readonly name: "platformName";
18
+ readonly message: "Platform";
19
+ readonly initial: string;
20
+ readonly validate: (value: unknown) => string | true;
21
+ }];
22
+ export declare const BASE_PROMPT_PROPS: {
23
+ choices: readonly [{
24
+ readonly name: "ownerName";
25
+ readonly message: "Owner";
26
+ readonly initial: "SEEK-Jobs/my-team";
27
+ readonly validate: (value: unknown) => true | "required" | "fails GitHub validation";
28
+ }, {
29
+ readonly name: "repoName";
30
+ readonly message: "Repo";
31
+ readonly initial: "my-repo";
32
+ readonly validate: (value: unknown) => Promise<string | true>;
33
+ }, {
34
+ readonly name: "platformName";
35
+ readonly message: "Platform";
36
+ readonly initial: string;
37
+ readonly validate: (value: unknown) => string | true;
38
+ }];
39
+ message: string;
40
+ name: string;
41
+ };
42
+ export declare const SHOULD_CONTINUE_PROMPT: Select<"yes" | "no">;
43
+ export declare const GIT_PATH_PROMPT: Input;
44
+ export declare const TEMPLATE_PROMPT: Select<"express-rest-api" | "greeter" | "koa-rest-api" | "lambda-sqs-worker" | "lambda-sqs-worker-cdk" | "oss-npm-package" | "private-npm-package" | "github →">;
45
+ export {};
@@ -0,0 +1,97 @@
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 prompts_exports = {};
20
+ __export(prompts_exports, {
21
+ BASE_PROMPT_PROPS: () => BASE_PROMPT_PROPS,
22
+ GIT_PATH_PROMPT: () => GIT_PATH_PROMPT,
23
+ SHOULD_CONTINUE_PROMPT: () => SHOULD_CONTINUE_PROMPT,
24
+ TEMPLATE_PROMPT: () => TEMPLATE_PROMPT
25
+ });
26
+ module.exports = __toCommonJS(prompts_exports);
27
+ var import_fs_extra = require("fs-extra");
28
+ var import_template = require("../../utils/template");
29
+ var import_validation = require("./validation");
30
+ var import_enquirer = require("enquirer");
31
+ const BASE_CHOICES = [
32
+ {
33
+ name: "ownerName",
34
+ message: "Owner",
35
+ initial: "SEEK-Jobs/my-team",
36
+ validate: (value) => {
37
+ if (typeof value !== "string") {
38
+ return "required";
39
+ }
40
+ const [org, team] = value.split("/");
41
+ if (!org || !(0, import_validation.isGitHubOrg)(org)) {
42
+ return "fails GitHub validation";
43
+ }
44
+ return team === void 0 || (0, import_validation.isGitHubTeam)(team) || "fails GitHub validation";
45
+ }
46
+ },
47
+ {
48
+ name: "repoName",
49
+ message: "Repo",
50
+ initial: "my-repo",
51
+ validate: async (value) => {
52
+ if (typeof value !== "string") {
53
+ return "required";
54
+ }
55
+ if (!(0, import_validation.isGitHubRepo)(value)) {
56
+ return "fails GitHub validation";
57
+ }
58
+ const exists = await (0, import_fs_extra.pathExists)(value);
59
+ return !exists || `'${value}' is an existing directory`;
60
+ }
61
+ },
62
+ {
63
+ name: "platformName",
64
+ message: "Platform",
65
+ initial: import_validation.PLATFORM_OPTIONS,
66
+ validate: (value) => (0, import_validation.isPlatform)(value) || `must be ${import_validation.PLATFORM_OPTIONS}`
67
+ }
68
+ ];
69
+ const BASE_PROMPT_PROPS = {
70
+ choices: BASE_CHOICES,
71
+ message: "For starters, some project details:",
72
+ name: "baseAnswers"
73
+ };
74
+ const SHOULD_CONTINUE_PROMPT = new import_enquirer.Select({
75
+ choices: ["yes", "no"],
76
+ message: "Fill this in now?",
77
+ name: "shouldContinue"
78
+ });
79
+ const GIT_PATH_PROMPT = new import_enquirer.Input({
80
+ message: "Git path",
81
+ name: "gitPath",
82
+ initial: "seek-oss/skuba",
83
+ validate: (value) => /[^/]+\/[^/]+/.test(value) || "Path is not valid"
84
+ });
85
+ const TEMPLATE_PROMPT = new import_enquirer.Select({
86
+ choices: import_template.TEMPLATE_NAMES_WITH_BYO,
87
+ message: "Select a template:",
88
+ name: "templateName"
89
+ });
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ BASE_PROMPT_PROPS,
93
+ GIT_PATH_PROMPT,
94
+ SHOULD_CONTINUE_PROMPT,
95
+ TEMPLATE_PROMPT
96
+ });
97
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/prompts.ts"],
4
+ "sourcesContent": ["import { pathExists } from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template';\n\nimport {\n PLATFORM_OPTIONS,\n type Platform,\n isGitHubOrg,\n isGitHubRepo,\n isGitHubTeam,\n isPlatform,\n} from './validation';\n\nimport { Input, Select } from 'enquirer';\n\nexport type BaseFields = Record<\n (typeof BASE_CHOICES)[number]['name'],\n string\n> & {\n platformName: Platform;\n};\n\nconst BASE_CHOICES = [\n {\n name: 'ownerName',\n message: 'Owner',\n initial: 'SEEK-Jobs/my-team',\n validate: (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n const [org, team] = value.split('/');\n\n if (!org || !isGitHubOrg(org)) {\n return 'fails GitHub validation';\n }\n\n return (\n team === undefined || isGitHubTeam(team) || 'fails GitHub validation'\n );\n },\n },\n {\n name: 'repoName',\n message: 'Repo',\n initial: 'my-repo',\n validate: async (value: unknown) => {\n if (typeof value !== 'string') {\n return 'required';\n }\n\n if (!isGitHubRepo(value)) {\n return 'fails GitHub validation';\n }\n\n const exists = await pathExists(value);\n\n return !exists || `'${value}' is an existing directory`;\n },\n },\n {\n name: 'platformName',\n message: 'Platform',\n initial: PLATFORM_OPTIONS,\n validate: (value: unknown) =>\n isPlatform(value) || `must be ${PLATFORM_OPTIONS}`,\n },\n] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some project details:',\n name: 'baseAnswers',\n};\n\nexport const SHOULD_CONTINUE_PROMPT = new Select({\n choices: ['yes', 'no'] as const,\n message: 'Fill this in now?',\n name: 'shouldContinue',\n});\n\nexport const GIT_PATH_PROMPT = new Input({\n message: 'Git path',\n name: 'gitPath',\n initial: 'seek-oss/skuba',\n validate: (value) => /[^/]+\\/[^/]+/.test(value) || 'Path is not valid',\n});\n\nexport const TEMPLATE_PROMPT = new Select({\n choices: TEMPLATE_NAMES_WITH_BYO,\n message: 'Select a template:',\n name: 'templateName',\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2B;AAE3B,sBAAwC;AAExC,wBAOO;AAEP,sBAA8B;AAS9B,MAAM,eAAe;AAAA,EACnB;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,CAAC,UAAmB;AAC5B,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,YAAM,CAAC,KAAK,IAAI,IAAI,MAAM,MAAM,GAAG;AAEnC,UAAI,CAAC,OAAO,KAAC,+BAAY,GAAG,GAAG;AAC7B,eAAO;AAAA,MACT;AAEA,aACE,SAAS,cAAa,gCAAa,IAAI,KAAK;AAAA,IAEhD;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,OAAO,UAAmB;AAClC,UAAI,OAAO,UAAU,UAAU;AAC7B,eAAO;AAAA,MACT;AAEA,UAAI,KAAC,gCAAa,KAAK,GAAG;AACxB,eAAO;AAAA,MACT;AAEA,YAAM,SAAS,UAAM,4BAAW,KAAK;AAErC,aAAO,CAAC,UAAU,IAAI,KAAK;AAAA,IAC7B;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU,CAAC,cACT,8BAAW,KAAK,KAAK,WAAW,kCAAgB;AAAA,EACpD;AACF;AAEO,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,yBAAyB,IAAI,uBAAO;AAAA,EAC/C,SAAS,CAAC,OAAO,IAAI;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR,CAAC;AAEM,MAAM,kBAAkB,IAAI,sBAAM;AAAA,EACvC,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,UAAU,eAAe,KAAK,KAAK,KAAK;AACrD,CAAC;AAEM,MAAM,kBAAkB,IAAI,uBAAO;AAAA,EACxC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as t from 'runtypes';
2
+ export type InitConfigInput = t.Static<typeof InitConfigInput>;
3
+ export declare const InitConfigInput: t.Record<{
4
+ destinationDir: t.String;
5
+ templateComplete: t.Boolean;
6
+ templateData: t.Intersect<[t.Record<{
7
+ ownerName: t.String;
8
+ repoName: t.String;
9
+ platformName: t.Union<[t.Literal<"amd64">, t.Literal<"arm64">]>;
10
+ }, false>, t.Dictionary<t.String, string>]>;
11
+ templateName: t.String;
12
+ }, false>;
13
+ export type InitConfig = t.Static<typeof InitConfig>;
14
+ declare const InitConfig: t.Record<{
15
+ templateData: t.Intersect<[t.Record<{
16
+ ownerName: t.String;
17
+ repoName: t.String;
18
+ orgName: t.String;
19
+ teamName: t.String;
20
+ port: t.String;
21
+ }, false>, t.Dictionary<t.String, string>]>;
22
+ entryPoint: t.Optional<t.String>;
23
+ type: t.Optional<t.Union<[t.Literal<"application">, t.Literal<"package">]>>;
24
+ destinationDir: t.String;
25
+ templateComplete: t.Boolean;
26
+ templateName: t.String;
27
+ }, false>;
28
+ export {};
@@ -0,0 +1,65 @@
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 types_exports = {};
30
+ __export(types_exports, {
31
+ InitConfigInput: () => InitConfigInput
32
+ });
33
+ module.exports = __toCommonJS(types_exports);
34
+ var t = __toESM(require("runtypes"));
35
+ var import_manifest = require("../../utils/manifest");
36
+ const INIT_CONFIG_INPUT_FIELDS = {
37
+ destinationDir: t.String,
38
+ templateComplete: t.Boolean,
39
+ templateData: t.Record({
40
+ ownerName: t.String,
41
+ repoName: t.String,
42
+ platformName: t.Union(t.Literal("amd64"), t.Literal("arm64"))
43
+ }).And(t.Dictionary(t.String, t.String)),
44
+ templateName: t.String
45
+ };
46
+ const InitConfigInput = t.Record(INIT_CONFIG_INPUT_FIELDS);
47
+ const InitConfig = t.Record({
48
+ ...INIT_CONFIG_INPUT_FIELDS,
49
+ templateData: t.Record({
50
+ ownerName: t.String,
51
+ repoName: t.String,
52
+ // Derived from ownerName
53
+ orgName: t.String,
54
+ teamName: t.String,
55
+ // Generated by init command
56
+ port: t.String
57
+ }).And(t.Dictionary(t.String, t.String)),
58
+ entryPoint: t.String.optional(),
59
+ type: import_manifest.ProjectType.optional()
60
+ });
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ InitConfigInput
64
+ });
65
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/types.ts"],
4
+ "sourcesContent": ["/* eslint-disable new-cap */\n\nimport * as t from 'runtypes';\n\nimport { ProjectType } from '../../utils/manifest';\n\nconst INIT_CONFIG_INPUT_FIELDS = {\n destinationDir: t.String,\n templateComplete: t.Boolean,\n templateData: t\n .Record({\n ownerName: t.String,\n repoName: t.String,\n platformName: t.Union(t.Literal('amd64'), t.Literal('arm64')),\n })\n .And(t.Dictionary(t.String, t.String)),\n templateName: t.String,\n};\n\nexport type InitConfigInput = t.Static<typeof InitConfigInput>;\n\nexport const InitConfigInput = t.Record(INIT_CONFIG_INPUT_FIELDS);\n\nexport type InitConfig = t.Static<typeof InitConfig>;\n\nconst InitConfig = t.Record({\n ...INIT_CONFIG_INPUT_FIELDS,\n\n templateData: t\n .Record({\n ownerName: t.String,\n repoName: t.String,\n\n // Derived from ownerName\n orgName: t.String,\n teamName: t.String,\n\n // Generated by init command\n port: t.String,\n })\n .And(t.Dictionary(t.String, t.String)),\n\n entryPoint: t.String.optional(),\n type: ProjectType.optional(),\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,QAAmB;AAEnB,sBAA4B;AAE5B,MAAM,2BAA2B;AAAA,EAC/B,gBAAgB,EAAE;AAAA,EAClB,kBAAkB,EAAE;AAAA,EACpB,cAAc,EACX,OAAO;AAAA,IACN,WAAW,EAAE;AAAA,IACb,UAAU,EAAE;AAAA,IACZ,cAAc,EAAE,MAAM,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,CAAC;AAAA,EAC9D,CAAC,EACA,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;AAAA,EACvC,cAAc,EAAE;AAClB;AAIO,MAAM,kBAAkB,EAAE,OAAO,wBAAwB;AAIhE,MAAM,aAAa,EAAE,OAAO;AAAA,EAC1B,GAAG;AAAA,EAEH,cAAc,EACX,OAAO;AAAA,IACN,WAAW,EAAE;AAAA,IACb,UAAU,EAAE;AAAA;AAAA,IAGZ,SAAS,EAAE;AAAA,IACX,UAAU,EAAE;AAAA;AAAA,IAGZ,MAAM,EAAE;AAAA,EACV,CAAC,EACA,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;AAAA,EAEvC,YAAY,EAAE,OAAO,SAAS;AAAA,EAC9B,MAAM,4BAAY,SAAS;AAC7B,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ export declare const isGitHubOrg: (value: string) => boolean;
2
+ export declare const isGitHubRepo: (value: string) => boolean;
3
+ export declare const isGitHubTeam: (value: string) => boolean;
4
+ declare const PLATFORMS: readonly ["amd64", "arm64"];
5
+ export type Platform = (typeof PLATFORMS)[number];
6
+ export declare const PLATFORM_OPTIONS: string;
7
+ export declare const isPlatform: (value: unknown) => boolean;
8
+ export {};
@@ -0,0 +1,43 @@
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 validation_exports = {};
20
+ __export(validation_exports, {
21
+ PLATFORM_OPTIONS: () => PLATFORM_OPTIONS,
22
+ isGitHubOrg: () => isGitHubOrg,
23
+ isGitHubRepo: () => isGitHubRepo,
24
+ isGitHubTeam: () => isGitHubTeam,
25
+ isPlatform: () => isPlatform
26
+ });
27
+ module.exports = __toCommonJS(validation_exports);
28
+ const isGitHubOrg = (value) => /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) && !value.includes("--");
29
+ const isGitHubRepo = (value) => /^[A-Za-z0-9_.-]+$/.test(value) && value !== "." && value !== "..";
30
+ const isGitHubTeam = (value) => /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) && !value.endsWith("-") && !value.includes("--");
31
+ const PLATFORMS = ["amd64", "arm64"];
32
+ const PLATFORM_OPTIONS = PLATFORMS.join(" | ");
33
+ const platformSet = new Set(PLATFORMS);
34
+ const isPlatform = (value) => platformSet.has(value);
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ PLATFORM_OPTIONS,
38
+ isGitHubOrg,
39
+ isGitHubRepo,
40
+ isGitHubTeam,
41
+ isPlatform
42
+ });
43
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/validation.ts"],
4
+ "sourcesContent": ["export const isGitHubOrg = (value: string) =>\n /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) &&\n !value.includes('--');\n\nexport const isGitHubRepo = (value: string) =>\n /^[A-Za-z0-9_.-]+$/.test(value) && value !== '.' && value !== '..';\n\nexport const isGitHubTeam = (value: string) =>\n /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) &&\n !value.endsWith('-') &&\n !value.includes('--');\n\nconst PLATFORMS = ['amd64', 'arm64'] as const;\n\nexport type Platform = (typeof PLATFORMS)[number];\n\nexport const PLATFORM_OPTIONS = PLATFORMS.join(' | ');\n\nconst platformSet = new Set<unknown>(PLATFORMS);\n\nexport const isPlatform = (value: unknown) => platformSet.has(value);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc,CAAC,UAC1B,6CAA6C,KAAK,KAAK,KACvD,CAAC,MAAM,SAAS,IAAI;AAEf,MAAM,eAAe,CAAC,UAC3B,oBAAoB,KAAK,KAAK,KAAK,UAAU,OAAO,UAAU;AAEzD,MAAM,eAAe,CAAC,UAC3B,gDAAgD,KAAK,KAAK,KAC1D,CAAC,MAAM,SAAS,GAAG,KACnB,CAAC,MAAM,SAAS,IAAI;AAEtB,MAAM,YAAY,CAAC,SAAS,OAAO;AAI5B,MAAM,mBAAmB,UAAU,KAAK,KAAK;AAEpD,MAAM,cAAc,IAAI,IAAa,SAAS;AAEvC,MAAM,aAAa,CAAC,UAAmB,YAAY,IAAI,KAAK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,13 @@
1
+ import type { ProjectType } from '../../utils/manifest';
2
+ interface WritePackageJsonProps {
3
+ cwd: string;
4
+ entryPoint?: string;
5
+ template: string;
6
+ type?: ProjectType;
7
+ version: string;
8
+ }
9
+ /**
10
+ * Write a `skuba` section into the destination `package.json`.
11
+ */
12
+ export declare const writePackageJson: ({ cwd, entryPoint, template, type, version, }: WritePackageJsonProps) => Promise<void>;
13
+ export {};
@@ -0,0 +1,58 @@
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 writePackageJson_exports = {};
30
+ __export(writePackageJson_exports, {
31
+ writePackageJson: () => writePackageJson
32
+ });
33
+ module.exports = __toCommonJS(writePackageJson_exports);
34
+ var import_fs_extra = __toESM(require("fs-extra"));
35
+ var import_package = require("../configure/analysis/package");
36
+ var import_package2 = require("../configure/processing/package");
37
+ const writePackageJson = async ({
38
+ cwd,
39
+ entryPoint,
40
+ template,
41
+ type,
42
+ version
43
+ }) => {
44
+ const manifest = await (0, import_package.getDestinationManifest)({ cwd });
45
+ manifest.packageJson.skuba = {
46
+ entryPoint: entryPoint ?? null,
47
+ template,
48
+ type,
49
+ version
50
+ };
51
+ const updatedPackageJson = await (0, import_package2.formatPackage)(manifest.packageJson);
52
+ await import_fs_extra.default.promises.writeFile(manifest.path, updatedPackageJson);
53
+ };
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ writePackageJson
57
+ });
58
+ //# sourceMappingURL=writePackageJson.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/writePackageJson.ts"],
4
+ "sourcesContent": ["import fs from 'fs-extra';\n\nimport type { ProjectType } from '../../utils/manifest';\nimport { getDestinationManifest } from '../configure/analysis/package';\nimport { formatPackage } from '../configure/processing/package';\n\ninterface WritePackageJsonProps {\n cwd: string;\n entryPoint?: string;\n template: string;\n type?: ProjectType;\n version: string;\n}\n\n/**\n * Write a `skuba` section into the destination `package.json`.\n */\nexport const writePackageJson = async ({\n cwd,\n entryPoint,\n template,\n type,\n version,\n}: WritePackageJsonProps) => {\n const manifest = await getDestinationManifest({ cwd });\n\n manifest.packageJson.skuba = {\n entryPoint: entryPoint ?? null,\n template,\n type,\n version,\n };\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n\n await fs.promises.writeFile(manifest.path, updatedPackageJson);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AAGf,qBAAuC;AACvC,IAAAA,kBAA8B;AAavB,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA6B;AAC3B,QAAM,WAAW,UAAM,uCAAuB,EAAE,IAAI,CAAC;AAErD,WAAS,YAAY,QAAQ;AAAA,IAC3B,YAAY,cAAc;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,UAAM,+BAAc,SAAS,WAAW;AAEnE,QAAM,gBAAAC,QAAG,SAAS,UAAU,SAAS,MAAM,kBAAkB;AAC/D;",
6
+ "names": ["import_package", "fs"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { ESLintOutput } from '../../../adapter/eslint';
2
+ export declare const createEslintAnnotations: (eslint: ESLintOutput) => string[];
@@ -0,0 +1,40 @@
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 eslint_exports = {};
30
+ __export(eslint_exports, {
31
+ createEslintAnnotations: () => createEslintAnnotations
32
+ });
33
+ module.exports = __toCommonJS(eslint_exports);
34
+ var Buildkite = __toESM(require("../../../../api/buildkite"));
35
+ const createEslintAnnotations = (eslint) => !eslint.ok ? ["**ESLint**", Buildkite.md.terminal(eslint.output.trim())] : [];
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ createEslintAnnotations
39
+ });
40
+ //# sourceMappingURL=eslint.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/buildkite/eslint.ts"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { ESLintOutput } from '../../../adapter/eslint';\n\nexport const createEslintAnnotations = (eslint: ESLintOutput): string[] =>\n !eslint.ok ? ['**ESLint**', Buildkite.md.terminal(eslint.output.trim())] : [];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,0BAA0B,CAAC,WACtC,CAAC,OAAO,KAAK,CAAC,cAAc,UAAU,GAAG,SAAS,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { ESLintOutput } from '../../../adapter/eslint';
2
+ import type { PrettierOutput } from '../../../adapter/prettier';
3
+ import type { StreamInterceptor } from '../../../lint/external';
4
+ export declare const createBuildkiteAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;