bingo 0.8.2 → 0.9.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 (239) hide show
  1. package/lib/cli/createTrackingBranches.d.ts +4 -0
  2. package/lib/cli/createTrackingBranches.d.ts.map +1 -0
  3. package/lib/cli/createTrackingBranches.js +7 -0
  4. package/lib/cli/createTrackingBranches.js.map +1 -0
  5. package/lib/cli/createTrackingBranches.test.d.ts +2 -0
  6. package/lib/cli/createTrackingBranches.test.d.ts.map +1 -0
  7. package/lib/cli/createTrackingBranches.test.js +19 -0
  8. package/lib/cli/createTrackingBranches.test.js.map +1 -0
  9. package/lib/cli/display/runSpinnerTask.d.ts +1 -1
  10. package/lib/cli/getGitRepositoryType.d.ts +8 -0
  11. package/lib/cli/getGitRepositoryType.d.ts.map +1 -0
  12. package/lib/cli/getGitRepositoryType.js +18 -0
  13. package/lib/cli/getGitRepositoryType.js.map +1 -0
  14. package/lib/cli/getGitRepositoryType.test.d.ts +2 -0
  15. package/lib/cli/getGitRepositoryType.test.d.ts.map +1 -0
  16. package/lib/cli/getGitRepositoryType.test.js +33 -0
  17. package/lib/cli/getGitRepositoryType.test.js.map +1 -0
  18. package/lib/cli/isInGitRepository.test.js +1 -1
  19. package/lib/cli/isInGitRepository.test.js.map +1 -1
  20. package/lib/cli/isInGitRepositoryRoot.d.ts +3 -0
  21. package/lib/cli/isInGitRepositoryRoot.d.ts.map +1 -0
  22. package/lib/cli/isInGitRepositoryRoot.js +7 -0
  23. package/lib/cli/isInGitRepositoryRoot.js.map +1 -0
  24. package/lib/cli/isInGitRepositoryRoot.test.d.ts +2 -0
  25. package/lib/cli/isInGitRepositoryRoot.test.d.ts.map +1 -0
  26. package/lib/cli/isInGitRepositoryRoot.test.js +26 -0
  27. package/lib/cli/isInGitRepositoryRoot.test.js.map +1 -0
  28. package/lib/cli/parseProcessArgv.d.ts +1 -0
  29. package/lib/cli/parseProcessArgv.d.ts.map +1 -1
  30. package/lib/cli/parseProcessArgv.js +3 -0
  31. package/lib/cli/parseProcessArgv.js.map +1 -1
  32. package/lib/cli/prepareGitRepository.d.ts +4 -0
  33. package/lib/cli/prepareGitRepository.d.ts.map +1 -0
  34. package/lib/cli/prepareGitRepository.js +9 -0
  35. package/lib/cli/prepareGitRepository.js.map +1 -0
  36. package/lib/cli/remotes/createRemoteRepository.d.ts +6 -0
  37. package/lib/cli/remotes/createRemoteRepository.d.ts.map +1 -0
  38. package/lib/cli/remotes/createRemoteRepository.js +25 -0
  39. package/lib/cli/remotes/createRemoteRepository.js.map +1 -0
  40. package/lib/cli/remotes/createRemoteRepository.test.d.ts +2 -0
  41. package/lib/cli/remotes/createRemoteRepository.test.d.ts.map +1 -0
  42. package/lib/cli/remotes/createRemoteRepository.test.js +54 -0
  43. package/lib/cli/remotes/createRemoteRepository.test.js.map +1 -0
  44. package/lib/cli/remotes/createTrackingBranches.d.ts +4 -0
  45. package/lib/cli/remotes/createTrackingBranches.d.ts.map +1 -0
  46. package/lib/cli/remotes/createTrackingBranches.js +7 -0
  47. package/lib/cli/remotes/createTrackingBranches.js.map +1 -0
  48. package/lib/cli/remotes/createTrackingBranches.test.d.ts +2 -0
  49. package/lib/cli/remotes/createTrackingBranches.test.d.ts.map +1 -0
  50. package/lib/cli/remotes/createTrackingBranches.test.js +19 -0
  51. package/lib/cli/remotes/createTrackingBranches.test.js.map +1 -0
  52. package/lib/cli/remotes/resolveRemoteRepository.d.ts +19 -0
  53. package/lib/cli/remotes/resolveRemoteRepository.d.ts.map +1 -0
  54. package/lib/cli/remotes/resolveRemoteRepository.js +58 -0
  55. package/lib/cli/remotes/resolveRemoteRepository.js.map +1 -0
  56. package/lib/cli/remotes/resolveRemoteRepository.test.d.ts +2 -0
  57. package/lib/cli/remotes/resolveRemoteRepository.test.d.ts.map +1 -0
  58. package/lib/cli/remotes/resolveRemoteRepository.test.js +148 -0
  59. package/lib/cli/remotes/resolveRemoteRepository.test.js.map +1 -0
  60. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.d.ts +4 -0
  61. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.d.ts.map +1 -0
  62. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.js +14 -0
  63. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.js.map +1 -0
  64. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts +2 -0
  65. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts.map +1 -0
  66. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.js +23 -0
  67. package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.js.map +1 -0
  68. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.d.ts +5 -0
  69. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.d.ts.map +1 -0
  70. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.js +26 -0
  71. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.js.map +1 -0
  72. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.d.ts +2 -0
  73. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.d.ts.map +1 -0
  74. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.js +82 -0
  75. package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.js.map +1 -0
  76. package/lib/cli/remotes/resolveRepository.d.ts +19 -0
  77. package/lib/cli/remotes/resolveRepository.d.ts.map +1 -0
  78. package/lib/cli/remotes/resolveRepository.js +58 -0
  79. package/lib/cli/remotes/resolveRepository.js.map +1 -0
  80. package/lib/cli/remotes/resolveRepository.test.d.ts +2 -0
  81. package/lib/cli/remotes/resolveRepository.test.d.ts.map +1 -0
  82. package/lib/cli/remotes/resolveRepository.test.js +148 -0
  83. package/lib/cli/remotes/resolveRepository.test.js.map +1 -0
  84. package/lib/cli/remotes/types.d.ts +5 -0
  85. package/lib/cli/remotes/types.d.ts.map +1 -0
  86. package/lib/cli/remotes/types.js +2 -0
  87. package/lib/cli/remotes/types.js.map +1 -0
  88. package/lib/cli/repository/clearLocalGitTags.d.ts +3 -0
  89. package/lib/cli/repository/clearLocalGitTags.d.ts.map +1 -0
  90. package/lib/cli/repository/clearLocalGitTags.js +7 -0
  91. package/lib/cli/repository/clearLocalGitTags.js.map +1 -0
  92. package/lib/cli/repository/clearLocalGitTags.test.d.ts +2 -0
  93. package/lib/cli/repository/clearLocalGitTags.test.d.ts.map +1 -0
  94. package/lib/cli/repository/clearLocalGitTags.test.js +16 -0
  95. package/lib/cli/repository/clearLocalGitTags.test.js.map +1 -0
  96. package/lib/cli/repository/createInitialCommit.d.ts +7 -0
  97. package/lib/cli/repository/createInitialCommit.d.ts.map +1 -0
  98. package/lib/cli/repository/createInitialCommit.js +10 -0
  99. package/lib/cli/repository/createInitialCommit.js.map +1 -0
  100. package/lib/cli/repository/createInitialCommit.test.d.ts +2 -0
  101. package/lib/cli/repository/createInitialCommit.test.d.ts.map +1 -0
  102. package/lib/cli/repository/createInitialCommit.test.js +50 -0
  103. package/lib/cli/repository/createInitialCommit.test.js.map +1 -0
  104. package/lib/cli/repository/createTrackingBranches.d.ts +4 -0
  105. package/lib/cli/repository/createTrackingBranches.d.ts.map +1 -0
  106. package/lib/cli/repository/createTrackingBranches.js +7 -0
  107. package/lib/cli/repository/createTrackingBranches.js.map +1 -0
  108. package/lib/cli/repository/createTrackingBranches.test.d.ts +2 -0
  109. package/lib/cli/repository/createTrackingBranches.test.d.ts.map +1 -0
  110. package/lib/cli/repository/createTrackingBranches.test.js +19 -0
  111. package/lib/cli/repository/createTrackingBranches.test.js.map +1 -0
  112. package/lib/cli/repository/prepareGitRepository.d.ts +4 -0
  113. package/lib/cli/repository/prepareGitRepository.d.ts.map +1 -0
  114. package/lib/cli/repository/prepareGitRepository.js +9 -0
  115. package/lib/cli/repository/prepareGitRepository.js.map +1 -0
  116. package/lib/cli/repository/prepareGitRepository.test.d.ts +2 -0
  117. package/lib/cli/repository/prepareGitRepository.test.d.ts.map +1 -0
  118. package/lib/cli/repository/prepareGitRepository.test.js +32 -0
  119. package/lib/cli/repository/prepareGitRepository.test.js.map +1 -0
  120. package/lib/cli/repository/resolveLocalRepository.d.ts +21 -0
  121. package/lib/cli/repository/resolveLocalRepository.d.ts.map +1 -0
  122. package/lib/cli/repository/resolveLocalRepository.js +57 -0
  123. package/lib/cli/repository/resolveLocalRepository.js.map +1 -0
  124. package/lib/cli/repository/resolveLocalRepository.test.d.ts +2 -0
  125. package/lib/cli/repository/resolveLocalRepository.test.d.ts.map +1 -0
  126. package/lib/cli/repository/resolveLocalRepository.test.js +167 -0
  127. package/lib/cli/repository/resolveLocalRepository.test.js.map +1 -0
  128. package/lib/cli/repository/resolveRepository.d.ts +21 -0
  129. package/lib/cli/repository/resolveRepository.d.ts.map +1 -0
  130. package/lib/cli/repository/resolveRepository.js +57 -0
  131. package/lib/cli/repository/resolveRepository.js.map +1 -0
  132. package/lib/cli/repository/resolveRepository.test.d.ts +2 -0
  133. package/lib/cli/repository/resolveRepository.test.d.ts.map +1 -0
  134. package/lib/cli/repository/resolveRepository.test.js +148 -0
  135. package/lib/cli/repository/resolveRepository.test.js.map +1 -0
  136. package/lib/cli/runCLI.d.ts +3 -4
  137. package/lib/cli/runCLI.d.ts.map +1 -1
  138. package/lib/cli/runCLI.js +2 -0
  139. package/lib/cli/runCLI.js.map +1 -1
  140. package/lib/cli/runTemplateCLI.d.ts +1 -4
  141. package/lib/cli/runTemplateCLI.d.ts.map +1 -1
  142. package/lib/cli/runTemplateCLI.js +0 -2
  143. package/lib/cli/runTemplateCLI.js.map +1 -1
  144. package/lib/cli/setup/createRepositoryOnGitHub.d.ts +0 -1
  145. package/lib/cli/setup/createRepositoryOnGitHub.d.ts.map +1 -1
  146. package/lib/cli/setup/createRepositoryOnGitHub.js.map +1 -1
  147. package/lib/cli/setup/createTrackingBranches.d.ts +1 -1
  148. package/lib/cli/setup/createTrackingBranches.d.ts.map +1 -1
  149. package/lib/cli/setup/createTrackingBranches.js.map +1 -1
  150. package/lib/cli/setup/getRemoteRepository.d.ts +2 -0
  151. package/lib/cli/setup/getRemoteRepository.d.ts.map +1 -0
  152. package/lib/cli/setup/getRemoteRepository.js +2 -0
  153. package/lib/cli/setup/getRemoteRepository.js.map +1 -0
  154. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts +4 -0
  155. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts.map +1 -0
  156. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js +15 -0
  157. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js.map +1 -0
  158. package/lib/cli/setup/remotes/createRemoteRepository.d.ts +5 -0
  159. package/lib/cli/setup/remotes/createRemoteRepository.d.ts.map +1 -0
  160. package/lib/cli/setup/remotes/createRemoteRepository.js +16 -0
  161. package/lib/cli/setup/remotes/createRemoteRepository.js.map +1 -0
  162. package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts +6 -0
  163. package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts.map +1 -0
  164. package/lib/cli/setup/remotes/createRepositoryOnGitHub.js +36 -0
  165. package/lib/cli/setup/remotes/createRepositoryOnGitHub.js.map +1 -0
  166. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts +2 -0
  167. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts.map +1 -0
  168. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js +157 -0
  169. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js.map +1 -0
  170. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts +4 -0
  171. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts.map +1 -0
  172. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js +14 -0
  173. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js.map +1 -0
  174. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts +2 -0
  175. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts.map +1 -0
  176. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js +23 -0
  177. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js.map +1 -0
  178. package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts +18 -0
  179. package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts.map +1 -0
  180. package/lib/cli/setup/remotes/resolveRemoteRepository.js +47 -0
  181. package/lib/cli/setup/remotes/resolveRemoteRepository.js.map +1 -0
  182. package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts +2 -0
  183. package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts.map +1 -0
  184. package/lib/cli/setup/remotes/resolveRemoteRepository.test.js +103 -0
  185. package/lib/cli/setup/remotes/resolveRemoteRepository.test.js.map +1 -0
  186. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts +4 -0
  187. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts.map +1 -0
  188. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js +14 -0
  189. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js.map +1 -0
  190. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts +2 -0
  191. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts.map +1 -0
  192. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js +23 -0
  193. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js.map +1 -0
  194. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts +5 -0
  195. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts.map +1 -0
  196. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js +26 -0
  197. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js.map +1 -0
  198. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts +2 -0
  199. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts.map +1 -0
  200. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js +82 -0
  201. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js.map +1 -0
  202. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts +3 -0
  203. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts.map +1 -0
  204. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js +9 -0
  205. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js.map +1 -0
  206. package/lib/cli/setup/remotes/types.d.ts +5 -0
  207. package/lib/cli/setup/remotes/types.d.ts.map +1 -0
  208. package/lib/cli/setup/remotes/types.js +2 -0
  209. package/lib/cli/setup/remotes/types.js.map +1 -0
  210. package/lib/cli/setup/resolveExistingRemote.d.ts +2 -0
  211. package/lib/cli/setup/resolveExistingRemote.d.ts.map +1 -0
  212. package/lib/cli/setup/resolveExistingRemote.js +2 -0
  213. package/lib/cli/setup/resolveExistingRemote.js.map +1 -0
  214. package/lib/cli/setup/resolveRemoteRepository.d.ts +26 -0
  215. package/lib/cli/setup/resolveRemoteRepository.d.ts.map +1 -0
  216. package/lib/cli/setup/resolveRemoteRepository.js +49 -0
  217. package/lib/cli/setup/resolveRemoteRepository.js.map +1 -0
  218. package/lib/cli/setup/runModeSetup.d.ts +4 -4
  219. package/lib/cli/setup/runModeSetup.d.ts.map +1 -1
  220. package/lib/cli/setup/runModeSetup.js +24 -39
  221. package/lib/cli/setup/runModeSetup.js.map +1 -1
  222. package/lib/cli/setup/runModeSetup.test.js +128 -68
  223. package/lib/cli/setup/runModeSetup.test.js.map +1 -1
  224. package/lib/cli/transition/runModeTransition.d.ts +4 -4
  225. package/lib/cli/transition/runModeTransition.d.ts.map +1 -1
  226. package/lib/cli/transition/runModeTransition.js +17 -4
  227. package/lib/cli/transition/runModeTransition.js.map +1 -1
  228. package/lib/cli/transition/runModeTransition.test.js +43 -12
  229. package/lib/cli/transition/runModeTransition.test.js.map +1 -1
  230. package/lib/predicates/isTemplate.d.ts +1 -2
  231. package/lib/predicates/isTemplate.d.ts.map +1 -1
  232. package/lib/predicates/isTemplate.js.map +1 -1
  233. package/lib/types/templates.d.ts +2 -1
  234. package/lib/types/templates.d.ts.map +1 -1
  235. package/lib/utils/tryCatch.d.ts +2 -1
  236. package/lib/utils/tryCatch.d.ts.map +1 -1
  237. package/lib/utils/tryCatch.js +8 -0
  238. package/lib/utils/tryCatch.js.map +1 -1
  239. package/package.json +4 -4
