bingo 0.9.2 → 0.9.3

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 (182) hide show
  1. package/lib/cli/display/runSpinnerTask.d.ts +1 -1
  2. package/lib/cli/loggers/logHelpText.d.ts.map +1 -1
  3. package/lib/cli/loggers/logHelpText.js +18 -0
  4. package/lib/cli/loggers/logHelpText.js.map +1 -1
  5. package/lib/cli/loggers/logHelpText.test.js +18 -0
  6. package/lib/cli/loggers/logHelpText.test.js.map +1 -1
  7. package/lib/cli/setup/createRepositoryOnGitHub.d.ts +1 -0
  8. package/lib/cli/setup/createRepositoryOnGitHub.d.ts.map +1 -1
  9. package/lib/cli/setup/createRepositoryOnGitHub.js.map +1 -1
  10. package/lib/cli/setup/createTrackingBranches.d.ts +1 -1
  11. package/lib/cli/setup/createTrackingBranches.d.ts.map +1 -1
  12. package/lib/cli/setup/createTrackingBranches.js.map +1 -1
  13. package/lib/utils/tryCatch.d.ts +1 -1
  14. package/package.json +3 -3
  15. package/lib/cli/createTrackingBranches.d.ts +0 -4
  16. package/lib/cli/createTrackingBranches.d.ts.map +0 -1
  17. package/lib/cli/createTrackingBranches.js +0 -7
  18. package/lib/cli/createTrackingBranches.js.map +0 -1
  19. package/lib/cli/createTrackingBranches.test.d.ts +0 -2
  20. package/lib/cli/createTrackingBranches.test.d.ts.map +0 -1
  21. package/lib/cli/createTrackingBranches.test.js +0 -19
  22. package/lib/cli/createTrackingBranches.test.js.map +0 -1
  23. package/lib/cli/isInGitRepository.d.ts +0 -3
  24. package/lib/cli/isInGitRepository.d.ts.map +0 -1
  25. package/lib/cli/isInGitRepository.js +0 -7
  26. package/lib/cli/isInGitRepository.js.map +0 -1
  27. package/lib/cli/isInGitRepository.test.d.ts +0 -2
  28. package/lib/cli/isInGitRepository.test.d.ts.map +0 -1
  29. package/lib/cli/isInGitRepository.test.js +0 -26
  30. package/lib/cli/isInGitRepository.test.js.map +0 -1
  31. package/lib/cli/isInGitRepositoryRoot.d.ts +0 -3
  32. package/lib/cli/isInGitRepositoryRoot.d.ts.map +0 -1
  33. package/lib/cli/isInGitRepositoryRoot.js +0 -7
  34. package/lib/cli/isInGitRepositoryRoot.js.map +0 -1
  35. package/lib/cli/isInGitRepositoryRoot.test.d.ts +0 -2
  36. package/lib/cli/isInGitRepositoryRoot.test.d.ts.map +0 -1
  37. package/lib/cli/isInGitRepositoryRoot.test.js +0 -26
  38. package/lib/cli/isInGitRepositoryRoot.test.js.map +0 -1
  39. package/lib/cli/prepareGitRepository.d.ts +0 -4
  40. package/lib/cli/prepareGitRepository.d.ts.map +0 -1
  41. package/lib/cli/prepareGitRepository.js +0 -9
  42. package/lib/cli/prepareGitRepository.js.map +0 -1
  43. package/lib/cli/remotes/createTrackingBranches.d.ts +0 -4
  44. package/lib/cli/remotes/createTrackingBranches.d.ts.map +0 -1
  45. package/lib/cli/remotes/createTrackingBranches.js +0 -7
  46. package/lib/cli/remotes/createTrackingBranches.js.map +0 -1
  47. package/lib/cli/remotes/createTrackingBranches.test.d.ts +0 -2
  48. package/lib/cli/remotes/createTrackingBranches.test.d.ts.map +0 -1
  49. package/lib/cli/remotes/createTrackingBranches.test.js +0 -19
  50. package/lib/cli/remotes/createTrackingBranches.test.js.map +0 -1
  51. package/lib/cli/remotes/resolveRemoteRepository.d.ts +0 -19
  52. package/lib/cli/remotes/resolveRemoteRepository.d.ts.map +0 -1
  53. package/lib/cli/remotes/resolveRemoteRepository.js +0 -58
  54. package/lib/cli/remotes/resolveRemoteRepository.js.map +0 -1
  55. package/lib/cli/remotes/resolveRemoteRepository.test.d.ts +0 -2
  56. package/lib/cli/remotes/resolveRemoteRepository.test.d.ts.map +0 -1
  57. package/lib/cli/remotes/resolveRemoteRepository.test.js +0 -148
  58. package/lib/cli/remotes/resolveRemoteRepository.test.js.map +0 -1
  59. package/lib/cli/remotes/resolveRepository.d.ts +0 -19
  60. package/lib/cli/remotes/resolveRepository.d.ts.map +0 -1
  61. package/lib/cli/remotes/resolveRepository.js +0 -58
  62. package/lib/cli/remotes/resolveRepository.js.map +0 -1
  63. package/lib/cli/remotes/resolveRepository.test.d.ts +0 -2
  64. package/lib/cli/remotes/resolveRepository.test.d.ts.map +0 -1
  65. package/lib/cli/remotes/resolveRepository.test.js +0 -148
  66. package/lib/cli/remotes/resolveRepository.test.js.map +0 -1
  67. package/lib/cli/repository/resolveRepository.d.ts +0 -21
  68. package/lib/cli/repository/resolveRepository.d.ts.map +0 -1
  69. package/lib/cli/repository/resolveRepository.js +0 -57
  70. package/lib/cli/repository/resolveRepository.js.map +0 -1
  71. package/lib/cli/repository/resolveRepository.test.d.ts +0 -2
  72. package/lib/cli/repository/resolveRepository.test.d.ts.map +0 -1
  73. package/lib/cli/repository/resolveRepository.test.js +0 -148
  74. package/lib/cli/repository/resolveRepository.test.js.map +0 -1
  75. package/lib/cli/setup/getRemoteRepository.d.ts +0 -2
  76. package/lib/cli/setup/getRemoteRepository.d.ts.map +0 -1
  77. package/lib/cli/setup/getRemoteRepository.js +0 -2
  78. package/lib/cli/setup/getRemoteRepository.js.map +0 -1
  79. package/lib/cli/setup/getRepositoryLocator.d.ts +0 -9
  80. package/lib/cli/setup/getRepositoryLocator.d.ts.map +0 -1
  81. package/lib/cli/setup/getRepositoryLocator.js +0 -16
  82. package/lib/cli/setup/getRepositoryLocator.js.map +0 -1
  83. package/lib/cli/setup/getRepositoryLocator.test.d.ts +0 -2
  84. package/lib/cli/setup/getRepositoryLocator.test.d.ts.map +0 -1
  85. package/lib/cli/setup/getRepositoryLocator.test.js +0 -42
  86. package/lib/cli/setup/getRepositoryLocator.test.js.map +0 -1
  87. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts +0 -4
  88. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.d.ts.map +0 -1
  89. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js +0 -15
  90. package/lib/cli/setup/remotes/checkTemplateRemoteSupport.js.map +0 -1
  91. package/lib/cli/setup/remotes/createRemoteRepository.d.ts +0 -5
  92. package/lib/cli/setup/remotes/createRemoteRepository.d.ts.map +0 -1
  93. package/lib/cli/setup/remotes/createRemoteRepository.js +0 -16
  94. package/lib/cli/setup/remotes/createRemoteRepository.js.map +0 -1
  95. package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts +0 -6
  96. package/lib/cli/setup/remotes/createRepositoryOnGitHub.d.ts.map +0 -1
  97. package/lib/cli/setup/remotes/createRepositoryOnGitHub.js +0 -36
  98. package/lib/cli/setup/remotes/createRepositoryOnGitHub.js.map +0 -1
  99. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts +0 -2
  100. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.d.ts.map +0 -1
  101. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js +0 -157
  102. package/lib/cli/setup/remotes/createRepositoryOnGitHub.test.js.map +0 -1
  103. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts +0 -4
  104. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.d.ts.map +0 -1
  105. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js +0 -14
  106. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.js.map +0 -1
  107. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts +0 -2
  108. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.d.ts.map +0 -1
  109. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js +0 -23
  110. package/lib/cli/setup/remotes/resolveExistingRemoteRepository.test.js.map +0 -1
  111. package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts +0 -18
  112. package/lib/cli/setup/remotes/resolveRemoteRepository.d.ts.map +0 -1
  113. package/lib/cli/setup/remotes/resolveRemoteRepository.js +0 -47
  114. package/lib/cli/setup/remotes/resolveRemoteRepository.js.map +0 -1
  115. package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts +0 -2
  116. package/lib/cli/setup/remotes/resolveRemoteRepository.test.d.ts.map +0 -1
  117. package/lib/cli/setup/remotes/resolveRemoteRepository.test.js +0 -103
  118. package/lib/cli/setup/remotes/resolveRemoteRepository.test.js.map +0 -1
  119. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts +0 -4
  120. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.d.ts.map +0 -1
  121. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js +0 -14
  122. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.js.map +0 -1
  123. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts +0 -2
  124. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.d.ts.map +0 -1
  125. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js +0 -23
  126. package/lib/cli/setup/remotes/resolveRemoteRepositoryFromOrigin.test.js.map +0 -1
  127. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts +0 -5
  128. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.d.ts.map +0 -1
  129. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js +0 -26
  130. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.js.map +0 -1
  131. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts +0 -2
  132. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.d.ts.map +0 -1
  133. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js +0 -82
  134. package/lib/cli/setup/remotes/resolveRemoteRepositoryToCreate.test.js.map +0 -1
  135. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts +0 -3
  136. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.d.ts.map +0 -1
  137. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js +0 -9
  138. package/lib/cli/setup/remotes/templateSupportsRemoteCreation.js.map +0 -1
  139. package/lib/cli/setup/remotes/types.d.ts +0 -5
  140. package/lib/cli/setup/remotes/types.d.ts.map +0 -1
  141. package/lib/cli/setup/remotes/types.js +0 -2
  142. package/lib/cli/setup/remotes/types.js.map +0 -1
  143. package/lib/cli/setup/resolveExistingRemote.d.ts +0 -2
  144. package/lib/cli/setup/resolveExistingRemote.d.ts.map +0 -1
  145. package/lib/cli/setup/resolveExistingRemote.js +0 -2
  146. package/lib/cli/setup/resolveExistingRemote.js.map +0 -1
  147. package/lib/cli/setup/resolveRemoteRepository.d.ts +0 -26
  148. package/lib/cli/setup/resolveRemoteRepository.d.ts.map +0 -1
  149. package/lib/cli/setup/resolveRemoteRepository.js +0 -49
  150. package/lib/cli/setup/resolveRemoteRepository.js.map +0 -1
  151. package/lib/cli/setup/skips.d.ts +0 -6
  152. package/lib/cli/setup/skips.d.ts.map +0 -1
  153. package/lib/cli/setup/skips.js +0 -2
  154. package/lib/cli/setup/skips.js.map +0 -1
  155. package/lib/cli/transition/parseTransitionSource.d.ts +0 -13
  156. package/lib/cli/transition/parseTransitionSource.d.ts.map +0 -1
  157. package/lib/cli/transition/parseTransitionSource.js +0 -26
  158. package/lib/cli/transition/parseTransitionSource.js.map +0 -1
  159. package/lib/cli/transition/parseTransitionSource.test.d.ts +0 -2
  160. package/lib/cli/transition/parseTransitionSource.test.d.ts.map +0 -1
  161. package/lib/cli/transition/parseTransitionSource.test.js +0 -74
  162. package/lib/cli/transition/parseTransitionSource.test.js.map +0 -1
  163. package/lib/config/tryImportConfigTemplate.d.ts +0 -2
  164. package/lib/config/tryImportConfigTemplate.d.ts.map +0 -1
  165. package/lib/config/tryImportConfigTemplate.js +0 -6
  166. package/lib/config/tryImportConfigTemplate.js.map +0 -1
  167. package/lib/predicates/isCreatedConfig.d.ts +0 -4
  168. package/lib/predicates/isCreatedConfig.d.ts.map +0 -1
  169. package/lib/predicates/isCreatedConfig.js +0 -8
  170. package/lib/predicates/isCreatedConfig.js.map +0 -1
  171. package/lib/predicates/isCreatedConfig.test.d.ts +0 -2
  172. package/lib/predicates/isCreatedConfig.test.d.ts.map +0 -1
  173. package/lib/predicates/isCreatedConfig.test.js +0 -32
  174. package/lib/predicates/isCreatedConfig.test.js.map +0 -1
  175. package/lib/utils/awaitLazyProperties.d.ts +0 -6
  176. package/lib/utils/awaitLazyProperties.d.ts.map +0 -1
  177. package/lib/utils/awaitLazyProperties.js +0 -24
  178. package/lib/utils/awaitLazyProperties.js.map +0 -1
  179. package/lib/utils/awaitLazyProperties.test.d.ts +0 -2
  180. package/lib/utils/awaitLazyProperties.test.d.ts.map +0 -1
  181. package/lib/utils/awaitLazyProperties.test.js +0 -33
  182. package/lib/utils/awaitLazyProperties.test.js.map +0 -1
