@slopus/beer 0.1.1

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 (304) hide show
  1. package/README.md +24 -0
  2. package/bin/beer.js +2 -0
  3. package/dist/apps/bootstrap.d.ts +5 -0
  4. package/dist/apps/bootstrap.d.ts.map +1 -0
  5. package/dist/apps/bootstrap.js +170 -0
  6. package/dist/apps/bootstrap.js.map +1 -0
  7. package/dist/commands/bootstrapCommand.d.ts +6 -0
  8. package/dist/commands/bootstrapCommand.d.ts.map +1 -0
  9. package/dist/commands/bootstrapCommand.js +16 -0
  10. package/dist/commands/bootstrapCommand.js.map +1 -0
  11. package/dist/main.d.ts +2 -0
  12. package/dist/main.d.ts.map +1 -0
  13. package/dist/main.js +17 -0
  14. package/dist/main.js.map +1 -0
  15. package/dist/modules/ai/aiOutputExtract.d.ts +6 -0
  16. package/dist/modules/ai/aiOutputExtract.d.ts.map +1 -0
  17. package/dist/modules/ai/aiOutputExtract.js +16 -0
  18. package/dist/modules/ai/aiOutputExtract.js.map +1 -0
  19. package/dist/modules/ai/aiOutputExtract.spec.d.ts +2 -0
  20. package/dist/modules/ai/aiOutputExtract.spec.d.ts.map +1 -0
  21. package/dist/modules/ai/aiOutputExtract.spec.js +25 -0
  22. package/dist/modules/ai/aiOutputExtract.spec.js.map +1 -0
  23. package/dist/modules/ai/aiReadmeGenerate.d.ts +18 -0
  24. package/dist/modules/ai/aiReadmeGenerate.d.ts.map +1 -0
  25. package/dist/modules/ai/aiReadmeGenerate.js +23 -0
  26. package/dist/modules/ai/aiReadmeGenerate.js.map +1 -0
  27. package/dist/modules/ai/aiReadmeGenerate.spec.d.ts +2 -0
  28. package/dist/modules/ai/aiReadmeGenerate.spec.d.ts.map +1 -0
  29. package/dist/modules/ai/aiReadmeGenerate.spec.js +27 -0
  30. package/dist/modules/ai/aiReadmeGenerate.spec.js.map +1 -0
  31. package/dist/modules/ai/generate.d.ts +28 -0
  32. package/dist/modules/ai/generate.d.ts.map +1 -0
  33. package/dist/modules/ai/generate.js +132 -0
  34. package/dist/modules/ai/generate.js.map +1 -0
  35. package/dist/modules/ai/generate.spec.d.ts +2 -0
  36. package/dist/modules/ai/generate.spec.d.ts.map +1 -0
  37. package/dist/modules/ai/generate.spec.js +53 -0
  38. package/dist/modules/ai/generate.spec.js.map +1 -0
  39. package/dist/modules/ai/generateFile.d.ts +14 -0
  40. package/dist/modules/ai/generateFile.d.ts.map +1 -0
  41. package/dist/modules/ai/generateFile.js +56 -0
  42. package/dist/modules/ai/generateFile.js.map +1 -0
  43. package/dist/modules/ai/generateFile.spec.d.ts +2 -0
  44. package/dist/modules/ai/generateFile.spec.d.ts.map +1 -0
  45. package/dist/modules/ai/generateFile.spec.js +60 -0
  46. package/dist/modules/ai/generateFile.spec.js.map +1 -0
  47. package/dist/modules/ai/generateText.d.ts +9 -0
  48. package/dist/modules/ai/generateText.d.ts.map +1 -0
  49. package/dist/modules/ai/generateText.js +12 -0
  50. package/dist/modules/ai/generateText.js.map +1 -0
  51. package/dist/modules/ai/generateText.spec.d.ts +2 -0
  52. package/dist/modules/ai/generateText.spec.d.ts.map +1 -0
  53. package/dist/modules/ai/generateText.spec.js +28 -0
  54. package/dist/modules/ai/generateText.spec.js.map +1 -0
  55. package/dist/modules/ai/providerGenerate.d.ts +29 -0
  56. package/dist/modules/ai/providerGenerate.d.ts.map +1 -0
  57. package/dist/modules/ai/providerGenerate.js +144 -0
  58. package/dist/modules/ai/providerGenerate.js.map +1 -0
  59. package/dist/modules/ai/providerGenerate.spec.d.ts +2 -0
  60. package/dist/modules/ai/providerGenerate.spec.d.ts.map +1 -0
  61. package/dist/modules/ai/providerGenerate.spec.js +85 -0
  62. package/dist/modules/ai/providerGenerate.spec.js.map +1 -0
  63. package/dist/modules/ai/providerGenerate.unit.spec.d.ts +2 -0
  64. package/dist/modules/ai/providerGenerate.unit.spec.d.ts.map +1 -0
  65. package/dist/modules/ai/providerGenerate.unit.spec.js +49 -0
  66. package/dist/modules/ai/providerGenerate.unit.spec.js.map +1 -0
  67. package/dist/modules/beer/beerDevFolderResolve.d.ts +5 -0
  68. package/dist/modules/beer/beerDevFolderResolve.d.ts.map +1 -0
  69. package/dist/modules/beer/beerDevFolderResolve.js +9 -0
  70. package/dist/modules/beer/beerDevFolderResolve.js.map +1 -0
  71. package/dist/modules/beer/beerDevFolderResolve.spec.d.ts +2 -0
  72. package/dist/modules/beer/beerDevFolderResolve.spec.d.ts.map +1 -0
  73. package/dist/modules/beer/beerDevFolderResolve.spec.js +10 -0
  74. package/dist/modules/beer/beerDevFolderResolve.spec.js.map +1 -0
  75. package/dist/modules/beer/beerOriginalPathResolve.d.ts +5 -0
  76. package/dist/modules/beer/beerOriginalPathResolve.d.ts.map +1 -0
  77. package/dist/modules/beer/beerOriginalPathResolve.js +8 -0
  78. package/dist/modules/beer/beerOriginalPathResolve.js.map +1 -0
  79. package/dist/modules/beer/beerOriginalPathResolve.spec.d.ts +2 -0
  80. package/dist/modules/beer/beerOriginalPathResolve.spec.d.ts.map +1 -0
  81. package/dist/modules/beer/beerOriginalPathResolve.spec.js +10 -0
  82. package/dist/modules/beer/beerOriginalPathResolve.spec.js.map +1 -0
  83. package/dist/modules/beer/beerSettingsPathResolve.d.ts +5 -0
  84. package/dist/modules/beer/beerSettingsPathResolve.d.ts.map +1 -0
  85. package/dist/modules/beer/beerSettingsPathResolve.js +9 -0
  86. package/dist/modules/beer/beerSettingsPathResolve.js.map +1 -0
  87. package/dist/modules/beer/beerSettingsPathResolve.spec.d.ts +2 -0
  88. package/dist/modules/beer/beerSettingsPathResolve.spec.d.ts.map +1 -0
  89. package/dist/modules/beer/beerSettingsPathResolve.spec.js +10 -0
  90. package/dist/modules/beer/beerSettingsPathResolve.spec.js.map +1 -0
  91. package/dist/modules/beer/beerSettingsRead.d.ts +6 -0
  92. package/dist/modules/beer/beerSettingsRead.d.ts.map +1 -0
  93. package/dist/modules/beer/beerSettingsRead.js +28 -0
  94. package/dist/modules/beer/beerSettingsRead.js.map +1 -0
  95. package/dist/modules/beer/beerSettingsTypes.d.ts +12 -0
  96. package/dist/modules/beer/beerSettingsTypes.d.ts.map +1 -0
  97. package/dist/modules/beer/beerSettingsTypes.js +2 -0
  98. package/dist/modules/beer/beerSettingsTypes.js.map +1 -0
  99. package/dist/modules/beer/beerSettingsWrite.d.ts +6 -0
  100. package/dist/modules/beer/beerSettingsWrite.d.ts.map +1 -0
  101. package/dist/modules/beer/beerSettingsWrite.js +10 -0
  102. package/dist/modules/beer/beerSettingsWrite.js.map +1 -0
  103. package/dist/modules/context/contextGet.d.ts +7 -0
  104. package/dist/modules/context/contextGet.d.ts.map +1 -0
  105. package/dist/modules/context/contextGet.js +12 -0
  106. package/dist/modules/context/contextGet.js.map +1 -0
  107. package/dist/modules/context/contextGetOrInitialize.d.ts +7 -0
  108. package/dist/modules/context/contextGetOrInitialize.d.ts.map +1 -0
  109. package/dist/modules/context/contextGetOrInitialize.js +12 -0
  110. package/dist/modules/context/contextGetOrInitialize.js.map +1 -0
  111. package/dist/modules/context/contextInitialize.d.ts +7 -0
  112. package/dist/modules/context/contextInitialize.d.ts.map +1 -0
  113. package/dist/modules/context/contextInitialize.js +25 -0
  114. package/dist/modules/context/contextInitialize.js.map +1 -0
  115. package/dist/modules/context/contextInitialize.spec.d.ts +2 -0
  116. package/dist/modules/context/contextInitialize.spec.d.ts.map +1 -0
  117. package/dist/modules/context/contextInitialize.spec.js +77 -0
  118. package/dist/modules/context/contextInitialize.spec.js.map +1 -0
  119. package/dist/modules/context/contextTypes.d.ts +21 -0
  120. package/dist/modules/context/contextTypes.d.ts.map +1 -0
  121. package/dist/modules/context/contextTypes.js +2 -0
  122. package/dist/modules/context/contextTypes.js.map +1 -0
  123. package/dist/modules/git/gitPush.d.ts +6 -0
  124. package/dist/modules/git/gitPush.d.ts.map +1 -0
  125. package/dist/modules/git/gitPush.js +9 -0
  126. package/dist/modules/git/gitPush.js.map +1 -0
  127. package/dist/modules/git/gitRemoteEnsure.d.ts +6 -0
  128. package/dist/modules/git/gitRemoteEnsure.d.ts.map +1 -0
  129. package/dist/modules/git/gitRemoteEnsure.js +20 -0
  130. package/dist/modules/git/gitRemoteEnsure.js.map +1 -0
  131. package/dist/modules/git/gitRepoCheckout.d.ts +6 -0
  132. package/dist/modules/git/gitRepoCheckout.d.ts.map +1 -0
  133. package/dist/modules/git/gitRepoCheckout.js +15 -0
  134. package/dist/modules/git/gitRepoCheckout.js.map +1 -0
  135. package/dist/modules/git/gitRepoCheckout.spec.d.ts +2 -0
  136. package/dist/modules/git/gitRepoCheckout.spec.d.ts.map +1 -0
  137. package/dist/modules/git/gitRepoCheckout.spec.js +33 -0
  138. package/dist/modules/git/gitRepoCheckout.spec.js.map +1 -0
  139. package/dist/modules/git/gitStageAndCommit.d.ts +6 -0
  140. package/dist/modules/git/gitStageAndCommit.d.ts.map +1 -0
  141. package/dist/modules/git/gitStageAndCommit.js +18 -0
  142. package/dist/modules/git/gitStageAndCommit.js.map +1 -0
  143. package/dist/modules/github/githubCliEnsure.d.ts +6 -0
  144. package/dist/modules/github/githubCliEnsure.d.ts.map +1 -0
  145. package/dist/modules/github/githubCliEnsure.js +13 -0
  146. package/dist/modules/github/githubCliEnsure.js.map +1 -0
  147. package/dist/modules/github/githubOwnerChoicesGet.d.ts +5 -0
  148. package/dist/modules/github/githubOwnerChoicesGet.d.ts.map +1 -0
  149. package/dist/modules/github/githubOwnerChoicesGet.js +20 -0
  150. package/dist/modules/github/githubOwnerChoicesGet.js.map +1 -0
  151. package/dist/modules/github/githubRepoCreate.d.ts +6 -0
  152. package/dist/modules/github/githubRepoCreate.d.ts.map +1 -0
  153. package/dist/modules/github/githubRepoCreate.js +17 -0
  154. package/dist/modules/github/githubRepoCreate.js.map +1 -0
  155. package/dist/modules/github/githubRepoExists.d.ts +5 -0
  156. package/dist/modules/github/githubRepoExists.d.ts.map +1 -0
  157. package/dist/modules/github/githubRepoExists.js +9 -0
  158. package/dist/modules/github/githubRepoExists.js.map +1 -0
  159. package/dist/modules/github/githubRepoNameResolve.d.ts +17 -0
  160. package/dist/modules/github/githubRepoNameResolve.d.ts.map +1 -0
  161. package/dist/modules/github/githubRepoNameResolve.js +34 -0
  162. package/dist/modules/github/githubRepoNameResolve.js.map +1 -0
  163. package/dist/modules/github/githubRepoNameResolve.spec.d.ts +2 -0
  164. package/dist/modules/github/githubRepoNameResolve.spec.d.ts.map +1 -0
  165. package/dist/modules/github/githubRepoNameResolve.spec.js +37 -0
  166. package/dist/modules/github/githubRepoNameResolve.spec.js.map +1 -0
  167. package/dist/modules/github/githubRepoParse.d.ts +7 -0
  168. package/dist/modules/github/githubRepoParse.d.ts.map +1 -0
  169. package/dist/modules/github/githubRepoParse.js +35 -0
  170. package/dist/modules/github/githubRepoParse.js.map +1 -0
  171. package/dist/modules/github/githubRepoParse.spec.d.ts +2 -0
  172. package/dist/modules/github/githubRepoParse.spec.d.ts.map +1 -0
  173. package/dist/modules/github/githubRepoParse.spec.js +17 -0
  174. package/dist/modules/github/githubRepoParse.spec.js.map +1 -0
  175. package/dist/modules/github/githubRepoStatusGet.d.ts +7 -0
  176. package/dist/modules/github/githubRepoStatusGet.d.ts.map +1 -0
  177. package/dist/modules/github/githubRepoStatusGet.js +21 -0
  178. package/dist/modules/github/githubRepoStatusGet.js.map +1 -0
  179. package/dist/modules/github/githubRepoUrlBuild.d.ts +5 -0
  180. package/dist/modules/github/githubRepoUrlBuild.d.ts.map +1 -0
  181. package/dist/modules/github/githubRepoUrlBuild.js +7 -0
  182. package/dist/modules/github/githubRepoUrlBuild.js.map +1 -0
  183. package/dist/modules/github/githubTypes.d.ts +8 -0
  184. package/dist/modules/github/githubTypes.d.ts.map +1 -0
  185. package/dist/modules/github/githubTypes.js +2 -0
  186. package/dist/modules/github/githubTypes.js.map +1 -0
  187. package/dist/modules/github/githubViewerGet.d.ts +5 -0
  188. package/dist/modules/github/githubViewerGet.d.ts.map +1 -0
  189. package/dist/modules/github/githubViewerGet.js +14 -0
  190. package/dist/modules/github/githubViewerGet.js.map +1 -0
  191. package/dist/modules/prompt/promptConfirm.d.ts +6 -0
  192. package/dist/modules/prompt/promptConfirm.d.ts.map +1 -0
  193. package/dist/modules/prompt/promptConfirm.js +23 -0
  194. package/dist/modules/prompt/promptConfirm.js.map +1 -0
  195. package/dist/modules/prompt/promptInput.d.ts +6 -0
  196. package/dist/modules/prompt/promptInput.d.ts.map +1 -0
  197. package/dist/modules/prompt/promptInput.js +14 -0
  198. package/dist/modules/prompt/promptInput.js.map +1 -0
  199. package/dist/modules/providers/providerDetect.d.ts +6 -0
  200. package/dist/modules/providers/providerDetect.d.ts.map +1 -0
  201. package/dist/modules/providers/providerDetect.js +43 -0
  202. package/dist/modules/providers/providerDetect.js.map +1 -0
  203. package/dist/modules/providers/providerDetect.spec.d.ts +2 -0
  204. package/dist/modules/providers/providerDetect.spec.d.ts.map +1 -0
  205. package/dist/modules/providers/providerDetect.spec.js +76 -0
  206. package/dist/modules/providers/providerDetect.spec.js.map +1 -0
  207. package/dist/modules/providers/providerModelSelect.d.ts +12 -0
  208. package/dist/modules/providers/providerModelSelect.d.ts.map +1 -0
  209. package/dist/modules/providers/providerModelSelect.js +134 -0
  210. package/dist/modules/providers/providerModelSelect.js.map +1 -0
  211. package/dist/modules/providers/providerModelSelect.spec.d.ts +2 -0
  212. package/dist/modules/providers/providerModelSelect.spec.d.ts.map +1 -0
  213. package/dist/modules/providers/providerModelSelect.spec.js +68 -0
  214. package/dist/modules/providers/providerModelSelect.spec.js.map +1 -0
  215. package/dist/modules/providers/providerModelsGet.d.ts +7 -0
  216. package/dist/modules/providers/providerModelsGet.d.ts.map +1 -0
  217. package/dist/modules/providers/providerModelsGet.js +100 -0
  218. package/dist/modules/providers/providerModelsGet.js.map +1 -0
  219. package/dist/modules/providers/providerModelsGet.spec.d.ts +2 -0
  220. package/dist/modules/providers/providerModelsGet.spec.d.ts.map +1 -0
  221. package/dist/modules/providers/providerModelsGet.spec.js +88 -0
  222. package/dist/modules/providers/providerModelsGet.spec.js.map +1 -0
  223. package/dist/modules/providers/providerPriorityList.d.ts +6 -0
  224. package/dist/modules/providers/providerPriorityList.d.ts.map +1 -0
  225. package/dist/modules/providers/providerPriorityList.js +16 -0
  226. package/dist/modules/providers/providerPriorityList.js.map +1 -0
  227. package/dist/modules/providers/providerPriorityList.spec.d.ts +2 -0
  228. package/dist/modules/providers/providerPriorityList.spec.d.ts.map +1 -0
  229. package/dist/modules/providers/providerPriorityList.spec.js +19 -0
  230. package/dist/modules/providers/providerPriorityList.spec.js.map +1 -0
  231. package/dist/modules/providers/providerTypes.d.ts +21 -0
  232. package/dist/modules/providers/providerTypes.d.ts.map +1 -0
  233. package/dist/modules/providers/providerTypes.js +2 -0
  234. package/dist/modules/providers/providerTypes.js.map +1 -0
  235. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.d.ts +17 -0
  236. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.d.ts.map +1 -0
  237. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.js +88 -0
  238. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.js.map +1 -0
  239. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.d.ts +2 -0
  240. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.d.ts.map +1 -0
  241. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.js +70 -0
  242. package/dist/modules/sandbox/sandboxInferenceFilesystemPolicy.spec.js.map +1 -0
  243. package/dist/modules/sandbox/sandboxInferenceGet.d.ts +12 -0
  244. package/dist/modules/sandbox/sandboxInferenceGet.d.ts.map +1 -0
  245. package/dist/modules/sandbox/sandboxInferenceGet.js +18 -0
  246. package/dist/modules/sandbox/sandboxInferenceGet.js.map +1 -0
  247. package/dist/modules/sandbox/sandboxInferenceGet.spec.d.ts +2 -0
  248. package/dist/modules/sandbox/sandboxInferenceGet.spec.d.ts.map +1 -0
  249. package/dist/modules/sandbox/sandboxInferenceGet.spec.js +65 -0
  250. package/dist/modules/sandbox/sandboxInferenceGet.spec.js.map +1 -0
  251. package/dist/modules/sandbox/sandboxInferenceTypes.d.ts +7 -0
  252. package/dist/modules/sandbox/sandboxInferenceTypes.d.ts.map +1 -0
  253. package/dist/modules/sandbox/sandboxInferenceTypes.js +2 -0
  254. package/dist/modules/sandbox/sandboxInferenceTypes.js.map +1 -0
  255. package/dist/modules/sandbox/sandboxTypes.d.ts +4 -0
  256. package/dist/modules/sandbox/sandboxTypes.d.ts.map +1 -0
  257. package/dist/modules/sandbox/sandboxTypes.js +2 -0
  258. package/dist/modules/sandbox/sandboxTypes.js.map +1 -0
  259. package/dist/modules/util/commandRun.d.ts +22 -0
  260. package/dist/modules/util/commandRun.d.ts.map +1 -0
  261. package/dist/modules/util/commandRun.js +112 -0
  262. package/dist/modules/util/commandRun.js.map +1 -0
  263. package/dist/modules/util/commandRun.spec.d.ts +2 -0
  264. package/dist/modules/util/commandRun.spec.d.ts.map +1 -0
  265. package/dist/modules/util/commandRun.spec.js +43 -0
  266. package/dist/modules/util/commandRun.spec.js.map +1 -0
  267. package/dist/modules/util/pathResolveFromInitCwd.d.ts +6 -0
  268. package/dist/modules/util/pathResolveFromInitCwd.d.ts.map +1 -0
  269. package/dist/modules/util/pathResolveFromInitCwd.js +10 -0
  270. package/dist/modules/util/pathResolveFromInitCwd.js.map +1 -0
  271. package/dist/release/releaseRun.d.ts +6 -0
  272. package/dist/release/releaseRun.d.ts.map +1 -0
  273. package/dist/release/releaseRun.js +153 -0
  274. package/dist/release/releaseRun.js.map +1 -0
  275. package/dist/release/releaseVersionIncrement.d.ts +7 -0
  276. package/dist/release/releaseVersionIncrement.d.ts.map +1 -0
  277. package/dist/release/releaseVersionIncrement.js +23 -0
  278. package/dist/release/releaseVersionIncrement.js.map +1 -0
  279. package/dist/release/releaseVersionIncrement.spec.d.ts +2 -0
  280. package/dist/release/releaseVersionIncrement.spec.d.ts.map +1 -0
  281. package/dist/release/releaseVersionIncrement.spec.js +20 -0
  282. package/dist/release/releaseVersionIncrement.spec.js.map +1 -0
  283. package/dist/release/releaseVersionPrompt.d.ts +6 -0
  284. package/dist/release/releaseVersionPrompt.d.ts.map +1 -0
  285. package/dist/release/releaseVersionPrompt.js +55 -0
  286. package/dist/release/releaseVersionPrompt.js.map +1 -0
  287. package/dist/text/all.txt +85 -0
  288. package/dist/text/text.d.ts +7 -0
  289. package/dist/text/text.d.ts.map +1 -0
  290. package/dist/text/text.js +34 -0
  291. package/dist/text/text.js.map +1 -0
  292. package/dist/types.d.ts +6 -0
  293. package/dist/types.d.ts.map +1 -0
  294. package/dist/types.js +2 -0
  295. package/dist/types.js.map +1 -0
  296. package/dist/workflows/steps/generateCommitMessage.d.ts +13 -0
  297. package/dist/workflows/steps/generateCommitMessage.d.ts.map +1 -0
  298. package/dist/workflows/steps/generateCommitMessage.js +25 -0
  299. package/dist/workflows/steps/generateCommitMessage.js.map +1 -0
  300. package/dist/workflows/steps/generateCommitMessage.spec.d.ts +2 -0
  301. package/dist/workflows/steps/generateCommitMessage.spec.d.ts.map +1 -0
  302. package/dist/workflows/steps/generateCommitMessage.spec.js +28 -0
  303. package/dist/workflows/steps/generateCommitMessage.spec.js.map +1 -0
  304. package/package.json +38 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitRepoCheckout.d.ts","sourceRoot":"","sources":["../../../sources/modules/git/gitRepoCheckout.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO3F"}
