skuba 4.4.1 → 5.0.0-beta.0

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 (313) hide show
  1. package/config/tsconfig.json +1 -0
  2. package/jest/moduleNameMapper.js +50 -78
  3. package/jest/moduleNameMapper.test.ts +4 -14
  4. package/jest/transform.js +10 -1
  5. package/jest/tsConfig.js +26 -0
  6. package/lib/api/buildkite/annotate.js +46 -33
  7. package/lib/api/buildkite/annotate.js.map +7 -1
  8. package/lib/api/buildkite/index.js +31 -7
  9. package/lib/api/buildkite/index.js.map +7 -1
  10. package/lib/api/buildkite/md.js +31 -8
  11. package/lib/api/buildkite/md.js.map +7 -1
  12. package/lib/api/git/commit.js +45 -17
  13. package/lib/api/git/commit.js.map +7 -1
  14. package/lib/api/git/commitAllChanges.js +57 -27
  15. package/lib/api/git/commitAllChanges.js.map +7 -1
  16. package/lib/api/git/currentBranch.js +50 -28
  17. package/lib/api/git/currentBranch.js.map +7 -1
  18. package/lib/api/git/getChangedFiles.js +49 -27
  19. package/lib/api/git/getChangedFiles.js.map +7 -1
  20. package/lib/api/git/index.js +54 -22
  21. package/lib/api/git/index.js.map +7 -1
  22. package/lib/api/git/log.js +63 -42
  23. package/lib/api/git/log.js.map +7 -1
  24. package/lib/api/git/pull.js +62 -31
  25. package/lib/api/git/pull.js.map +7 -1
  26. package/lib/api/git/push.js +63 -31
  27. package/lib/api/git/push.js.map +7 -1
  28. package/lib/api/git/remote.js +59 -56
  29. package/lib/api/git/remote.js.map +7 -1
  30. package/lib/api/git/reset.js +55 -27
  31. package/lib/api/git/reset.js.map +7 -1
  32. package/lib/api/git/statusMatrix.js +46 -13
  33. package/lib/api/git/statusMatrix.js.map +7 -1
  34. package/lib/api/github/checkRun.js +70 -79
  35. package/lib/api/github/checkRun.js.map +7 -1
  36. package/lib/api/github/environment.js +40 -33
  37. package/lib/api/github/environment.js.map +7 -1
  38. package/lib/api/github/index.js +47 -17
  39. package/lib/api/github/index.js.map +7 -1
  40. package/lib/api/github/issueComment.js +73 -81
  41. package/lib/api/github/issueComment.js.map +7 -1
  42. package/lib/api/github/pullRequest.js +60 -61
  43. package/lib/api/github/pullRequest.js.map +7 -1
  44. package/lib/api/github/push.js +138 -133
  45. package/lib/api/github/push.js.map +7 -1
  46. package/lib/api/jest/index.d.ts +2 -1
  47. package/lib/api/jest/index.js +35 -14
  48. package/lib/api/jest/index.js.map +7 -1
  49. package/lib/api/net/compose.js +45 -17
  50. package/lib/api/net/compose.js.map +7 -1
  51. package/lib/api/net/index.js +28 -5
  52. package/lib/api/net/index.js.map +7 -1
  53. package/lib/api/net/socket.js +58 -36
  54. package/lib/api/net/socket.js.map +7 -1
  55. package/lib/api/net/waitFor.js +38 -18
  56. package/lib/api/net/waitFor.js.map +7 -1
  57. package/lib/cli/adapter/eslint.js +95 -72
  58. package/lib/cli/adapter/eslint.js.map +7 -1
  59. package/lib/cli/adapter/prettier.js +126 -124
  60. package/lib/cli/adapter/prettier.js.map +7 -1
  61. package/lib/cli/build/args.d.ts +7 -0
  62. package/lib/cli/build/args.js +69 -0
  63. package/lib/cli/build/args.js.map +7 -0
  64. package/lib/cli/build/esbuild.d.ts +5 -0
  65. package/lib/cli/build/esbuild.js +128 -0
  66. package/lib/cli/build/esbuild.js.map +7 -0
  67. package/lib/cli/build/index.d.ts +1 -1
  68. package/lib/cli/build/index.js +68 -5
  69. package/lib/cli/build/index.js.map +7 -1
  70. package/lib/cli/build/tsc.d.ts +1 -1
  71. package/lib/cli/build/tsc.js +34 -23
  72. package/lib/cli/build/tsc.js.map +7 -1
  73. package/lib/cli/buildPackage.js +53 -23
  74. package/lib/cli/buildPackage.js.map +7 -1
  75. package/lib/cli/configure/addEmptyExports.d.ts +5 -0
  76. package/lib/cli/configure/addEmptyExports.js +67 -0
  77. package/lib/cli/configure/addEmptyExports.js.map +7 -0
  78. package/lib/cli/configure/analyseConfiguration.js +61 -31
  79. package/lib/cli/configure/analyseConfiguration.js.map +7 -1
  80. package/lib/cli/configure/analyseDependencies.js +122 -113
  81. package/lib/cli/configure/analyseDependencies.js.map +7 -1
  82. package/lib/cli/configure/analysis/diff.js +37 -11
  83. package/lib/cli/configure/analysis/diff.js.map +7 -1
  84. package/lib/cli/configure/analysis/files.js +49 -22
  85. package/lib/cli/configure/analysis/files.js.map +7 -1
  86. package/lib/cli/configure/analysis/git.js +46 -16
  87. package/lib/cli/configure/analysis/git.js.map +7 -1
  88. package/lib/cli/configure/analysis/package.js +99 -52
  89. package/lib/cli/configure/analysis/package.js.map +7 -1
  90. package/lib/cli/configure/analysis/project.js +90 -54
  91. package/lib/cli/configure/analysis/project.js.map +7 -1
  92. package/lib/cli/configure/dependencies/index.js +40 -13
  93. package/lib/cli/configure/dependencies/index.js.map +7 -1
  94. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +57 -32
  95. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -1
  96. package/lib/cli/configure/dependencies/seekKoala.js +53 -31
  97. package/lib/cli/configure/dependencies/seekKoala.js.map +7 -1
  98. package/lib/cli/configure/dependencies/skuba.js +49 -27
  99. package/lib/cli/configure/dependencies/skuba.js.map +7 -1
  100. package/lib/cli/configure/dependencies/skubaDeps.js +49 -28
  101. package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -1
  102. package/lib/cli/configure/dependencies/skubaDive.js +65 -38
  103. package/lib/cli/configure/dependencies/skubaDive.js.map +7 -1
  104. package/lib/cli/configure/ensureTemplateCompletion.js +69 -41
  105. package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -1
  106. package/lib/cli/configure/getEntryPoint.js +62 -32
  107. package/lib/cli/configure/getEntryPoint.js.map +7 -1
  108. package/lib/cli/configure/getProjectType.js +50 -28
  109. package/lib/cli/configure/getProjectType.js.map +7 -1
  110. package/lib/cli/configure/index.js +134 -109
  111. package/lib/cli/configure/index.js.map +7 -1
  112. package/lib/cli/configure/modules/eslint.js +57 -26
  113. package/lib/cli/configure/modules/eslint.js.map +7 -1
  114. package/lib/cli/configure/modules/ignore.js +37 -14
  115. package/lib/cli/configure/modules/ignore.js.map +7 -1
  116. package/lib/cli/configure/modules/index.js +53 -28
  117. package/lib/cli/configure/modules/index.js.map +7 -1
  118. package/lib/cli/configure/modules/jest.js +84 -47
  119. package/lib/cli/configure/modules/jest.js.map +7 -1
  120. package/lib/cli/configure/modules/nodemon.js +29 -6
  121. package/lib/cli/configure/modules/nodemon.js.map +7 -1
  122. package/lib/cli/configure/modules/package.js +113 -92
  123. package/lib/cli/configure/modules/package.js.map +7 -1
  124. package/lib/cli/configure/modules/prettier.js +48 -19
  125. package/lib/cli/configure/modules/prettier.js.map +7 -1
  126. package/lib/cli/configure/modules/renovate.js +52 -39
  127. package/lib/cli/configure/modules/renovate.js.map +7 -1
  128. package/lib/cli/configure/modules/serverless.js +33 -15
  129. package/lib/cli/configure/modules/serverless.js.map +7 -1
  130. package/lib/cli/configure/modules/skubaDive.js +63 -37
  131. package/lib/cli/configure/modules/skubaDive.js.map +7 -1
  132. package/lib/cli/configure/modules/tsconfig.js +79 -63
  133. package/lib/cli/configure/modules/tsconfig.js.map +7 -1
  134. package/lib/cli/configure/modules/tslint.js +29 -6
  135. package/lib/cli/configure/modules/tslint.js.map +7 -1
  136. package/lib/cli/configure/processing/deleteFiles.js +30 -8
  137. package/lib/cli/configure/processing/deleteFiles.js.map +7 -1
  138. package/lib/cli/configure/processing/ignoreFile.js +65 -59
  139. package/lib/cli/configure/processing/ignoreFile.js.map +7 -1
  140. package/lib/cli/configure/processing/javascript.js +35 -15
  141. package/lib/cli/configure/processing/javascript.js.map +7 -1
  142. package/lib/cli/configure/processing/json.js +51 -20
  143. package/lib/cli/configure/processing/json.js.map +7 -1
  144. package/lib/cli/configure/processing/loadFiles.js +30 -8
  145. package/lib/cli/configure/processing/loadFiles.js.map +7 -1
  146. package/lib/cli/configure/processing/module.js +37 -14
  147. package/lib/cli/configure/processing/module.js.map +7 -1
  148. package/lib/cli/configure/processing/package.js +73 -43
  149. package/lib/cli/configure/processing/package.js.map +7 -1
  150. package/lib/cli/configure/processing/prettier.js +37 -11
  151. package/lib/cli/configure/processing/prettier.js.map +7 -1
  152. package/lib/cli/configure/processing/record.js +54 -31
  153. package/lib/cli/configure/processing/record.js.map +7 -1
  154. package/lib/cli/configure/processing/typescript.js +176 -158
  155. package/lib/cli/configure/processing/typescript.js.map +7 -1
  156. package/lib/cli/configure/refreshIgnoreFiles.js +64 -40
  157. package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -1
  158. package/lib/cli/configure/types.js +16 -2
  159. package/lib/cli/configure/types.js.map +7 -1
  160. package/lib/cli/format.js +58 -31
  161. package/lib/cli/format.js.map +7 -1
  162. package/lib/cli/help.js +31 -8
  163. package/lib/cli/help.js.map +7 -1
  164. package/lib/cli/init/getConfig.js +238 -207
  165. package/lib/cli/init/getConfig.js.map +7 -1
  166. package/lib/cli/init/git.js +70 -63
  167. package/lib/cli/init/git.js.map +7 -1
  168. package/lib/cli/init/index.js +133 -100
  169. package/lib/cli/init/index.js.map +7 -1
  170. package/lib/cli/init/prompts.js +84 -54
  171. package/lib/cli/init/prompts.js.map +7 -1
  172. package/lib/cli/init/types.js +52 -52
  173. package/lib/cli/init/types.js.map +7 -1
  174. package/lib/cli/init/validation.js +34 -12
  175. package/lib/cli/init/validation.js.map +7 -1
  176. package/lib/cli/init/writePackageJson.js +51 -22
  177. package/lib/cli/init/writePackageJson.js.map +7 -1
  178. package/lib/cli/lint/annotate/buildkite/eslint.js +34 -28
  179. package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -1
  180. package/lib/cli/lint/annotate/buildkite/index.js +50 -44
  181. package/lib/cli/lint/annotate/buildkite/index.js.map +7 -1
  182. package/lib/cli/lint/annotate/buildkite/prettier.js +41 -35
  183. package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -1
  184. package/lib/cli/lint/annotate/buildkite/tsc.js +39 -39
  185. package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -1
  186. package/lib/cli/lint/annotate/github/eslint.js +40 -16
  187. package/lib/cli/lint/annotate/github/eslint.js.map +7 -1
  188. package/lib/cli/lint/annotate/github/index.js +55 -51
  189. package/lib/cli/lint/annotate/github/index.js.map +7 -1
  190. package/lib/cli/lint/annotate/github/prettier.js +36 -13
  191. package/lib/cli/lint/annotate/github/prettier.js.map +7 -1
  192. package/lib/cli/lint/annotate/github/tsc.js +52 -52
  193. package/lib/cli/lint/annotate/github/tsc.js.map +7 -1
  194. package/lib/cli/lint/annotate/index.js +33 -10
  195. package/lib/cli/lint/annotate/index.js.map +7 -1
  196. package/lib/cli/lint/autofix.js +122 -117
  197. package/lib/cli/lint/autofix.js.map +7 -1
  198. package/lib/cli/lint/eslint.js +48 -18
  199. package/lib/cli/lint/eslint.js.map +7 -1
  200. package/lib/cli/lint/external.js +102 -81
  201. package/lib/cli/lint/external.js.map +7 -1
  202. package/lib/cli/lint/index.js +42 -18
  203. package/lib/cli/lint/index.js.map +7 -1
  204. package/lib/cli/lint/internal.js +54 -21
  205. package/lib/cli/lint/internal.js.map +7 -1
  206. package/lib/cli/lint/prettier.js +48 -18
  207. package/lib/cli/lint/prettier.js.map +7 -1
  208. package/lib/cli/lint/tsc.js +56 -32
  209. package/lib/cli/lint/tsc.js.map +7 -1
  210. package/lib/cli/lint/types.js +16 -2
  211. package/lib/cli/lint/types.js.map +7 -1
  212. package/lib/cli/node.js +65 -58
  213. package/lib/cli/node.js.map +7 -1
  214. package/lib/cli/release.js +29 -6
  215. package/lib/cli/release.js.map +7 -1
  216. package/lib/cli/start.js +61 -24
  217. package/lib/cli/start.js.map +7 -1
  218. package/lib/cli/test/index.js +35 -11
  219. package/lib/cli/test/index.js.map +7 -1
  220. package/lib/cli/test/reporters/github/annotations.js +89 -92
  221. package/lib/cli/test/reporters/github/annotations.js.map +7 -1
  222. package/lib/cli/test/reporters/github/index.js +68 -68
  223. package/lib/cli/test/reporters/github/index.js.map +7 -1
  224. package/lib/cli/version.js +31 -8
  225. package/lib/cli/version.js.map +7 -1
  226. package/lib/enquirer.d.js +2 -0
  227. package/lib/enquirer.d.js.map +7 -0
  228. package/lib/index.d.ts +6 -0
  229. package/lib/index.js +45 -41
  230. package/lib/index.js.map +7 -1
  231. package/lib/skuba.js +45 -38
  232. package/lib/skuba.js.map +7 -1
  233. package/lib/utils/args.js +97 -96
  234. package/lib/utils/args.js.map +7 -1
  235. package/lib/utils/command.js +64 -33
  236. package/lib/utils/command.js.map +7 -1
  237. package/lib/utils/copy.js +88 -51
  238. package/lib/utils/copy.js.map +7 -1
  239. package/lib/utils/dir.js +79 -67
  240. package/lib/utils/dir.js.map +7 -1
  241. package/lib/utils/env.js +27 -7
  242. package/lib/utils/env.js.map +7 -1
  243. package/lib/utils/error.js +58 -56
  244. package/lib/utils/error.js.map +7 -1
  245. package/lib/utils/exec.js +139 -110
  246. package/lib/utils/exec.js.map +7 -1
  247. package/lib/utils/help.js +31 -8
  248. package/lib/utils/help.js.map +7 -1
  249. package/lib/utils/logging.js +52 -24
  250. package/lib/utils/logging.js.map +7 -1
  251. package/lib/utils/logo.js +65 -27
  252. package/lib/utils/logo.js.map +7 -1
  253. package/lib/utils/manifest.d.ts +1 -0
  254. package/lib/utils/manifest.js +65 -51
  255. package/lib/utils/manifest.js.map +7 -1
  256. package/lib/utils/port.js +38 -17
  257. package/lib/utils/port.js.map +7 -1
  258. package/lib/utils/template.js +106 -87
  259. package/lib/utils/template.js.map +7 -1
  260. package/lib/utils/validation.js +43 -18
  261. package/lib/utils/validation.js.map +7 -1
  262. package/lib/utils/version.js +72 -82
  263. package/lib/utils/version.js.map +7 -1
  264. package/lib/utils/wait.js +52 -25
  265. package/lib/utils/wait.js.map +7 -1
  266. package/lib/utils/worker.js +59 -44
  267. package/lib/utils/worker.js.map +7 -1
  268. package/lib/wrapper/function-arguments.d.js +2 -0
  269. package/lib/wrapper/function-arguments.d.js.map +7 -0
  270. package/lib/wrapper/functionHandler.js +56 -29
  271. package/lib/wrapper/functionHandler.js.map +7 -1
  272. package/lib/wrapper/http.js +66 -56
  273. package/lib/wrapper/http.js.map +7 -1
  274. package/lib/wrapper/index.js +9 -21
  275. package/lib/wrapper/index.js.map +7 -1
  276. package/lib/wrapper/main.js +39 -20
  277. package/lib/wrapper/main.js.map +7 -1
  278. package/lib/wrapper/requestListener.js +50 -35
  279. package/lib/wrapper/requestListener.js.map +7 -1
  280. package/package.json +19 -13
  281. package/template/base/jest.config.ts +0 -6
  282. package/template/base/jest.setup.ts +2 -0
  283. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  284. package/template/express-rest-api/package.json +1 -1
  285. package/template/greeter/.buildkite/pipeline.yml +1 -1
  286. package/template/greeter/package.json +1 -1
  287. package/template/greeter/src/app.test.ts +3 -1
  288. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  289. package/template/koa-rest-api/package.json +6 -7
  290. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -7
  291. package/template/koa-rest-api/src/api/jobs/postJob.ts +2 -2
  292. package/template/koa-rest-api/src/framework/validation.test.ts +17 -15
  293. package/template/koa-rest-api/src/framework/validation.ts +50 -9
  294. package/template/koa-rest-api/src/testing/types.ts +5 -10
  295. package/template/koa-rest-api/src/types/jobs.ts +5 -10
  296. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +3 -3
  297. package/template/lambda-sqs-worker/package.json +2 -6
  298. package/template/lambda-sqs-worker/src/app.ts +2 -2
  299. package/template/lambda-sqs-worker/src/framework/validation.test.ts +37 -17
  300. package/template/lambda-sqs-worker/src/framework/validation.ts +4 -2
  301. package/template/lambda-sqs-worker/src/services/jobScorer.ts +2 -2
  302. package/template/lambda-sqs-worker/src/testing/types.ts +5 -10
  303. package/template/lambda-sqs-worker/src/types/jobScorer.ts +9 -16
  304. package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +13 -20
  305. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +3 -3
  306. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +6 -0
  307. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  308. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  309. package/template/lambda-sqs-worker-cdk/package.json +2 -2
  310. package/template/lambda-sqs-worker-cdk/shared/context-types.ts +16 -25
  311. package/template/oss-npm-package/_package.json +1 -1
  312. package/template/private-npm-package/_package.json +1 -1
  313. package/jest/resolver.js +0 -24
