bingo 0.11.0 → 0.11.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logHelpText.d.ts","sourceRoot":"","sources":["../../../src/cli/loggers/logHelpText.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,wBAAgB,WAAW,CAAC,YAAY,SAAS,QAAQ,EAAE,WAAW,EACrE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,GAC3C,WAAW,
|
|
1
|
+
{"version":3,"file":"logHelpText.d.ts","sourceRoot":"","sources":["../../../src/cli/loggers/logHelpText.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,wBAAgB,WAAW,CAAC,YAAY,SAAS,QAAQ,EAAE,WAAW,EACrE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,GAC3C,WAAW,CAwFb"}
|
|
@@ -24,7 +24,7 @@ export function logHelpText(mode, from, template) {
|
|
|
24
24
|
examples: ["--help"],
|
|
25
25
|
flag: "--help",
|
|
26
26
|
text: "Prints help text.",
|
|
27
|
-
type: "
|
|
27
|
+
type: "boolean",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
examples: ["--mode setup", "--mode transition"],
|
|
@@ -38,12 +38,24 @@ export function logHelpText(mode, from, template) {
|
|
|
38
38
|
text: 'Whether to run in an "offline" mode that skips network requests.',
|
|
39
39
|
type: "boolean",
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
examples: ["--owner my-org"],
|
|
43
|
+
flag: "--owner",
|
|
44
|
+
text: "What GitHub organization or user the repository will be under.",
|
|
45
|
+
type: "string",
|
|
46
|
+
},
|
|
41
47
|
{
|
|
42
48
|
examples: ["--remote"],
|
|
43
49
|
flag: "--remote",
|
|
44
50
|
text: "Whether to create a remote repository on GitHub if one does not already exist.",
|
|
45
51
|
type: "boolean",
|
|
46
52
|
},
|
|
53
|
+
{
|
|
54
|
+
examples: ["--repository my-fancy-project"],
|
|
55
|
+
flag: "--repository",
|
|
56
|
+
text: "What the repository will be named.",
|
|
57
|
+
type: "string",
|
|
58
|
+
},
|
|
47
59
|
{
|
|
48
60
|
examples: ["--skip-files"],
|
|
49
61
|
flag: "--skip-files",
|
|
@@ -56,6 +68,12 @@ export function logHelpText(mode, from, template) {
|
|
|
56
68
|
text: "Whether to skip sending network requests as specified by templates.",
|
|
57
69
|
type: "boolean",
|
|
58
70
|
},
|
|
71
|
+
{
|
|
72
|
+
examples: ["--skip-scripts"],
|
|
73
|
+
flag: "--skip-scripts",
|
|
74
|
+
text: "Whether to skip running local scripts as specified by templates.",
|
|
75
|
+
type: "boolean",
|
|
76
|
+
},
|
|
59
77
|
{
|
|
60
78
|
examples: ["--version"],
|
|
61
79
|
flag: "--version",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logHelpText.js","sourceRoot":"","sources":["../../../src/cli/loggers/logHelpText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,c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ACpB,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,SAAS;SACf;QACD;YACC,QAAQ,EAAE,CAAC,iBAAiB,CAAC;YAC7B,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,qEAAqE;YAC3E,IAAI,EAAE,SAAS;SACf;QACD;YACC,QAAQ,EAAE,CAAC,gBAAgB,CAAC;YAC5B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,kEAAkE;YACxE,IAAI,EAAE,SAAS;SACf;QACD;YACC,QAAQ,EAAE,CAAC,WAAW,CAAC;YACvB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,0BAA0B;YAChC,IAAI,EAAE,SAAS;SACf;KACD,CAAC,CAAC;IAEH,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAErD,OAAO;QACN,KAAK,EAAE,UAAU,CAAC,EAAE;QACpB,MAAM,EAAE,SAAS,CAAC,OAAO;KACzB,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { describe, expect, test, vi } from "vitest";
|
|
1
|
+
import { describe, expect, it, test, vi } from "vitest";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createTemplate } from "../../creators/createTemplate.js";
|
|
4
|
+
import { cliArgsOptions } from "../cliArgsOptions.js";
|
|
4
5
|
import { logHelpText } from "./logHelpText.js";
|
|
5
6
|
const mockLog = {
|
|
6
7
|
info: vi.fn(),
|
|
@@ -11,7 +12,18 @@ vi.mock("@clack/prompts", () => ({
|
|
|
11
12
|
return mockLog;
|
|
12
13
|
},
|
|
13
14
|
}));
|
|
15
|
+
const narrowedTypes = new Map([["mode", '"setup" | "transition"']]);
|
|
14
16
|
describe("logHelpText", () => {
|
|
17
|
+
it("prints every CLI flag with its parsed type", () => {
|
|
18
|
+
logHelpText("setup", "./template.js", createTemplate({
|
|
19
|
+
produce: vi.fn(),
|
|
20
|
+
}));
|
|
21
|
+
const [[message]] = mockLog.message.mock.calls;
|
|
22
|
+
const missing = Object.entries(cliArgsOptions)
|
|
23
|
+
.map(([flag, { type }]) => `--${flag} (${narrowedTypes.get(flag) ?? type})`)
|
|
24
|
+
.filter((expected) => !message.includes(expected));
|
|
25
|
+
expect(missing).toEqual([]);
|
|
26
|
+
});
|
|
15
27
|
test("anonymous template with no options", () => {
|
|
16
28
|
logHelpText("setup", "./template.js", createTemplate({
|
|
17
29
|
produce: vi.fn(),
|
|
@@ -31,7 +43,7 @@ describe("logHelpText", () => {
|
|
|
31
43
|
--directory (string): What local directory path to run under
|
|
32
44
|
npx ./template.js --directory my-fancy-project
|
|
33
45
|
|
|
34
|
-
--help (
|
|
46
|
+
--help (boolean): Prints help text.
|
|
35
47
|
npx ./template.js --help
|
|
36
48
|
|
|
37
49
|
--mode ("setup" | "transition"): Which mode to run in.
|
|
@@ -41,15 +53,24 @@ describe("logHelpText", () => {
|
|
|
41
53
|
--offline (boolean): Whether to run in an "offline" mode that skips network requests.
|
|
42
54
|
npx ./template.js --offline
|
|
43
55
|
|
|
56
|
+
--owner (string): What GitHub organization or user the repository will be under.
|
|
57
|
+
npx ./template.js --owner my-org
|
|
58
|
+
|
|
44
59
|
--remote (boolean): Whether to create a remote repository on GitHub if one does not already exist.
|
|
45
60
|
npx ./template.js --remote
|
|
46
61
|
|
|
62
|
+
--repository (string): What the repository will be named.
|
|
63
|
+
npx ./template.js --repository my-fancy-project
|
|
64
|
+
|
|
47
65
|
--skip-files (boolean): Whether to skip creating files on disk.
|
|
48
66
|
npx ./template.js --skip-files
|
|
49
67
|
|
|
50
68
|
--skip-requests (boolean): Whether to skip sending network requests as specified by templates.
|
|
51
69
|
npx ./template.js --skip-requests
|
|
52
70
|
|
|
71
|
+
--skip-scripts (boolean): Whether to skip running local scripts as specified by templates.
|
|
72
|
+
npx ./template.js --skip-scripts
|
|
73
|
+
|
|
53
74
|
--version (boolean): Prints package versions.
|
|
54
75
|
npx ./template.js --version
|
|
55
76
|
",
|
|
@@ -85,7 +106,7 @@ describe("logHelpText", () => {
|
|
|
85
106
|
--directory (string): What local directory path to run under
|
|
86
107
|
npx ./template.js --directory my-fancy-project
|
|
87
108
|
|
|
88
|
-
--help (
|
|
109
|
+
--help (boolean): Prints help text.
|
|
89
110
|
npx ./template.js --help
|
|
90
111
|
|
|
91
112
|
--mode ("setup" | "transition"): Which mode to run in.
|
|
@@ -95,15 +116,24 @@ describe("logHelpText", () => {
|
|
|
95
116
|
--offline (boolean): Whether to run in an "offline" mode that skips network requests.
|
|
96
117
|
npx ./template.js --offline
|
|
97
118
|
|
|
119
|
+
--owner (string): What GitHub organization or user the repository will be under.
|
|
120
|
+
npx ./template.js --owner my-org
|
|
121
|
+
|
|
98
122
|
--remote (boolean): Whether to create a remote repository on GitHub if one does not already exist.
|
|
99
123
|
npx ./template.js --remote
|
|
100
124
|
|
|
125
|
+
--repository (string): What the repository will be named.
|
|
126
|
+
npx ./template.js --repository my-fancy-project
|
|
127
|
+
|
|
101
128
|
--skip-files (boolean): Whether to skip creating files on disk.
|
|
102
129
|
npx ./template.js --skip-files
|
|
103
130
|
|
|
104
131
|
--skip-requests (boolean): Whether to skip sending network requests as specified by templates.
|
|
105
132
|
npx ./template.js --skip-requests
|
|
106
133
|
|
|
134
|
+
--skip-scripts (boolean): Whether to skip running local scripts as specified by templates.
|
|
135
|
+
npx ./template.js --skip-scripts
|
|
136
|
+
|
|
107
137
|
--version (boolean): Prints package versions.
|
|
108
138
|
npx ./template.js --version
|
|
109
139
|
",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logHelpText.test.js","sourceRoot":"","sources":["../../../src/cli/loggers/logHelpText.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"logHelpText.test.js","sourceRoot":"","sources":["../../../src/cli/loggers/logHelpText.test.ts"],"names":[],"mappings":"AAAA,OAA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