@fnd-platform/cli 1.0.0-alpha.31 → 1.0.0-alpha.33
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,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Progress steps component for the FND TUI.
|
|
3
3
|
*
|
|
4
|
-
* Displays a vertical list of progress steps with
|
|
4
|
+
* Displays a vertical list of progress steps with animated indicators,
|
|
5
|
+
* elapsed time, and contextual status messages.
|
|
5
6
|
*/
|
|
6
7
|
import React from 'react';
|
|
7
8
|
/**
|
|
@@ -27,9 +28,11 @@ export interface ProgressStepsProps {
|
|
|
27
28
|
steps: ProgressStep[];
|
|
28
29
|
/** Error message to display */
|
|
29
30
|
errorMessage?: string;
|
|
31
|
+
/** Whether to show enhanced progress UI */
|
|
32
|
+
showProgress?: boolean;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* Progress steps component showing multiple steps with their status.
|
|
33
36
|
*/
|
|
34
|
-
export declare function ProgressSteps({ steps, errorMessage }: ProgressStepsProps): React.ReactElement;
|
|
37
|
+
export declare function ProgressSteps({ steps, errorMessage, showProgress, }: ProgressStepsProps): React.ReactElement;
|
|
35
38
|
//# sourceMappingURL=ProgressSteps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressSteps.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/feedback/ProgressSteps.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ProgressSteps.d.ts","sourceRoot":"","sources":["../../../../src/tui/components/feedback/ProgressSteps.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAqKD;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,YAAmB,GACpB,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAqDzC"}
|
|
@@ -1,7 +1,92 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Progress steps component for the FND TUI.
|
|
4
|
+
*
|
|
5
|
+
* Displays a vertical list of progress steps with animated indicators,
|
|
6
|
+
* elapsed time, and contextual status messages.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
9
|
import { Box, Text } from 'ink';
|
|
3
10
|
import { colors } from '../../utils/colors.js';
|
|
4
11
|
import { Spinner } from './Spinner.js';
|
|
12
|
+
/**
|
|
13
|
+
* Fun status messages for different step types.
|
|
14
|
+
*/
|
|
15
|
+
const STATUS_MESSAGES = {
|
|
16
|
+
'creating-directory': [
|
|
17
|
+
'Setting up your workspace...',
|
|
18
|
+
'Making room for greatness...',
|
|
19
|
+
'Preparing the foundation...',
|
|
20
|
+
],
|
|
21
|
+
'writing-files': [
|
|
22
|
+
'Writing configuration files...',
|
|
23
|
+
'Laying down the blueprints...',
|
|
24
|
+
'Crafting your project structure...',
|
|
25
|
+
],
|
|
26
|
+
'initializing-git': [
|
|
27
|
+
'Initializing version control...',
|
|
28
|
+
'Setting up git history...',
|
|
29
|
+
'Preparing for collaboration...',
|
|
30
|
+
],
|
|
31
|
+
'installing-deps': [
|
|
32
|
+
'Fetching packages from npm registry...',
|
|
33
|
+
'Resolving dependency tree...',
|
|
34
|
+
'Downloading node modules...',
|
|
35
|
+
'This might take a moment...',
|
|
36
|
+
'Linking dependencies...',
|
|
37
|
+
'Building native modules...',
|
|
38
|
+
'Almost there, hang tight...',
|
|
39
|
+
'Optimizing package cache...',
|
|
40
|
+
],
|
|
41
|
+
'running-projen': [
|
|
42
|
+
'Synthesizing project configuration...',
|
|
43
|
+
'Generating TypeScript configs...',
|
|
44
|
+
'Creating package.json files...',
|
|
45
|
+
'Setting up build scripts...',
|
|
46
|
+
],
|
|
47
|
+
'running-synth': [
|
|
48
|
+
'Synthesizing project configuration...',
|
|
49
|
+
'Generating TypeScript configs...',
|
|
50
|
+
'Applying Projen templates...',
|
|
51
|
+
],
|
|
52
|
+
'generating-infra': [
|
|
53
|
+
'Generating CDK infrastructure...',
|
|
54
|
+
'Creating stack definitions...',
|
|
55
|
+
'Setting up AWS resources...',
|
|
56
|
+
],
|
|
57
|
+
'modifying-projenrc': [
|
|
58
|
+
'Updating .projenrc.ts...',
|
|
59
|
+
'Adding package definition...',
|
|
60
|
+
],
|
|
61
|
+
'validating': [
|
|
62
|
+
'Validating configuration...',
|
|
63
|
+
'Checking requirements...',
|
|
64
|
+
],
|
|
65
|
+
default: [
|
|
66
|
+
'Working on it...',
|
|
67
|
+
'Processing...',
|
|
68
|
+
'Please wait...',
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Animated ASCII activity indicator frames.
|
|
73
|
+
*/
|
|
74
|
+
const ACTIVITY_FRAMES = [
|
|
75
|
+
'⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'
|
|
76
|
+
];
|
|
77
|
+
/**
|
|
78
|
+
* Bouncing dot animation for visual interest.
|
|
79
|
+
*/
|
|
80
|
+
const BOUNCE_FRAMES = [
|
|
81
|
+
'●∙∙∙∙',
|
|
82
|
+
'∙●∙∙∙',
|
|
83
|
+
'∙∙●∙∙',
|
|
84
|
+
'∙∙∙●∙',
|
|
85
|
+
'∙∙∙∙●',
|
|
86
|
+
'∙∙∙●∙',
|
|
87
|
+
'∙∙●∙∙',
|
|
88
|
+
'∙●∙∙∙',
|
|
89
|
+
];
|
|
5
90
|
/**
|
|
6
91
|
* Renders a status indicator for a step.
|
|
7
92
|
*/
|
|
@@ -19,11 +104,60 @@ function StepIndicator({ status }) {
|
|
|
19
104
|
return _jsx(Text, { color: colors.muted, children: "\u25CB" });
|
|
20
105
|
}
|
|
21
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Animated activity indicator with bouncing dots.
|
|
109
|
+
*/
|
|
110
|
+
function ActivityIndicator() {
|
|
111
|
+
const [frame, setFrame] = useState(0);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
const interval = setInterval(() => {
|
|
114
|
+
setFrame((prev) => (prev + 1) % BOUNCE_FRAMES.length);
|
|
115
|
+
}, 120);
|
|
116
|
+
return () => clearInterval(interval);
|
|
117
|
+
}, []);
|
|
118
|
+
return _jsx(Text, { color: colors.accent, children: BOUNCE_FRAMES[frame] });
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Elapsed time display.
|
|
122
|
+
*/
|
|
123
|
+
function ElapsedTime({ startTime }) {
|
|
124
|
+
const [elapsed, setElapsed] = useState(0);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
const interval = setInterval(() => {
|
|
127
|
+
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
|
128
|
+
}, 1000);
|
|
129
|
+
return () => clearInterval(interval);
|
|
130
|
+
}, [startTime]);
|
|
131
|
+
const minutes = Math.floor(elapsed / 60);
|
|
132
|
+
const seconds = elapsed % 60;
|
|
133
|
+
const timeStr = minutes > 0
|
|
134
|
+
? `${minutes}m ${seconds}s`
|
|
135
|
+
: `${seconds}s`;
|
|
136
|
+
return (_jsxs(Text, { color: colors.muted, children: ["elapsed: ", timeStr] }));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Rotating status message component.
|
|
140
|
+
*/
|
|
141
|
+
function StatusMessage({ stepId }) {
|
|
142
|
+
const [messageIndex, setMessageIndex] = useState(0);
|
|
143
|
+
const messages = STATUS_MESSAGES[stepId] || STATUS_MESSAGES.default;
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
const interval = setInterval(() => {
|
|
146
|
+
setMessageIndex((prev) => (prev + 1) % messages.length);
|
|
147
|
+
}, 3000); // Change message every 3 seconds
|
|
148
|
+
return () => clearInterval(interval);
|
|
149
|
+
}, [messages.length]);
|
|
150
|
+
return (_jsx(Text, { color: colors.muted, children: messages[messageIndex] }));
|
|
151
|
+
}
|
|
22
152
|
/**
|
|
23
153
|
* Progress steps component showing multiple steps with their status.
|
|
24
154
|
*/
|
|
25
|
-
export function ProgressSteps({ steps, errorMessage }) {
|
|
26
|
-
|
|
155
|
+
export function ProgressSteps({ steps, errorMessage, showProgress = true, }) {
|
|
156
|
+
const startTimeRef = useRef(Date.now());
|
|
157
|
+
const currentStepIndex = steps.findIndex((s) => s.status === 'in-progress');
|
|
158
|
+
const currentStep = currentStepIndex >= 0 ? steps[currentStepIndex] : null;
|
|
159
|
+
const completedCount = steps.filter((s) => s.status === 'complete').length;
|
|
160
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 0, children: [showProgress && currentStep && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { gap: 2, children: [_jsx(ActivityIndicator, {}), _jsxs(Text, { color: colors.primary, bold: true, children: ["Step ", completedCount + 1, " of ", steps.length] }), _jsx(ElapsedTime, { startTime: startTimeRef.current })] }), _jsx(Box, { marginTop: 1, children: _jsx(StatusMessage, { stepId: currentStep.id }) })] })), steps.map((step) => {
|
|
27
161
|
const textColor = step.status === 'complete'
|
|
28
162
|
? colors.success
|
|
29
163
|
: step.status === 'error'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressSteps.js","sourceRoot":"","sources":["../../../../src/tui/components/feedback/ProgressSteps.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ProgressSteps.js","sourceRoot":"","sources":["../../../../src/tui/components/feedback/ProgressSteps.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA+BvC;;GAEG;AACH,MAAM,eAAe,GAA6B;IAChD,oBAAoB,EAAE;QACpB,8BAA8B;QAC9B,8BAA8B;QAC9B,6BAA6B;KAC9B;IACD,eAAe,EAAE;QACf,gCAAgC;QAChC,+BAA+B;QAC/B,oCAAoC;KACrC;IACD,kBAAkB,EAAE;QAClB,iCAAiC;QACjC,2BAA2B;QAC3B,gCAAgC;KACjC;IACD,iBAAiB,EAAE;QACjB,wCAAwC;QACxC,8BAA8B;QAC9B,6BAA6B;QAC7B,6BAA6B;QAC7B,yBAAyB;QACzB,4BAA4B;QAC5B,6BAA6B;QAC7B,6BAA6B;KAC9B;IACD,gBAAgB,EAAE;QAChB,uCAAuC;QACvC,kCAAkC;QAClC,gCAAgC;QAChC,6BAA6B;KAC9B;IACD,eAAe,EAAE;QACf,uCAAuC;QACvC,kCAAkC;QAClC,8BAA8B;KAC/B;IACD,kBAAkB,EAAE;QAClB,kCAAkC;QAClC,+BAA+B;QAC/B,6BAA6B;KAC9B;IACD,oBAAoB,EAAE;QACpB,0BAA0B;QAC1B,8BAA8B;KAC/B;IACD,YAAY,EAAE;QACZ,6BAA6B;QAC7B,0BAA0B;KAC3B;IACD,OAAO,EAAE;QACP,kBAAkB;QAClB,eAAe;QACf,gBAAgB;KACjB;CACF,CAA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