@@ -1 +1,7 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/cli/init/prompts.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AACzC,uCAAsC;AAEtC,mDAA+D;AAE/D,6CAAuE;AAIvE,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,mBAAmB;QAC5B,QAAQ,EAAE,CAAC,KAAc,EAAE,EAAE;YAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,OAAO,UAAU,CAAC;aACnB;YAED,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAErC,IAAI,CAAC,IAAA,wBAAW,EAAC,GAAG,CAAC,EAAE;gBACrB,OAAO,yBAAyB,CAAC;aAClC;YAED,OAAO,CACL,IAAI,KAAK,SAAS,IAAI,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,yBAAyB,CACtE,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE;YACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,OAAO,UAAU,CAAC;aACnB;YAED,IAAI,CAAC,IAAA,yBAAY,EAAC,KAAK,CAAC,EAAE;gBACxB,OAAO,yBAAyB,CAAC;aAClC;YAED,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;YAEvC,OAAO,CAAC,MAAM,IAAI,IAAI,KAAK,4BAA4B,CAAC;QAC1D,CAAC;KACF;CACO,CAAC;AAEE,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,aAAa;CACpB,CAAC;AAEW,QAAA,sBAAsB,GAAG,IAAI,iBAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAU;IAC/B,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,IAAI,gBAAK,CAAC;IACvC,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,mBAAmB;CACvE,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,IAAI,iBAAM,CAAC;IACxC,OAAO,EAAE,kCAAuB;IAChC,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/cli/init/prompts.ts"],
4
+ "sourcesContent": ["import { Input, Select } from 'enquirer';\nimport { pathExists } from 'fs-extra';\n\nimport { TEMPLATE_NAMES_WITH_BYO } from '../../utils/template';\n\nimport { isGitHubOrg, isGitHubRepo, isGitHubTeam } from './validation';\n\nexport type BaseFields = Record<typeof BASE_CHOICES[number]['name'], string>;\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 (!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] as const;\n\nexport const BASE_PROMPT_PROPS = {\n choices: BASE_CHOICES,\n message: 'For starters, some GitHub 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,sBAA8B;AAC9B,sBAA2B;AAE3B,sBAAwC;AAExC,wBAAwD;AAIxD,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,KAAC,+BAAY,GAAG,GAAG;AACrB,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;AAAA,IACxB;AAAA,EACF;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
+ }
@@ -1,58 +1,58 @@
1
1
  "use strict";
