procedure-cli 0.1.7 → 0.1.9
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/dist/app.js +6 -2
- package/dist/app.js.map +1 -1
- package/dist/components/step-indicator.js +3 -3
- package/dist/components/step-indicator.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/dist/steps/generation.js +6 -53
- package/dist/steps/generation.js.map +1 -1
- package/dist/steps/powerline.js +32 -24
- package/dist/steps/powerline.js.map +1 -1
- package/dist/steps/stack-style.js +145 -40
- package/dist/steps/stack-style.js.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +4 -2
- package/src/components/step-indicator.tsx +3 -3
- package/src/lib/types.ts +2 -1
- package/src/steps/generation.tsx +18 -117
- package/src/steps/powerline.tsx +120 -32
- package/src/steps/stack-style.tsx +158 -56
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -50,6 +50,7 @@ const EMPTY_ANSWERS: WizardAnswers = {
|
|
|
50
50
|
generationSkipped: false,
|
|
51
51
|
setupPowerline: false,
|
|
52
52
|
setupGit: false,
|
|
53
|
+
setupRelease: false,
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
function getSummary(stepIndex: number, answers: WizardAnswers): string {
|
|
@@ -87,8 +88,9 @@ function getSummary(stepIndex: number, answers: WizardAnswers): string {
|
|
|
87
88
|
case 6: {
|
|
88
89
|
const parts: string[] = [];
|
|
89
90
|
if (answers.setupPowerline) parts.push("Powerline");
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
if (answers.setupGit) parts.push("Git");
|
|
92
|
+
if (answers.setupRelease) parts.push("Release scripts");
|
|
93
|
+
return parts.length > 0 ? parts.join(", ") : "skipped";
|
|
92
94
|
}
|
|
93
95
|
default:
|
|
94
96
|
return "done";
|
|
@@ -16,11 +16,11 @@ export default function StepIndicator({ status, label }: Props) {
|
|
|
16
16
|
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
if (status !== "active") return;
|
|
19
|
-
const id =
|
|
19
|
+
const id = setTimeout(() => {
|
|
20
20
|
setFrame((f) => (f + 1) % ACTIVE_FRAMES.length);
|
|
21
21
|
}, 350);
|
|
22
|
-
return () =>
|
|
23
|
-
}, [status]);
|
|
22
|
+
return () => clearTimeout(id);
|
|
23
|
+
}, [status, frame]);
|
|
24
24
|
|
|
25
25
|
if (status === "completed") {
|
|
26
26
|
return <Text><Text color={C.green}>{"◇"}</Text>{" "}<Text color={C.green}>{label}</Text></Text>;
|
package/src/lib/types.ts
CHANGED
package/src/steps/generation.tsx
CHANGED
|
@@ -2,14 +2,7 @@ import React, { useEffect, useState } from "react";
|
|
|
2
2
|
import { Text } from "ink";
|
|
3
3
|
import { ConfirmInput, Spinner } from "@inkjs/ui";
|
|
4
4
|
import { GutterLine } from "../components/gutter-line.js";
|
|
5
|
-
import {
|
|
6
|
-
scaffoldAll,
|
|
7
|
-
checkConflicts,
|
|
8
|
-
checkReleaseConflicts,
|
|
9
|
-
scaffoldRelease,
|
|
10
|
-
ensurePackageJsonReleaseScripts,
|
|
11
|
-
} from "../lib/template.js";
|
|
12
|
-
import { homeBinPath } from "../lib/fs.js";
|
|
5
|
+
import { scaffoldAll, checkConflicts } from "../lib/template.js";
|
|
13
6
|
import type { WizardAnswers } from "../lib/types.js";
|
|
14
7
|
import { C } from "../theme.js";
|
|
15
8
|
|
|
@@ -28,40 +21,14 @@ const FILES_TO_GENERATE = [
|
|
|
28
21
|
];
|
|
29
22
|
|
|
30
23
|
export default function Generation({ answers, onComplete }: Props) {
|
|
31
|
-
const [phase, setPhase] = useState<
|
|
32
|
-
"summary" | "running" | "done" | "error"
|
|
33
|
-
>("summary");
|
|
24
|
+
const [phase, setPhase] = useState<"summary" | "running" | "done" | "error">("summary");
|
|
34
25
|
const [errorMsg, setErrorMsg] = useState("");
|
|
35
|
-
const [releaseResult, setReleaseResult] = useState("");
|
|
36
26
|
|
|
37
27
|
useEffect(() => {
|
|
38
28
|
if (phase !== "running") return;
|
|
39
29
|
|
|
40
30
|
try {
|
|
41
|
-
|
|
42
|
-
const projectName = answers.projectName || "untitled";
|
|
43
|
-
|
|
44
|
-
scaffoldAll(targetDir, answers);
|
|
45
|
-
|
|
46
|
-
// Release script scaffolding
|
|
47
|
-
const releaseRes = scaffoldRelease(projectName, answers);
|
|
48
|
-
const pkgRes = ensurePackageJsonReleaseScripts(targetDir, projectName);
|
|
49
|
-
|
|
50
|
-
const parts: string[] = [];
|
|
51
|
-
if (releaseRes.skipped) {
|
|
52
|
-
parts.push(`~/bin/${projectName}-release (skipped, ${releaseRes.reason})`);
|
|
53
|
-
} else {
|
|
54
|
-
parts.push(`~/bin/${projectName}-release (created)`);
|
|
55
|
-
}
|
|
56
|
-
if (pkgRes.skipped) {
|
|
57
|
-
parts.push("package.json release scripts (skipped, already present)");
|
|
58
|
-
} else if (pkgRes.modified) {
|
|
59
|
-
parts.push("package.json release scripts (added)");
|
|
60
|
-
} else if (pkgRes.created) {
|
|
61
|
-
parts.push("package.json (created with release scripts)");
|
|
62
|
-
}
|
|
63
|
-
setReleaseResult(parts.join(", "));
|
|
64
|
-
|
|
31
|
+
scaffoldAll(process.cwd(), answers);
|
|
65
32
|
setPhase("done");
|
|
66
33
|
const timer = setTimeout(() => onComplete({ generationSkipped: false }), 1500);
|
|
67
34
|
return () => clearTimeout(timer);
|
|
@@ -71,38 +38,11 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
71
38
|
}
|
|
72
39
|
}, [phase]);
|
|
73
40
|
|
|
74
|
-
function handleConfirm() {
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function handleCancel() {
|
|
79
|
-
onComplete({ generationSkipped: true });
|
|
80
|
-
}
|
|
41
|
+
function handleConfirm() { setPhase("running"); }
|
|
42
|
+
function handleCancel() { onComplete({ generationSkipped: true }); }
|
|
81
43
|
|
|
82
44
|
if (phase === "summary") {
|
|
83
|
-
const techParts: string[] = [];
|
|
84
|
-
if (answers.language) techParts.push(answers.language);
|
|
85
|
-
if (answers.framework) techParts.push(answers.framework);
|
|
86
|
-
const stack = techParts.length > 0 ? techParts.join(", ") : "N/A";
|
|
87
|
-
|
|
88
|
-
const pmAndLicense = [answers.packageManager, answers.license]
|
|
89
|
-
.filter(Boolean)
|
|
90
|
-
.join(", ");
|
|
91
|
-
|
|
92
45
|
const conflicts = checkConflicts(process.cwd());
|
|
93
|
-
const projectName = answers.projectName || "untitled";
|
|
94
|
-
const releaseConflicts = checkReleaseConflicts(projectName, process.cwd());
|
|
95
|
-
|
|
96
|
-
const scriptDisplay = `~/bin/${projectName}-release`;
|
|
97
|
-
const scriptStatus = releaseConflicts.releaseScriptExists
|
|
98
|
-
? "exists, will skip"
|
|
99
|
-
: "new";
|
|
100
|
-
const pkgStatus = releaseConflicts.packageJsonHasRelease
|
|
101
|
-
? "has release scripts, will skip"
|
|
102
|
-
: releaseConflicts.packageJsonExists
|
|
103
|
-
? "will add release scripts"
|
|
104
|
-
: "will create with release scripts";
|
|
105
|
-
|
|
106
46
|
const codeStyleDisplay = answers.codeStyle.length > 0
|
|
107
47
|
? answers.codeStyle.join(", ")
|
|
108
48
|
: "N/A";
|
|
@@ -114,9 +54,7 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
114
54
|
<Text bold color={C.sapphire}>Project Info</Text>
|
|
115
55
|
</GutterLine>
|
|
116
56
|
<GutterLine>
|
|
117
|
-
<Text>
|
|
118
|
-
{" "}Name: <Text bold>{answers.projectName || "untitled"}</Text>
|
|
119
|
-
</Text>
|
|
57
|
+
<Text> Name: <Text bold>{answers.projectName || "untitled"}</Text></Text>
|
|
120
58
|
</GutterLine>
|
|
121
59
|
<GutterLine>
|
|
122
60
|
<Text> Description: {answers.description || "N/A"}</Text>
|
|
@@ -126,9 +64,7 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
126
64
|
</GutterLine>
|
|
127
65
|
|
|
128
66
|
{/* ── Stack & Style ── */}
|
|
129
|
-
<GutterLine>
|
|
130
|
-
<Text> </Text>
|
|
131
|
-
</GutterLine>
|
|
67
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
132
68
|
<GutterLine>
|
|
133
69
|
<Text bold color={C.sapphire}>Stack & Style</Text>
|
|
134
70
|
</GutterLine>
|
|
@@ -140,9 +76,7 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
140
76
|
</GutterLine>
|
|
141
77
|
|
|
142
78
|
{/* ── Build & Test ── */}
|
|
143
|
-
<GutterLine>
|
|
144
|
-
<Text> </Text>
|
|
145
|
-
</GutterLine>
|
|
79
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
146
80
|
<GutterLine>
|
|
147
81
|
<Text bold color={C.sapphire}>Build & Test</Text>
|
|
148
82
|
</GutterLine>
|
|
@@ -151,21 +85,17 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
151
85
|
</GutterLine>
|
|
152
86
|
{(answers.typecheckCommand || answers.lintCommand) && (
|
|
153
87
|
<GutterLine>
|
|
154
|
-
<Text>
|
|
155
|
-
{" "}Typecheck: {answers.typecheckCommand || "N/A"} | Lint: {answers.lintCommand || "N/A"}
|
|
156
|
-
</Text>
|
|
88
|
+
<Text> Typecheck: {answers.typecheckCommand || "N/A"} | Lint: {answers.lintCommand || "N/A"}</Text>
|
|
157
89
|
</GutterLine>
|
|
158
90
|
)}
|
|
159
91
|
{answers.prCommand && (
|
|
160
92
|
<GutterLine>
|
|
161
|
-
<Text> PR
|
|
93
|
+
<Text> PR: {answers.prCommand}</Text>
|
|
162
94
|
</GutterLine>
|
|
163
95
|
)}
|
|
164
96
|
|
|
165
97
|
{/* ── Architecture ── */}
|
|
166
|
-
<GutterLine>
|
|
167
|
-
<Text> </Text>
|
|
168
|
-
</GutterLine>
|
|
98
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
169
99
|
<GutterLine>
|
|
170
100
|
<Text bold color={C.sapphire}>Architecture</Text>
|
|
171
101
|
</GutterLine>
|
|
@@ -174,9 +104,7 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
174
104
|
</GutterLine>
|
|
175
105
|
|
|
176
106
|
{/* ── Product Context ── */}
|
|
177
|
-
<GutterLine>
|
|
178
|
-
<Text> </Text>
|
|
179
|
-
</GutterLine>
|
|
107
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
180
108
|
<GutterLine>
|
|
181
109
|
<Text bold color={C.sapphire}>Product Context</Text>
|
|
182
110
|
</GutterLine>
|
|
@@ -201,9 +129,7 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
201
129
|
)}
|
|
202
130
|
|
|
203
131
|
{/* ── Files ── */}
|
|
204
|
-
<GutterLine>
|
|
205
|
-
<Text> </Text>
|
|
206
|
-
</GutterLine>
|
|
132
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
207
133
|
<GutterLine>
|
|
208
134
|
<Text bold color={C.sapphire}>Files to generate</Text>
|
|
209
135
|
</GutterLine>
|
|
@@ -212,30 +138,12 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
212
138
|
</GutterLine>
|
|
213
139
|
{conflicts.length > 0 && (
|
|
214
140
|
<GutterLine>
|
|
215
|
-
<Text color={C.peach}>
|
|
216
|
-
{" ⚠ Will overwrite: "}{conflicts.join(", ")}
|
|
217
|
-
</Text>
|
|
141
|
+
<Text color={C.peach}> ⚠ Will overwrite: {conflicts.join(", ")}</Text>
|
|
218
142
|
</GutterLine>
|
|
219
143
|
)}
|
|
220
144
|
|
|
221
|
-
{/* ── Release ── */}
|
|
222
|
-
<GutterLine>
|
|
223
|
-
<Text> </Text>
|
|
224
|
-
</GutterLine>
|
|
225
|
-
<GutterLine>
|
|
226
|
-
<Text bold color={C.sapphire}>Release setup</Text>
|
|
227
|
-
</GutterLine>
|
|
228
|
-
<GutterLine>
|
|
229
|
-
<Text> {scriptDisplay} → {scriptStatus}</Text>
|
|
230
|
-
</GutterLine>
|
|
231
|
-
<GutterLine>
|
|
232
|
-
<Text> package.json → {pkgStatus}</Text>
|
|
233
|
-
</GutterLine>
|
|
234
|
-
|
|
235
145
|
{/* ── Confirm ── */}
|
|
236
|
-
<GutterLine>
|
|
237
|
-
<Text> </Text>
|
|
238
|
-
</GutterLine>
|
|
146
|
+
<GutterLine><Text> </Text></GutterLine>
|
|
239
147
|
<GutterLine>
|
|
240
148
|
<Text>Proceed? </Text>
|
|
241
149
|
<ConfirmInput onConfirm={handleConfirm} onCancel={handleCancel} />
|
|
@@ -261,15 +169,8 @@ export default function Generation({ answers, onComplete }: Props) {
|
|
|
261
169
|
}
|
|
262
170
|
|
|
263
171
|
return (
|
|
264
|
-
|
|
265
|
-
<
|
|
266
|
-
|
|
267
|
-
</GutterLine>
|
|
268
|
-
{releaseResult && (
|
|
269
|
-
<GutterLine>
|
|
270
|
-
<Text color={C.green}>Release: {releaseResult}</Text>
|
|
271
|
-
</GutterLine>
|
|
272
|
-
)}
|
|
273
|
-
</>
|
|
172
|
+
<GutterLine>
|
|
173
|
+
<Text color={C.green}>All project files generated successfully.</Text>
|
|
174
|
+
</GutterLine>
|
|
274
175
|
);
|
|
275
176
|
}
|
package/src/steps/powerline.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { ConfirmInput, Spinner } from "@inkjs/ui";
|
|
|
4
4
|
import { GutterLine } from "../components/gutter-line.js";
|
|
5
5
|
import { setupPowerline } from "../lib/powerline.js";
|
|
6
6
|
import { initGit } from "../lib/git.js";
|
|
7
|
+
import { scaffoldRelease, ensurePackageJsonReleaseScripts } from "../lib/template.js";
|
|
7
8
|
import type { WizardAnswers } from "../lib/types.js";
|
|
8
9
|
import { C } from "../theme.js";
|
|
9
10
|
|
|
@@ -15,6 +16,7 @@ interface Props {
|
|
|
15
16
|
type Phase =
|
|
16
17
|
| "ask-powerline"
|
|
17
18
|
| "ask-git"
|
|
19
|
+
| "ask-release"
|
|
18
20
|
| "running"
|
|
19
21
|
| "done"
|
|
20
22
|
| "error";
|
|
@@ -22,59 +24,84 @@ type Phase =
|
|
|
22
24
|
interface SetupResult {
|
|
23
25
|
gitCommitted?: boolean;
|
|
24
26
|
gitWarning?: string;
|
|
27
|
+
releaseCreated?: boolean;
|
|
28
|
+
releaseSkipped?: boolean;
|
|
29
|
+
pkgModified?: boolean;
|
|
30
|
+
pkgCreated?: boolean;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export default function Powerline({ answers, onComplete }: Props) {
|
|
28
34
|
const [phase, setPhase] = useState<Phase>("ask-powerline");
|
|
29
35
|
const [wantPowerline, setWantPowerline] = useState(false);
|
|
30
36
|
const [wantGit, setWantGit] = useState(false);
|
|
37
|
+
const [wantRelease, setWantRelease] = useState(false);
|
|
31
38
|
const [errorMsg, setErrorMsg] = useState("");
|
|
32
39
|
const [setupResult, setSetupResult] = useState<SetupResult>({});
|
|
33
40
|
|
|
34
|
-
function runSetup(powerline: boolean, git: boolean) {
|
|
41
|
+
function runSetup(powerline: boolean, git: boolean, release: boolean) {
|
|
35
42
|
setPhase("running");
|
|
36
43
|
try {
|
|
37
44
|
const targetDir = process.cwd();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
const projectName = answers.projectName || "untitled";
|
|
46
|
+
const result: SetupResult = {};
|
|
47
|
+
|
|
48
|
+
if (powerline) setupPowerline(targetDir);
|
|
49
|
+
|
|
41
50
|
if (git) {
|
|
42
51
|
const gitResult = initGit(targetDir);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
gitWarning: gitResult.committed ? undefined : gitResult.reason,
|
|
46
|
-
});
|
|
52
|
+
result.gitCommitted = gitResult.committed;
|
|
53
|
+
result.gitWarning = gitResult.committed ? undefined : gitResult.reason;
|
|
47
54
|
}
|
|
55
|
+
|
|
56
|
+
if (release) {
|
|
57
|
+
const releaseRes = scaffoldRelease(projectName, answers);
|
|
58
|
+
const pkgRes = ensurePackageJsonReleaseScripts(targetDir, projectName);
|
|
59
|
+
result.releaseCreated = !releaseRes.skipped;
|
|
60
|
+
result.releaseSkipped = releaseRes.skipped;
|
|
61
|
+
result.pkgModified = pkgRes.modified;
|
|
62
|
+
result.pkgCreated = pkgRes.created;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
setSetupResult(result);
|
|
48
66
|
setPhase("done");
|
|
49
|
-
setTimeout(() => onComplete({ setupPowerline: powerline, setupGit: git }), 1000);
|
|
67
|
+
setTimeout(() => onComplete({ setupPowerline: powerline, setupGit: git, setupRelease: release }), 1000);
|
|
50
68
|
} catch (err) {
|
|
51
69
|
setPhase("error");
|
|
52
70
|
setErrorMsg(err instanceof Error ? err.message : String(err));
|
|
53
71
|
}
|
|
54
72
|
}
|
|
55
73
|
|
|
74
|
+
// ── Ask: Powerline ──────────────────────────────────────────────────────────
|
|
56
75
|
if (phase === "ask-powerline") {
|
|
57
76
|
return (
|
|
58
77
|
<>
|
|
59
78
|
<GutterLine>
|
|
60
|
-
<Text bold>
|
|
79
|
+
<Text bold>Claude Powerline</Text>
|
|
80
|
+
</GutterLine>
|
|
81
|
+
<GutterLine>
|
|
82
|
+
<Text color={C.overlay1}>Adds a live status bar to Claude Code showing: git branch,</Text>
|
|
83
|
+
</GutterLine>
|
|
84
|
+
<GutterLine>
|
|
85
|
+
<Text color={C.overlay1}>context usage %, session cost, and active tools.</Text>
|
|
86
|
+
</GutterLine>
|
|
87
|
+
<GutterLine>
|
|
88
|
+
<Text color={C.overlay1}>Runs via npx on each session — no global install needed.</Text>
|
|
89
|
+
</GutterLine>
|
|
90
|
+
<GutterLine>
|
|
91
|
+
<Text> </Text>
|
|
61
92
|
</GutterLine>
|
|
62
93
|
<GutterLine>
|
|
94
|
+
<Text bold>Set up Powerline? </Text>
|
|
63
95
|
<ConfirmInput
|
|
64
|
-
onConfirm={() => {
|
|
65
|
-
|
|
66
|
-
setPhase("ask-git");
|
|
67
|
-
}}
|
|
68
|
-
onCancel={() => {
|
|
69
|
-
setWantPowerline(false);
|
|
70
|
-
setPhase("ask-git");
|
|
71
|
-
}}
|
|
96
|
+
onConfirm={() => { setWantPowerline(true); setPhase("ask-git"); }}
|
|
97
|
+
onCancel={() => { setWantPowerline(false); setPhase("ask-git"); }}
|
|
72
98
|
/>
|
|
73
99
|
</GutterLine>
|
|
74
100
|
</>
|
|
75
101
|
);
|
|
76
102
|
}
|
|
77
103
|
|
|
104
|
+
// ── Ask: Git ────────────────────────────────────────────────────────────────
|
|
78
105
|
if (phase === "ask-git") {
|
|
79
106
|
return (
|
|
80
107
|
<>
|
|
@@ -84,24 +111,73 @@ export default function Powerline({ answers, onComplete }: Props) {
|
|
|
84
111
|
</GutterLine>
|
|
85
112
|
)}
|
|
86
113
|
<GutterLine>
|
|
87
|
-
<Text bold>
|
|
114
|
+
<Text bold>Git repository</Text>
|
|
115
|
+
</GutterLine>
|
|
116
|
+
<GutterLine>
|
|
117
|
+
<Text color={C.overlay1}>Runs git init and makes an initial commit with the generated</Text>
|
|
118
|
+
</GutterLine>
|
|
119
|
+
<GutterLine>
|
|
120
|
+
<Text color={C.overlay1}>files — clean starting point for your project history.</Text>
|
|
121
|
+
</GutterLine>
|
|
122
|
+
<GutterLine>
|
|
123
|
+
<Text> </Text>
|
|
124
|
+
</GutterLine>
|
|
125
|
+
<GutterLine>
|
|
126
|
+
<Text bold>Initialize git repo? </Text>
|
|
127
|
+
<ConfirmInput
|
|
128
|
+
onConfirm={() => { setWantGit(true); setPhase("ask-release"); }}
|
|
129
|
+
onCancel={() => { setWantGit(false); setPhase("ask-release"); }}
|
|
130
|
+
/>
|
|
131
|
+
</GutterLine>
|
|
132
|
+
</>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ── Ask: Release scripts ────────────────────────────────────────────────────
|
|
137
|
+
if (phase === "ask-release") {
|
|
138
|
+
const projectName = answers.projectName || "untitled";
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
{wantPowerline && (
|
|
142
|
+
<GutterLine>
|
|
143
|
+
<Text color={C.overlay1}>Powerline: yes</Text>
|
|
144
|
+
</GutterLine>
|
|
145
|
+
)}
|
|
146
|
+
{wantGit && (
|
|
147
|
+
<GutterLine>
|
|
148
|
+
<Text color={C.overlay1}>Git: yes</Text>
|
|
149
|
+
</GutterLine>
|
|
150
|
+
)}
|
|
151
|
+
<GutterLine>
|
|
152
|
+
<Text bold>npm release scripts</Text>
|
|
153
|
+
</GutterLine>
|
|
154
|
+
<GutterLine>
|
|
155
|
+
<Text color={C.overlay1}>Creates ~/bin/{projectName}-release and adds release:patch /</Text>
|
|
88
156
|
</GutterLine>
|
|
89
157
|
<GutterLine>
|
|
158
|
+
<Text color={C.overlay1}>minor / major scripts to package.json. One command to build,</Text>
|
|
159
|
+
</GutterLine>
|
|
160
|
+
<GutterLine>
|
|
161
|
+
<Text color={C.overlay1}>version-bump, push tags, and publish to npm.</Text>
|
|
162
|
+
</GutterLine>
|
|
163
|
+
<GutterLine>
|
|
164
|
+
<Text color={C.overlay1}>Requires: npm login. Best for packages published to npm.</Text>
|
|
165
|
+
</GutterLine>
|
|
166
|
+
<GutterLine>
|
|
167
|
+
<Text> </Text>
|
|
168
|
+
</GutterLine>
|
|
169
|
+
<GutterLine>
|
|
170
|
+
<Text bold>Set up release scripts? </Text>
|
|
90
171
|
<ConfirmInput
|
|
91
|
-
onConfirm={() => {
|
|
92
|
-
|
|
93
|
-
runSetup(wantPowerline, true);
|
|
94
|
-
}}
|
|
95
|
-
onCancel={() => {
|
|
96
|
-
setWantGit(false);
|
|
97
|
-
runSetup(wantPowerline, false);
|
|
98
|
-
}}
|
|
172
|
+
onConfirm={() => { setWantRelease(true); runSetup(wantPowerline, wantGit, true); }}
|
|
173
|
+
onCancel={() => { setWantRelease(false); runSetup(wantPowerline, wantGit, false); }}
|
|
99
174
|
/>
|
|
100
175
|
</GutterLine>
|
|
101
176
|
</>
|
|
102
177
|
);
|
|
103
178
|
}
|
|
104
179
|
|
|
180
|
+
// ── Running ─────────────────────────────────────────────────────────────────
|
|
105
181
|
if (phase === "running") {
|
|
106
182
|
return (
|
|
107
183
|
<GutterLine>
|
|
@@ -110,6 +186,7 @@ export default function Powerline({ answers, onComplete }: Props) {
|
|
|
110
186
|
);
|
|
111
187
|
}
|
|
112
188
|
|
|
189
|
+
// ── Error ───────────────────────────────────────────────────────────────────
|
|
113
190
|
if (phase === "error") {
|
|
114
191
|
return (
|
|
115
192
|
<GutterLine>
|
|
@@ -118,6 +195,7 @@ export default function Powerline({ answers, onComplete }: Props) {
|
|
|
118
195
|
);
|
|
119
196
|
}
|
|
120
197
|
|
|
198
|
+
// ── Done ────────────────────────────────────────────────────────────────────
|
|
121
199
|
return (
|
|
122
200
|
<>
|
|
123
201
|
{wantPowerline && (
|
|
@@ -135,15 +213,25 @@ export default function Powerline({ answers, onComplete }: Props) {
|
|
|
135
213
|
<Text color={C.peach}>{"⚠ Git: "}{setupResult.gitWarning}</Text>
|
|
136
214
|
</GutterLine>
|
|
137
215
|
)}
|
|
138
|
-
{
|
|
216
|
+
{wantRelease && setupResult.releaseCreated && (
|
|
217
|
+
<GutterLine>
|
|
218
|
+
<Text color={C.green}>
|
|
219
|
+
Release script created.{setupResult.pkgModified ? " package.json updated." : setupResult.pkgCreated ? " package.json created." : ""}
|
|
220
|
+
</Text>
|
|
221
|
+
</GutterLine>
|
|
222
|
+
)}
|
|
223
|
+
{wantRelease && setupResult.releaseSkipped && (
|
|
224
|
+
<GutterLine>
|
|
225
|
+
<Text color={C.overlay1}>Release script already exists — skipped.</Text>
|
|
226
|
+
</GutterLine>
|
|
227
|
+
)}
|
|
228
|
+
{!wantPowerline && !wantGit && !wantRelease && (
|
|
139
229
|
<GutterLine>
|
|
140
|
-
<Text color={C.overlay1}>No extras
|
|
230
|
+
<Text color={C.overlay1}>No extras configured.</Text>
|
|
141
231
|
</GutterLine>
|
|
142
232
|
)}
|
|
143
233
|
<GutterLine>
|
|
144
|
-
<Text color={C.green} bold>
|
|
145
|
-
Setup complete!
|
|
146
|
-
</Text>
|
|
234
|
+
<Text color={C.green} bold>Setup complete!</Text>
|
|
147
235
|
</GutterLine>
|
|
148
236
|
</>
|
|
149
237
|
);
|