@@ -0,0 +1,4 @@
1
+ import { SystemRunner } from "bingo-systems";
2
+ import { RepositoryLocator } from "new-github-repository";
3
+ export declare function createTrackingBranches(remote: RepositoryLocator | undefined, runner: SystemRunner): Promise<void>;
4
+ //# sourceMappingURL=createTrackingBranches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.d.ts","sourceRoot":"","sources":["../../src/cli/createTrackingBranches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,EAAE,YAAY,iBASpB"}
@@ -0,0 +1,7 @@
1
+ export async function createTrackingBranches(remote, runner) {
2
+ await runner("git init");
3
+ if (remote) {
4
+ await runner(`git remote add origin https://github.com/${remote.owner}/${remote.repository}`);
5
+ }
6
+ }
7
+ //# sourceMappingURL=createTrackingBranches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.js","sourceRoot":"","sources":["../../src/cli/createTrackingBranches.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,MAAqC,EACrC,MAAoB;IAEpB,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAEzB,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,MAAM,CACX,4CAA4C,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAC/E,CAAC;IACH,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createTrackingBranches.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.test.d.ts","sourceRoot":"","sources":["../../src/cli/createTrackingBranches.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { describe, expect, test, vi } from "vitest";
2
+ import { createTrackingBranches } from "./createTrackingBranches.js";
3
+ describe("createTrackingBranches", () => {
4
+ test("commands", async () => {
5
+ const runner = vi.fn();
6
+ await createTrackingBranches({ owner: "TestOwner", repository: "test-repository" }, runner);
7
+ expect(runner.mock.calls).toMatchInlineSnapshot(`
8
+ [
9
+ [
10
+ "git init",
11
+ ],
12
+ [
13
+ "git remote add origin https://github.com/TestOwner/test-repository",
14
+ ],
15
+ ]
16
+ `);
17
+ });
18
+ });
19
+ //# sourceMappingURL=createTrackingBranches.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.test.js","sourceRoot":"","sources":["../../src/cli/createTrackingBranches.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,sBAAsB,CAC3B,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,EACrD,MAAM,CACN,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;GAS/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { ClackDisplay } from "./createClackDisplay.js";
2
- export declare function runSpinnerTask<T>(display: ClackDisplay, start: string, stop: string, task: () => Promise<T>): Promise<Error | T>;
2
+ export declare function runSpinnerTask<T>(display: ClackDisplay, start: string, stop: string, task: () => Promise<T>): Promise<T | Error>;
3
3
  //# sourceMappingURL=runSpinnerTask.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { SystemRunner } from "bingo-systems";