2
- /* eslint-disable new-cap */
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
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;
25
19
  };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.InitConfigInput = void 0;
28
- const t = __importStar(require("runtypes"));
29
- const manifest_1 = require("../../utils/manifest");
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var types_exports = {};
26
+ __export(types_exports, {
27
+ InitConfigInput: () => InitConfigInput
28
+ });
29
+ module.exports = __toCommonJS(types_exports);
30
+ var t = __toESM(require("runtypes"));
31
+ var import_manifest = require("../../utils/manifest");
30
32
  const INIT_CONFIG_INPUT_FIELDS = {
31
- destinationDir: t.String,
32
- templateComplete: t.Boolean,
33
- templateData: t
34
- .Record({
35
- ownerName: t.String,
36
- repoName: t.String,
37
- })
38
- .And(t.Dictionary(t.String, t.String)),
39
- templateName: t.String,
33
+ destinationDir: t.String,
34
+ templateComplete: t.Boolean,
35
+ templateData: t.Record({
36
+ ownerName: t.String,
37
+ repoName: t.String
38
+ }).And(t.Dictionary(t.String, t.String)),
39
+ templateName: t.String
40
40
  };
41
- exports.InitConfigInput = t.Record(INIT_CONFIG_INPUT_FIELDS);
41
+ const InitConfigInput = t.Record(INIT_CONFIG_INPUT_FIELDS);
42
42
  const InitConfig = t.Record({
43
- ...INIT_CONFIG_INPUT_FIELDS,
44
- templateData: t
45
- .Record({
46
- ownerName: t.String,
47
- repoName: t.String,
48
- // Derived from ownerName
49
- orgName: t.String,
50
- teamName: t.String,
51
- // Generated by init command
52
- port: t.String,
53
- })
54
- .And(t.Dictionary(t.String, t.String)),
55
- entryPoint: t.String.optional(),
56
- type: manifest_1.ProjectType.optional(),
43
+ ...INIT_CONFIG_INPUT_FIELDS,
44
+ templateData: t.Record({
45
+ ownerName: t.String,
46
+ repoName: t.String,
47
+ orgName: t.String,
48
+ teamName: t.String,
49
+ port: t.String
50
+ }).And(t.Dictionary(t.String, t.String)),
51
+ entryPoint: t.String.optional(),
52
+ type: import_manifest.ProjectType.optional()
53
+ });
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ InitConfigInput
57
57
  });