@@ -0,0 +1,15 @@
1
+ import { mkdir, rm } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { commandRun } from "@/modules/util/commandRun.js";
4
+ /**
5
+ * Recreates a shallow clone of the repository at targetDir.
6
+ * Returns the HEAD commit hash of the checkout for reproducibility.
7
+ */
8
+ export async function gitRepoCheckout(remoteUrl, targetDir) {
9
+ await rm(targetDir, { recursive: true, force: true });
10
+ await mkdir(path.dirname(targetDir), { recursive: true });
11
+ await commandRun("git", ["clone", "--depth", "1", remoteUrl, targetDir]);
12
+ const result = await commandRun("git", ["rev-parse", "HEAD"], { cwd: targetDir });
13
+ return result.stdout.trim();
14
+ }
15
+ //# sourceMappingURL=gitRepoCheckout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitRepoCheckout.js","sourceRoot":"","sources":["../../../sources/modules/git/gitRepoCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,SAAiB,EAAE,SAAiB;IACxE,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAEzE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=gitRepoCheckout.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitRepoCheckout.spec.d.ts","sourceRoot":"","sources":["../../../sources/modules/git/gitRepoCheckout.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { describe, expect, it } from "vitest";
5
+ import { commandRun } from "@/modules/util/commandRun.js";
6
+ import { gitRepoCheckout } from "@/modules/git/gitRepoCheckout.js";
7
+ describe("gitRepoCheckout", () => {
8
+ it("recreates a shallow clone at target path", async () => {
9
+ const tempRoot = await mkdtemp(path.join(os.tmpdir(), "beer-git-"));
10
+ const sourceDir = path.join(tempRoot, "source");
11
+ const targetDir = path.join(tempRoot, "target");
12
+ await commandRun("git", ["init", sourceDir]);
13
+ await writeFile(path.join(sourceDir, "README.md"), "hello\n", "utf-8");
14
+ await commandRun("git", ["-C", sourceDir, "add", "README.md"]);
15
+ await commandRun("git", [
16
+ "-C",
17
+ sourceDir,
18
+ "-c",
19
+ "user.name=holdmybeer",
20
+ "-c",
21
+ "user.email=holdmybeer@example.com",
22
+ "commit",
23
+ "-m",
24
+ "init"
25
+ ]);
26
+ const hash = await gitRepoCheckout(sourceDir, targetDir);
27
+ const readme = await readFile(path.join(targetDir, "README.md"), "utf-8");
28
+ expect(readme).toBe("hello\n");
29
+ expect(hash).toMatch(/^[0-9a-f]{40}$/);
30
+ await rm(tempRoot, { recursive: true, force: true });
31
+ });
32
+ });
33
+ //# sourceMappingURL=gitRepoCheckout.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitRepoCheckout.spec.js","sourceRoot":"","sources":["../../../sources/modules/git/gitRepoCheckout.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QACpE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEhD,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;QAC7C,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACvE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;QAC/D,MAAM,UAAU,CAAC,KAAK,EAAE;YACtB,IAAI;YACJ,SAAS;YACT,IAAI;YACJ,sBAAsB;YACtB,IAAI;YACJ,mCAAmC;YACnC,QAAQ;YACR,IAAI;YACJ,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAEzD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;QAC1E,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAEvC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Stages all files and creates a commit in the given directory.
3
+ * Returns true if a commit was created, false if there were no changes.
4
+ */
5
+ export declare function gitStageAndCommit(message: string, cwd: string): Promise<boolean>;
6
+ //# sourceMappingURL=gitStageAndCommit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitStageAndCommit.d.ts","sourceRoot":"","sources":["../../../sources/modules/git/gitStageAndCommit.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CActF"}
@@ -0,0 +1,18 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ /**
3
+ * Stages all files and creates a commit in the given directory.
4
+ * Returns true if a commit was created, false if there were no changes.
5
+ */
6
+ export async function gitStageAndCommit(message, cwd) {
7
+ await commandRun("git", ["add", "."], { cwd });
8
+ const hasChanges = await commandRun("git", ["diff", "--cached", "--quiet"], {
9
+ cwd,
10
+ allowFailure: true
11
+ });
12
+ if (hasChanges.exitCode === 0) {
13
+ return false;
14
+ }
15
+ await commandRun("git", ["commit", "-m", message], { cwd });
16
+ return true;
17
+ }
18
+ //# sourceMappingURL=gitStageAndCommit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitStageAndCommit.js","sourceRoot":"","sources":["../../../sources/modules/git/gitStageAndCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAe,EAAE,GAAW;IAClE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAE/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE;QAC1E,GAAG;QACH,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,IAAI,UAAU,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5D,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Verifies GitHub CLI is installed and callable.
3
+ * Throws with a clear message when unavailable.
4
+ */
5
+ export declare function githubCliEnsure(): Promise<void>;
6
+ //# sourceMappingURL=githubCliEnsure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubCliEnsure.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubCliEnsure.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAKrD"}
@@ -0,0 +1,13 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ import { text } from "@text";
3
+ /**
4
+ * Verifies GitHub CLI is installed and callable.
5
+ * Throws with a clear message when unavailable.
6
+ */
7
+ export async function githubCliEnsure() {
8
+ const result = await commandRun("gh", ["--version"], { allowFailure: true });
9
+ if (result.exitCode !== 0) {
10
+ throw new Error(text["error_gh_required"]);
11
+ }
12
+ }
13
+ //# sourceMappingURL=githubCliEnsure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubCliEnsure.js","sourceRoot":"","sources":["../../../sources/modules/github/githubCliEnsure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns candidate publish owners: authenticated user plus org memberships.
3
+ */
4
+ export declare function githubOwnerChoicesGet(viewerLogin: string): Promise<string[]>;
5
+ //# sourceMappingURL=githubOwnerChoicesGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubOwnerChoicesGet.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubOwnerChoicesGet.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBlF"}
@@ -0,0 +1,20 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ /**
3
+ * Returns candidate publish owners: authenticated user plus org memberships.
4
+ */
5
+ export async function githubOwnerChoicesGet(viewerLogin) {
6
+ const result = await commandRun("gh", ["api", "user/orgs", "--jq", ".[].login"], {
7
+ allowFailure: true
8
+ });
9
+ const values = new Set([viewerLogin]);
10
+ if (result.exitCode === 0) {
11
+ for (const line of result.stdout.split("\n")) {
12
+ const value = line.trim();
13
+ if (value) {
14
+ values.add(value);
15
+ }
16
+ }
17
+ }
18
+ return Array.from(values).sort((a, b) => a.localeCompare(b));
19
+ }
20
+ //# sourceMappingURL=githubOwnerChoicesGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubOwnerChoicesGet.js","sourceRoot":"","sources":["../../../sources/modules/github/githubOwnerChoicesGet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAmB;IAC7D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE;QAC/E,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1B,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type GitHubRepoVisibility = "private" | "public";
2
+ /**
3
+ * Creates a GitHub repository via gh CLI.
4
+ */
5
+ export declare function githubRepoCreate(fullName: string, visibility: GitHubRepoVisibility): Promise<void>;
6
+ //# sourceMappingURL=githubRepoCreate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoCreate.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoCreate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAWf"}
@@ -0,0 +1,17 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ /**
3
+ * Creates a GitHub repository via gh CLI.
4
+ */
5
+ export async function githubRepoCreate(fullName, visibility) {
6
+ const visibilityFlag = visibility === "private" ? "--private" : "--public";
7
+ await commandRun("gh", [
8
+ "repo",
9
+ "create",
10
+ fullName,
11
+ visibilityFlag,
12
+ "--disable-issues",
13
+ "--disable-wiki",
14
+ "--confirm"
15
+ ]);
16
+ }
17
+ //# sourceMappingURL=githubRepoCreate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoCreate.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAAgB,EAChB,UAAgC;IAEhC,MAAM,cAAc,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;IAC3E,MAAM,UAAU,CAAC,IAAI,EAAE;QACrB,MAAM;QACN,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Checks whether a GitHub repository exists and is accessible.
3
+ */
4
+ export declare function githubRepoExists(fullName: string): Promise<boolean>;
5
+ //# sourceMappingURL=githubRepoExists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoExists.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoExists.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOzE"}
@@ -0,0 +1,9 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ /**
3
+ * Checks whether a GitHub repository exists and is accessible.
4
+ */
5
+ export async function githubRepoExists(fullName) {
6
+ const result = await commandRun("gh", ["repo", "view", fullName, "--json", "nameWithOwner"], { allowFailure: true });
7
+ return result.exitCode === 0;
8
+ }
9
+ //# sourceMappingURL=githubRepoExists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoExists.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoExists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,MAAM,MAAM,GAAG,MAAM,UAAU,CAC7B,IAAI,EACJ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,CAAC,EACrD,EAAE,YAAY,EAAE,IAAI,EAAE,CACvB,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { GitHubRepoStatus } from "@/modules/github/githubTypes.js";
2
+ export interface GitHubRepoNameResolveOptions {
3
+ owner: string;
4
+ requestedRepo: string;
5
+ statusGet: (fullName: string) => Promise<GitHubRepoStatus>;
6
+ }
7
+ export interface GitHubRepoNameResolveResult {
8
+ repo: string;
9
+ fullName: string;
10
+ status: GitHubRepoStatus;
11
+ }
12
+ /**
13
+ * Resolves a publish repository name, adding numeric suffixes for collisions.
14
+ * Existing empty repositories are accepted as-is.
15
+ */
16
+ export declare function githubRepoNameResolve(options: GitHubRepoNameResolveOptions): Promise<GitHubRepoNameResolveResult>;
17
+ //# sourceMappingURL=githubRepoNameResolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoNameResolve.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoNameResolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CA8BtC"}
@@ -0,0 +1,34 @@
1
+ import { text } from "@text";
2
+ /**
3
+ * Resolves a publish repository name, adding numeric suffixes for collisions.
4
+ * Existing empty repositories are accepted as-is.
5
+ */
6
+ export async function githubRepoNameResolve(options) {
7
+ const requested = options.requestedRepo.trim();
8
+ if (!requested || !/^[A-Za-z0-9_.-]+$/.test(requested)) {
9
+ throw new Error(text["error_repo_name_invalid"]);
10
+ }
11
+ const firstFullName = `${options.owner}/${requested}`;
12
+ const firstStatus = await options.statusGet(firstFullName);
13
+ if (firstStatus === "missing" || firstStatus === "empty") {
14
+ return {
15
+ repo: requested,
16
+ fullName: firstFullName,
17
+ status: firstStatus
18
+ };
19
+ }
20
+ for (let suffix = 2; suffix <= 100; suffix += 1) {
21
+ const repo = `${requested}-${suffix}`;
22
+ const fullName = `${options.owner}/${repo}`;
23
+ const status = await options.statusGet(fullName);
24
+ if (status === "missing" || status === "empty") {
25
+ return {
26
+ repo,
27
+ fullName,
28
+ status
29
+ };
30
+ }
31
+ }
32
+ throw new Error(text["error_repo_name_exhausted"]);
33
+ }
34
+ //# sourceMappingURL=githubRepoNameResolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoNameResolve.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoNameResolve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAc7B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAqC;IAErC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,CAAC;IACtD,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAC3D,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QACzD,OAAO;YACL,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,aAAa;YACvB,MAAM,EAAE,WAAW;SACpB,CAAC;IACJ,CAAC;IAED,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,IAAI,GAAG,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;QACtC,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YAC/C,OAAO;gBACL,IAAI;gBACJ,QAAQ;gBACR,MAAM;aACP,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAE,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=githubRepoNameResolve.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoNameResolve.spec.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoNameResolve.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { githubRepoNameResolve } from "@/modules/github/githubRepoNameResolve.js";
3
+ describe("githubRepoNameResolve", () => {
4
+ it("keeps requested name when missing", async () => {
5
+ const result = await githubRepoNameResolve({
6
+ owner: "ex3ndr",
7
+ requestedRepo: "sample",
8
+ statusGet: async () => "missing"
9
+ });
10
+ expect(result.repo).toBe("sample");
11
+ expect(result.fullName).toBe("ex3ndr/sample");
12
+ });
13
+ it("adds numeric suffix when repository already has content", async () => {
14
+ const statuses = new Map([
15
+ ["ex3ndr/sample", "nonEmpty"],
16
+ ["ex3ndr/sample-2", "nonEmpty"],
17
+ ["ex3ndr/sample-3", "missing"]
18
+ ]);
19
+ const result = await githubRepoNameResolve({
20
+ owner: "ex3ndr",
21
+ requestedRepo: "sample",
22
+ statusGet: async (fullName) => statuses.get(fullName) ?? "missing"
23
+ });
24
+ expect(result.repo).toBe("sample-3");
25
+ expect(result.fullName).toBe("ex3ndr/sample-3");
26
+ });
27
+ it("allows existing empty repository", async () => {
28
+ const result = await githubRepoNameResolve({
29
+ owner: "ex3ndr",
30
+ requestedRepo: "sample",
31
+ statusGet: async () => "empty"
32
+ });
33
+ expect(result.repo).toBe("sample");
34
+ expect(result.status).toBe("empty");
35
+ });
36
+ });
37
+ //# sourceMappingURL=githubRepoNameResolve.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoNameResolve.spec.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoNameResolve.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC;YACzC,KAAK,EAAE,QAAQ;YACf,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;SACjC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAA2C;YACjE,CAAC,eAAe,EAAE,UAAU,CAAC;YAC7B,CAAC,iBAAiB,EAAE,UAAU,CAAC;YAC/B,CAAC,iBAAiB,EAAE,SAAS,CAAC;SAC/B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC;YACzC,KAAK,EAAE,QAAQ;YACf,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS;SACnE,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC;YACzC,KAAK,EAAE,QAAQ;YACf,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO;SAC/B,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { GitHubRepoRef } from "@/modules/github/githubTypes.js";
2
+ /**
3
+ * Parses GitHub repository input into owner/repo.
4
+ * Supports URLs, SSH remotes, and owner/repo shorthand.
5
+ */
6
+ export declare function githubRepoParse(input: string): GitHubRepoRef | null;
7
+ //# sourceMappingURL=githubRepoParse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoParse.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoParse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAkCnE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Parses GitHub repository input into owner/repo.
3
+ * Supports URLs, SSH remotes, and owner/repo shorthand.
4
+ */
5
+ export function githubRepoParse(input) {
6
+ const trimmed = input.trim();
7
+ if (!trimmed) {
8
+ return null;
9
+ }
10
+ const withoutProtocol = trimmed
11
+ .replace(/^https?:\/\//i, "")
12
+ .replace(/^ssh:\/\//i, "")
13
+ .replace(/^git@github\.com:/i, "github.com/")
14
+ .replace(/\.git$/i, "");
15
+ const withoutQuery = withoutProtocol.split(/[?#]/)[0] ?? "";
16
+ const normalized = withoutQuery.startsWith("github.com/")
17
+ ? withoutQuery.slice("github.com/".length)
18
+ : withoutQuery;
19
+ const parts = normalized.split("/").filter(Boolean);
20
+ if (parts.length < 2) {
21
+ return null;
22
+ }
23
+ const owner = parts[0] ?? "";
24
+ const repo = parts[1] ?? "";
25
+ if (!/^[A-Za-z0-9_.-]+$/.test(owner) || !/^[A-Za-z0-9_.-]+$/.test(repo)) {
26
+ return null;
27
+ }
28
+ return {
29
+ owner,
30
+ repo,
31
+ fullName: `${owner}/${repo}`,
32
+ url: `https://github.com/${owner}/${repo}`
33
+ };
34
+ }
35
+ //# sourceMappingURL=githubRepoParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoParse.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoParse.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,OAAO;SAC5B,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,oBAAoB,EAAE,aAAa,CAAC;SAC5C,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAE1B,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;QACvD,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC;QAC1C,CAAC,CAAC,YAAY,CAAC;IAEjB,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,KAAK;QACL,IAAI;QACJ,QAAQ,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE;QAC5B,GAAG,EAAE,sBAAsB,KAAK,IAAI,IAAI,EAAE;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=githubRepoParse.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoParse.spec.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoParse.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { githubRepoParse } from "@/modules/github/githubRepoParse.js";
3
+ describe("githubRepoParse", () => {
4
+ it("parses owner/repo shorthand", () => {
5
+ expect(githubRepoParse("ex3ndr/holdmybeer")?.fullName).toBe("ex3ndr/holdmybeer");
6
+ });
7
+ it("parses https url", () => {
8
+ expect(githubRepoParse("https://github.com/ex3ndr/holdmybeer")?.fullName).toBe("ex3ndr/holdmybeer");
9
+ });
10
+ it("parses ssh git url", () => {
11
+ expect(githubRepoParse("git@github.com:ex3ndr/holdmybeer.git")?.fullName).toBe("ex3ndr/holdmybeer");
12
+ });
13
+ it("rejects invalid input", () => {
14
+ expect(githubRepoParse("not-a-repo")).toBeNull();
15
+ });
16
+ });
17
+ //# sourceMappingURL=githubRepoParse.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoParse.spec.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoParse.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,eAAe,CAAC,sCAAsC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAC5E,mBAAmB,CACpB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC5B,MAAM,CAAC,eAAe,CAAC,sCAAsC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAC5E,mBAAmB,CACpB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { GitHubRepoStatus } from "@/modules/github/githubTypes.js";
2
+ /**
3
+ * Checks repository status for publish targeting.
4
+ * missing: not found, empty: exists with no content, nonEmpty: contains content.
5
+ */
6
+ export declare function githubRepoStatusGet(fullName: string): Promise<GitHubRepoStatus>;
7
+ //# sourceMappingURL=githubRepoStatusGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoStatusGet.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoStatusGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAIxE;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoBrF"}
@@ -0,0 +1,21 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ import { text, textFormat } from "@text";
3
+ /**
4
+ * Checks repository status for publish targeting.
5
+ * missing: not found, empty: exists with no content, nonEmpty: contains content.
6
+ */
7
+ export async function githubRepoStatusGet(fullName) {
8
+ const result = await commandRun("gh", ["api", `repos/${fullName}`, "--jq", ".size"], { allowFailure: true });
9
+ if (result.exitCode !== 0) {
10
+ if (result.stderr.includes("404") || result.stdout.includes("404")) {
11
+ return "missing";
12
+ }
13
+ throw new Error(textFormat(text["error_repo_status_check"], { repo: fullName, detail: result.stderr || result.stdout }));
14
+ }
15
+ const size = Number(result.stdout.trim());
16
+ if (Number.isFinite(size) && size === 0) {
17
+ return "empty";
18
+ }
19
+ return "nonEmpty";
20
+ }
21
+ //# sourceMappingURL=githubRepoStatusGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoStatusGet.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoStatusGet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,MAAM,MAAM,GAAG,MAAM,UAAU,CAC7B,IAAI,EACJ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAC7C,EAAE,YAAY,EAAE,IAAI,EAAE,CACvB,CAAC;IAEF,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnE,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,CAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5H,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Builds the canonical HTTPS URL for a GitHub repository.
3
+ */
4
+ export declare function githubRepoUrlBuild(fullName: string): string;
5
+ //# sourceMappingURL=githubRepoUrlBuild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoUrlBuild.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoUrlBuild.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Builds the canonical HTTPS URL for a GitHub repository.
3
+ */
4
+ export function githubRepoUrlBuild(fullName) {
5
+ return `https://github.com/${fullName}.git`;
6
+ }
7
+ //# sourceMappingURL=githubRepoUrlBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubRepoUrlBuild.js","sourceRoot":"","sources":["../../../sources/modules/github/githubRepoUrlBuild.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,sBAAsB,QAAQ,MAAM,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface GitHubRepoRef {
2
+ owner: string;
3
+ repo: string;
4
+ fullName: string;
5
+ url: string;
6
+ }
7
+ export type GitHubRepoStatus = "missing" | "empty" | "nonEmpty";
8
+ //# sourceMappingURL=githubTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubTypes.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=githubTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubTypes.js","sourceRoot":"","sources":["../../../sources/modules/github/githubTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns the authenticated GitHub login from gh auth.
3
+ */
4
+ export declare function githubViewerGet(): Promise<string>;
5
+ //# sourceMappingURL=githubViewerGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubViewerGet.d.ts","sourceRoot":"","sources":["../../../sources/modules/github/githubViewerGet.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAOvD"}
@@ -0,0 +1,14 @@
1
+ import { commandRun } from "@/modules/util/commandRun.js";
2
+ import { text } from "@text";
3
+ /**
4
+ * Returns the authenticated GitHub login from gh auth.
5
+ */
6
+ export async function githubViewerGet() {
7
+ const result = await commandRun("gh", ["api", "user", "--jq", ".login"]);
8
+ const login = result.stdout.trim();
9
+ if (!login) {
10
+ throw new Error(text["error_gh_user_resolve"]);
11
+ }
12
+ return login;
13
+ }
14
+ //# sourceMappingURL=githubViewerGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubViewerGet.js","sourceRoot":"","sources":["../../../sources/modules/github/githubViewerGet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAE,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Prompts for yes/no confirmation.
3
+ * Accepts y/yes and n/no; blank answers resolve to defaultValue.
4
+ */
5
+ export declare function promptConfirm(question: string, defaultValue: boolean): Promise<boolean>;
6
+ //# sourceMappingURL=promptConfirm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptConfirm.d.ts","sourceRoot":"","sources":["../../../sources/modules/prompt/promptConfirm.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
@@ -0,0 +1,23 @@
1
+ import readline from "node:readline/promises";
2
+ import { stdin as input, stdout as output } from "node:process";
3
+ /**
4
+ * Prompts for yes/no confirmation.
5
+ * Accepts y/yes and n/no; blank answers resolve to defaultValue.
6
+ */
7
+ export async function promptConfirm(question, defaultValue) {
8
+ const rl = readline.createInterface({ input, output });
9
+ const hint = defaultValue ? "Y/n" : "y/N";
10
+ const answer = (await rl.question(`${question} (${hint}): `)).trim().toLowerCase();
11
+ rl.close();
12
+ if (!answer) {
13
+ return defaultValue;
14
+ }
15
+ if (answer === "y" || answer === "yes") {
16
+ return true;
17
+ }
18
+ if (answer === "n" || answer === "no") {
19
+ return false;
20
+ }
21
+ return defaultValue;
22
+ }
23
+ //# sourceMappingURL=promptConfirm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptConfirm.js","sourceRoot":"","sources":["../../../sources/modules/prompt/promptConfirm.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,YAAqB;IAErB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,QAAQ,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnF,EAAE,CAAC,KAAK,EAAE,CAAC;IAEX,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Prompts for free-form text input.
3
+ * Returns the default value when input is blank.
4
+ */
5
+ export declare function promptInput(question: string, defaultValue?: string): Promise<string>;
6
+ //# sourceMappingURL=promptInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptInput.d.ts","sourceRoot":"","sources":["../../../sources/modules/prompt/promptInput.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAMjB"}