@fnd-platform/cli 1.0.0-alpha.31 → 1.0.0-alpha.32
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 status indicators
|
|
4
|
+
* Displays a vertical list of progress steps with status indicators,
|
|
5
|
+
* progress bar, percentage, and fun 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,KAA8B,MAAM,OAAO,CAAC;AAKnD;;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;AA0HD;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,YAAY,EACZ,YAAmB,GACpB,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAwDzC"}
|
|
@@ -1,7 +1,73 @@
|
|
|
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 status indicators,
|
|
6
|
+
* progress bar, percentage, and fun status messages.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useEffect } 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 dependencies...',
|
|
33
|
+
'Downloading packages from npm...',
|
|
34
|
+
'Building your node_modules...',
|
|
35
|
+
'This might take a moment...',
|
|
36
|
+
'Resolving package versions...',
|
|
37
|
+
'Installing the good stuff...',
|
|
38
|
+
'Almost there, hang tight...',
|
|
39
|
+
'Compiling dependencies...',
|
|
40
|
+
],
|
|
41
|
+
'running-projen': [
|
|
42
|
+
'Running Projen synthesis...',
|
|
43
|
+
'Generating project files...',
|
|
44
|
+
'Applying configurations...',
|
|
45
|
+
'Finalizing setup...',
|
|
46
|
+
],
|
|
47
|
+
'running-synth': [
|
|
48
|
+
'Running Projen synthesis...',
|
|
49
|
+
'Generating project files...',
|
|
50
|
+
'Applying configurations...',
|
|
51
|
+
],
|
|
52
|
+
'generating-infra': [
|
|
53
|
+
'Generating infrastructure...',
|
|
54
|
+
'Creating CDK stacks...',
|
|
55
|
+
'Building AWS resources...',
|
|
56
|
+
],
|
|
57
|
+
'modifying-projenrc': [
|
|
58
|
+
'Updating configuration...',
|
|
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
|
+
};
|
|
5
71
|
/**
|
|
6
72
|
* Renders a status indicator for a step.
|
|
7
73
|
*/
|
|
@@ -19,11 +85,46 @@ function StepIndicator({ status }) {
|
|
|
19
85
|
return _jsx(Text, { color: colors.muted, children: "\u25CB" });
|
|
20
86
|
}
|
|
21
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* ASCII progress bar component.
|
|
90
|
+
*/
|
|
91
|
+
function ProgressBar({ percent }) {
|
|
92
|
+
const width = 30;
|
|
93
|
+
const filled = Math.round((percent / 100) * width);
|
|
94
|
+
const empty = width - filled;
|
|
95
|
+
const filledChar = '█';
|
|
96
|
+
const emptyChar = '░';
|
|
97
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: colors.accent, children: filledChar.repeat(filled) }), _jsx(Text, { color: colors.muted, children: emptyChar.repeat(empty) }), _jsxs(Text, { color: colors.primary, children: [" ", percent, "%"] })] }));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Rotating status message component.
|
|
101
|
+
*/
|
|
102
|
+
function StatusMessage({ stepId }) {
|
|
103
|
+
const [messageIndex, setMessageIndex] = useState(0);
|
|
104
|
+
const messages = STATUS_MESSAGES[stepId] || STATUS_MESSAGES.default;
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const interval = setInterval(() => {
|
|
107
|
+
setMessageIndex((prev) => (prev + 1) % messages.length);
|
|
108
|
+
}, 2500); // Change message every 2.5 seconds
|
|
109
|
+
return () => clearInterval(interval);
|
|
110
|
+
}, [messages.length]);
|
|
111
|
+
return (_jsx(Text, { color: colors.muted, italic: true, children: messages[messageIndex] }));
|
|
112
|
+
}
|
|
22
113
|
/**
|
|
23
114
|
* Progress steps component showing multiple steps with their status.
|
|
24
115
|
*/
|
|
25
|
-
export function ProgressSteps({ steps, errorMessage }) {
|
|
26
|
-
|
|
116
|
+
export function ProgressSteps({ steps, errorMessage, showProgress = true, }) {
|
|
117
|
+
// Calculate progress
|
|
118
|
+
const completedSteps = steps.filter((s) => s.status === 'complete').length;
|
|
119
|
+
const totalSteps = steps.length;
|
|
120
|
+
const currentStepIndex = steps.findIndex((s) => s.status === 'in-progress');
|
|
121
|
+
const currentStep = currentStepIndex >= 0 ? steps[currentStepIndex] : null;
|
|
122
|
+
// Calculate percentage (give partial credit for in-progress step)
|
|
123
|
+
const basePercent = Math.round((completedSteps / totalSteps) * 100);
|
|
124
|
+
const inProgressBonus = currentStep ? Math.round((1 / totalSteps) * 50) : 0; // 50% of step
|
|
125
|
+
const percent = Math.min(basePercent + inProgressBonus, 99); // Cap at 99% until complete
|
|
126
|
+
const isComplete = completedSteps === totalSteps;
|
|
127
|
+
return (_jsxs(Box, { flexDirection: "column", gap: 0, children: [showProgress && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(ProgressBar, { percent: isComplete ? 100 : percent }), currentStep && (_jsx(Box, { marginTop: 1, children: _jsx(StatusMessage, { stepId: currentStep.id }) }))] })), steps.map((step) => {
|
|
27
128
|
const textColor = step.status === 'complete'
|
|
28
129
|
? colors.success
|
|
29
130
|
: 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,OAAO,CAAC;AACnD,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,0BAA0B;QAC1B,kCAAkC;QAClC,+BAA+B;QAC/B,6BAA6B;QAC7B,+BAA+B;QAC/B,8BAA8B;QAC9B,6BAA6B;QAC7B,2BAA2B;KAC5B;IACD,gBAAgB,EAAE;QAChB,6BAA6B;QAC7B,6B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