58
- //# sourceMappingURL=types.js.map
58
+ //# sourceMappingURL=types.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cli/init/types.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5B,4CAA8B;AAE9B,mDAAmD;AAEnD,MAAM,wBAAwB,GAAG;IAC/B,cAAc,EAAE,CAAC,CAAC,MAAM;IACxB,gBAAgB,EAAE,CAAC,CAAC,OAAO;IAC3B,YAAY,EAAE,CAAC;SACZ,MAAM,CAAC;QACN,SAAS,EAAE,CAAC,CAAC,MAAM;QACnB,QAAQ,EAAE,CAAC,CAAC,MAAM;KACnB,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,CAAC,CAAC,MAAM;CACvB,CAAC;AAIW,QAAA,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAIlE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,GAAG,wBAAwB;IAE3B,YAAY,EAAE,CAAC;SACZ,MAAM,CAAC;QACN,SAAS,EAAE,CAAC,CAAC,MAAM;QACnB,QAAQ,EAAE,CAAC,CAAC,MAAM;QAElB,yBAAyB;QACzB,OAAO,EAAE,CAAC,CAAC,MAAM;QACjB,QAAQ,EAAE,CAAC,CAAC,MAAM;QAElB,4BAA4B;QAC5B,IAAI,EAAE,CAAC,CAAC,MAAM;KACf,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAExC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,sBAAW,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}
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 })\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,EACd,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,IAGZ,SAAS,EAAE;AAAA,IACX,UAAU,EAAE;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
+ }
@@ -1,13 +1,35 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isGitHubTeam = exports.isGitHubRepo = exports.isGitHubOrg = void 0;
4
- const isGitHubOrg = (value) => /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) &&
5
- !value.includes('--');
6
- exports.isGitHubOrg = isGitHubOrg;
7
- const isGitHubRepo = (value) => /^[A-Za-z0-9_.-]+$/.test(value) && value !== '.' && value !== '..';
8
- exports.isGitHubRepo = isGitHubRepo;
9
- const isGitHubTeam = (value) => /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) &&
10
- !value.endsWith('-') &&
11
- !value.includes('--');
12
- exports.isGitHubTeam = isGitHubTeam;
13
- //# sourceMappingURL=validation.js.map
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
+ isGitHubOrg: () => isGitHubOrg,
22
+ isGitHubRepo: () => isGitHubRepo,
23
+ isGitHubTeam: () => isGitHubTeam
24
+ });
25
+ module.exports = __toCommonJS(validation_exports);
26
+ const isGitHubOrg = (value) => /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(value) && !value.includes("--");
27
+ const isGitHubRepo = (value) => /^[A-Za-z0-9_.-]+$/.test(value) && value !== "." && value !== "..";
28
+ const isGitHubTeam = (value) => /^[A-Za-z0-9_](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/.test(value) && !value.endsWith("-") && !value.includes("--");
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ isGitHubOrg,
32
+ isGitHubRepo,
33
+ isGitHubTeam
34
+ });
35
+ //# sourceMappingURL=validation.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/cli/init/validation.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAC3C,4CAA4C,CAAC,IAAI,CAAC,KAAK,CAAC;IACxD,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAFX,QAAA,WAAW,eAEA;AAEjB,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,CAAC;AADxD,QAAA,YAAY,gBAC4C;AAE9D,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,+CAA+C,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3D,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;IACpB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAHX,QAAA,YAAY,gBAGD"}
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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;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;",
6
+ "names": []
7
+ }
@@ -1,25 +1,54 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writePackageJson = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
- const package_1 = require("../configure/analysis/package");
9
- const package_2 = require("../configure/processing/package");
10
- /**
11
- * Write a `skuba` section into the destination `package.json`.
12
- */
13
- const writePackageJson = async ({ cwd, entryPoint, template, type, version, }) => {
14
- const manifest = await (0, package_1.getDestinationManifest)({ cwd });
15
- manifest.packageJson.skuba = {
16
- entryPoint: entryPoint ?? null,
17
- template,
18
- type,
19
- version,
20
- };
21
- const updatedPackageJson = (0, package_2.formatPackage)(manifest.packageJson);
22
- await fs_extra_1.default.promises.writeFile(manifest.path, updatedPackageJson);
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;
23
19
  };
