bingo 0.8.2 → 0.9.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.
- package/lib/cli/createTrackingBranches.d.ts +4 -0
- package/lib/cli/createTrackingBranches.d.ts.map +1 -0
- package/lib/cli/createTrackingBranches.js +7 -0
- package/lib/cli/createTrackingBranches.js.map +1 -0
- package/lib/cli/createTrackingBranches.test.d.ts +2 -0
- package/lib/cli/createTrackingBranches.test.d.ts.map +1 -0
- package/lib/cli/createTrackingBranches.test.js +19 -0
- package/lib/cli/createTrackingBranches.test.js.map +1 -0
- package/lib/cli/display/runSpinnerTask.d.ts +1 -1
- package/lib/cli/getGitRepositoryType.d.ts +8 -0
- package/lib/cli/getGitRepositoryType.d.ts.map +1 -0
- package/lib/cli/getGitRepositoryType.js +18 -0
- package/lib/cli/getGitRepositoryType.js.map +1 -0
- package/lib/cli/getGitRepositoryType.test.d.ts +2 -0
- package/lib/cli/getGitRepositoryType.test.d.ts.map +1 -0
- package/lib/cli/getGitRepositoryType.test.js +33 -0
- package/lib/cli/getGitRepositoryType.test.js.map +1 -0
- package/lib/cli/isInGitRepository.test.js +1 -1
- package/lib/cli/isInGitRepository.test.js.map +1 -1
- package/lib/cli/isInGitRepositoryRoot.d.ts +3 -0
- package/lib/cli/isInGitRepositoryRoot.d.ts.map +1 -0
- package/lib/cli/isInGitRepositoryRoot.js +7 -0
- package/lib/cli/isInGitRepositoryRoot.js.map +1 -0
- package/lib/cli/isInGitRepositoryRoot.test.d.ts +2 -0
- package/lib/cli/isInGitRepositoryRoot.test.d.ts.map +1 -0
- package/lib/cli/isInGitRepositoryRoot.test.js +26 -0
- package/lib/cli/isInGitRepositoryRoot.test.js.map +1 -0
- package/lib/cli/parseProcessArgv.d.ts +1 -0
- package/lib/cli/parseProcessArgv.d.ts.map +1 -1
- package/lib/cli/parseProcessArgv.js +3 -0
- package/lib/cli/parseProcessArgv.js.map +1 -1
- package/lib/cli/prepareGitRepository.d.ts +4 -0
- package/lib/cli/prepareGitRepository.d.ts.map +1 -0
- package/lib/cli/prepareGitRepository.js +9 -0
- package/lib/cli/prepareGitRepository.js.map +1 -0
- package/lib/cli/remotes/createRemoteRepository.d.ts +6 -0
- package/lib/cli/remotes/createRemoteRepository.d.ts.map +1 -0
- package/lib/cli/remotes/createRemoteRepository.js +25 -0
- package/lib/cli/remotes/createRemoteRepository.js.map +1 -0
- package/lib/cli/remotes/createRemoteRepository.test.d.ts +2 -0
- package/lib/cli/remotes/createRemoteRepository.test.d.ts.map +1 -0
- package/lib/cli/remotes/createRemoteRepository.test.js +54 -0
- package/lib/cli/remotes/createRemoteRepository.test.js.map +1 -0
- package/lib/cli/remotes/createTrackingBranches.d.ts +4 -0
- package/lib/cli/remotes/createTrackingBranches.d.ts.map +1 -0
- package/lib/cli/remotes/createTrackingBranches.js +7 -0
- package/lib/cli/remotes/createTrackingBranches.js.map +1 -0
- package/lib/cli/remotes/createTrackingBranches.test.d.ts +2 -0
- package/lib/cli/remotes/createTrackingBranches.test.d.ts.map +1 -0
- package/lib/cli/remotes/createTrackingBranches.test.js +19 -0
- package/lib/cli/remotes/createTrackingBranches.test.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepository.d.ts +19 -0
- package/lib/cli/remotes/resolveRemoteRepository.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepository.js +58 -0
- package/lib/cli/remotes/resolveRemoteRepository.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepository.test.d.ts +2 -0
- package/lib/cli/remotes/resolveRemoteRepository.test.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepository.test.js +148 -0
- package/lib/cli/remotes/resolveRemoteRepository.test.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.d.ts +4 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.js +14 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts +2 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.js +23 -0
- package/lib/cli/remotes/resolveRemoteRepositoryFromOrigin.test.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.d.ts +5 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.js +26 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.js.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.d.ts +2 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.js +82 -0
- package/lib/cli/remotes/resolveRemoteRepositoryToCreate.test.js.map +1 -0
- package/lib/cli/remotes/resolveRepository.d.ts +19 -0
- package/lib/cli/remotes/resolveRepository.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRepository.js +58 -0
- package/lib/cli/remotes/resolveRepository.js.map +1 -0
- package/lib/cli/remotes/resolveRepository.test.d.ts +2 -0
- package/lib/cli/remotes/resolveRepository.test.d.ts.map +1 -0
- package/lib/cli/remotes/resolveRepository.test.js +148 -0
- package/lib/cli/remotes/resolveRepository.test.js.map +1 -0
- package/lib/cli/remotes/types.d.ts +5 -0
- package/lib/cli/remotes/types.d.ts.map +1 -0
- package/lib/cli/remotes/types.js +2 -0
- package/lib/cli/remotes/types.js.map +1 -0
- package/lib/cli/repository/clearLocalGitTags.d.ts +3 -0
- package/lib/cli/repository/clearLocalGitTags.d.ts.map +1 -0
- package/lib/cli/repository/clearLocalGitTags.js +7 -0
- package/lib/cli/repository/clearLocalGitTags.js.map +1 -0
- package/lib/cli/repository/clearLocalGitTags.test.d.ts +2 -0
- package/lib/cli/repository/clearLocalGitTags.test.d.ts.map +1 -0
- package/lib/cli/repository/clearLocalGitTags.test.js +16 -0
- package/lib/cli/repository/clearLocalGitTags.test.js.map +1 -0
- package/lib/cli/repository/createInitialCommit.d.ts +7 -0
- package/lib/cli/repository/createInitialCommit.d.ts.map +1 -0
- package/lib/cli/repository/createInitialCommit.js +10 -0
- package/lib/cli/repository/createInitialCommit.js.map +1 -0
- package/lib/cli/repository/createInitialCommit.test.d.ts +2 -0
- package/lib/cli/repository/createInitialCommit.test.d.ts.map +1 -0
- package/lib/cli/repository/createInitialCommit.test.js +50 -0
- package/lib/cli/repository/createInitialCommit.test.js.map +1 -0
- package/lib/cli/repository/createTrackingBranches.d.ts +4 -0
- package/lib/cli/repository/createTrackingBranches.d.ts.map +1 -0
- package/lib/cli/repository/createTrackingBranches.js +7 -0
- package/lib/cli/repository/createTrackingBranches.js.map +1 -0
- package/lib/cli/repository/createTrackingBranches.test.d.ts +2 -0
- package/lib/cli/repository/createTrackingBranches.test.d.ts.map +1 -0
- package/lib/cli/repository/createTrackingBranches.test.js +19 -0
- package/lib/cli/repository/createTrackingBranches.test.js.map +1 -0
- package/lib/cli/repository/prepareGitRepository.d.ts +4 -0
- package/lib/cli/repository/prepareGitRepository.d.ts.map +1 -0
- package/lib/cli/repository/prepareGitRepository.js +9 -0
- package/lib/cli/repository/prepareGitRepository.js.map +1 -0
- package/lib/cli/repository/prepareGitRepository.test.d.ts +2 -0
- package/lib/cli/repository/prepareGitRepository.test.d.ts.map +1 -0
- package/lib/cli/repository/prepareGitRepository.test.js +32 -0
- package/lib/cli/repository/prepareGitRepository.test.js.map +1 -0
- package/lib/cli/repository/resolveLocalRepository.d.ts +21 -0
- package/lib/cli/repository/resolveLocalRepository.d.ts.map +1 -0
- package/lib/cli/repository/resolveLocalRepository.js +57 -0
- package/lib/cli/repository/resolveLocalRepository.js.map +1 -0
- package/lib/cli/repository/resolveLocalRepository.test.d.ts +2 -0
- package/lib/cli/repository/resolveLocalRepository.test.d.ts.map +1 -0
- package/lib/cli/repository/resolveLocalRepository.test.js +167 -0
- package/lib/cli/repository/resolveLocalRepository.test.js.map +1 -0
- package/lib/cli/repository/resolveRepository.d.ts +21 -0
- package/lib/cli/repository/resolveRepository.d.ts.map +1 -0
- package/lib/cli/repository/resolveRepository.js +57 -0
- package/lib/cli/repository/resolveRepository.js.map +1 -0
- package/lib/cli/repository/resolveRepository.test.d.ts +2 -0
- package/lib/cli/repository/resolveRepository.test.d.ts.map +1 -0
- package/lib/cli/repository/resolveRepository.test.js +148 -0
- package/lib/cli/repository/resolveRepository.test.js.map +1 -0
- package/lib/cli/runCLI.d.ts +3 -4
- package/lib/cli/runCLI.d.ts.map +1 -1
- package/lib/cli/runCLI.js +2 -0
- package/lib/cli/runCLI.js.map +1 -1
- package/lib/cli/runTemplateCLI.d.ts +1 -4
- package/lib/cli/runTemplateCLI.d.ts.map +1 -1
- package/lib/cli/runTemplateCLI.js +0 -2
- package/lib/cli/runTemplateCLI.js.map +1 -1
- package/lib/cli/setup/createRepositoryOnGitHub.d.ts +0 -1
- package/lib/cli/setup/createRepositoryOnGitHub.d.ts.map +1 -1
- package/lib/cli/setup/createRepositoryOnGitHub.js.map +1 -1
- package/lib/cli/setup/createTrackingBranches.d.ts +1 -1
- package/lib/cli/setup/createTrackingBranches.d.ts.map +1 -1
- package/lib/cli/setup/createTrackingBranches.js.map +1 -1
- package/lib/cli/setup/getRemoteRepository.d.ts +2 -0
- package/lib/cli/setup/getRemoteRepository.d.ts.map +1 -0
- package/lib/cli/setup/getRemoteRepository.js +2 -0
- package/lib/cli/setup/getRemoteRepository.js.map +1 -0
- package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts +4 -0
- package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts.map +1 -0
- package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js +15 -0
- package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js.map +1 -0
- package/lib/cli/setup/remotes/createRemoteRepository.d.ts +5 -0
- package/lib/cli/setup/remotes/createRemoteRepository.d.ts.map +1 -0
- package/lib/cli/setup/remotes/createRemoteRepository.js +16 -0
- package/lib/cli/setup/remotes/createRemoteRepository.js.map +1 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts +6 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts.map +1 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.js +36 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.js.map +1 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts +2 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts.map +1 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js +157 -0
- package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js.map +1 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts +4 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js +14 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js.map +1 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts +2 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js +23 -0
- package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts +18 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.js +47 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts +2 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.test.js +103 -0
- package/lib/cli/setup/remotes/resolveRemoteRepository.test.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts +4 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js +14 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts +2 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js +23 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts +5 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js +26 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts +2 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts.map +1 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js +82 -0
- package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js.map +1 -0
- package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts +3 -0
- package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts.map +1 -0
- package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js +9 -0
- package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js.map +1 -0
- package/lib/cli/setup/remotes/types.d.ts +5 -0
- package/lib/cli/setup/remotes/types.d.ts.map +1 -0
- package/lib/cli/setup/remotes/types.js +2 -0
- package/lib/cli/setup/remotes/types.js.map +1 -0
- package/lib/cli/setup/resolveExistingRemote.d.ts +2 -0
- package/lib/cli/setup/resolveExistingRemote.d.ts.map +1 -0
- package/lib/cli/setup/resolveExistingRemote.js +2 -0
- package/lib/cli/setup/resolveExistingRemote.js.map +1 -0
- package/lib/cli/setup/resolveRemoteRepository.d.ts +26 -0
- package/lib/cli/setup/resolveRemoteRepository.d.ts.map +1 -0
- package/lib/cli/setup/resolveRemoteRepository.js +49 -0
- package/lib/cli/setup/resolveRemoteRepository.js.map +1 -0
- package/lib/cli/setup/runModeSetup.d.ts +4 -4
- package/lib/cli/setup/runModeSetup.d.ts.map +1 -1
- package/lib/cli/setup/runModeSetup.js +24 -39
- package/lib/cli/setup/runModeSetup.js.map +1 -1
- package/lib/cli/setup/runModeSetup.test.js +128 -68
- package/lib/cli/setup/runModeSetup.test.js.map +1 -1
- package/lib/cli/transition/runModeTransition.d.ts +4 -4
- package/lib/cli/transition/runModeTransition.d.ts.map +1 -1
- package/lib/cli/transition/runModeTransition.js +26 -18
- package/lib/cli/transition/runModeTransition.js.map +1 -1
- package/lib/cli/transition/runModeTransition.test.js +105 -16
- package/lib/cli/transition/runModeTransition.test.js.map +1 -1
- package/lib/predicates/isTemplate.d.ts +1 -2
- package/lib/predicates/isTemplate.d.ts.map +1 -1
- package/lib/predicates/isTemplate.js.map +1 -1
- package/lib/types/templates.d.ts +2 -1
- package/lib/types/templates.d.ts.map +1 -1
- package/lib/utils/tryCatch.d.ts +2 -1
- package/lib/utils/tryCatch.d.ts.map +1 -1
- package/lib/utils/tryCatch.js +8 -0
- package/lib/utils/tryCatch.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/remotes/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cli/remotes/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearLocalGitTags.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/clearLocalGitTags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,iBAM3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearLocalGitTags.js","sourceRoot":"","sources":["../../../src/cli/repository/clearLocalGitTags.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAoB;IAC3D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IAExC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACjB,MAAM,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearLocalGitTags.test.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/clearLocalGitTags.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { clearLocalGitTags } from "./clearLocalGitTags.js";
|
|
3
|
+
describe("clearLocalGitTags", () => {
|
|
4
|
+
it("deletes tags when git tag -l has stdout", async () => {
|
|
5
|
+
const runner = vi.fn().mockResolvedValueOnce({ stdout: "a\nb\nc" });
|
|
6
|
+
await clearLocalGitTags(runner);
|
|
7
|
+
expect(runner).toHaveBeenCalledTimes(2);
|
|
8
|
+
expect(runner).toHaveBeenCalledWith(`git tag -d a b c`);
|
|
9
|
+
});
|
|
10
|
+
it("does not attempt to delete tags when git tag -l has no stdout", async () => {
|
|
11
|
+
const runner = vi.fn().mockResolvedValueOnce({ stdout: "" });
|
|
12
|
+
await clearLocalGitTags(runner);
|
|
13
|
+
expect(runner).toHaveBeenCalledTimes(1);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=clearLocalGitTags.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearLocalGitTags.test.js","sourceRoot":"","sources":["../../../src/cli/repository/clearLocalGitTags.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,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAEpE,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAEhC,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,MAAM,CAAC,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;QAC9E,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAE7D,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAEhC,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SystemRunner } from "bingo-systems";
|
|
2
|
+
export interface CreateInitialCommitSettings {
|
|
3
|
+
amend?: boolean;
|
|
4
|
+
push: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function createInitialCommit(runner: SystemRunner, { amend, push }: CreateInitialCommitSettings): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=createInitialCommit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInitialCommit.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/createInitialCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,WAAW,2BAA2B;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACd;AAED,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,YAAY,EACpB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,2BAA2B,iBAS5C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export async function createInitialCommit(runner, { amend, push }) {
|
|
2
|
+
for (const command of [
|
|
3
|
+
`git add -A`,
|
|
4
|
+
`git commit --message feat:\\ initialized\\ repo\\ ✨ ${amend ? "--amend " : ""}--no-gpg-sign`,
|
|
5
|
+
...(push ? [`git push -u origin main --force`] : []),
|
|
6
|
+
]) {
|
|
7
|
+
await runner(command);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=createInitialCommit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInitialCommit.js","sourceRoot":"","sources":["../../../src/cli/repository/createInitialCommit.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,MAAoB,EACpB,EAAE,KAAK,EAAE,IAAI,EAA+B;IAE5C,KAAK,MAAM,OAAO,IAAI;QACrB,YAAY;QACZ,uDAAuD,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,eAAe;QAC7F,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,EAAE,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInitialCommit.test.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/createInitialCommit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
|
+
import { createInitialCommit } from "./createInitialCommit.js";
|
|
3
|
+
describe("createInitialCommit", () => {
|
|
4
|
+
test("runs without --amend when amend is falsy", async () => {
|
|
5
|
+
const runner = vi.fn();
|
|
6
|
+
await createInitialCommit(runner, { push: false });
|
|
7
|
+
expect(runner.mock.calls).toMatchInlineSnapshot(`
|
|
8
|
+
[
|
|
9
|
+
[
|
|
10
|
+
"git add -A",
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"git commit --message feat:\\ initialized\\ repo\\ ✨ --no-gpg-sign",
|
|
14
|
+
],
|
|
15
|
+
]
|
|
16
|
+
`);
|
|
17
|
+
});
|
|
18
|
+
test("runs with --amend when amend is true", async () => {
|
|
19
|
+
const runner = vi.fn();
|
|
20
|
+
await createInitialCommit(runner, { amend: true, push: false });
|
|
21
|
+
expect(runner.mock.calls).toMatchInlineSnapshot(`
|
|
22
|
+
[
|
|
23
|
+
[
|
|
24
|
+
"git add -A",
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"git commit --message feat:\\ initialized\\ repo\\ ✨ --amend --no-gpg-sign",
|
|
28
|
+
],
|
|
29
|
+
]
|
|
30
|
+
`);
|
|
31
|
+
});
|
|
32
|
+
test("pushes to the remote when push is true", async () => {
|
|
33
|
+
const runner = vi.fn();
|
|
34
|
+
await createInitialCommit(runner, { push: true });
|
|
35
|
+
expect(runner.mock.calls).toMatchInlineSnapshot(`
|
|
36
|
+
[
|
|
37
|
+
[
|
|
38
|
+
"git add -A",
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"git commit --message feat:\\ initialized\\ repo\\ ✨ --no-gpg-sign",
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"git push -u origin main --force",
|
|
45
|
+
],
|
|
46
|
+
]
|
|
47
|
+
`);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=createInitialCommit.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInitialCommit.test.js","sourceRoot":"","sources":["../../../src/cli/repository/createInitialCommit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,IAAI,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,mBAAmB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEnD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;GAS/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,mBAAmB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEhE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;GAS/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,mBAAmB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAElD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;GAY/C,CAAC,CAAC;IACJ,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/repository/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 @@
|
|
|
1
|
+
{"version":3,"file":"createTrackingBranches.js","sourceRoot":"","sources":["../../../src/cli/repository/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 @@
|
|
|
1
|
+
{"version":3,"file":"createTrackingBranches.test.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/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/repository/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,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/repository/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/repository/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 @@
|
|
|
1
|
+
{"version":3,"file":"prepareGitRepository.test.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/prepareGitRepository.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { prepareGitRepository } from "./prepareGitRepository.js";
|
|
3
|
+
const mockCreateInitialCommit = vi.fn();
|
|
4
|
+
vi.mock("./createInitialCommit.js", () => ({
|
|
5
|
+
get createInitialCommit() {
|
|
6
|
+
return mockCreateInitialCommit;
|
|
7
|
+
},
|
|
8
|
+
}));
|
|
9
|
+
vi.mock("./createTrackingBranches.js", () => ({
|
|
10
|
+
createTrackingBranches: vi.fn(),
|
|
11
|
+
}));
|
|
12
|
+
vi.mock("./clearLocalGitTags.js", () => ({
|
|
13
|
+
clearLocalGitTags: vi.fn(),
|
|
14
|
+
}));
|
|
15
|
+
describe(prepareGitRepository, () => {
|
|
16
|
+
it("pushes in createInitialCommit when locator is defined", async () => {
|
|
17
|
+
const runner = vi.fn();
|
|
18
|
+
const locator = { owner: "TestOwner", repository: "test-repository" };
|
|
19
|
+
await prepareGitRepository(locator, runner);
|
|
20
|
+
expect(mockCreateInitialCommit).toHaveBeenCalledWith(runner, {
|
|
21
|
+
push: true,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
it("does not push in createInitialCommit when locator is not defined", async () => {
|
|
25
|
+
const runner = vi.fn();
|
|
26
|
+
await prepareGitRepository(undefined, runner);
|
|
27
|
+
expect(mockCreateInitialCommit).toHaveBeenCalledWith(runner, {
|
|
28
|
+
push: false,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=prepareGitRepository.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareGitRepository.test.js","sourceRoot":"","sources":["../../../src/cli/repository/prepareGitRepository.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,uBAAuB,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;AAExC,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1C,IAAI,mBAAmB;QACtB,OAAO,uBAAuB,CAAC;IAChC,CAAC;CACD,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7C,sBAAsB,EAAE,EAAE,CAAC,EAAE,EAAE;CAC/B,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACxC,iBAAiB,EAAE,EAAE,CAAC,EAAE,EAAE;CAC1B,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;QAEtE,MAAM,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAE5C,MAAM,CAAC,uBAAuB,CAAC,CAAC,oBAAoB,CAAC,MAAM,EAAE;YAC5D,IAAI,EAAE,IAAI;SACV,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,KAAK,IAAI,EAAE;QACjF,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAEvB,MAAM,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAE9C,MAAM,CAAC,uBAAuB,CAAC,CAAC,oBAAoB,CAAC,MAAM,EAAE;YAC5D,IAAI,EAAE,KAAK;SACX,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { GitRepositoryType } from "../getGitRepositoryType.js";
|
|
6
|
+
import { PartialRepositoryLocator } from "../remotes/types.js";
|
|
7
|
+
export interface RemoteRepositoryRequest {
|
|
8
|
+
offline?: boolean | undefined;
|
|
9
|
+
remote?: boolean | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvedRemoteMessage {
|
|
12
|
+
level: "step" | "warn";
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolvedRepository {
|
|
16
|
+
message?: ResolvedRemoteMessage | undefined;
|
|
17
|
+
remote: Error | RepositoryLocator | undefined;
|
|
18
|
+
repositoryType: GitRepositoryType;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveLocalRepository(display: ClackDisplay, locator: PartialRepositoryLocator, request: RemoteRepositoryRequest, system: BingoSystem, template: Template): Promise<ResolvedRepository>;
|
|
21
|
+
//# sourceMappingURL=resolveLocalRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocalRepository.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/resolveLocalRepository.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;AAChE,OAAO,EAEN,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,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,kBAAkB;IAClC,OAAO,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,KAAK,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC9C,cAAc,EAAE,iBAAiB,CAAC;CAClC;AAED,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA6E7B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getGitRepositoryType, GitRepositoryType, } from "../getGitRepositoryType.js";
|
|
2
|
+
import { createRemoteRepository } from "../remotes/createRemoteRepository.js";
|
|
3
|
+
import { resolveRemoteRepositoryFromOrigin } from "../remotes/resolveRemoteRepositoryFromOrigin.js";
|
|
4
|
+
import { resolveRemoteRepositoryToCreate } from "../remotes/resolveRemoteRepositoryToCreate.js";
|
|
5
|
+
export async function resolveLocalRepository(display, locator, request, system, template) {
|
|
6
|
+
const repositoryType = await getGitRepositoryType(system.runner);
|
|
7
|
+
if (request.offline) {
|
|
8
|
+
return {
|
|
9
|
+
remote: request.remote
|
|
10
|
+
? new Error("--offline cannot be combined with --remote.")
|
|
11
|
+
: undefined,
|
|
12
|
+
repositoryType,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
if (repositoryType === GitRepositoryType.Subdirectory) {
|
|
16
|
+
return {
|
|
17
|
+
remote: request.remote
|
|
18
|
+
? new Error("--remote can only be used when in a non-Git directory or in the root of a Git directory.")
|
|
19
|
+
: undefined,
|
|
20
|
+
repositoryType,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const origin = repositoryType === GitRepositoryType.Root &&
|
|
24
|
+
(await resolveRemoteRepositoryFromOrigin(system.runner));
|
|
25
|
+
if (origin) {
|
|
26
|
+
if (request.remote) {
|
|
27
|
+
return {
|
|
28
|
+
remote: new Error("--remote requested, but an origin remote already exists."),
|
|
29
|
+
repositoryType,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
message: {
|
|
34
|
+
level: "step",
|
|
35
|
+
text: `Detected existing remote origin repository`,
|
|
36
|
+
},
|
|
37
|
+
remote: origin,
|
|
38
|
+
repositoryType,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (!request.remote) {
|
|
42
|
+
return { remote: undefined, repositoryType };
|
|
43
|
+
}
|
|
44
|
+
if (!system.fetchers.octokit) {
|
|
45
|
+
return {
|
|
46
|
+
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."),
|
|
47
|
+
repositoryType,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const creationLocator = await resolveRemoteRepositoryToCreate(locator, system, template);
|
|
51
|
+
if (creationLocator instanceof Error) {
|
|
52
|
+
return { remote: creationLocator, repositoryType };
|
|
53
|
+
}
|
|
54
|
+
const creationError = await createRemoteRepository(display, creationLocator, system, template);
|
|
55
|
+
return { remote: creationError ?? creationLocator, repositoryType };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=resolveLocalRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocalRepository.js","sourceRoot":"","sources":["../../../src/cli/repository/resolveLocalRepository.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AACpG,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAmBhG,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,OAAqB,EACrB,OAAiC,EACjC,OAAgC,EAChC,MAAmB,EACnB,QAAkB;IAElB,MAAM,cAAc,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEjE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO;YACN,MAAM,EAAE,OAAO,CAAC,MAAM;gBACrB,CAAC,CAAC,IAAI,KAAK,CAAC,6CAA6C,CAAC;gBAC1D,CAAC,CAAC,SAAS;YACZ,cAAc;SACd,CAAC;IACH,CAAC;IAED,IAAI,cAAc,KAAK,iBAAiB,CAAC,YAAY,EAAE,CAAC;QACvD,OAAO;YACN,MAAM,EAAE,OAAO,CAAC,MAAM;gBACrB,CAAC,CAAC,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ocalRepository.test.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/resolveLocalRepository.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { GitRepositoryType } from "../getGitRepositoryType.js";
|
|
3
|
+
import { resolveLocalRepository } from "./resolveLocalRepository.js";
|
|
4
|
+
const mockGetGitRepositoryType = vi.fn();
|
|
5
|
+
vi.mock("../getGitRepositoryType.js", async () => ({
|
|
6
|
+
...(await vi.importActual("../getGitRepositoryType.js")),
|
|
7
|
+
get getGitRepositoryType() {
|
|
8
|
+
return mockGetGitRepositoryType;
|
|
9
|
+
},
|
|
10
|
+
}));
|
|
11
|
+
const mockCreateRemoteRepository = vi.fn();
|
|
12
|
+
vi.mock("../remotes/createRemoteRepository.js", () => ({
|
|
13
|
+
get createRemoteRepository() {
|
|
14
|
+
return mockCreateRemoteRepository;
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
17
|
+
const mockResolveRemoteRepositoryFromOrigin = vi.fn();
|
|
18
|
+
vi.mock("../remotes/resolveRemoteRepositoryFromOrigin.js", () => ({
|
|
19
|
+
get resolveRemoteRepositoryFromOrigin() {
|
|
20
|
+
return mockResolveRemoteRepositoryFromOrigin;
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
const mockResolveRemoteRepositoryToCreate = vi.fn();
|
|
24
|
+
vi.mock("../remotes/resolveRemoteRepositoryToCreate.js", () => ({
|
|
25
|
+
get resolveRemoteRepositoryToCreate() {
|
|
26
|
+
return mockResolveRemoteRepositoryToCreate;
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
const stubOrigin = "stub-origin";
|
|
30
|
+
const stubRepository = "stub-repository";
|
|
31
|
+
const stubDisplay = {
|
|
32
|
+
dumpItems: vi.fn(),
|
|
33
|
+
item: vi.fn(),
|
|
34
|
+
log: vi.fn(),
|
|
35
|
+
spinner: {
|
|
36
|
+
message: vi.fn(),
|
|
37
|
+
start: vi.fn(),
|
|
38
|
+
stop: vi.fn(),
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
describe(resolveLocalRepository, () => {
|
|
42
|
+
it("returns a remote error when both requests.remote and offline are true", async () => {
|
|
43
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
44
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { offline: true, remote: true }, {}, {});
|
|
45
|
+
expect(actual).toEqual({
|
|
46
|
+
remote: new Error("--offline cannot be combined with --remote."),
|
|
47
|
+
repositoryType: GitRepositoryType.Root,
|
|
48
|
+
});
|
|
49
|
+
expect(mockResolveRemoteRepositoryFromOrigin).not.toHaveBeenCalled();
|
|
50
|
+
});
|
|
51
|
+
it("returns no remote when requests.remote is falsy and offline is true", async () => {
|
|
52
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
53
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { offline: true, remote: false }, {}, {});
|
|
54
|
+
expect(actual).toEqual({
|
|
55
|
+
remote: undefined,
|
|
56
|
+
repositoryType: GitRepositoryType.Root,
|
|
57
|
+
});
|
|
58
|
+
expect(mockResolveRemoteRepositoryFromOrigin).not.toHaveBeenCalled();
|
|
59
|
+
});
|
|
60
|
+
it("returns no remote when in a Git subdirectory and request.remote is falsy", async () => {
|
|
61
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Subdirectory);
|
|
62
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, {}, {}, {});
|
|
63
|
+
expect(actual).toEqual({
|
|
64
|
+
remote: undefined,
|
|
65
|
+
repositoryType: GitRepositoryType.Subdirectory,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
it("returns a remote error when in a Git subdirectory and request.remote is true", async () => {
|
|
69
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Subdirectory);
|
|
70
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, {}, {});
|
|
71
|
+
expect(actual).toEqual({
|
|
72
|
+
remote: new Error("--remote can only be used when in a non-Git directory or in the root of a Git directory."),
|
|
73
|
+
repositoryType: GitRepositoryType.Subdirectory,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
it("returns the origin when it already exists and request.remote is falsy", async () => {
|
|
77
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
78
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce({
|
|
79
|
+
owner: stubOrigin,
|
|
80
|
+
repository: stubRepository,
|
|
81
|
+
});
|
|
82
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, {}, {}, {});
|
|
83
|
+
expect(actual).toEqual({
|
|
84
|
+
message: {
|
|
85
|
+
level: "step",
|
|
86
|
+
text: `Detected existing remote origin repository`,
|
|
87
|
+
},
|
|
88
|
+
remote: {
|
|
89
|
+
owner: stubOrigin,
|
|
90
|
+
repository: stubRepository,
|
|
91
|
+
},
|
|
92
|
+
repositoryType: GitRepositoryType.Root,
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
it("returns an error when an origin already exists and request.remote is true", async () => {
|
|
96
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
97
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce({
|
|
98
|
+
owner: stubOrigin,
|
|
99
|
+
repository: stubRepository,
|
|
100
|
+
});
|
|
101
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, {}, {});
|
|
102
|
+
expect(actual).toEqual({
|
|
103
|
+
remote: new Error("--remote requested, but an origin remote already exists."),
|
|
104
|
+
repositoryType: GitRepositoryType.Root,
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
it("returns no remote when there is no existing origin and both requests.remote and offline are falsy", async () => {
|
|
108
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
109
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce(undefined);
|
|
110
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, {}, {}, {});
|
|
111
|
+
expect(actual).toEqual({
|
|
112
|
+
remote: undefined,
|
|
113
|
+
repositoryType: GitRepositoryType.Root,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
it("returns a remote error when there is no existing origin, requests.remote is true, and there is no Octokit fetcher", async () => {
|
|
117
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
118
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce(undefined);
|
|
119
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, { fetchers: {} }, {});
|
|
120
|
+
expect(actual).toEqual({
|
|
121
|
+
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."),
|
|
122
|
+
repositoryType: GitRepositoryType.Root,
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
it("returns the error when resolving a remote repository to create fails", async () => {
|
|
126
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
127
|
+
const creationLocator = new Error("Could not create remote.");
|
|
128
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce(undefined);
|
|
129
|
+
mockResolveRemoteRepositoryToCreate.mockResolvedValueOnce(creationLocator);
|
|
130
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, { fetchers: { octokit: {} } }, {});
|
|
131
|
+
expect(actual).toEqual({
|
|
132
|
+
remote: creationLocator,
|
|
133
|
+
repositoryType: GitRepositoryType.Root,
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
it("returns the error when resolving a remote repository to create succeeds and creating a new repository fails", async () => {
|
|
137
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
138
|
+
const creationError = new Error("Could not create repository.");
|
|
139
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce(undefined);
|
|
140
|
+
mockResolveRemoteRepositoryToCreate.mockResolvedValueOnce({
|
|
141
|
+
owner: stubOrigin,
|
|
142
|
+
repository: stubRepository,
|
|
143
|
+
});
|
|
144
|
+
mockCreateRemoteRepository.mockResolvedValueOnce(creationError);
|
|
145
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, { fetchers: { octokit: {} } }, {});
|
|
146
|
+
expect(actual).toEqual({
|
|
147
|
+
remote: creationError,
|
|
148
|
+
repositoryType: GitRepositoryType.Root,
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
it("returns the locator when resolving a remote repository to create succeeds and creating a new repository succeeds", async () => {
|
|
152
|
+
mockGetGitRepositoryType.mockResolvedValueOnce(GitRepositoryType.Root);
|
|
153
|
+
const creationLocator = {
|
|
154
|
+
owner: stubOrigin,
|
|
155
|
+
repository: stubRepository,
|
|
156
|
+
};
|
|
157
|
+
mockResolveRemoteRepositoryFromOrigin.mockResolvedValueOnce(undefined);
|
|
158
|
+
mockResolveRemoteRepositoryToCreate.mockResolvedValueOnce(creationLocator);
|
|
159
|
+
mockCreateRemoteRepository.mockResolvedValueOnce(creationLocator);
|
|
160
|
+
const actual = await resolveLocalRepository(stubDisplay, { repository: stubRepository }, { remote: true }, { fetchers: { octokit: {} } }, {});
|
|
161
|
+
expect(actual).toEqual({
|
|
162
|
+
remote: creationLocator,
|
|
163
|
+
repositoryType: GitRepositoryType.Root,
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=resolveLocalRepository.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLocalRepository.test.js","sourceRoot":"","sources":["../../../src/cli/repository/resolveLocalRepository.test.ts"],"names":[],"mappings":"A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AC;QAC3E,0BAA0B,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAC1C,WAAW,EACX,EAAE,UAAU,EAAE,cAAc,EAAE,EAC9B,EAAE,MAAM,EAAE,IAAI,EAAE,EAChB,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAiB,EAC5C,EAAc,CACd,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACtB,MAAM,EAAE,eAAe;YACvB,cAAc,EAAE,iBAAiB,CAAC,IAAI;SACtC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { GitRepositoryType } from "../getGitRepositoryType.js";
|
|
6
|
+
import { PartialRepositoryLocator } from "../remotes/types.js";
|
|
7
|
+
export interface RemoteRepositoryRequest {
|
|
8
|
+
offline?: boolean | undefined;
|
|
9
|
+
remote?: boolean | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvedRemoteMessage {
|
|
12
|
+
level: "step" | "warn";
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolvedRepository {
|
|
16
|
+
message?: ResolvedRemoteMessage | undefined;
|
|
17
|
+
remote: Error | RepositoryLocator | undefined;
|
|
18
|
+
type: GitRepositoryType;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveLocalRepository(display: ClackDisplay, locator: PartialRepositoryLocator, request: RemoteRepositoryRequest, system: BingoSystem, template: Template): Promise<ResolvedRepository>;
|
|
21
|
+
//# sourceMappingURL=resolveRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRepository.d.ts","sourceRoot":"","sources":["../../../src/cli/repository/resolveRepository.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;AAChE,OAAO,EAEN,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,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,kBAAkB;IAClC,OAAO,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,KAAK,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC9C,IAAI,EAAE,iBAAiB,CAAC;CACxB;AAED,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA6E7B"}
|