2
+ export declare enum GitRepositoryType {
3
+ None = 0,
4
+ Root = 1,
5
+ Subdirectory = 2
6
+ }
7
+ export declare function getGitRepositoryType(runner: SystemRunner): Promise<GitRepositoryType>;
8
+ //# sourceMappingURL=getGitRepositoryType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGitRepositoryType.d.ts","sourceRoot":"","sources":["../../src/cli/getGitRepositoryType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,oBAAY,iBAAiB;IAC5B,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,YAAY,IAAA;CACZ;AAED,wBAAsB,oBAAoB,CACzC,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,iBAAiB,CAAC,CAa5B"}
@@ -0,0 +1,18 @@
1
+ export var GitRepositoryType;
2
+ (function (GitRepositoryType) {
3
+ GitRepositoryType[GitRepositoryType["None"] = 0] = "None";
4
+ GitRepositoryType[GitRepositoryType["Root"] = 1] = "Root";
5
+ GitRepositoryType[GitRepositoryType["Subdirectory"] = 2] = "Subdirectory";
6
+ })(GitRepositoryType || (GitRepositoryType = {}));
7
+ export async function getGitRepositoryType(runner) {
8
+ const result = await runner("git rev-parse --git-dir");
9
+ const message = result.stdout?.toString();
10
+ if (!message || message.includes("fatal: not a git repository")) {
11
+ return GitRepositoryType.None;
12
+ }
13
+ if (message === ".git") {
14
+ return GitRepositoryType.Root;
15
+ }
16
+ return GitRepositoryType.Subdirectory;
17
+ }
18
+ //# sourceMappingURL=getGitRepositoryType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGitRepositoryType.js","sourceRoot":"","sources":["../../src/cli/getGitRepositoryType.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,yDAAI,CAAA;IACJ,yDAAI,CAAA;IACJ,yEAAY,CAAA;AACb,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,MAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IAE1C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAC,EAAE,CAAC;QACjE,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACxB,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,OAAO,iBAAiB,CAAC,YAAY,CAAC;AACvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getGitRepositoryType.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGitRepositoryType.test.d.ts","sourceRoot":"","sources":["../../src/cli/getGitRepositoryType.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import { getGitRepositoryType, GitRepositoryType, } from "./getGitRepositoryType.js";
3
+ describe(getGitRepositoryType, () => {
4
+ it("returns GitRepositoryType.None when git rev-parse --git-dir has no output", async () => {
5
+ const runner = vi.fn().mockResolvedValueOnce({
6
+ stdout: undefined,
7
+ });
8
+ const actual = await getGitRepositoryType(runner);
9
+ expect(actual).toBe(GitRepositoryType.None);
10
+ });
11
+ it("returns GitRepositoryType.None when git rev-parse --git-dir has a fatal stdout", async () => {
12
+ const runner = vi.fn().mockResolvedValueOnce({
13
+ stdout: "fatal: not a git repository ...",
14
+ });
15
+ const actual = await getGitRepositoryType(runner);
16
+ expect(actual).toBe(GitRepositoryType.None);
17
+ });
18
+ it("returns GitRepositoryType.Root when git rev-parse --git-dir returns just .git", async () => {
19
+ const runner = vi.fn().mockResolvedValueOnce({
20
+ stdout: ".git",
21
+ });
22
+ const actual = await getGitRepositoryType(runner);
23
+ expect(actual).toBe(GitRepositoryType.Root);
24
+ });
25
+ it("returns GitRepositoryType.Subdirectory when git rev-parse --git-dir returns a subdirectory", async () => {
26
+ const runner = vi.fn().mockResolvedValueOnce({
27
+ stdout: "/parent/directory/.git",
28
+ });
29
+ const actual = await getGitRepositoryType(runner);
30
+ expect(actual).toBe(GitRepositoryType.Subdirectory);
31
+ });
32
+ });
33
+ //# sourceMappingURL=getGitRepositoryType.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGitRepositoryType.test.js","sourceRoot":"","sources":["../../src/cli/getGitRepositoryType.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EACN,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,2EAA2E,EAAE,KAAK,IAAI,EAAE;QAC1F,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,MAAM,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,CAAC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"./isInGitRepositoryRoot.js";
3
3
  describe("isInGitRepository", () => {
4
4
  it("returns false when git rev-parse --git-dir has no message", async () => {
5
5
  const runner = vi.fn().mockResolvedValueOnce({
@@ -1 +1 @@
1
- {"version":3,"file":"isInGitRepository.test.js","sourceRoot":"","sources":["../../src/cli/isInGitRepository.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,SAAS;SAClB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE/C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,iCAAiC;SAC1C,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE/C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,KAAK,IAAI,EAAE;QACjF,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,OAAO;SAChB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAA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H,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE/C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { SystemRunner } from "bingo-systems";
2
+ export declare function isInGitRepositoryRoot(runner: SystemRunner): Promise<boolean>;
3
+ //# sourceMappingURL=isInGitRepositoryRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInGitRepositoryRoot.d.ts","sourceRoot":"","sources":["../../src/cli/isInGitRepositoryRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,YAAY,oBAK/D"}
@@ -0,0 +1,7 @@
1
+ export async function isInGitRepositoryRoot(runner) {
2
+ const result = await runner("git rev-parse --git-dir");
3
+ return result.message
4
+ ? !result.message.includes("fatal: not a git repository")
5
+ : false;
6
+ }
7
+ //# sourceMappingURL=isInGitRepositoryRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInGitRepositoryRoot.js","sourceRoot":"","sources":["../../src/cli/isInGitRepositoryRoot.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAoB;IAC/D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,OAAO;QACpB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzD,CAAC,CAAC,KAAK,CAAC;AACV,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isInGitRepositoryRoot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInGitRepositoryRoot.test.d.ts","sourceRoot":"","sources":["../../src/cli/isInGitRepositoryRoot.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import { isInGitRepositoryRoot } from "./getGitRepositoryType.js";
3
+ describe(isInGitRepositoryRoot, () => {
4
+ it("returns false when git rev-parse --git-dir has no message", async () => {
5
+ const runner = vi.fn().mockResolvedValueOnce({
6
+ message: undefined,
7
+ });
8
+ const actual = await isInGitRepositoryRoot(runner);
9
+ expect(actual).toBe(false);
10
+ });
11
+ it("returns false when git rev-parse --git-dir has explicit non-Git stdout", async () => {
12
+ const runner = vi.fn().mockResolvedValueOnce({
13
+ message: "fatal: not a git repository ...",
14
+ });
15
+ const actual = await isInGitRepositoryRoot(runner);
16
+ expect(actual).toBe(false);
17
+ });
18
+ it("returns true when git rev-parse --git-dir has Git-related stdout", async () => {
19
+ const runner = vi.fn().mockResolvedValueOnce({
20
+ message: "/.git",
21
+ });
22
+ const actual = await isInGitRepositoryRoot(runner);
23
+ expect(actual).toBe(true);
24
+ });
25
+ });
26
+ //# sourceMappingURL=isInGitRepositoryRoot.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInGitRepositoryRoot.test.js","sourceRoot":"","sources":["../../src/cli/isInGitRepositoryRoot.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,SAAS;SAClB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAEnD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,iCAAiC;SAC1C,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAEnD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,KAAK,IAAI,EAAE;QACjF,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC;YAC5C,OAAO,EAAE,OAAO;SAChB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAEnD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -19,6 +19,7 @@ export declare function parseProcessArgv(): {
19
19
  mode?: string | boolean | undefined;
20
20
  offline?: string | boolean | undefined;
21
21
  owner?: string | boolean | undefined;
22
+ remote?: string | boolean | undefined;
22
23
  repository?: string | boolean | undefined;
23
24
  "skip-files"?: string | boolean | undefined;
24
25
  "skip-requests"?: string | boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"parseProcessArgv.d.ts","sourceRoot":"","sources":["../../src/cli/parseProcessArgv.ts"],"names":[],"mappings":"AAwCA,MAAM,WAAW,eAAe;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,G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ACvC;AAED,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;EAS/B"}
@@ -15,6 +15,9 @@ const cliArgsOptions = {
15
15
  owner: {
16
16
  type: "string",
17
17
  },
18
+ remote: {
19
+ type: "boolean",
20
+ },
18
21
  repository: {
19
22
  type: "string",
20
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"parseProcessArgv.js","sourceRoot":"","sources":["../../src/cli/parseProcessArgv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,WAAW,CAAC;AAOvD,MAAM,cAAc,GAAG;IACtB,SAAS,EAAE;QACV,IAAI,EAAE,QAAQ;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;KACf;IACD,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;KACf;IACD,KAAK,EAAE;QACN,IAAI,EAAE,QAAQ;KACd;IACD,UAAU,EAAE;QACX,IAAI,EAAE,QAAQ;KACd;IACD,YAAY,EAAE;QACb,IAAI,EAAE,SAAS;KACf;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,SAAS;KACf;IACD,cAAc,EAAE;QACf,IAAI,EAAE,SAAS;KACf;IACD,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;KACf;CACgC,CAAC;AAenC,MAAM,UAAU,gBAAgB;IAC/B,OAAO;QACN,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,SAAS,CAAC;YACZ,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3B,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,KAAK;SACb,CAAC;KACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"parseProcessArgv.js","sourceRoot":"","sources":["../../src/cli/parseProcessArgv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,WAAW,CAAC;AAOvD,MAAM,cAAc,GAAG;IACtB,SAAS,EAAE;QACV,IAAI,EAAE,QAAQ;KACd;IACD,IAAI,EAAE;QACL,IAAI,EAAE,SAAS;KACf;IACD,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;KACd;IACD,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;KACf;IACD,KAAK,EAAE;QACN,IAAI,EAAE,QAAQ;KACd;IACD,MAAM,EAAE;QACP,IAAI,EAAE,SAAS;KACf;IACD,UAAU,EAAE;QACX,IAAI,EAAE,QAAQ;KACd;IACD,YAAY,EAAE;QACb,IAAI,EAAE,SAAS;KACf;IACD,eAAe,EAAE;QAChB,IAAI,EAAE,SAAS;KACf;IACD,cAAc,EAAE;QACf,IAAI,EAAE,SAAS;KACf;IACD,OAAO,EAAE;QACR,IAAI,EAAE,SAAS;KACf;CACgC,CAAC;AAenC,MAAM,UAAU,gBAAgB;IAC/B,OAAO;QACN,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,SAAS,CAAC;YACZ,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3B,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,KAAK;SACb,CAAC;KACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SystemRunner } from "bingo-systems";
2
+ import { RepositoryLocator } from "new-github-repository";
3
+ export declare function prepareGitRepository(locator: RepositoryLocator | undefined, runner: SystemRunner): Promise<void>;
4
+ //# sourceMappingURL=prepareGitRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareGitRepository.d.ts","sourceRoot":"","sources":["../../src/cli/prepareGitRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,MAAM,EAAE,YAAY,iBAKpB"}
@@ -0,0 +1,9 @@
1
+ import { clearLocalGitTags } from "./clearLocalGitTags.js";
2
+ import { createInitialCommit } from "./createInitialCommit.js";
3
+ import { createTrackingBranches } from "./createTrackingBranches.js";
4
+ export async function prepareGitRepository(locator, runner) {
5
+ await createTrackingBranches(locator, runner);
6
+ await createInitialCommit(runner, { push: !!locator });
7
+ await clearLocalGitTags(runner);
8
+ }
9
+ //# sourceMappingURL=prepareGitRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareGitRepository.js","sourceRoot":"","sources":["../../src/cli/prepareGitRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,OAAsC,EACtC,MAAoB;IAEpB,MAAM,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,MAAM,mBAAmB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACvD,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { BingoSystem } from "bingo-systems";
2
+ import { RepositoryLocator } from "new-github-repository";
3
+ import { Template } from "../../types/templates.js";
4
+ import { ClackDisplay } from "../display/createClackDisplay.js";
5
+ export declare function createRemoteRepository(display: ClackDisplay, locator: RepositoryLocator, system: BingoSystem, template: Template): Promise<Error | undefined>;
6
+ //# sourceMappingURL=createRemoteRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRemoteRepository.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/createRemoteRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAuB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIhE,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CA2B5B"}
@@ -0,0 +1,25 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ import { newGitHubRepository } from "new-github-repository";
4
+ import { runSpinnerTask } from "../display/runSpinnerTask.js";
5
+ import { prepareGitRepository } from "../repository/prepareGitRepository.js";
6
+ export async function createRemoteRepository(display, locator, system, template) {
7
+ const remoteDescriptor = `${locator.owner}/${locator.repository}`;
8
+ const creationResult = await runSpinnerTask(display, `Creating repository on GitHub: ${chalk.green(remoteDescriptor)}`, `Created repository on GitHub`, async () => {
9
+ await newGitHubRepository({
10
+ octokit: system.fetchers.octokit,
11
+ owner: locator.owner,
12
+ repository: locator.repository,
13
+ template: template.about?.repository,
14
+ });
15
+ await prepareGitRepository(locator, system.runner);
16
+ });
17
+ if (creationResult instanceof Error) {
18
+ return creationResult;
19
+ }
20
+ prompts.log.step([
21
+ "You've got a new repository ready to use in:",
22
+ ` ${chalk.green(`https://github.com/${remoteDescriptor}`)}`,
23
+ ].join("\n"));
24
+ }
25
+ //# sourceMappingURL=createRemoteRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRemoteRepository.js","sourceRoot":"","sources":["../../../src/cli/remotes/createRemoteRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAI/E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,OAAqB,EACrB,OAA0B,EAC1B,MAAmB,EACnB,QAAkB;IAElB,MAAM,gBAAgB,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAClE,MAAM,cAAc,GAAG,MAAM,cAAc,CAC1C,OAAO,EACP,kCAAkC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,EACjE,8BAA8B,EAC9B,KAAK,IAAwB,EAAE;QAC9B,MAAM,mBAAmB,CAAC;YACzB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO;YAChC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;SACpC,CAAC,CAAC;QACH,MAAM,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC,CACD,CAAC;IAEF,IAAI,cAAc,YAAY,KAAK,EAAE,CAAC;QACrC,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAI,CACf;QACC,8CAA8C;QAC9C,KAAK,KAAK,CAAC,KAAK,CAAC,sBAAsB,gBAAgB,EAAE,CAAC,EAAE;KAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createRemoteRepository.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRemoteRepository.test.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/createRemoteRepository.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,54 @@
1
+ import chalk from "chalk";
2
+ import { describe, expect, it, vi } from "vitest";
3
+ import { createRemoteRepository } from "./createRemoteRepository.js";
4
+ const mockLog = {
5
+ error: vi.fn(),
6
+ step: vi.fn(),
7
+ };
8
+ vi.mock("@clack/prompts", () => ({
9
+ get log() {
10
+ return mockLog;
11
+ },
12
+ }));
13
+ const mockNewGitHubRepository = vi.fn();
14
+ vi.mock("new-github-repository", () => ({
15
+ get newGitHubRepository() {
16
+ return mockNewGitHubRepository;
17
+ },
18
+ }));
19
+ const mockPrepareGitRepository = vi.fn();
20
+ vi.mock("../repository/prepareGitRepository.js", () => ({
21
+ get prepareGitRepository() {
22
+ return mockPrepareGitRepository;
23
+ },
24
+ }));
25
+ const stubDisplay = {
26
+ dumpItems: vi.fn(),
27
+ item: vi.fn(),
28
+ log: vi.fn(),
29
+ spinner: {
30
+ message: vi.fn(),
31
+ start: vi.fn(),
32
+ stop: vi.fn(),
33
+ },
34
+ };
35
+ const stubLocator = { owner: "owner", repository: "repository" };
36
+ const stubSystem = { fetchers: {} };
37
+ describe(createRemoteRepository, () => {
38
+ it("returns the error without logging when creating the remote repository fails", async () => {
39
+ const creationError = new Error("Creation failed.");
40
+ mockNewGitHubRepository.mockRejectedValueOnce(creationError);
41
+ const actual = await createRemoteRepository(stubDisplay, stubLocator, stubSystem, {});
42
+ expect(actual).toBe(creationError);
43
+ expect(mockLog.step).not.toHaveBeenCalled();
44
+ });
45
+ it("logs when creating the remote repository succeeds", async () => {
46
+ const actual = await createRemoteRepository(stubDisplay, stubLocator, stubSystem, {});
47
+ expect(actual).toBe(undefined);
48
+ expect(mockLog.step).toHaveBeenCalledWith([
49
+ "You've got a new repository ready to use in:",
50
+ ` ${chalk.green(`https://github.com/owner/repository`)}`,
51
+ ].join("\n"));
52
+ });
53
+ });
54
+ //# sourceMappingURL=createRemoteRepository.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createRemoteRepository.test.js","sourceRoot":"","sources":["../../../src/cli/remotes/createRemoteRepository.test.ts"],"names":[],"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AAE,YAAY,EAAE,CAAC;AAEjE,MAAM,UAAU,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAiB,CAAC;AAEnD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,6EAA6E,EAAE,KAAK,IAAI,EAAE;QAC5F,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAEpD,uBAAuB,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QAE7D,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAC1C,WAAW,EACX,WAAW,EACX,UAAU,EACV,EAAc,CACd,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAC1C,WAAW,EACX,WAAW,EACX,UAAU,EACV,EAAc,CACd,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,oBAAoB,CACxC;YACC,8CAA8C;YAC9C,KAAK,KAAK,CAAC,KAAK,CAAC,qCAAqC,CAAC,EAAE;SACzD,CAAC,IAAI,CAAC,IAAI,CAAC,CACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SystemRunner } from "bingo-systems";
2
+ import { RepositoryLocator } from "new-github-repository";
3
+ export declare function createTrackingBranches(remote: RepositoryLocator | undefined, runner: SystemRunner): Promise<void>;
4
+ //# sourceMappingURL=createTrackingBranches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/createTrackingBranches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,MAAM,EAAE,YAAY,iBASpB"}
@@ -0,0 +1,7 @@
1
+ export async function createTrackingBranches(remote, runner) {
2
+ await runner("git init");
3
+ if (remote) {
4
+ await runner(`git remote add origin https://github.com/${remote.owner}/${remote.repository}`);
5
+ }
6
+ }
7
+ //# sourceMappingURL=createTrackingBranches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.js","sourceRoot":"","sources":["../../../src/cli/remotes/createTrackingBranches.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,MAAqC,EACrC,MAAoB;IAEpB,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAEzB,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,MAAM,CACX,4CAA4C,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAC/E,CAAC;IACH,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createTrackingBranches.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.test.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/createTrackingBranches.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { describe, expect, test, vi } from "vitest";
2
+ import { createTrackingBranches } from "./createTrackingBranches.js";
3
+ describe("createTrackingBranches", () => {
4
+ test("commands", async () => {
5
+ const runner = vi.fn();
6
+ await createTrackingBranches({ owner: "TestOwner", repository: "test-repository" }, runner);
7
+ expect(runner.mock.calls).toMatchInlineSnapshot(`
8
+ [
9
+ [
10
+ "git init",
11
+ ],
12
+ [
13
+ "git remote add origin https://github.com/TestOwner/test-repository",
14
+ ],
15
+ ]
16
+ `);
17
+ });
18
+ });
19
+ //# sourceMappingURL=createTrackingBranches.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTrackingBranches.test.js","sourceRoot":"","sources":["../../../src/cli/remotes/createTrackingBranches.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;QAC3B,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,sBAAsB,CAC3B,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,EACrD,MAAM,CACN,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;GAS/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { BingoSystem } from "bingo-systems";
2
+ import { RepositoryLocator } from "new-github-repository";
3
+ import { Template } from "../../types/templates.js";
4
+ import { ClackDisplay } from "../display/createClackDisplay.js";
5
+ import { PartialRepositoryLocator } from "./types.js";
6
+ export interface RemoteRepositoryRequest {
7
+ offline?: boolean | undefined;
8
+ remote?: boolean | undefined;
9
+ }
10
+ export interface ResolvedRemoteMessage {
11
+ level: "step" | "warn";
12
+ text: string;
13
+ }
14
+ export interface ResolvedRemoteRepository {
15
+ message?: ResolvedRemoteMessage | undefined;
16
+ remote: Error | RepositoryLocator | undefined;
17
+ }
18
+ export declare function resolveRemoteRepository(display: ClackDisplay, locator: PartialRepositoryLocator, request: RemoteRepositoryRequest, system: BingoSystem, template: Template): Promise<ResolvedRemoteRepository>;
19
+ //# sourceMappingURL=resolveRemoteRepository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRemoteRepository.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/resolveRemoteRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAQhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACvC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,wBAAwB;IACxC,OAAO,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,KAAK,GAAG,iBAAiB,GAAG,SAAS,CAAC;CAC9C;AAED,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,wBAAwB,CAAC,CA6EnC"}
@@ -0,0 +1,58 @@
1
+ import { getGitRepositoryType, GitRepositoryType, } from "../getGitRepositoryType.js";
2
+ import { createRemoteRepository } from "./createRemoteRepository.js";
3
+ import { resolveRemoteRepositoryFromOrigin } from "./resolveRemoteRepositoryFromOrigin.js";
4
+ import { resolveRemoteRepositoryToCreate } from "./resolveRemoteRepositoryToCreate.js";
5
+ export async function resolveRemoteRepository(display, locator, request, system, template) {
6
+ if (request.offline) {
7
+ return {
8
+ remote: request.remote
9
+ ? new Error("--offline cannot be combined with --remote.")
10
+ : undefined,
11
+ };
12
+ }
13
+ const gitRepositoryType = await getGitRepositoryType(system.runner);
14
+ if (gitRepositoryType === GitRepositoryType.Subdirectory) {
15
+ return {
16
+ remote: request.remote
17
+ ? new Error("--remote can only be used when in a non-Git directory or in the root of a Git directory.")
18
+ : undefined,
19
+ };
20
+ }
21
+ const origin = gitRepositoryType === GitRepositoryType.Root &&
22
+ (await resolveRemoteRepositoryFromOrigin(system.runner));
23
+ if (origin) {
24
+ if (request.remote) {
25
+ return {
26
+ remote: new Error("--remote requested, but an origin remote already exists."),
27
+ };
28
+ }
29
+ return {
30
+ message: {
31
+ level: "step",
32
+ text: `Detected existing remote origin repository`,
33
+ },
34
+ remote: origin,
35
+ };
36
+ }
37
+ if (!request.remote) {
38
+ return {
39
+ remote: undefined,
40
+ };
41
+ }
42
+ if (!system.fetchers.octokit) {
43
+ return {
44
+ remote: new Error("--remote requested, but no existing repository or GitHub authentication found. Please log in with the GitHub CLI or set a GH_AUTH env variable."),
45
+ };
46
+ }
47
+ const creationLocator = await resolveRemoteRepositoryToCreate(locator, system, template);
48
+ if (creationLocator instanceof Error) {
49
+ return {
50
+ remote: creationLocator,
51
+ };
52
+ }
53
+ const creationError = await createRemoteRepository(display, creationLocator, system, template);
54
+ return {
55
+ remote: creationError ?? creationLocator,
56
+ };
57
+ }
58
+ //# sourceMappingURL=resolveRemoteRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRemoteRepository.js","sourceRoot":"","sources":["../../../src/cli/remotes/resolveRemoteRepository.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CA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CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO;YACN,MAAM,EAAE,IAAI,KAAK,CAChB,iJAAiJ,CACjJ;SACD,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,+BAA+B,CAC5D,OAAO,EACP,MAAM,EACN,QAAQ,CACR,CAAC;IACF,IAAI,eAAe,YAAY,KAAK,EAAE,CAAC;QACtC,OAAO;YACN,MAAM,EAAE,eAAe;SACvB,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,sBAAsB,CACjD,OAAO,EACP,eAAe,EACf,MAAM,EACN,QAAQ,CACR,CAAC;IAEF,OAAO;QACN,MAAM,EAAE,aAAa,IAAI,eAAe;KACxC,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resolveRemoteRepository.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRemoteRepository.test.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/resolveRemoteRepository.test.ts"],"names":[],"mappings":""}