24
- exports.writePackageJson = writePackageJson;
25
- //# sourceMappingURL=writePackageJson.js.map
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var writePackageJson_exports = {};
26
+ __export(writePackageJson_exports, {
27
+ writePackageJson: () => writePackageJson
28
+ });
29
+ module.exports = __toCommonJS(writePackageJson_exports);
30
+ var import_fs_extra = __toESM(require("fs-extra"));
31
+ var import_package = require("../configure/analysis/package");
32
+ var import_package2 = require("../configure/processing/package");
33
+ const writePackageJson = async ({
34
+ cwd,
35
+ entryPoint,
36
+ template,
37
+ type,
38
+ version
39
+ }) => {
40
+ const manifest = await (0, import_package.getDestinationManifest)({ cwd });
41
+ manifest.packageJson.skuba = {
42
+ entryPoint: entryPoint ?? null,
43
+ template,
44
+ type,
45
+ version
46
+ };
47
+ const updatedPackageJson = (0, import_package2.formatPackage)(manifest.packageJson);
48
+ await import_fs_extra.default.promises.writeFile(manifest.path, updatedPackageJson);
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ writePackageJson
53
+ });
54
+ //# sourceMappingURL=writePackageJson.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"writePackageJson.js","sourceRoot":"","sources":["../../../src/cli/init/writePackageJson.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAG1B,2DAAuE;AACvE,6DAAgE;AAUhE;;GAEG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,GAAG,EACH,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,OAAO,GACe,EAAE,EAAE;IAC1B,MAAM,QAAQ,GAAG,MAAM,IAAA,gCAAsB,EAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAEvD,QAAQ,CAAC,WAAW,CAAC,KAAK,GAAG;QAC3B,UAAU,EAAE,UAAU,IAAI,IAAI;QAC9B,QAAQ;QACR,IAAI;QACJ,OAAO;KACR,CAAC;IAEF,MAAM,kBAAkB,GAAG,IAAA,uBAAa,EAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE/D,MAAM,kBAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AACjE,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B"}
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 = 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,yBAAqB,+BAAc,SAAS,WAAW;AAE7D,QAAM,gBAAAC,QAAG,SAAS,UAAU,SAAS,MAAM,kBAAkB;AAC/D;",
6
+ "names": ["import_package", "fs"]
7
+ }
@@ -1,30 +1,36 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
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;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createEslintAnnotations = void 0;
27
- const Buildkite = __importStar(require("../../../../api/buildkite"));
28
- const createEslintAnnotations = (eslint) => !eslint.ok ? ['**ESLint**', Buildkite.md.terminal(eslint.output.trim())] : [];
29
- exports.createEslintAnnotations = createEslintAnnotations;
30
- //# sourceMappingURL=eslint.js.map
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var eslint_exports = {};
26
+ __export(eslint_exports, {
27
+ createEslintAnnotations: () => createEslintAnnotations
28
+ });
29
+ module.exports = __toCommonJS(eslint_exports);
30
+ var Buildkite = __toESM(require("../../../../api/buildkite"));
31
+ const createEslintAnnotations = (eslint) => !eslint.ok ? ["**ESLint**", Buildkite.md.terminal(eslint.output.trim())] : [];
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ createEslintAnnotations
35
+ });
36
+ //# sourceMappingURL=eslint.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/eslint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,uBAAuB,GAAG,CAAC,MAAoB,EAAY,EAAE,CACxE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AADnE,QAAA,uBAAuB,2BAC4C"}
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 '../../../../cli/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
+ }
@@ -1,48 +1,54 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
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;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createBuildkiteAnnotations = void 0;
27
- const Buildkite = __importStar(require("../../../../api/buildkite"));
28
- const eslint_1 = require("./eslint");
29
- const prettier_1 = require("./prettier");
30
- const tsc_1 = require("./tsc");
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var buildkite_exports = {};
26
+ __export(buildkite_exports, {
27
+ createBuildkiteAnnotations: () => createBuildkiteAnnotations
28
+ });
29
+ module.exports = __toCommonJS(buildkite_exports);
30
+ var Buildkite = __toESM(require("../../../../api/buildkite"));
31
+ var import_eslint = require("./eslint");
32
+ var import_prettier = require("./prettier");
33
+ var import_tsc = require("./tsc");
31
34
  const createBuildkiteAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