@@ -1,13 +0,0 @@
1
- import { Template } from "../../types/templates.js";
2
- export interface RequestedTransitionSource {
3
- configFile?: string;
4
- directory: string;
5
- from?: string;
6
- }
7
- export interface TransitionSource {
8
- descriptor: string;
9
- load: () => Promise<Error | symbol | Template>;
10
- type: "config file" | "template";
11
- }
12
- export declare function parseTransitionSource({ configFile, directory, from, }: RequestedTransitionSource): Error | TransitionSource;
13
- //# sourceMappingURL=parseTransitionSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseTransitionSource.d.ts","sourceRoot":"","sources":["../../../src/cli/transition/parseTransitionSource.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,MAAM,WAAW,yBAAyB;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,OAAO,CAAC,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;IAC/C,IAAI,EAAE,aAAa,GAAG,UAAU,CAAC;CACjC;AAED,wBAAgB,qBAAqB,CAAC,EACrC,UAAU,EACV,SAAS,EACT,IAAI,GACJ,EAAE,yBAAyB,GAAG,KAAK,GAAG,gBAAgB,CA2BtD"}
@@ -1,26 +0,0 @@
1
- import chalk from "chalk";
2
- import path from "node:path";
3
- import { tryImportConfigTemplate } from "../../config/tryImportConfigTemplate.js";
4
- import { tryImportTemplate } from "../importers/tryImportTemplate.js";
5
- export function parseTransitionSource({ configFile, directory, from, }) {
6
- if (configFile && from) {
7
- return new Error(`${chalk.green("--mode transition")} cannot combine an existing config file (${chalk.blue(configFile)}) with an explicit ${chalk.blue("--from")} (${chalk.blue(from)}).`);
8
- }
9
- if (configFile) {
10
- const absolutePath = path.join(process.cwd(), directory, configFile);
11
- return {
12
- descriptor: path.relative(process.cwd(), absolutePath),
13
- load: async () => await tryImportConfigTemplate(absolutePath),
14
- type: "config file",
15
- };
16
- }
17
- if (from) {
18
- return {
19
- descriptor: from,
20
- load: async () => await tryImportTemplate(from),
21
- type: "template",
22
- };
23
- }
24
- return new Error(`Existing repository detected. To transition an existing repository, either create a create-example.config file or provide the name or path of a template.`);
25
- }
26
- //# sourceMappingURL=parseTransitionSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseTransitionSource.js","sourceRoot":"","sources":["../../../src/cli/transition/parseTransitionSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AActE,MAAM,UAAU,qBAAqB,CAAC,EACrC,UAAU,EACV,SAAS,EACT,IAAI,GACuB;IAC3B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,KAAK,CACf,GAAG,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,4CAA4C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,sBAAsB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACxK,CAAC;IACH,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QAChB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACrE,OAAO;YACN,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC;YACtD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,uBAAuB,CAAC,YAAY,CAAC;YAC7D,IAAI,EAAE,aAAa;SACnB,CAAC;IACH,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QACV,OAAO;YACN,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,iBAAiB,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,UAAU;SAChB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,KAAK,CACf,2JAA2J,CAC3J,CAAC;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=parseTransitionSource.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseTransitionSource.test.d.ts","sourceRoot":"","sources":["../../../src/cli/transition/parseTransitionSource.test.ts"],"names":[],"mappings":""}
@@ -1,74 +0,0 @@
1
- import { describe, expect, it, vi } from "vitest";
2
- import { createTemplate } from "../../creators/createTemplate.js";
3
- import { parseTransitionSource, } from "./parseTransitionSource.js";
4
- const mockTryImportConfig = vi.fn();
5
- vi.mock("../../config/tryImportConfig.js", () => ({
6
- get tryImportConfig() {
7
- return mockTryImportConfig;
8
- },
9
- }));
10
- vi.mock("../display/createClackDisplay.js", () => ({
11
- createClackDisplay: () => ({
12
- spinner: {
13
- start: vi.fn(),
14
- stop: vi.fn(),
15
- },
16
- }),
17
- }));
18
- const mockTryImportTemplate = vi.fn();
19
- vi.mock("../importers/tryImportTemplate.js", () => ({
20
- get tryImportTemplate() {
21
- return mockTryImportTemplate;
22
- },
23
- }));
24
- describe("parseTransitionSource", () => {
25
- it("returns a CLI error when configFile and from are undefined", () => {
26
- const actual = parseTransitionSource({
27
- directory: ".",
28
- });
29
- expect(actual).toEqual(new Error("Existing repository detected. To transition an existing repository, either create a create-example.config file or provide the name or path of a template."));
30
- });
31
- it("returns a CLI error when configFile and from are both defined", () => {
32
- const actual = parseTransitionSource({
33
- configFile: "create-example.config.js",
34
- directory: ".",
35
- from: "my-app",
36
- });
37
- expect(actual).toEqual(new Error("--mode transition cannot combine an existing config file (create-example.config.js) with an explicit --from (my-app)."));
38
- });
39
- it("returns a config loader when only configFile is defined", async () => {
40
- const template = createTemplate({
41
- produce: () => ({}),
42
- });
43
- mockTryImportConfig.mockResolvedValueOnce({ template });
44
- const actual = parseTransitionSource({
45
- configFile: "create-example.config.js",
46
- directory: ".",
47
- });
48
- expect(actual).toEqual({
49
- descriptor: "create-example.config.js",
50
- load: expect.any(Function),
51
- type: "config file",
52
- });
53
- const loaded = await actual.load();
54
- expect(loaded).toBe(template);
55
- expect(mockTryImportTemplate).not.toHaveBeenCalled();
56
- });
57
- it("returns a template loader when only from is defined", async () => {
58
- const expected = { configFile: true };
59
- mockTryImportTemplate.mockResolvedValueOnce(expected);
60
- const actual = parseTransitionSource({
61
- directory: ".",
62
- from: "my-app",
63
- });
64
- expect(actual).toEqual({
65
- descriptor: "my-app",
66
- load: expect.any(Function),
67
- type: "template",
68
- });
69
- const loaded = await actual.load();
70
- expect(loaded).toBe(expected);
71
- expect(mockTryImportConfig).not.toHaveBeenCalled();
72
- });
73
- });
74
- //# sourceMappingURL=parseTransitionSource.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseTransitionSource.test.js","sourceRoot":"","sources":["../../../src/cli/transition/parseTransitionSource.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,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Q;YACpB,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC1B,IAAI,EAAE,UAAU;SAChB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAO,MAA2B,CAAC,IAAI,EAAE,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function tryImportConfigTemplate(configFile: string): Promise<Error | import("../index.js").Template<import("zod").ZodRawShape>>;
2
- //# sourceMappingURL=tryImportConfigTemplate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tryImportConfigTemplate.d.ts","sourceRoot":"","sources":["../../src/config/tryImportConfigTemplate.ts"],"names":[],"mappings":"AAEA,wBAAsB,uBAAuB,CAAC,UAAU,EAAE,MAAM,8EAI/D"}
@@ -1,6 +0,0 @@
1
- import { tryImportConfig } from "./tryImportConfig.js";
2
- export async function tryImportConfigTemplate(configFile) {
3
- const config = await tryImportConfig(configFile);
4
- return config instanceof Error ? config : config.template;
5
- }
6
- //# sourceMappingURL=tryImportConfigTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tryImportConfigTemplate.js","sourceRoot":"","sources":["../../src/config/tryImportConfigTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,UAAkB;IAC/D,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;IAEjD,OAAO,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC3D,CAAC"}
@@ -1,4 +0,0 @@
1
- import { TemplateConfig } from "../types/configs.js";
2
- import { AnyShape } from "../types/shapes.js";
3
- export declare function isCreatedConfig(value: unknown): value is TemplateConfig<AnyShape, unknown>;
4
- //# sourceMappingURL=isCreatedConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCreatedConfig.d.ts","sourceRoot":"","sources":["../../src/predicates/isCreatedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAkB,MAAM,oBAAoB,CAAC;AAI9D,wBAAgB,eAAe,CAC9B,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAO5C"}
@@ -1,8 +0,0 @@
1
- import { isTemplate } from "./isTemplate.js";
2
- export function isCreatedConfig(value) {
3
- return (!!value &&
4
- typeof value === "object" &&
5
- "template" in value &&
6
- isTemplate(value.template));
7
- }
8
- //# sourceMappingURL=isCreatedConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCreatedConfig.js","sourceRoot":"","sources":["../../src/predicates/isCreatedConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,eAAe,CAC9B,KAAc;IAEd,OAAO,CACN,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,UAAU,IAAI,KAAK;QACnB,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC1B,CAAC;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=isCreatedConfig.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCreatedConfig.test.d.ts","sourceRoot":"","sources":["../../src/predicates/isCreatedConfig.test.ts"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- import { describe, expect, test, vi } from "vitest";
2
- import { createTemplate } from "../creators/createTemplate.js";
3
- import { isCreatedConfig } from "./isTemplateConfig.js";
4
- const template = createTemplate({
5
- about: { name: "Test Template" },
6
- options: {},
7
- produce: vi.fn(),
8
- });
9
- describe("isCreatedConfig", () => {
10
- test.each([
11
- [null, false],
12
- [undefined, false],
13
- [123, false],
14
- ["abc", false],
15
- [{}, false],
16
- [{ template: null }, false],
17
- [{ template: {} }, false],
18
- [{ settings: { options: {} }, template: {} }, false],
19
- [{ settings: null }, false],
20
- [{ settings: {} }, false],
21
- [{ settings: {}, template: {} }, false],
22
- [{ template }, true],
23
- [{ template }, true],
24
- [{ options: {}, template }, true],
25
- [{ settings: {}, template }, true],
26
- [{ options: {}, settings: {}, template }, true],
27
- ])("%j", (input, expected) => {
28
- const actual = isCreatedConfig(input);
29
- expect(actual).toBe(expected);
30
- });
31
- });
32
- //# sourceMappingURL=isCreatedConfig.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isCreatedConfig.test.js","sourceRoot":"","sources":["../../src/predicates/isCreatedConfig.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;IAChC,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE;CAChB,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAChC,IAAI,CAAC,IAAI,CAAC;QACT,CAAC,IAAI,EAAE,KAAK,CAAC;QACb,CAAC,SAAS,EAAE,KAAK,CAAC;QAClB,CAAC,GAAG,EAAE,KAAK,CAAC;QACZ,CAAC,KAAK,EAAE,KAAK,CAAC;QACd,CAAC,EAAE,EAAE,KAAK,CAAC;QACX,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC;QAC3B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;QACzB,CAAC,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;QACpD,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC;QAC3B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;QACzB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;QACvC,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;QACpB,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;QACpB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;QACjC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;QAClC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC;KAC/C,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAEtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export type AwaitedLazyProperties<T> = {
2
- [K in keyof T]: AwaitedLazyProperty<T[K]>;
3
- };
4
- export type AwaitedLazyProperty<T> = T extends () => infer R ? Awaited<R> : T;
5
- export declare function awaitLazyProperties<T extends object>(source: T): Promise<AwaitedLazyProperties<T>>;
6
- //# sourceMappingURL=awaitLazyProperties.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"awaitLazyProperties.d.ts","sourceRoot":"","sources":["../../src/utils/awaitLazyProperties.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;KACrC,CAAC,IAAI,MAAM,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAG9E,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EACzD,MAAM,EAAE,CAAC,GACP,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CA0BnC"}
@@ -1,24 +0,0 @@
1
- import { withoutUndefinedProperties } from "without-undefined-properties";
2
- // TODO: move into separate package?
3
- export async function awaitLazyProperties(source) {
4
- const result = {};
5
- const tasks = [];
6
- for (const [key, creator] of Object.entries(source)) {
7
- if (typeof creator !== "function") {
8
- result[key] = creator;
9
- continue;
10
- }
11
- const task = creator();
12
- if (task instanceof Promise) {
13
- tasks.push(task.then((awaited) => {
14
- result[key] = awaited;
15
- }));
16
- }
17
- else if (task !== undefined) {
18
- result[key] = task;
19
- }
20
- }
21
- await Promise.all(tasks);
22
- return withoutUndefinedProperties(result);
23
- }
24
- //# sourceMappingURL=awaitLazyProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"awaitLazyProperties.js","sourceRoot":"","sources":["../../src/utils/awaitLazyProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAQ1E,oCAAoC;AACpC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,MAAS;IAET,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;YACtB,SAAS;QACV,CAAC;QAED,MAAM,IAAI,GAAI,OAAyB,EAAE,CAAC;QAE1C,IAAI,IAAI,YAAY,OAAO,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBACrB,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;YACvB,CAAC,CAAC,CACF,CAAC;QACH,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACpB,CAAC;IACF,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEzB,OAAO,0BAA0B,CAAC,MAAM,CAA6B,CAAC;AACvE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=awaitLazyProperties.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"awaitLazyProperties.test.d.ts","sourceRoot":"","sources":["../../src/utils/awaitLazyProperties.test.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { awaitLazyProperties } from "./awaitLazyProperties.js";
3
- describe("awaitLazyProperties", () => {
4
- it("returns a property directly when it is not a function", async () => {
5
- const actual = await awaitLazyProperties({ value: "abc" });
6
- expect(actual).toEqual({ value: "abc" });
7
- });
8
- it("returns a property's return directly when it is a function", async () => {
9
- const actual = await awaitLazyProperties({ value: () => "abc" });
10
- expect(actual).toEqual({ value: "abc" });
11
- });
12
- it("returns a property's await return when it is an asynchronous function", async () => {
13
- const actual = await awaitLazyProperties({
14
- value: () => Promise.resolve("abc"),
15
- });
16
- expect(actual).toEqual({ value: "abc" });
17
- });
18
- it("starts tasks immediately when multiple properties are asynchronous functions", async () => {
19
- let iteration = 0;
20
- async function returnStartIteration() {
21
- const current = iteration;
22
- await Promise.resolve();
23
- iteration += 1;
24
- return current;
25
- }
26
- const actual = await awaitLazyProperties({
27
- first: returnStartIteration,
28
- second: returnStartIteration,
29
- });
30
- expect(actual).toEqual({ first: 0, second: 0 });
31
- });
32
- });
33
- //# sourceMappingURL=awaitLazyProperties.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"awaitLazyProperties.test.js","sourceRoot":"","sources":["../../src/utils/awaitLazyProperties.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAE3D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QAEjE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;QACtF,MAAM,MAAM,GAA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