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,52 @@
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 skuba_exports = {};
20
+ __export(skuba_exports, {
21
+ skuba: () => skuba
22
+ });
23
+ module.exports = __toCommonJS(skuba_exports);
24
+ var import_module = require("../processing/module");
25
+ const OLD_NAME = "@seek/skuba";
26
+ const NEW_NAME = "skuba";
27
+ const skuba = ({ dependencies, devDependencies }) => {
28
+ devDependencies[NEW_NAME] = "*";
29
+ delete dependencies[NEW_NAME];
30
+ if (!dependencies[OLD_NAME] && !devDependencies[OLD_NAME]) {
31
+ return [];
32
+ }
33
+ delete dependencies[OLD_NAME];
34
+ delete devDependencies[OLD_NAME];
35
+ return [
36
+ (0, import_module.replacePackageReferences)({
37
+ old: {
38
+ packageName: OLD_NAME,
39
+ repoSlug: "seek-jobs/skuba"
40
+ },
41
+ new: {
42
+ packageName: NEW_NAME,
43
+ repoSlug: "seek-oss/skuba"
44
+ }
45
+ })
46
+ ];
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ skuba
51
+ });
52
+ //# sourceMappingURL=skuba.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/configure/dependencies/skuba.ts"],
4
+ "sourcesContent": ["import { replacePackageReferences } from '../processing/module';\nimport type { DependencySet } from '../types';\n\nconst OLD_NAME = '@seek/skuba';\nconst NEW_NAME = 'skuba';\n\nexport const skuba = ({ dependencies, devDependencies }: DependencySet) => {\n // force latest dev dependency\n devDependencies[NEW_NAME] = '*';\n delete dependencies[NEW_NAME];\n\n if (!dependencies[OLD_NAME] && !devDependencies[OLD_NAME]) {\n return [];\n }\n\n delete dependencies[OLD_NAME];\n delete devDependencies[OLD_NAME];\n\n return [\n replacePackageReferences({\n old: {\n packageName: OLD_NAME,\n repoSlug: 'seek-jobs/skuba',\n },\n new: {\n packageName: NEW_NAME,\n repoSlug: 'seek-oss/skuba',\n },\n }),\n ];\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyC;AAGzC,MAAM,WAAW;AACjB,MAAM,WAAW;AAEV,MAAM,QAAQ,CAAC,EAAE,cAAc,gBAAgB,MAAqB;AAEzE,kBAAgB,QAAQ,IAAI;AAC5B,SAAO,aAAa,QAAQ;AAE5B,MAAI,CAAC,aAAa,QAAQ,KAAK,CAAC,gBAAgB,QAAQ,GAAG;AACzD,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,aAAa,QAAQ;AAC5B,SAAO,gBAAgB,QAAQ;AAE/B,SAAO;AAAA,QACL,wCAAyB;AAAA,MACvB,KAAK;AAAA,QACH,aAAa;AAAA,QACb,UAAU;AAAA,MACZ;AAAA,MACA,KAAK;AAAA,QACH,aAAa;AAAA,QACb,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { DependencySet } from '../types';
2
+ export declare const skubaDeps: ({ dependencies, devDependencies }: DependencySet) => never[];
@@ -0,0 +1,56 @@
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 skubaDeps_exports = {};
20
+ __export(skubaDeps_exports, {
21
+ skubaDeps: () => skubaDeps
22
+ });
23
+ module.exports = __toCommonJS(skubaDeps_exports);
24
+ const DEV_DEPENDENCIES = [
25
+ // replaced
26
+ "@seek/seek-module-toolkit",
27
+ "eslint-config-seek",
28
+ "nodemon",
29
+ "tslint",
30
+ "tslint-config-seek",
31
+ // bundled
32
+ "@types/jest",
33
+ "concurrently",
34
+ "eslint",
35
+ "eslint-config-skuba",
36
+ "jest",
37
+ "prettier",
38
+ "semantic-release",
39
+ "ts-jest",
40
+ "ts-node",
41
+ "ts-node-dev",
42
+ "tsconfig-seek",
43
+ "typescript"
44
+ ];
45
+ const skubaDeps = ({ dependencies, devDependencies }) => {
46
+ DEV_DEPENDENCIES.forEach((dep) => {
47
+ delete dependencies[dep];
48
+ delete devDependencies[dep];
49
+ });
50
+ return [];
51
+ };
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ skubaDeps
55
+ });
56
+ //# sourceMappingURL=skubaDeps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/configure/dependencies/skubaDeps.ts"],
4
+ "sourcesContent": ["import type { DependencySet } from '../types';\n\nconst DEV_DEPENDENCIES = [\n // replaced\n '@seek/seek-module-toolkit',\n 'eslint-config-seek',\n 'nodemon',\n 'tslint',\n 'tslint-config-seek',\n\n // bundled\n '@types/jest',\n 'concurrently',\n 'eslint',\n 'eslint-config-skuba',\n 'jest',\n 'prettier',\n 'semantic-release',\n 'ts-jest',\n 'ts-node',\n 'ts-node-dev',\n 'tsconfig-seek',\n 'typescript',\n] as const;\n\nexport const skubaDeps = ({ dependencies, devDependencies }: DependencySet) => {\n DEV_DEPENDENCIES.forEach((dep) => {\n delete dependencies[dep];\n delete devDependencies[dep];\n });\n\n return [];\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,mBAAmB;AAAA;AAAA,EAEvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,YAAY,CAAC,EAAE,cAAc,gBAAgB,MAAqB;AAC7E,mBAAiB,QAAQ,CAAC,QAAQ;AAChC,WAAO,aAAa,GAAG;AACvB,WAAO,gBAAgB,GAAG;AAAA,EAC5B,CAAC;AAED,SAAO,CAAC;AACV;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { DependencySet } from '../types';
2
+ export declare const SKUBA_DIVE_HOOKS: readonly ["module-alias", "source-map-support"];
3
+ export declare const skubaDive: ({ dependencies, devDependencies, type, }: DependencySet) => import("../../../utils/copy").TextProcessor[];
@@ -0,0 +1,70 @@
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 skubaDive_exports = {};
20
+ __export(skubaDive_exports, {
21
+ SKUBA_DIVE_HOOKS: () => SKUBA_DIVE_HOOKS,
22
+ skubaDive: () => skubaDive
23
+ });
24
+ module.exports = __toCommonJS(skubaDive_exports);
25
+ var import_module = require("../processing/module");
26
+ const OLD_NAME = "@seek/skuba-dive";
27
+ const NEW_NAME = "skuba-dive";
28
+ const SKUBA_DIVE_HOOKS = ["module-alias", "source-map-support"];
29
+ const skubaDive = ({
30
+ dependencies,
31
+ devDependencies,
32
+ type
33
+ }) => {
34
+ SKUBA_DIVE_HOOKS.forEach((hook) => {
35
+ delete dependencies[hook];
36
+ delete devDependencies[hook];
37
+ });
38
+ if (type === "package") {
39
+ delete dependencies[NEW_NAME];
40
+ delete devDependencies[NEW_NAME];
41
+ delete dependencies[OLD_NAME];
42
+ delete devDependencies[OLD_NAME];
43
+ return [];
44
+ }
45
+ dependencies[NEW_NAME] = dependencies[NEW_NAME] || devDependencies[NEW_NAME] || "*";
46
+ delete devDependencies[NEW_NAME];
47
+ if (!dependencies[OLD_NAME] && !devDependencies[OLD_NAME]) {
48
+ return [];
49
+ }
50
+ delete dependencies[OLD_NAME];
51
+ delete devDependencies[OLD_NAME];
52
+ return [
53
+ (0, import_module.replacePackageReferences)({
54
+ old: {
55
+ packageName: OLD_NAME,
56
+ repoSlug: "seek-jobs/skuba-dive"
57
+ },
58
+ new: {
59
+ packageName: NEW_NAME,
60
+ repoSlug: "seek-oss/skuba-dive"
61
+ }
62
+ })
63
+ ];
64
+ };
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ SKUBA_DIVE_HOOKS,
68
+ skubaDive
69
+ });
70
+ //# sourceMappingURL=skubaDive.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/configure/dependencies/skubaDive.ts"],
4
+ "sourcesContent": ["import { replacePackageReferences } from '../processing/module';\nimport type { DependencySet } from '../types';\n\nconst OLD_NAME = '@seek/skuba-dive';\nconst NEW_NAME = 'skuba-dive';\n\nexport const SKUBA_DIVE_HOOKS = ['module-alias', 'source-map-support'] as const;\n\nexport const skubaDive = ({\n dependencies,\n devDependencies,\n type,\n}: DependencySet) => {\n SKUBA_DIVE_HOOKS.forEach((hook) => {\n delete dependencies[hook];\n delete devDependencies[hook];\n });\n\n // skuba-dive is a runtime component; it's not appropriate for packages\n if (type === 'package') {\n delete dependencies[NEW_NAME];\n delete devDependencies[NEW_NAME];\n delete dependencies[OLD_NAME];\n delete devDependencies[OLD_NAME];\n\n return [];\n }\n\n dependencies[NEW_NAME] =\n dependencies[NEW_NAME] || devDependencies[NEW_NAME] || '*';\n delete devDependencies[NEW_NAME];\n\n if (!dependencies[OLD_NAME] && !devDependencies[OLD_NAME]) {\n return [];\n }\n\n delete dependencies[OLD_NAME];\n delete devDependencies[OLD_NAME];\n\n return [\n replacePackageReferences({\n old: {\n packageName: OLD_NAME,\n repoSlug: 'seek-jobs/skuba-dive',\n },\n new: {\n packageName: NEW_NAME,\n repoSlug: 'seek-oss/skuba-dive',\n },\n }),\n ];\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyC;AAGzC,MAAM,WAAW;AACjB,MAAM,WAAW;AAEV,MAAM,mBAAmB,CAAC,gBAAgB,oBAAoB;AAE9D,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF,MAAqB;AACnB,mBAAiB,QAAQ,CAAC,SAAS;AACjC,WAAO,aAAa,IAAI;AACxB,WAAO,gBAAgB,IAAI;AAAA,EAC7B,CAAC;AAGD,MAAI,SAAS,WAAW;AACtB,WAAO,aAAa,QAAQ;AAC5B,WAAO,gBAAgB,QAAQ;AAC/B,WAAO,aAAa,QAAQ;AAC5B,WAAO,gBAAgB,QAAQ;AAE/B,WAAO,CAAC;AAAA,EACV;AAEA,eAAa,QAAQ,IACnB,aAAa,QAAQ,KAAK,gBAAgB,QAAQ,KAAK;AACzD,SAAO,gBAAgB,QAAQ;AAE/B,MAAI,CAAC,aAAa,QAAQ,KAAK,CAAC,gBAAgB,QAAQ,GAAG;AACzD,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,aAAa,QAAQ;AAC5B,SAAO,gBAAgB,QAAQ;AAE/B,SAAO;AAAA,QACL,wCAAyB;AAAA,MACvB,KAAK;AAAA,QACH,aAAa;AAAA,QACb,UAAU;AAAA,MACZ;AAAA,MACA,KAAK;AAAA,QACH,aAAa;AAAA,QACb,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { NormalizedReadResult } from 'read-pkg-up';
2
+ import { type TemplateConfig } from '../../utils/template';
3
+ interface Props {
4
+ destinationRoot: string;
5
+ include: (pathname: string) => boolean;
6
+ manifest: NormalizedReadResult;
7
+ }
8
+ export declare const ensureTemplateCompletion: ({ destinationRoot, include, manifest, }: Props) => Promise<TemplateConfig>;
9
+ export {};
@@ -0,0 +1,77 @@
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 ensureTemplateCompletion_exports = {};
30
+ __export(ensureTemplateCompletion_exports, {
31
+ ensureTemplateCompletion: () => ensureTemplateCompletion
32
+ });
33
+ module.exports = __toCommonJS(ensureTemplateCompletion_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_chalk = __toESM(require("chalk"));
36
+ var import_fs_extra = __toESM(require("fs-extra"));
37
+ var import_copy = require("../../utils/copy");
38
+ var import_logging = require("../../utils/logging");
39
+ var import_template = require("../../utils/template");
40
+ var import_validation = require("../../utils/validation");
41
+ var import_getConfig = require("../init/getConfig");
42
+ var import_package = require("./processing/package");
43
+ const ensureTemplateCompletion = async ({
44
+ destinationRoot,
45
+ include,
46
+ manifest
47
+ }) => {
48
+ const templateConfig = (0, import_getConfig.getTemplateConfig)(destinationRoot);
49
+ if (templateConfig.fields.length === 0) {
50
+ return templateConfig;
51
+ }
52
+ const templateName = (0, import_validation.hasStringProp)(manifest.packageJson.skuba, "template") ? manifest.packageJson.skuba.template : "template";
53
+ import_logging.log.newline();
54
+ const templateData = await (0, import_getConfig.runForm)({
55
+ choices: templateConfig.fields,
56
+ message: import_chalk.default.bold(`Complete ${import_chalk.default.cyan(templateName)}:`),
57
+ name: "customAnswers"
58
+ });
59
+ const updatedPackageJson = await (0, import_package.formatPackage)(manifest.packageJson);
60
+ const packageJsonFilepath = import_path.default.join(destinationRoot, "package.json");
61
+ await import_fs_extra.default.promises.writeFile(packageJsonFilepath, updatedPackageJson);
62
+ await (0, import_copy.copyFiles)({
63
+ sourceRoot: destinationRoot,
64
+ destinationRoot,
65
+ include,
66
+ processors: [(0, import_copy.createEjsRenderer)(templateData)]
67
+ });
68
+ await (0, import_template.ensureTemplateConfigDeletion)(destinationRoot);
69
+ import_logging.log.newline();
70
+ import_logging.log.ok("Templating complete!");
71
+ return templateConfig;
72
+ };
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ ensureTemplateCompletion
76
+ });
77
+ //# sourceMappingURL=ensureTemplateCompletion.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/configure/ensureTemplateCompletion.ts"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport type { NormalizedReadResult } from 'read-pkg-up';\n\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { log } from '../../utils/logging';\nimport {\n type TemplateConfig,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { hasStringProp } from '../../utils/validation';\nimport { getTemplateConfig, runForm } from '../init/getConfig';\n\nimport { formatPackage } from './processing/package';\n\ninterface Props {\n destinationRoot: string;\n include: (pathname: string) => boolean;\n manifest: NormalizedReadResult;\n}\n\nexport const ensureTemplateCompletion = async ({\n destinationRoot,\n include,\n manifest,\n}: Props): Promise<TemplateConfig> => {\n const templateConfig = getTemplateConfig(destinationRoot);\n\n if (templateConfig.fields.length === 0) {\n return templateConfig;\n }\n\n const templateName = hasStringProp(manifest.packageJson.skuba, 'template')\n ? manifest.packageJson.skuba.template\n : 'template';\n\n log.newline();\n const templateData = await runForm({\n choices: templateConfig.fields,\n message: chalk.bold(`Complete ${chalk.cyan(templateName)}:`),\n name: 'customAnswers',\n });\n\n const updatedPackageJson = await formatPackage(manifest.packageJson);\n const packageJsonFilepath = path.join(destinationRoot, 'package.json');\n await fs.promises.writeFile(packageJsonFilepath, updatedPackageJson);\n\n await copyFiles({\n sourceRoot: destinationRoot,\n destinationRoot,\n include,\n processors: [createEjsRenderer(templateData)],\n });\n\n await ensureTemplateConfigDeletion(destinationRoot);\n\n log.newline();\n log.ok('Templating complete!');\n\n return templateConfig;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAe;AAGf,kBAA6C;AAC7C,qBAAoB;AACpB,sBAGO;AACP,wBAA8B;AAC9B,uBAA2C;AAE3C,qBAA8B;AAQvB,MAAM,2BAA2B,OAAO;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AACpC,QAAM,qBAAiB,oCAAkB,eAAe;AAExD,MAAI,eAAe,OAAO,WAAW,GAAG;AACtC,WAAO;AAAA,EACT;AAEA,QAAM,mBAAe,iCAAc,SAAS,YAAY,OAAO,UAAU,IACrE,SAAS,YAAY,MAAM,WAC3B;AAEJ,qBAAI,QAAQ;AACZ,QAAM,eAAe,UAAM,0BAAQ;AAAA,IACjC,SAAS,eAAe;AAAA,IACxB,SAAS,aAAAA,QAAM,KAAK,YAAY,aAAAA,QAAM,KAAK,YAAY,CAAC,GAAG;AAAA,IAC3D,MAAM;AAAA,EACR,CAAC;AAED,QAAM,qBAAqB,UAAM,8BAAc,SAAS,WAAW;AACnE,QAAM,sBAAsB,YAAAC,QAAK,KAAK,iBAAiB,cAAc;AACrE,QAAM,gBAAAC,QAAG,SAAS,UAAU,qBAAqB,kBAAkB;AAEnE,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,YAAY,KAAC,+BAAkB,YAAY,CAAC;AAAA,EAC9C,CAAC;AAED,YAAM,8CAA6B,eAAe;AAElD,qBAAI,QAAQ;AACZ,qBAAI,GAAG,sBAAsB;AAE7B,SAAO;AACT;",
6
+ "names": ["chalk", "path", "fs"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import type { NormalizedReadResult } from 'read-pkg-up';
2
+ import type { ProjectType } from '../../utils/manifest';
3
+ import type { TemplateConfig } from '../../utils/template';
4
+ interface Props {
5
+ destinationRoot: string;
6
+ manifest: NormalizedReadResult;
7
+ templateConfig: TemplateConfig;
8
+ type: ProjectType;
9
+ }
10
+ export declare const getEntryPoint: ({ destinationRoot, manifest, templateConfig, type, }: Props) => string | Promise<string>;
11
+ export {};
@@ -0,0 +1,73 @@
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 getEntryPoint_exports = {};
30
+ __export(getEntryPoint_exports, {
31
+ getEntryPoint: () => getEntryPoint
32
+ });
33
+ module.exports = __toCommonJS(getEntryPoint_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_chalk = __toESM(require("chalk"));
36
+ var import_logging = require("../../utils/logging");
37
+ var import_validation = require("../../utils/validation");
38
+ var import_files = require("./analysis/files");
39
+ var import_enquirer = require("enquirer");
40
+ const getEntryPoint = ({
41
+ destinationRoot,
42
+ manifest,
43
+ templateConfig,
44
+ type
45
+ }) => {
46
+ if ((0, import_validation.hasStringProp)(manifest.packageJson.skuba, "entryPoint")) {
47
+ return manifest.packageJson.skuba.entryPoint;
48
+ }
49
+ if (templateConfig.entryPoint !== void 0) {
50
+ return templateConfig.entryPoint;
51
+ }
52
+ import_logging.log.newline();
53
+ const entryPointPrompt = new import_enquirer.Input({
54
+ initial: type === "package" ? "src/index.ts" : "src/app.ts",
55
+ message: "Entry point:",
56
+ name: "entryPoint",
57
+ result: (value) => value.endsWith(".ts") ? value : `${value}.ts`,
58
+ validate: async (value) => {
59
+ const [modulePath] = value.split("#", 2);
60
+ if (!modulePath) {
61
+ return `${import_chalk.default.bold(value)} is an invalid module path`;
62
+ }
63
+ const exists = await (0, import_files.tsFileExists)(import_path.default.join(destinationRoot, modulePath));
64
+ return exists || `${import_chalk.default.bold(value)} is not a TypeScript file.`;
65
+ }
66
+ });
67
+ return entryPointPrompt.run();
68
+ };
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ getEntryPoint
72
+ });
73
+ //# sourceMappingURL=getEntryPoint.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/configure/getEntryPoint.ts"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport chalk from 'chalk';\nimport type { NormalizedReadResult } from 'read-pkg-up';\n\nimport { log } from '../../utils/logging';\nimport type { ProjectType } from '../../utils/manifest';\nimport type { TemplateConfig } from '../../utils/template';\nimport { hasStringProp } from '../../utils/validation';\n\nimport { tsFileExists } from './analysis/files';\n\nimport { Input } from 'enquirer';\n\ninterface Props {\n destinationRoot: string;\n manifest: NormalizedReadResult;\n templateConfig: TemplateConfig;\n type: ProjectType;\n}\nexport const getEntryPoint = ({\n destinationRoot,\n manifest,\n templateConfig,\n type,\n}: Props) => {\n if (hasStringProp(manifest.packageJson.skuba, 'entryPoint')) {\n return manifest.packageJson.skuba.entryPoint;\n }\n\n if (templateConfig.entryPoint !== undefined) {\n return templateConfig.entryPoint;\n }\n\n log.newline();\n const entryPointPrompt = new Input({\n initial: type === 'package' ? 'src/index.ts' : 'src/app.ts',\n message: 'Entry point:',\n name: 'entryPoint',\n result: (value) => (value.endsWith('.ts') ? value : `${value}.ts`),\n validate: async (value) => {\n // Support exported function targeting, e.g. `src/module.ts#callMeMaybe`\n const [modulePath] = value.split('#', 2);\n\n if (!modulePath) {\n return `${chalk.bold(value)} is an invalid module path`;\n }\n\n const exists = await tsFileExists(path.join(destinationRoot, modulePath));\n\n return exists || `${chalk.bold(value)} is not a TypeScript file.`;\n },\n });\n\n return entryPointPrompt.run();\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAGlB,qBAAoB;AAGpB,wBAA8B;AAE9B,mBAA6B;AAE7B,sBAAsB;AAQf,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAa;AACX,UAAI,iCAAc,SAAS,YAAY,OAAO,YAAY,GAAG;AAC3D,WAAO,SAAS,YAAY,MAAM;AAAA,EACpC;AAEA,MAAI,eAAe,eAAe,QAAW;AAC3C,WAAO,eAAe;AAAA,EACxB;AAEA,qBAAI,QAAQ;AACZ,QAAM,mBAAmB,IAAI,sBAAM;AAAA,IACjC,SAAS,SAAS,YAAY,iBAAiB;AAAA,IAC/C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ,CAAC,UAAW,MAAM,SAAS,KAAK,IAAI,QAAQ,GAAG,KAAK;AAAA,IAC5D,UAAU,OAAO,UAAU;AAEzB,YAAM,CAAC,UAAU,IAAI,MAAM,MAAM,KAAK,CAAC;AAEvC,UAAI,CAAC,YAAY;AACf,eAAO,GAAG,aAAAA,QAAM,KAAK,KAAK,CAAC;AAAA,MAC7B;AAEA,YAAM,SAAS,UAAM,2BAAa,YAAAC,QAAK,KAAK,iBAAiB,UAAU,CAAC;AAExE,aAAO,UAAU,GAAG,aAAAD,QAAM,KAAK,KAAK,CAAC;AAAA,IACvC;AAAA,EACF,CAAC;AAED,SAAO,iBAAiB,IAAI;AAC9B;",
6
+ "names": ["chalk", "path"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import type { NormalizedReadResult } from 'read-pkg-up';
2
+ import { ProjectType } from '../../utils/manifest';
3
+ import type { TemplateConfig } from '../../utils/template';
4
+ interface Props {
5
+ manifest: NormalizedReadResult;
6
+ templateConfig: TemplateConfig;
7
+ }
8
+ export declare const getProjectType: ({ manifest, templateConfig, }: Props) => Promise<ProjectType>;
9
+ export {};
@@ -0,0 +1,52 @@
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 getProjectType_exports = {};
20
+ __export(getProjectType_exports, {
21
+ getProjectType: () => getProjectType
22
+ });
23
+ module.exports = __toCommonJS(getProjectType_exports);
24
+ var import_logging = require("../../utils/logging");
25
+ var import_manifest = require("../../utils/manifest");
26
+ var import_validation = require("../../utils/validation");
27
+ var import_enquirer = require("enquirer");
28
+ const getProjectType = async ({
29
+ manifest,
30
+ templateConfig
31
+ }) => {
32
+ if ((0, import_validation.hasProp)(manifest.packageJson.skuba, "type") && import_manifest.ProjectType.guard(manifest.packageJson.skuba.type)) {
33
+ return manifest.packageJson.skuba.type;
34
+ }
35
+ if (templateConfig.type !== void 0) {
36
+ return templateConfig.type;
37
+ }
38
+ const initial = manifest.packageJson.devDependencies?.["@seek/seek-module-toolkit"] || manifest.packageJson.files ? "package" : "application";
39
+ import_logging.log.newline();
40
+ const projectTypePrompt = new import_enquirer.Select({
41
+ choices: import_manifest.PROJECT_TYPES,
42
+ message: "Project type:",
43
+ name: "projectType",
44
+ initial
45
+ });
46
+ return projectTypePrompt.run();
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ getProjectType
51
+ });
52
+ //# sourceMappingURL=getProjectType.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/configure/getProjectType.ts"],
4
+ "sourcesContent": ["import type { NormalizedReadResult } from 'read-pkg-up';\n\nimport { log } from '../../utils/logging';\nimport { PROJECT_TYPES, ProjectType } from '../../utils/manifest';\nimport type { TemplateConfig } from '../../utils/template';\nimport { hasProp } from '../../utils/validation';\n\nimport { Select } from 'enquirer';\n\ninterface Props {\n manifest: NormalizedReadResult;\n templateConfig: TemplateConfig;\n}\n\nexport const getProjectType = async ({\n manifest,\n templateConfig,\n}: Props): Promise<ProjectType> => {\n if (\n hasProp(manifest.packageJson.skuba, 'type') &&\n ProjectType.guard(manifest.packageJson.skuba.type)\n ) {\n return manifest.packageJson.skuba.type;\n }\n\n if (templateConfig.type !== undefined) {\n return templateConfig.type;\n }\n\n const initial: ProjectType =\n manifest.packageJson.devDependencies?.['@seek/seek-module-toolkit'] ||\n manifest.packageJson.files\n ? 'package'\n : 'application';\n\n log.newline();\n const projectTypePrompt = new Select({\n choices: PROJECT_TYPES,\n message: 'Project type:',\n name: 'projectType',\n initial,\n });\n\n return projectTypePrompt.run();\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoB;AACpB,sBAA2C;AAE3C,wBAAwB;AAExB,sBAAuB;AAOhB,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AACF,MAAmC;AACjC,UACE,2BAAQ,SAAS,YAAY,OAAO,MAAM,KAC1C,4BAAY,MAAM,SAAS,YAAY,MAAM,IAAI,GACjD;AACA,WAAO,SAAS,YAAY,MAAM;AAAA,EACpC;AAEA,MAAI,eAAe,SAAS,QAAW;AACrC,WAAO,eAAe;AAAA,EACxB;AAEA,QAAM,UACJ,SAAS,YAAY,kBAAkB,2BAA2B,KAClE,SAAS,YAAY,QACjB,YACA;AAEN,qBAAI,QAAQ;AACZ,QAAM,oBAAoB,IAAI,uBAAO;AAAA,IACnC,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AAED,SAAO,kBAAkB,IAAI;AAC/B;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export declare const configure: () => Promise<void>;
@@ -0,0 +1,148 @@
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 configure_exports = {};
30
+ __export(configure_exports, {
31
+ configure: () => configure
32
+ });
33
+ module.exports = __toCommonJS(configure_exports);
34
+ var import_path = __toESM(require("path"));
35
+ var import_dir = require("../../utils/dir");
36
+ var import_exec = require("../../utils/exec");
37
+ var import_logging = require("../../utils/logging");
38
+ var import_logo = require("../../utils/logo");
39
+ var import_template = require("../../utils/template");
40
+ var import_validation = require("../../utils/validation");
41
+ var import_analyseConfiguration = require("./analyseConfiguration");
42
+ var import_analyseDependencies = require("./analyseDependencies");
43
+ var import_git = require("./analysis/git");
44
+ var import_package = require("./analysis/package");
45
+ var import_ensureTemplateCompletion = require("./ensureTemplateCompletion");
46
+ var import_getEntryPoint = require("./getEntryPoint");
47
+ var import_getProjectType = require("./getProjectType");
48
+ var import_enquirer = require("enquirer");
49
+ const shouldApply = async (name) => {
50
+ const prompt = new import_enquirer.Select({
51
+ choices: ["yes", "no"],
52
+ message: "Apply changes?",
53
+ name
54
+ });
55
+ const result = await prompt.run();
56
+ return result === "yes";
57
+ };
58
+ const configure = async () => {
59
+ await (0, import_logo.showLogoAndVersionInfo)();
60
+ const [manifest] = await Promise.all([
61
+ (0, import_package.getDestinationManifest)(),
62
+ (0, import_exec.ensureCommands)("yarn")
63
+ ]);
64
+ const destinationRoot = import_path.default.dirname(manifest.path);
65
+ import_logging.log.plain("Detected project root:", import_logging.log.bold(destinationRoot));
66
+ const [include] = await Promise.all([
67
+ (0, import_dir.createInclusionFilter)([
68
+ import_path.default.join(destinationRoot, ".gitignore"),
69
+ import_path.default.join(import_template.BASE_TEMPLATE_DIR, "_.gitignore")
70
+ ]),
71
+ (0, import_git.auditWorkingTree)(destinationRoot)
72
+ ]);
73
+ const templateConfig = await (0, import_ensureTemplateCompletion.ensureTemplateCompletion)({
74
+ destinationRoot,
75
+ include,
76
+ manifest
77
+ });
78
+ const type = await (0, import_getProjectType.getProjectType)({
79
+ manifest,
80
+ templateConfig
81
+ });
82
+ const entryPoint = await (0, import_getEntryPoint.getEntryPoint)({
83
+ destinationRoot,
84
+ manifest,
85
+ templateConfig,
86
+ type
87
+ });
88
+ const fixDependencies = await (0, import_analyseDependencies.analyseDependencies)({
89
+ destinationRoot,
90
+ include,
91
+ manifest,
92
+ type
93
+ });
94
+ if (fixDependencies) {
95
+ import_logging.log.newline();
96
+ if (await shouldApply("fixDependencies")) {
97
+ await fixDependencies();
98
+ }
99
+ }
100
+ const firstRun = (0, import_validation.hasProp)(manifest.packageJson, "skuba");
101
+ const fixConfiguration = await (0, import_analyseConfiguration.analyseConfiguration)({
102
+ destinationRoot,
103
+ entryPoint,
104
+ firstRun,
105
+ type
106
+ });
107
+ if (fixConfiguration) {
108
+ import_logging.log.newline();
109
+ if (await shouldApply("fixConfiguration")) {
110
+ await fixConfiguration();
111
+ }
112
+ }
113
+ if (fixDependencies) {
114
+ const exec = (0, import_exec.createExec)({
115
+ stdio: "pipe",
116
+ streamStdio: "yarn"
117
+ });
118
+ import_logging.log.newline();
119
+ try {
120
+ await exec("yarn", "install");
121
+ } catch {
122
+ import_logging.log.newline();
123
+ import_logging.log.warn(import_logging.log.bold("\u2717 Failed to install dependencies. Resume with:"));
124
+ import_logging.log.newline();
125
+ import_logging.log.plain(import_logging.log.bold("yarn install"));
126
+ import_logging.log.plain(import_logging.log.bold("yarn format"));
127
+ import_logging.log.newline();
128
+ process.exitCode = 1;
129
+ return;
130
+ }
131
+ try {
132
+ await exec("npx", "yarn-deduplicate", "--strategy=highest");
133
+ } catch {
134
+ }
135
+ }
136
+ if (fixConfiguration ?? fixDependencies) {
137
+ import_logging.log.newline();
138
+ import_logging.log.ok(import_logging.log.bold("\u2714 All done! Try running:"));
139
+ import_logging.log.newline();
140
+ import_logging.log.plain(import_logging.log.bold("yarn format"));
141
+ }
142
+ import_logging.log.newline();
143
+ };
144
+ // Annotate the CommonJS export names for ESM import in node:
145
+ 0 && (module.exports = {
146
+ configure
147
+ });
148
+ //# sourceMappingURL=index.js.map