32
- if (eslint.ok && prettier.ok && tscOk) {
33
- return;
34
- }
35
- const buildkiteOutput = [
36
- '`skuba lint` found issues that require triage:',
37
- ...(0, eslint_1.createEslintAnnotations)(eslint),
38
- ...(0, prettier_1.createPrettierAnnotations)(prettier),
39
- ...(0, tsc_1.createTscAnnotations)(tscOk, tscOutputStream),
40
- ].join('\n\n');
41
- await Buildkite.annotate(buildkiteOutput, {
42
- context: 'skuba-lint-external',
43
- scopeContextToStep: true,
44
- style: 'error',
45
- });
35
+ if (eslint.ok && prettier.ok && tscOk) {
36
+ return;
37
+ }
38
+ const buildkiteOutput = [
39
+ "`skuba lint` found issues that require triage:",
40
+ ...(0, import_eslint.createEslintAnnotations)(eslint),
41
+ ...(0, import_prettier.createPrettierAnnotations)(prettier),
42
+ ...(0, import_tsc.createTscAnnotations)(tscOk, tscOutputStream)
43
+ ].join("\n\n");
44
+ await Buildkite.annotate(buildkiteOutput, {
45
+ context: "skuba-lint-external",
46
+ scopeContextToStep: true,
47
+ style: "error"
48
+ });
46
49
  };
