@contentful/experience-design-system-cli 2.26.1-dev-build-a852362.0 → 2.26.1-dev-build-f03f014.0
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/package.json +14 -10
- package/dist/src/index.js +34937 -9
- package/dist/src/lib/cli-path.d.ts +4 -0
- package/dist/src/runs/export-helpers.d.ts +1 -12
- package/dist/src/runs/push-helpers.d.ts +1 -6
- package/package.json +12 -7
- package/skills/generate-components.md +427 -0
- package/skills/generate-tokens.md +194 -0
- package/skills/select-components.md +224 -0
- package/dist/src/analytics/apply.js +0 -30
- package/dist/src/analytics/client.js +0 -81
- package/dist/src/analytics/constants.js +0 -4
- package/dist/src/analytics/env.js +0 -14
- package/dist/src/analytics/exit.js +0 -24
- package/dist/src/analytics/index.js +0 -9
- package/dist/src/analytics/normalize.js +0 -18
- package/dist/src/analytics/os.js +0 -13
- package/dist/src/analytics/session.js +0 -15
- package/dist/src/analytics/tracker.js +0 -126
- package/dist/src/analytics/types.js +0 -1
- package/dist/src/analyze/build-analyze-view-rows.js +0 -63
- package/dist/src/analyze/command.js +0 -599
- package/dist/src/analyze/composite-closure.js +0 -0
- package/dist/src/analyze/composition/agent-parser/author-prompt.js +0 -22
- package/dist/src/analyze/composition/agent-parser/extract-parser.js +0 -44
- package/dist/src/analyze/composition/agent-parser/load-prompt.js +0 -31
- package/dist/src/analyze/composition/agent-parser/resolve-via-parser.js +0 -88
- package/dist/src/analyze/composition/agent-parser/sandbox.js +0 -187
- package/dist/src/analyze/composition/apply-mapping.js +0 -67
- package/dist/src/analyze/composition/candidate-critic-agent.js +0 -39
- package/dist/src/analyze/composition/candidate-critic.js +0 -63
- package/dist/src/analyze/composition/candidate-files.js +0 -131
- package/dist/src/analyze/composition/composition-cache-key.js +0 -19
- package/dist/src/analyze/composition/interchange-schema.js +0 -61
- package/dist/src/analyze/composition/manifest-doc-evidence.js +0 -136
- package/dist/src/analyze/composition/merge-edges.js +0 -70
- package/dist/src/analyze/composition/parse-map-edges.js +0 -55
- package/dist/src/analyze/composition/resolve-mapping-cli.js +0 -29
- package/dist/src/analyze/composition/resolve-mapping.js +0 -111
- package/dist/src/analyze/cycle-detection.js +0 -234
- package/dist/src/analyze/cycle-view.js +0 -28
- package/dist/src/analyze/fuzzy-search.js +0 -55
- package/dist/src/analyze/issue-inheritance.js +0 -108
- package/dist/src/analyze/lineage.js +0 -0
- package/dist/src/analyze/scope-gate-cascade.js +0 -170
- package/dist/src/analyze/search-neighborhood.js +0 -56
- package/dist/src/analyze/select/command.js +0 -484
- package/dist/src/analyze/select/index.js +0 -5
- package/dist/src/analyze/select/parser.js +0 -53
- package/dist/src/analyze/select/persistence.js +0 -80
- package/dist/src/analyze/select/preview-annotations.js +0 -62
- package/dist/src/analyze/select/stdout.js +0 -3
- package/dist/src/analyze/select/tui/App.js +0 -483
- package/dist/src/analyze/select/tui/components/ComponentDetail.js +0 -48
- package/dist/src/analyze/select/tui/components/ComponentRationalePanel.js +0 -125
- package/dist/src/analyze/select/tui/components/FieldEditor.js +0 -1131
- package/dist/src/analyze/select/tui/components/FinalizeDialog.js +0 -36
- package/dist/src/analyze/select/tui/components/GotoBanner.js +0 -30
- package/dist/src/analyze/select/tui/components/GroupedSidebar.js +0 -517
- package/dist/src/analyze/select/tui/components/HelpOverlay.js +0 -17
- package/dist/src/analyze/select/tui/components/JsonEditor.js +0 -131
- package/dist/src/analyze/select/tui/components/JsonPanel.js +0 -66
- package/dist/src/analyze/select/tui/components/LineagePanel.js +0 -22
- package/dist/src/analyze/select/tui/components/PreviewSummaryBar.js +0 -29
- package/dist/src/analyze/select/tui/components/QuitDialog.js +0 -14
- package/dist/src/analyze/select/tui/components/RationalePanel.js +0 -80
- package/dist/src/analyze/select/tui/components/Sidebar.js +0 -92
- package/dist/src/analyze/select/tui/components/SourcePanel.js +0 -52
- package/dist/src/analyze/select/tui/components/StatusBar.js +0 -7
- package/dist/src/analyze/select/tui/components/TopBar.js +0 -10
- package/dist/src/analyze/select/tui/components/removed-components-text.js +0 -11
- package/dist/src/analyze/select/tui/hooks/scroll-offset.js +0 -26
- package/dist/src/analyze/select/tui/hooks/useImmediateInput.js +0 -66
- package/dist/src/analyze/select/tui/hooks/useKeymap.js +0 -67
- package/dist/src/analyze/select/tui/hooks/useSession.js +0 -52
- package/dist/src/analyze/select/tui/hooks/useUndo.js +0 -26
- package/dist/src/analyze/select/tui/theme.js +0 -28
- package/dist/src/analyze/select/types.js +0 -39
- package/dist/src/analyze/select-agent/command.js +0 -558
- package/dist/src/analyze/select-agent/context-builder.js +0 -197
- package/dist/src/analyze/select-agent/show-rationale.js +0 -92
- package/dist/src/analyze/selection-cascade.js +0 -19
- package/dist/src/analyze/slot-graph.js +0 -17
- package/dist/src/analyze/tui/AnalyzeView.js +0 -64
- package/dist/src/apply/api-client.js +0 -440
- package/dist/src/apply/command.js +0 -845
- package/dist/src/apply/manifest.js +0 -1
- package/dist/src/apply/preview-utils.js +0 -26
- package/dist/src/apply/tui/SelectView.js +0 -34
- package/dist/src/apply/tui/ServerApplyView.js +0 -49
- package/dist/src/apply/tui/ServerPreviewView.js +0 -23
- package/dist/src/credentials-store.js +0 -74
- package/dist/src/generate/command.js +0 -597
- package/dist/src/generate/edit/command.js +0 -127
- package/dist/src/generate/tui/GenerateView.js +0 -10
- package/dist/src/host-utils.js +0 -26
- package/dist/src/import/agent-model-resolve.js +0 -35
- package/dist/src/import/auto-filter-resolve.js +0 -16
- package/dist/src/import/command.js +0 -380
- package/dist/src/import/cycle-auto-reject.js +0 -14
- package/dist/src/import/orchestrator.js +0 -603
- package/dist/src/import/path-utils.js +0 -30
- package/dist/src/import/picker-dispatch.js +0 -44
- package/dist/src/import/print-prompt.js +0 -31
- package/dist/src/import/strip-allowed-components.js +0 -22
- package/dist/src/import/tui/CustomPromptBanner.js +0 -8
- package/dist/src/import/tui/WizardApp.js +0 -1670
- package/dist/src/import/tui/ai-flag.js +0 -6
- package/dist/src/import/tui/auto-filter-error.js +0 -29
- package/dist/src/import/tui/autocomplete.js +0 -32
- package/dist/src/import/tui/components/AutoFilterBanner.js +0 -19
- package/dist/src/import/tui/components/CounterStrip.js +0 -12
- package/dist/src/import/tui/components/LegendEntry.js +0 -6
- package/dist/src/import/tui/cycle-panel-scroll.js +0 -33
- package/dist/src/import/tui/final-review-host.js +0 -25
- package/dist/src/import/tui/group-collapse.js +0 -11
- package/dist/src/import/tui/history.js +0 -53
- package/dist/src/import/tui/hooks/useLineage.js +0 -50
- package/dist/src/import/tui/hooks/useOverlayPanel.js +0 -27
- package/dist/src/import/tui/lineage-layout.js +0 -82
- package/dist/src/import/tui/merge-ai-decisions.js +0 -22
- package/dist/src/import/tui/push-decision-gate-helpers.js +0 -8
- package/dist/src/import/tui/push-progress.js +0 -1
- package/dist/src/import/tui/run-print-files-helpers.js +0 -8
- package/dist/src/import/tui/run-teaser.js +0 -9
- package/dist/src/import/tui/runLivePreview.js +0 -82
- package/dist/src/import/tui/runScopeGate.js +0 -28
- package/dist/src/import/tui/scope-gate-columns.js +0 -94
- package/dist/src/import/tui/scope-gate-host.js +0 -28
- package/dist/src/import/tui/sidebar-width.js +0 -3
- package/dist/src/import/tui/spawn-generate.js +0 -53
- package/dist/src/import/tui/step-filters.js +0 -42
- package/dist/src/import/tui/steps/AtomicGenerateReviewStep.js +0 -726
- package/dist/src/import/tui/steps/AtomicScopeGateStep.js +0 -210
- package/dist/src/import/tui/steps/CredentialsStep.js +0 -108
- package/dist/src/import/tui/steps/DoneStep.js +0 -24
- package/dist/src/import/tui/steps/ErrorStep.js +0 -16
- package/dist/src/import/tui/steps/GateStep.js +0 -22
- package/dist/src/import/tui/steps/GenerateReviewStep.js +0 -1618
- package/dist/src/import/tui/steps/PathValidationStep.js +0 -152
- package/dist/src/import/tui/steps/PreviewStep.js +0 -37
- package/dist/src/import/tui/steps/PreviewValidationErrorStep.js +0 -23
- package/dist/src/import/tui/steps/PushDecisionGateStep.js +0 -73
- package/dist/src/import/tui/steps/PushingStep.js +0 -24
- package/dist/src/import/tui/steps/RunningStep.js +0 -21
- package/dist/src/import/tui/steps/ScopeGateStep.js +0 -907
- package/dist/src/import/tui/steps/TokenInputStep.js +0 -88
- package/dist/src/import/tui/steps/WelcomeStep.js +0 -34
- package/dist/src/import/tui/steps/WizardPreviewStep.js +0 -169
- package/dist/src/import/tui/steps/auto-reject-decision.js +0 -9
- package/dist/src/import/tui/steps/breaking-change-format.js +0 -24
- package/dist/src/import/tui/steps/enumerate-cycle-breaks.js +0 -0
- package/dist/src/import/tui/steps/preview-diff.js +0 -175
- package/dist/src/import/tui/useFinalizePreview.js +0 -0
- package/dist/src/import/tui/useLivePreview.js +0 -122
- package/dist/src/import/tui/wizard-422-helpers.js +0 -60
- package/dist/src/import/tui/wizard-generate-progress.js +0 -25
- package/dist/src/import/tui/wizard-save-flow.js +0 -20
- package/dist/src/import/tui/wizard-state-transitions.js +0 -32
- package/dist/src/lib/agent-model-options.js +0 -15
- package/dist/src/lib/command-options.js +0 -30
- package/dist/src/lib/composition-mode.js +0 -39
- package/dist/src/lib/contentful-urls.js +0 -27
- package/dist/src/lib/debug-logger.js +0 -229
- package/dist/src/lib/debug-preamble.js +0 -33
- package/dist/src/lib/error-parser.js +0 -269
- package/dist/src/lib/prompt-overrides.js +0 -69
- package/dist/src/lib/terminal-capabilities.js +0 -51
- package/dist/src/lib/user-agent.js +0 -29
- package/dist/src/output/format.js +0 -110
- package/dist/src/print/command.js +0 -221
- package/dist/src/print/validate/tui/ValidateView.js +0 -37
- package/dist/src/print/validate/validators/cdf-validator.js +0 -104
- package/dist/src/print/validate/validators/dtcg-validator.js +0 -110
- package/dist/src/print/validate/validators/format-errors.js +0 -18
- package/dist/src/program.js +0 -105
- package/dist/src/runs/export-helpers.js +0 -59
- package/dist/src/runs/fingerprint.js +0 -75
- package/dist/src/runs/ls-command.js +0 -137
- package/dist/src/runs/modify-launcher.js +0 -42
- package/dist/src/runs/path-prompt.js +0 -72
- package/dist/src/runs/push-creds-prompt.js +0 -39
- package/dist/src/runs/push-helpers.js +0 -72
- package/dist/src/runs/push-launcher.js +0 -77
- package/dist/src/runs/replay-helpers.js +0 -164
- package/dist/src/runs/resolve-run-target.js +0 -45
- package/dist/src/runs/run-picker-mount.js +0 -72
- package/dist/src/runs/run-picker.js +0 -129
- package/dist/src/runs/save-conflict.js +0 -56
- package/dist/src/runs/save-path-resolver.js +0 -75
- package/dist/src/runs/staleness.js +0 -140
- package/dist/src/runs/store.js +0 -136
- package/dist/src/session/cache-keys.js +0 -44
- package/dist/src/session/command.js +0 -261
- package/dist/src/session/db.js +0 -1538
- package/dist/src/session/migration.js +0 -117
- package/dist/src/session/session-id.js +0 -212
- package/dist/src/session/stats.js +0 -89
- package/dist/src/setup/analytics-prompt.js +0 -24
- package/dist/src/setup/auto-filter-prompt.js +0 -24
- package/dist/src/setup/command.js +0 -966
- package/dist/src/setup/composition-mode-prompt.js +0 -37
- package/dist/src/setup/debug-mode-prompt.js +0 -22
- package/dist/src/types.js +0 -1
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { PALETTE } from '../../../analyze/select/tui/theme.js';
|
|
4
|
-
import { Box, Text } from 'ink';
|
|
5
|
-
import { promises as fs } from 'node:fs';
|
|
6
|
-
import { join } from 'node:path';
|
|
7
|
-
import { useImmediateInput } from '../../../analyze/select/tui/hooks/useImmediateInput.js';
|
|
8
|
-
const IGNORE_DIRS = new Set([
|
|
9
|
-
'node_modules',
|
|
10
|
-
'dist',
|
|
11
|
-
'build',
|
|
12
|
-
'.next',
|
|
13
|
-
'.nuxt',
|
|
14
|
-
'coverage',
|
|
15
|
-
'storybook-static',
|
|
16
|
-
'out',
|
|
17
|
-
'.git',
|
|
18
|
-
]);
|
|
19
|
-
async function countFiles(dir) {
|
|
20
|
-
const counts = {
|
|
21
|
-
tsx: 0,
|
|
22
|
-
ts: 0,
|
|
23
|
-
vue: 0,
|
|
24
|
-
astro: 0,
|
|
25
|
-
jsx: 0,
|
|
26
|
-
js: 0,
|
|
27
|
-
json: 0,
|
|
28
|
-
other: 0,
|
|
29
|
-
total: 0,
|
|
30
|
-
};
|
|
31
|
-
async function walk(current) {
|
|
32
|
-
let entries;
|
|
33
|
-
try {
|
|
34
|
-
entries = await fs.readdir(current);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
await Promise.all(entries.map(async (entry) => {
|
|
40
|
-
if (IGNORE_DIRS.has(entry))
|
|
41
|
-
return;
|
|
42
|
-
const full = join(current, entry);
|
|
43
|
-
let stat;
|
|
44
|
-
try {
|
|
45
|
-
stat = await fs.stat(full);
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (stat.isDirectory()) {
|
|
51
|
-
await walk(full);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
counts.total++;
|
|
55
|
-
const ext = entry.slice(entry.lastIndexOf('.'));
|
|
56
|
-
if (ext === '.tsx')
|
|
57
|
-
counts.tsx++;
|
|
58
|
-
else if (ext === '.ts' && !entry.endsWith('.d.ts'))
|
|
59
|
-
counts.ts++;
|
|
60
|
-
else if (ext === '.vue')
|
|
61
|
-
counts.vue++;
|
|
62
|
-
else if (ext === '.astro')
|
|
63
|
-
counts.astro++;
|
|
64
|
-
else if (ext === '.jsx')
|
|
65
|
-
counts.jsx++;
|
|
66
|
-
else if (ext === '.js')
|
|
67
|
-
counts.js++;
|
|
68
|
-
else if (ext === '.json')
|
|
69
|
-
counts.json++;
|
|
70
|
-
else
|
|
71
|
-
counts.other++;
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
await walk(dir);
|
|
76
|
-
return counts;
|
|
77
|
-
}
|
|
78
|
-
export function PathValidationStep({ projectPath, onConfirm, onSkipComponents, onChangePath, onQuit, }) {
|
|
79
|
-
const [counts, setCounts] = useState(null);
|
|
80
|
-
const [error, setError] = useState(null);
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
void (async () => {
|
|
83
|
-
try {
|
|
84
|
-
const stat = await fs.stat(projectPath);
|
|
85
|
-
if (stat.isFile()) {
|
|
86
|
-
setError(`That's a file, not a directory.\n\nProvide the path to your component library's root folder, not a specific file.\n\nExample: ~/projects/my-design-system`);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (!stat.isDirectory()) {
|
|
90
|
-
setError(`Not a directory: ${projectPath}`);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const result = await countFiles(projectPath);
|
|
94
|
-
setCounts(result);
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
const code = e.code;
|
|
98
|
-
if (code === 'ENOENT') {
|
|
99
|
-
setError(`Directory not found: ${projectPath}\n\nDouble-check the path and try again. Tip: you can use ~, relative, or absolute paths.`);
|
|
100
|
-
}
|
|
101
|
-
else if (code === 'EACCES') {
|
|
102
|
-
setError(`Permission denied: ${projectPath}\n\nYou don't have read access to this directory.`);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
setError(`Cannot access: ${projectPath}`);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
})();
|
|
109
|
-
}, [projectPath]);
|
|
110
|
-
useImmediateInput((input, key) => {
|
|
111
|
-
if (error) {
|
|
112
|
-
if (input === 'e' || key.return) {
|
|
113
|
-
onChangePath();
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (input === 'q' || key.escape) {
|
|
117
|
-
onQuit();
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (!counts)
|
|
123
|
-
return;
|
|
124
|
-
if (key.return) {
|
|
125
|
-
onConfirm(projectPath);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (input === 's') {
|
|
129
|
-
onSkipComponents();
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (input === 'e') {
|
|
133
|
-
onChangePath();
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (input === 'q' || key.escape) {
|
|
137
|
-
onQuit();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
if (!counts && !error) {
|
|
142
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["Scanning ", _jsx(Text, { bold: true, children: projectPath }), "..."] }) }));
|
|
143
|
-
}
|
|
144
|
-
if (error) {
|
|
145
|
-
const lines = error.split('\n');
|
|
146
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: PALETTE.error, children: ["\u2717 ", lines[0]] }), lines.slice(1).map((line, i) => (_jsx(Text, { dimColor: true, children: line }, i)))] }), _jsxs(Box, { gap: 3, marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "[e / Enter] Try a different path" }), _jsx(Text, { dimColor: true, children: "[q] Quit" })] })] }));
|
|
147
|
-
}
|
|
148
|
-
const c = counts;
|
|
149
|
-
const componentFiles = c.tsx + c.ts + c.vue + c.astro + c.jsx + c.js;
|
|
150
|
-
const tokenFiles = c.json;
|
|
151
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsxs(Text, { children: ["Scanning ", _jsx(Text, { bold: true, children: projectPath }), "..."] }), _jsxs(Box, { flexDirection: "column", gap: 0, marginTop: 1, children: [_jsxs(Text, { color: PALETTE.success, children: ["\u2713 Found ", c.total, " files:"] }), c.tsx > 0 && (_jsxs(Text, { children: [' • ', String(c.tsx).padStart(3), " .tsx files"] })), c.ts > 0 && (_jsxs(Text, { children: [' • ', String(c.ts).padStart(3), " .ts files"] })), c.vue > 0 && (_jsxs(Text, { children: [' • ', String(c.vue).padStart(3), " .vue files"] })), c.astro > 0 && (_jsxs(Text, { children: [' • ', String(c.astro).padStart(3), " .astro files"] })), c.jsx > 0 && (_jsxs(Text, { children: [' • ', String(c.jsx).padStart(3), " .jsx files"] })), c.js > 0 && (_jsxs(Text, { children: [' • ', String(c.js).padStart(3), " .js files"] })), c.json > 0 && (_jsxs(Text, { color: PALETTE.info, children: [' • ', String(c.json).padStart(3), " .json files (design tokens)"] })), c.other > 0 && (_jsxs(Text, { dimColor: true, children: [' • ', String(c.other).padStart(3), " other (ignored)"] }))] }), componentFiles === 0 && tokenFiles === 0 && (_jsx(Text, { color: PALETTE.warning, children: "\u26A0 No component or token files found. Try a different path." })), componentFiles === 0 && tokenFiles > 0 && (_jsx(Text, { color: PALETTE.warning, children: "\u26A0 No component files found \u2014 only token files detected." })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: "Does this look right?" }) }), _jsxs(Box, { gap: 3, marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "[Enter] Yes, start extracting" }), _jsx(Text, { dimColor: true, children: "[s] Skip components" }), _jsx(Text, { dimColor: true, children: "[e] Change path" }), _jsx(Text, { dimColor: true, children: "[q] Quit" })] })] }));
|
|
152
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { PALETTE } from '../../../analyze/select/tui/theme.js';
|
|
3
|
-
import { Box, Text } from 'ink';
|
|
4
|
-
import { useImmediateInput } from '../../../analyze/select/tui/hooks/useImmediateInput.js';
|
|
5
|
-
export function PreviewStep({ componentTypes, designTokens, spaceId, environmentId, stepNumber, totalSteps, onConfirm, onSaveFiles, onQuit, }) {
|
|
6
|
-
useImmediateInput((input, key) => {
|
|
7
|
-
if (key.return) {
|
|
8
|
-
onConfirm();
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if (input === 's' && onSaveFiles) {
|
|
12
|
-
onSaveFiles();
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (input === 'q' || key.escape) {
|
|
16
|
-
onQuit();
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const hasComponents = componentTypes.created > 0 ||
|
|
21
|
-
componentTypes.updated > 0 ||
|
|
22
|
-
componentTypes.unchanged > 0 ||
|
|
23
|
-
componentTypes.conflicts > 0 ||
|
|
24
|
-
componentTypes.failed > 0;
|
|
25
|
-
const hasTokens = designTokens.created > 0 ||
|
|
26
|
-
designTokens.updated > 0 ||
|
|
27
|
-
designTokens.unchanged > 0 ||
|
|
28
|
-
designTokens.conflicts > 0 ||
|
|
29
|
-
designTokens.failed > 0;
|
|
30
|
-
const hasAnything = hasComponents || hasTokens;
|
|
31
|
-
function EntityRows({ label, summary }) {
|
|
32
|
-
if (!summary.created && !summary.updated && !summary.unchanged && !summary.conflicts && !summary.failed)
|
|
33
|
-
return null;
|
|
34
|
-
return (_jsxs(_Fragment, { children: [_jsx(Box, { gap: 1, marginTop: 1, children: _jsx(Text, { bold: true, dimColor: true, children: label }) }), summary.created > 0 && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.success, children: " \uFF0B" }), _jsxs(Text, { children: [summary.created, " will be created"] })] })), summary.updated > 0 && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.warning, children: " \uFF5E" }), _jsxs(Text, { children: [summary.updated, " will be updated"] })] })), summary.unchanged > 0 && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: " \u00B7" }), _jsxs(Text, { dimColor: true, children: [summary.unchanged, " unchanged"] })] })), summary.conflicts > 0 && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.error, children: " \u2717" }), _jsxs(Text, { color: PALETTE.error, children: [summary.conflicts, " conflict", summary.conflicts !== 1 ? 's' : '', " \u2014 resolve before pushing"] })] })), summary.failed > 0 && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.error, children: " \u2717" }), _jsxs(Text, { color: PALETTE.error, children: [summary.failed, " failed \u2014 check logs"] })] }))] }));
|
|
35
|
-
}
|
|
36
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsxs(Box, { flexDirection: "column", gap: 0, children: [_jsx(Text, { dimColor: true, children: '─'.repeat(40) }), _jsxs(Box, { gap: 1, children: [_jsxs(Text, { bold: true, children: ["Step ", stepNumber, " of ", totalSteps] }), _jsx(Text, { bold: true, children: "\u2014" }), _jsx(Text, { bold: true, children: "Push to Contentful" })] }), _jsx(Text, { dimColor: true, children: '─'.repeat(40) })] }), hasAnything ? (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Here's what will happen in your space:" }), _jsxs(Box, { flexDirection: "column", gap: 0, children: [hasComponents && _jsx(EntityRows, { label: "ComponentTypes", summary: componentTypes }), hasTokens && _jsx(EntityRows, { label: "Design Tokens", summary: designTokens })] })] })) : (_jsx(Text, { dimColor: true, children: "Nothing to push \u2014 everything is already up to date." })), _jsxs(Box, { gap: 1, marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "Space:" }), _jsx(Text, { children: spaceId }), _jsx(Text, { dimColor: true, children: "/" }), _jsx(Text, { dimColor: true, children: "Environment:" }), _jsx(Text, { children: environmentId })] }), _jsxs(Box, { gap: 3, marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "[Enter] Push to Contentful" }), onSaveFiles && _jsx(Text, { dimColor: true, children: "[s] Save files instead" }), _jsx(Text, { dimColor: true, children: "[q] Cancel" })] })] }));
|
|
37
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { GateStep } from './GateStep.js';
|
|
3
|
-
import { formatParsedEdsiError } from '../../../lib/error-parser.js';
|
|
4
|
-
export function PreviewValidationErrorStep({ errors, missingNames, onEdit, onSkip, onQuit, }) {
|
|
5
|
-
const uniqueNames = [...new Set(errors.map((e) => e.componentName))];
|
|
6
|
-
const matchedNames = uniqueNames.filter((n) => !missingNames.includes(n));
|
|
7
|
-
const errorLines = errors
|
|
8
|
-
.map((error) => formatParsedEdsiError({
|
|
9
|
-
code: null,
|
|
10
|
-
message: '',
|
|
11
|
-
cycle: null,
|
|
12
|
-
raw: false,
|
|
13
|
-
diagnostics: [{ message: error.message, component: error.componentName, path: error.path }],
|
|
14
|
-
}))
|
|
15
|
-
.join('\n');
|
|
16
|
-
const missingNote = missingNames.length > 0
|
|
17
|
-
? `\n\nNote: ${missingNames.length} component name${missingNames.length === 1 ? '' : 's'} from the server (${missingNames.join(', ')}) ${missingNames.length === 1 ? 'does' : 'do'} not match anything in this session — they cannot be edited or skipped from here.`
|
|
18
|
-
: '';
|
|
19
|
-
const skipLabel = matchedNames.length === 0
|
|
20
|
-
? 'No matching components to skip'
|
|
21
|
-
: `Skip ${matchedNames.length === 1 ? matchedNames[0] : `${matchedNames.length} components`} and retry`;
|
|
22
|
-
return (_jsx(GateStep, { intent: "error", successMessage: "Preview validation failed", summary: errorLines, context: `${uniqueNames.length} component${uniqueNames.length === 1 ? '' : 's'} failed server validation. Edit their definitions in the review TUI, or skip them and retry preview without them.${missingNote}`, continueLabel: "Edit definitions", skipLabel: skipLabel, showSkip: matchedNames.length > 0, onContinue: onEdit, onSkip: onSkip, onQuit: onQuit }));
|
|
23
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { PALETTE } from '../../../analyze/select/tui/theme.js';
|
|
4
|
-
import { Box, Text } from 'ink';
|
|
5
|
-
import { useImmediateInput } from '../../../analyze/select/tui/hooks/useImmediateInput.js';
|
|
6
|
-
const OPTIONS = [
|
|
7
|
-
{ value: 'both', label: 'Save AND push', shortcut: 'b' },
|
|
8
|
-
{ value: 'push-only', label: 'Push only', shortcut: 'p' },
|
|
9
|
-
{ value: 'save-only', label: 'Save only', shortcut: 's' },
|
|
10
|
-
];
|
|
11
|
-
const SAVE_ONLY_INDEX = OPTIONS.findIndex((o) => o.value === 'save-only');
|
|
12
|
-
export function PushDecisionGateStep({ summary, context, onChoice, onQuit, pushDisabled = false, }) {
|
|
13
|
-
const [cursor, setCursor] = useState(pushDisabled ? SAVE_ONLY_INDEX : 0);
|
|
14
|
-
function isSelectable(index) {
|
|
15
|
-
if (!pushDisabled)
|
|
16
|
-
return true;
|
|
17
|
-
return OPTIONS[index].value === 'save-only';
|
|
18
|
-
}
|
|
19
|
-
useImmediateInput((input, key) => {
|
|
20
|
-
if (key.return) {
|
|
21
|
-
if (!isSelectable(cursor))
|
|
22
|
-
return;
|
|
23
|
-
onChoice(OPTIONS[cursor].value);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (input === 'b') {
|
|
27
|
-
if (pushDisabled)
|
|
28
|
-
return;
|
|
29
|
-
onChoice('both');
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (input === 'p') {
|
|
33
|
-
if (pushDisabled)
|
|
34
|
-
return;
|
|
35
|
-
onChoice('push-only');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (input === 's') {
|
|
39
|
-
onChoice('save-only');
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (input === 'j' || key.downArrow) {
|
|
43
|
-
setCursor((c) => {
|
|
44
|
-
for (let i = c + 1; i < OPTIONS.length; i++) {
|
|
45
|
-
if (isSelectable(i))
|
|
46
|
-
return i;
|
|
47
|
-
}
|
|
48
|
-
return c;
|
|
49
|
-
});
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (input === 'k' || key.upArrow) {
|
|
53
|
-
setCursor((c) => {
|
|
54
|
-
for (let i = c - 1; i >= 0; i--) {
|
|
55
|
-
if (isSelectable(i))
|
|
56
|
-
return i;
|
|
57
|
-
}
|
|
58
|
-
return c;
|
|
59
|
-
});
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (input === 'q' || key.escape) {
|
|
63
|
-
onQuit();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsx(Text, { color: PALETTE.success, children: "\u2713 Generation complete" }), _jsx(Text, { dimColor: true, children: summary }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: context }) }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: OPTIONS.map((opt, i) => {
|
|
68
|
-
const selected = i === cursor;
|
|
69
|
-
const disabled = pushDisabled && opt.value !== 'save-only';
|
|
70
|
-
const suffix = disabled ? ' (unavailable — credentials skipped)' : '';
|
|
71
|
-
return (_jsxs(Text, { color: selected ? PALETTE.info : undefined, dimColor: disabled, children: [selected ? '›' : ' ', " [", opt.shortcut, "] ", opt.label, suffix] }, opt.value));
|
|
72
|
-
}) }), _jsxs(Box, { gap: 3, marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "[Enter] Confirm" }), _jsx(Text, { dimColor: true, children: "[j/k] Move" }), _jsx(Text, { dimColor: true, children: "[q] Quit" })] })] }));
|
|
73
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { PALETTE } from '../../../analyze/select/tui/theme.js';
|
|
4
|
-
import { Box, Text } from 'ink';
|
|
5
|
-
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
6
|
-
export function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
7
|
-
const [frame, setFrame] = useState(0);
|
|
8
|
-
const [elapsed, setElapsed] = useState(0);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const spinner = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
|
|
11
|
-
const timer = setInterval(() => setElapsed((s) => s + 1), 1000);
|
|
12
|
-
return () => {
|
|
13
|
-
clearInterval(spinner);
|
|
14
|
-
clearInterval(timer);
|
|
15
|
-
};
|
|
16
|
-
}, []);
|
|
17
|
-
const mins = Math.floor(elapsed / 60);
|
|
18
|
-
const secs = elapsed % 60;
|
|
19
|
-
const elapsedStr = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
|
20
|
-
const operationId = progress && progress.kind === 'queued' ? progress.operationId : null;
|
|
21
|
-
const showGlobal = progress && progress.kind === 'progress';
|
|
22
|
-
const showCurrent = progress && progress.kind === 'progress' && progress.current ? progress.current : null;
|
|
23
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsxs(Box, { flexDirection: "column", gap: 0, children: [_jsx(Text, { dimColor: true, children: '─'.repeat(40) }), _jsxs(Box, { gap: 1, children: [_jsxs(Text, { bold: true, children: ["Step ", stepNumber, " of ", totalSteps] }), _jsx(Text, { bold: true, children: "\u2014" }), _jsx(Text, { bold: true, children: "Push to Contentful" })] }), _jsx(Text, { dimColor: true, children: '─'.repeat(40) })] }), _jsx(Text, { children: "Writing component types and design tokens to your Contentful space..." }), operationId && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Operation:" }), _jsx(Text, { children: operationId })] })), showGlobal && progress && progress.kind === 'progress' && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.info, children: SPINNER_FRAMES[frame] }), _jsxs(Text, { dimColor: true, children: [progress.processed, "/", progress.total, " entities"] })] })), showCurrent && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { dimColor: true, children: "Now processing:" }), _jsx(Text, { children: showCurrent })] })), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Elapsed: ", elapsedStr] }) })] }));
|
|
24
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { PALETTE } from '../../../analyze/select/tui/theme.js';
|
|
4
|
-
import { Box, Text } from 'ink';
|
|
5
|
-
const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
6
|
-
export function RunningStep({ stepNumber, totalSteps, title, description, detail, secondaryDetail, }) {
|
|
7
|
-
const [frame, setFrame] = useState(0);
|
|
8
|
-
const [elapsed, setElapsed] = useState(0);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const spinner = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
|
|
11
|
-
const timer = setInterval(() => setElapsed((s) => s + 1), 1000);
|
|
12
|
-
return () => {
|
|
13
|
-
clearInterval(spinner);
|
|
14
|
-
clearInterval(timer);
|
|
15
|
-
};
|
|
16
|
-
}, []);
|
|
17
|
-
const mins = Math.floor(elapsed / 60);
|
|
18
|
-
const secs = elapsed % 60;
|
|
19
|
-
const elapsedStr = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
|
20
|
-
return (_jsxs(Box, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [_jsxs(Box, { flexDirection: "column", gap: 0, children: [_jsx(Text, { dimColor: true, children: '─'.repeat(40) }), _jsxs(Box, { gap: 1, children: [_jsxs(Text, { bold: true, children: ["Step ", stepNumber, " of ", totalSteps] }), _jsx(Text, { bold: true, children: "\u2014" }), _jsx(Text, { bold: true, children: title })] }), _jsx(Text, { dimColor: true, children: '─'.repeat(40) })] }), _jsx(Text, { children: description }), _jsxs(Box, { gap: 1, marginTop: 1, children: [_jsx(Text, { color: PALETTE.info, children: SPINNER_FRAMES[frame] }), _jsx(Text, { dimColor: true, children: detail ?? 'Running...' })] }), secondaryDetail !== undefined && (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: PALETTE.info, children: SPINNER_FRAMES[(frame + 5) % SPINNER_FRAMES.length] }), _jsx(Text, { dimColor: true, children: secondaryDetail })] })), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Elapsed: ", elapsedStr] }) })] }));
|
|
21
|
-
}
|