47
- exports.createBuildkiteAnnotations = createBuildkiteAnnotations;
48
- //# sourceMappingURL=index.js.map
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ createBuildkiteAnnotations
53
+ });
54
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAKvD,qCAAmD;AACnD,yCAAuD;AACvD,+BAA6C;AAEtC,MAAM,0BAA0B,GAAG,KAAK,EAC7C,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EACnB,EAAE;IACjB,IAAI,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,EAAE;QACrC,OAAO;KACR;IAED,MAAM,eAAe,GAAG;QACtB,gDAAgD;QAChD,GAAG,IAAA,gCAAuB,EAAC,MAAM,CAAC;QAClC,GAAG,IAAA,oCAAyB,EAAC,QAAQ,CAAC;QACtC,GAAG,IAAA,0BAAoB,EAAC,KAAK,EAAE,eAAe,CAAC;KAChD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,MAAM,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE;QACxC,OAAO,EAAE,qBAAqB;QAC9B,kBAAkB,EAAE,IAAI;QACxB,KAAK,EAAE,OAAO;KACf,CAAC,CAAC;AACL,CAAC,CAAC;AAtBW,QAAA,0BAA0B,8BAsBrC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/buildkite/index.ts"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { ESLintOutput } from '../../../../cli/adapter/eslint';\nimport type { PrettierOutput } from '../../../../cli/adapter/prettier';\nimport type { StreamInterceptor } from '../../../../cli/lint/external';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createBuildkiteAnnotations = async (\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n if (eslint.ok && prettier.ok && tscOk) {\n return;\n }\n\n const buildkiteOutput = [\n '`skuba lint` found issues that require triage:',\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ].join('\\n\\n');\n\n await Buildkite.annotate(buildkiteOutput, {\n context: 'skuba-lint-external',\n scopeContextToStep: true,\n style: 'error',\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAK3B,oBAAwC;AACxC,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,6BAA6B,OACxC,QACA,UACA,OACA,oBACkB;AAClB,MAAI,OAAO,MAAM,SAAS,MAAM,OAAO;AACrC;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD,EAAE,KAAK,MAAM;AAEb,QAAM,UAAU,SAAS,iBAAiB;AAAA,IACxC,SAAS;AAAA,IACT,oBAAoB;AAAA,IACpB,OAAO;AAAA,EACT,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -1,37 +1,43 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
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;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createPrettierAnnotations = void 0;
27
- const Buildkite = __importStar(require("../../../../api/buildkite"));
28
- const createPrettierAnnotations = (prettier) => !prettier.ok
29
- ? [
30
- '**Prettier**',
31
- Buildkite.md.terminal(prettier.result.errored
32
- .map(({ err, filepath }) => [filepath, ...(err ? [String(err)] : [])].join(' '))
33
- .join('\n')),
34
- ]
35
- : [];
36
- exports.createPrettierAnnotations = createPrettierAnnotations;
37
- //# sourceMappingURL=prettier.js.map
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var prettier_exports = {};
26
+ __export(prettier_exports, {
27
+ createPrettierAnnotations: () => createPrettierAnnotations
28
+ });
29
+ module.exports = __toCommonJS(prettier_exports);
30
+ var Buildkite = __toESM(require("../../../../api/buildkite"));
31
+ const createPrettierAnnotations = (prettier) => !prettier.ok ? [
32
+ "**Prettier**",
33
+ Buildkite.md.terminal(
34
+ prettier.result.errored.map(
35
+ ({ err, filepath }) => [filepath, ...err ? [String(err)] : []].join(" ")
36
+ ).join("\n")
37
+ )
38
+ ] : [];
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ createPrettierAnnotations
42
+ });
43
+ //# sourceMappingURL=prettier.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/prettier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,yBAAyB,GAAG,CAAC,QAAwB,EAAY,EAAE,CAC9E,CAAC,QAAQ,CAAC,EAAE;IACV,CAAC,CAAC;QACE,cAAc;QACd,SAAS,CAAC,EAAE,CAAC,QAAQ,CACnB,QAAQ,CAAC,MAAM,CAAC,OAAO;aACpB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CACzB,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACpD;aACA,IAAI,CAAC,IAAI,CAAC,CACd;KACF;IACH,CAAC,CAAC,EAAE,CAAC;AAZI,QAAA,yBAAyB,6BAY7B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/buildkite/prettier.ts"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { PrettierOutput } from '../../../../cli/adapter/prettier';\n\nexport const createPrettierAnnotations = (prettier: PrettierOutput): string[] =>\n !prettier.ok\n ? [\n '**Prettier**',\n Buildkite.md.terminal(\n prettier.result.errored\n .map(({ err, filepath }) =>\n [filepath, ...(err ? [String(err)] : [])].join(' '),\n )\n .join('\\n'),\n ),\n ]\n : [];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,4BAA4B,CAAC,aACxC,CAAC,SAAS,KACN;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,SAAS,OAAO,QACb;AAAA,MAAI,CAAC,EAAE,KAAK,SAAS,MACpB,CAAC,UAAU,GAAI,MAAM,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAE,EAAE,KAAK,GAAG;AAAA,IACpD,EACC,KAAK,IAAI;AAAA,EACd;AACF,IACA,CAAC;",
6
+ "names": []
7
+ }