@contentful/experience-design-system-cli 2.37.1-dev-build-0d4be259.0 → 2.37.1-dev-build-c3f4df22.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/app.js +33 -35
- package/dist/index.js +33 -36
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/03-path-validation/helpers/scan-files.d.ts +1 -9
- package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +0 -4
- package/dist/src/tui/import/steps/07-scope-gate/columns.d.ts +0 -2
- package/dist/src/tui/import/steps/07-scope-gate/graph/fuzzy-search.d.ts +0 -2
- package/dist/src/tui/import/steps/07-scope-gate/graph/lineage.d.ts +0 -22
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/ai-flag.d.ts +0 -1
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +0 -33
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/lineage-layout.d.ts +0 -36
- package/dist/src/tui/import/steps/09-review/components/FieldEditor.d.ts +1 -18
- package/dist/src/tui/import/steps/09-review/components/ReviewDialogs.d.ts +0 -14
- package/dist/src/tui/import/steps/09-review/components/TokenReviewPanel.d.ts +0 -6
- package/dist/src/tui/import/steps/09-review/generate-review-step.d.ts +1 -22
- package/dist/src/tui/import/steps/09-review/helpers/cycle-panel-scroll.d.ts +0 -4
- package/dist/src/tui/import/steps/09-review/run-live-preview.d.ts +0 -3
- package/dist/src/tui/import/steps/09-review/use-finalize-preview.d.ts +1 -11
- package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +7 -8
- package/dist/src/tui/import/steps/10-flow/flow/preview.d.ts +1 -15
- package/dist/src/tui/import/steps/10-flow/flow/save.d.ts +1 -10
- package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +1 -7
- package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +4 -1
- package/dist/src/tui/import/steps/10-flow/screens/WizardPreviewStep.d.ts +0 -6
- package/dist/src/tui/import/steps/10-flow/support/path-utils.d.ts +0 -5
- package/dist/src/tui/import/steps/10-flow/support/preview-diff.d.ts +1 -4
- package/dist/src/tui/import/steps/preview-validation-error/logic.d.ts +0 -3
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -2018,7 +2018,7 @@ var init_cache_keys = __esm({
|
|
|
2018
2018
|
|
|
2019
2019
|
// packages/experience-design-system-cli/app.tsx
|
|
2020
2020
|
import { join as join25 } from "node:path";
|
|
2021
|
-
import { useEffect as
|
|
2021
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
2022
2022
|
|
|
2023
2023
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2024
2024
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
@@ -20436,9 +20436,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
20436
20436
|
onProgress(progress);
|
|
20437
20437
|
};
|
|
20438
20438
|
const accepted = input.decisions.accepted;
|
|
20439
|
-
update({ components: { done: 0, total: accepted.length, current: "Restoring cache..." } });
|
|
20440
20439
|
const handedOverNames = await input.cachedNames.catch(() => []);
|
|
20441
|
-
update({ components: { done: 0, total: accepted.length, current: "Starting generation..." } });
|
|
20442
20440
|
try {
|
|
20443
20441
|
await deps.saveDecisions({ sessionId: input.sessionId, decisions: input.decisions });
|
|
20444
20442
|
} catch (error) {
|
|
@@ -20590,7 +20588,6 @@ function buildFlowStart(input) {
|
|
|
20590
20588
|
}
|
|
20591
20589
|
|
|
20592
20590
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
20593
|
-
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
20594
20591
|
import { Box as Box41 } from "ink";
|
|
20595
20592
|
|
|
20596
20593
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
@@ -26991,18 +26988,10 @@ function FlowScreen({
|
|
|
26991
26988
|
controller,
|
|
26992
26989
|
livePreview = true,
|
|
26993
26990
|
generatePromptPath,
|
|
26994
|
-
onExit
|
|
26995
|
-
onStepChange
|
|
26991
|
+
onExit
|
|
26996
26992
|
}) {
|
|
26997
26993
|
const totalSteps = totalStepsFor(state);
|
|
26998
26994
|
const quit = () => onExit(0);
|
|
26999
|
-
const previousStep = useRef12(state.step);
|
|
27000
|
-
useEffect20(() => {
|
|
27001
|
-
if (previousStep.current !== state.step) {
|
|
27002
|
-
onStepChange?.();
|
|
27003
|
-
previousStep.current = state.step;
|
|
27004
|
-
}
|
|
27005
|
-
}, [state.step, onStepChange]);
|
|
27006
26995
|
const content = (() => {
|
|
27007
26996
|
switch (state.step) {
|
|
27008
26997
|
case "final-review":
|
|
@@ -27128,7 +27117,7 @@ function FlowScreen({
|
|
|
27128
27117
|
}
|
|
27129
27118
|
|
|
27130
27119
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27131
|
-
import { useEffect as
|
|
27120
|
+
import { useEffect as useEffect20, useRef as useRef12, useSyncExternalStore } from "react";
|
|
27132
27121
|
|
|
27133
27122
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
27134
27123
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -27718,6 +27707,12 @@ function createFlowController(start, deps) {
|
|
|
27718
27707
|
deps.log({ update: sanitizeForLog(patch) });
|
|
27719
27708
|
} catch {
|
|
27720
27709
|
}
|
|
27710
|
+
if (patch.step !== void 0 && patch.step !== state.step) {
|
|
27711
|
+
try {
|
|
27712
|
+
deps.beforeStepChange?.();
|
|
27713
|
+
} catch {
|
|
27714
|
+
}
|
|
27715
|
+
}
|
|
27721
27716
|
state = { ...state, ...patch };
|
|
27722
27717
|
for (const listener of listeners) listener();
|
|
27723
27718
|
};
|
|
@@ -27855,28 +27850,32 @@ function createFlowController(start, deps) {
|
|
|
27855
27850
|
}
|
|
27856
27851
|
|
|
27857
27852
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27858
|
-
function useFlow(start,
|
|
27859
|
-
const controller =
|
|
27853
|
+
function useFlow(start, options = {}) {
|
|
27854
|
+
const controller = useRef12();
|
|
27860
27855
|
if (start && !controller.current) {
|
|
27861
27856
|
try {
|
|
27862
27857
|
startWizardLog();
|
|
27863
27858
|
} catch {
|
|
27864
27859
|
}
|
|
27865
|
-
|
|
27860
|
+
const flowDeps = (options.deps ?? realFlowDeps)();
|
|
27861
|
+
controller.current = createFlowController(start, {
|
|
27862
|
+
...flowDeps,
|
|
27863
|
+
...options.beforeStepChange ? { beforeStepChange: options.beforeStepChange } : {}
|
|
27864
|
+
});
|
|
27866
27865
|
}
|
|
27867
27866
|
const current = controller.current;
|
|
27868
27867
|
const state = useSyncExternalStore(
|
|
27869
27868
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
27870
27869
|
() => current?.getState()
|
|
27871
27870
|
);
|
|
27872
|
-
|
|
27871
|
+
useEffect20(() => {
|
|
27873
27872
|
if (!start) controller.current = void 0;
|
|
27874
27873
|
}, [start]);
|
|
27875
27874
|
return current && state ? { controller: current, state } : void 0;
|
|
27876
27875
|
}
|
|
27877
27876
|
|
|
27878
27877
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
27879
|
-
import { useEffect as
|
|
27878
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
27880
27879
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
27881
27880
|
|
|
27882
27881
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
@@ -28070,7 +28069,7 @@ function Section({ title, rows }) {
|
|
|
28070
28069
|
}
|
|
28071
28070
|
function HelpScreen({ onDone }) {
|
|
28072
28071
|
const [info, setInfo] = useState27();
|
|
28073
|
-
|
|
28072
|
+
useEffect21(() => {
|
|
28074
28073
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
28075
28074
|
void readHelpInfo().then(setInfo);
|
|
28076
28075
|
}, []);
|
|
@@ -28163,7 +28162,7 @@ function SettingsScreen({
|
|
|
28163
28162
|
}
|
|
28164
28163
|
|
|
28165
28164
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28166
|
-
import { useEffect as
|
|
28165
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28167
28166
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28168
28167
|
import TextInput4 from "ink-text-input";
|
|
28169
28168
|
|
|
@@ -28231,7 +28230,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28231
28230
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
28232
28231
|
const [editing, setEditing] = useState29(false);
|
|
28233
28232
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28234
|
-
|
|
28233
|
+
useEffect22(() => {
|
|
28235
28234
|
readCredentials().then((cfg) => {
|
|
28236
28235
|
setConfig(cfg);
|
|
28237
28236
|
setStage("form");
|
|
@@ -28368,7 +28367,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28368
28367
|
}
|
|
28369
28368
|
|
|
28370
28369
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28371
|
-
import { useEffect as
|
|
28370
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
28372
28371
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
28373
28372
|
|
|
28374
28373
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -28391,7 +28390,7 @@ import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-
|
|
|
28391
28390
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28392
28391
|
const [loading, setLoading] = useState30(true);
|
|
28393
28392
|
const [enabled, setEnabled] = useState30(true);
|
|
28394
|
-
|
|
28393
|
+
useEffect23(() => {
|
|
28395
28394
|
readAnalyticsSetting().then((setting) => {
|
|
28396
28395
|
setEnabled(setting.enabled);
|
|
28397
28396
|
setLoading(false);
|
|
@@ -28445,13 +28444,13 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28445
28444
|
}
|
|
28446
28445
|
|
|
28447
28446
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28448
|
-
import { useEffect as
|
|
28447
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
28449
28448
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
28450
28449
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28451
28450
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28452
28451
|
function UpgradeScreen({ onDone }) {
|
|
28453
28452
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28454
|
-
|
|
28453
|
+
useEffect24(() => {
|
|
28455
28454
|
startDebugRun({
|
|
28456
28455
|
flow: "upgrade",
|
|
28457
28456
|
step: "01-upgrade",
|
|
@@ -28516,13 +28515,13 @@ function renderBody(upgradeCheck) {
|
|
|
28516
28515
|
}
|
|
28517
28516
|
|
|
28518
28517
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28519
|
-
import { useEffect as
|
|
28518
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
28520
28519
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
28521
28520
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28522
28521
|
function DebugModeScreen({ onDone }) {
|
|
28523
28522
|
const [loading, setLoading] = useState32(true);
|
|
28524
28523
|
const [enabled, setEnabled] = useState32(true);
|
|
28525
|
-
|
|
28524
|
+
useEffect25(() => {
|
|
28526
28525
|
readDebugModeSetting().then((setting) => {
|
|
28527
28526
|
setEnabled(setting.enabled);
|
|
28528
28527
|
setLoading(false);
|
|
@@ -28600,9 +28599,9 @@ function App({ importOptions, inkClear }) {
|
|
|
28600
28599
|
const [generationInput, setGenerationInput] = useState33();
|
|
28601
28600
|
const generation = useGeneration(generationInput);
|
|
28602
28601
|
const [flowStart, setFlowStart] = useState33();
|
|
28603
|
-
const flow = useFlow(flowStart);
|
|
28602
|
+
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
28604
28603
|
const [importDefaults, setImportDefaults] = useState33();
|
|
28605
|
-
|
|
28604
|
+
useEffect26(() => {
|
|
28606
28605
|
if (screen !== "import") {
|
|
28607
28606
|
setImportDefaults(void 0);
|
|
28608
28607
|
return;
|
|
@@ -28660,12 +28659,12 @@ function App({ importOptions, inkClear }) {
|
|
|
28660
28659
|
}
|
|
28661
28660
|
});
|
|
28662
28661
|
};
|
|
28663
|
-
|
|
28662
|
+
useEffect26(() => {
|
|
28664
28663
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
28665
28664
|
setExtractionRun(void 0);
|
|
28666
28665
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
28667
28666
|
}, [extraction, extractionRun]);
|
|
28668
|
-
|
|
28667
|
+
useEffect26(() => {
|
|
28669
28668
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
28670
28669
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28671
28670
|
setGenerationInput({
|
|
@@ -28683,7 +28682,7 @@ function App({ importOptions, inkClear }) {
|
|
|
28683
28682
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
28684
28683
|
});
|
|
28685
28684
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
28686
|
-
|
|
28685
|
+
useEffect26(() => {
|
|
28687
28686
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
28688
28687
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28689
28688
|
inkClear();
|
|
@@ -28734,8 +28733,7 @@ function App({ importOptions, inkClear }) {
|
|
|
28734
28733
|
state: flow.state,
|
|
28735
28734
|
controller: flow.controller,
|
|
28736
28735
|
generatePromptPath: flowStart.generatePromptPath,
|
|
28737
|
-
onExit: setImportExitCode
|
|
28738
|
-
onStepChange: inkClear
|
|
28736
|
+
onExit: setImportExitCode
|
|
28739
28737
|
}
|
|
28740
28738
|
);
|
|
28741
28739
|
}
|
package/dist/index.js
CHANGED
|
@@ -24053,9 +24053,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24053
24053
|
onProgress(progress);
|
|
24054
24054
|
};
|
|
24055
24055
|
const accepted = input.decisions.accepted;
|
|
24056
|
-
update({ components: { done: 0, total: accepted.length, current: "Restoring cache..." } });
|
|
24057
24056
|
const handedOverNames = await input.cachedNames.catch(() => []);
|
|
24058
|
-
update({ components: { done: 0, total: accepted.length, current: "Starting generation..." } });
|
|
24059
24057
|
try {
|
|
24060
24058
|
await deps.saveDecisions({ sessionId: input.sessionId, decisions: input.decisions });
|
|
24061
24059
|
} catch (error) {
|
|
@@ -30172,7 +30170,6 @@ var init_generate_review_step = __esm({
|
|
|
30172
30170
|
init_review_input();
|
|
30173
30171
|
init_use_review_preview();
|
|
30174
30172
|
init_LivePreviewSummary();
|
|
30175
|
-
init_cycle_auto_reject();
|
|
30176
30173
|
HELP_SECTIONS2 = [
|
|
30177
30174
|
{
|
|
30178
30175
|
title: "Navigation",
|
|
@@ -31140,7 +31137,6 @@ var init_run_teaser = __esm({
|
|
|
31140
31137
|
});
|
|
31141
31138
|
|
|
31142
31139
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
31143
|
-
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
31144
31140
|
import { Box as Box41 } from "ink";
|
|
31145
31141
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31146
31142
|
function totalStepsFor(state) {
|
|
@@ -31156,18 +31152,10 @@ function FlowScreen({
|
|
|
31156
31152
|
controller,
|
|
31157
31153
|
livePreview = true,
|
|
31158
31154
|
generatePromptPath,
|
|
31159
|
-
onExit
|
|
31160
|
-
onStepChange
|
|
31155
|
+
onExit
|
|
31161
31156
|
}) {
|
|
31162
31157
|
const totalSteps = totalStepsFor(state);
|
|
31163
31158
|
const quit = () => onExit(0);
|
|
31164
|
-
const previousStep = useRef12(state.step);
|
|
31165
|
-
useEffect20(() => {
|
|
31166
|
-
if (previousStep.current !== state.step) {
|
|
31167
|
-
onStepChange?.();
|
|
31168
|
-
previousStep.current = state.step;
|
|
31169
|
-
}
|
|
31170
|
-
}, [state.step, onStepChange]);
|
|
31171
31159
|
const content = (() => {
|
|
31172
31160
|
switch (state.step) {
|
|
31173
31161
|
case "final-review":
|
|
@@ -31935,6 +31923,12 @@ function createFlowController(start, deps) {
|
|
|
31935
31923
|
deps.log({ update: sanitizeForLog(patch) });
|
|
31936
31924
|
} catch {
|
|
31937
31925
|
}
|
|
31926
|
+
if (patch.step !== void 0 && patch.step !== state.step) {
|
|
31927
|
+
try {
|
|
31928
|
+
deps.beforeStepChange?.();
|
|
31929
|
+
} catch {
|
|
31930
|
+
}
|
|
31931
|
+
}
|
|
31938
31932
|
state = { ...state, ...patch };
|
|
31939
31933
|
for (const listener of listeners) listener();
|
|
31940
31934
|
};
|
|
@@ -32087,22 +32081,26 @@ var init_controller = __esm({
|
|
|
32087
32081
|
});
|
|
32088
32082
|
|
|
32089
32083
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
32090
|
-
import { useEffect as
|
|
32091
|
-
function useFlow(start,
|
|
32092
|
-
const controller =
|
|
32084
|
+
import { useEffect as useEffect20, useRef as useRef12, useSyncExternalStore } from "react";
|
|
32085
|
+
function useFlow(start, options = {}) {
|
|
32086
|
+
const controller = useRef12();
|
|
32093
32087
|
if (start && !controller.current) {
|
|
32094
32088
|
try {
|
|
32095
32089
|
startWizardLog();
|
|
32096
32090
|
} catch {
|
|
32097
32091
|
}
|
|
32098
|
-
|
|
32092
|
+
const flowDeps = (options.deps ?? realFlowDeps)();
|
|
32093
|
+
controller.current = createFlowController(start, {
|
|
32094
|
+
...flowDeps,
|
|
32095
|
+
...options.beforeStepChange ? { beforeStepChange: options.beforeStepChange } : {}
|
|
32096
|
+
});
|
|
32099
32097
|
}
|
|
32100
32098
|
const current = controller.current;
|
|
32101
32099
|
const state = useSyncExternalStore(
|
|
32102
32100
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
32103
32101
|
() => current?.getState()
|
|
32104
32102
|
);
|
|
32105
|
-
|
|
32103
|
+
useEffect20(() => {
|
|
32106
32104
|
if (!start) controller.current = void 0;
|
|
32107
32105
|
}, [start]);
|
|
32108
32106
|
return current && state ? { controller: current, state } : void 0;
|
|
@@ -32315,7 +32313,7 @@ var init_help_info = __esm({
|
|
|
32315
32313
|
});
|
|
32316
32314
|
|
|
32317
32315
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32318
|
-
import { useEffect as
|
|
32316
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
32319
32317
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
32320
32318
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
32321
32319
|
function Section({ title, rows }) {
|
|
@@ -32329,7 +32327,7 @@ function Section({ title, rows }) {
|
|
|
32329
32327
|
}
|
|
32330
32328
|
function HelpScreen({ onDone }) {
|
|
32331
32329
|
const [info, setInfo] = useState27();
|
|
32332
|
-
|
|
32330
|
+
useEffect21(() => {
|
|
32333
32331
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
32334
32332
|
void readHelpInfo().then(setInfo);
|
|
32335
32333
|
}, []);
|
|
@@ -32478,7 +32476,7 @@ var init_config_store = __esm({
|
|
|
32478
32476
|
});
|
|
32479
32477
|
|
|
32480
32478
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
32481
|
-
import { useEffect as
|
|
32479
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
32482
32480
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
32483
32481
|
import TextInput4 from "ink-text-input";
|
|
32484
32482
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -32500,7 +32498,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32500
32498
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
32501
32499
|
const [editing, setEditing] = useState29(false);
|
|
32502
32500
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
32503
|
-
|
|
32501
|
+
useEffect22(() => {
|
|
32504
32502
|
readCredentials().then((cfg) => {
|
|
32505
32503
|
setConfig(cfg);
|
|
32506
32504
|
setStage("form");
|
|
@@ -32684,13 +32682,13 @@ var init_analytics_store = __esm({
|
|
|
32684
32682
|
});
|
|
32685
32683
|
|
|
32686
32684
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
32687
|
-
import { useEffect as
|
|
32685
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
32688
32686
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
32689
32687
|
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32690
32688
|
function OptInAnalyticsScreen({ onDone }) {
|
|
32691
32689
|
const [loading, setLoading] = useState30(true);
|
|
32692
32690
|
const [enabled, setEnabled] = useState30(true);
|
|
32693
|
-
|
|
32691
|
+
useEffect23(() => {
|
|
32694
32692
|
readAnalyticsSetting().then((setting) => {
|
|
32695
32693
|
setEnabled(setting.enabled);
|
|
32696
32694
|
setLoading(false);
|
|
@@ -32753,12 +32751,12 @@ var init_screen11 = __esm({
|
|
|
32753
32751
|
});
|
|
32754
32752
|
|
|
32755
32753
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
32756
|
-
import { useEffect as
|
|
32754
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
32757
32755
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
32758
32756
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32759
32757
|
function UpgradeScreen({ onDone }) {
|
|
32760
32758
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
32761
|
-
|
|
32759
|
+
useEffect24(() => {
|
|
32762
32760
|
startDebugRun({
|
|
32763
32761
|
flow: "upgrade",
|
|
32764
32762
|
step: "01-upgrade",
|
|
@@ -32833,13 +32831,13 @@ var init_PageContainer4 = __esm({
|
|
|
32833
32831
|
});
|
|
32834
32832
|
|
|
32835
32833
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32836
|
-
import { useEffect as
|
|
32834
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
32837
32835
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
32838
32836
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32839
32837
|
function DebugModeScreen({ onDone }) {
|
|
32840
32838
|
const [loading, setLoading] = useState32(true);
|
|
32841
32839
|
const [enabled, setEnabled] = useState32(true);
|
|
32842
|
-
|
|
32840
|
+
useEffect25(() => {
|
|
32843
32841
|
readDebugModeSetting().then((setting) => {
|
|
32844
32842
|
setEnabled(setting.enabled);
|
|
32845
32843
|
setLoading(false);
|
|
@@ -32902,7 +32900,7 @@ __export(app_exports, {
|
|
|
32902
32900
|
runApp: () => runApp
|
|
32903
32901
|
});
|
|
32904
32902
|
import { join as join27 } from "node:path";
|
|
32905
|
-
import { useEffect as
|
|
32903
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
32906
32904
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
32907
32905
|
function App({ importOptions, inkClear }) {
|
|
32908
32906
|
const [screen, setScreen] = useState33("start");
|
|
@@ -32932,9 +32930,9 @@ function App({ importOptions, inkClear }) {
|
|
|
32932
32930
|
const [generationInput, setGenerationInput] = useState33();
|
|
32933
32931
|
const generation = useGeneration(generationInput);
|
|
32934
32932
|
const [flowStart, setFlowStart] = useState33();
|
|
32935
|
-
const flow = useFlow(flowStart);
|
|
32933
|
+
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
32936
32934
|
const [importDefaults, setImportDefaults] = useState33();
|
|
32937
|
-
|
|
32935
|
+
useEffect26(() => {
|
|
32938
32936
|
if (screen !== "import") {
|
|
32939
32937
|
setImportDefaults(void 0);
|
|
32940
32938
|
return;
|
|
@@ -32992,12 +32990,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32992
32990
|
}
|
|
32993
32991
|
});
|
|
32994
32992
|
};
|
|
32995
|
-
|
|
32993
|
+
useEffect26(() => {
|
|
32996
32994
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
32997
32995
|
setExtractionRun(void 0);
|
|
32998
32996
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
32999
32997
|
}, [extraction, extractionRun]);
|
|
33000
|
-
|
|
32998
|
+
useEffect26(() => {
|
|
33001
32999
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
33002
33000
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33003
33001
|
setGenerationInput({
|
|
@@ -33015,7 +33013,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33015
33013
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33016
33014
|
});
|
|
33017
33015
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33018
|
-
|
|
33016
|
+
useEffect26(() => {
|
|
33019
33017
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33020
33018
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33021
33019
|
inkClear();
|
|
@@ -33066,8 +33064,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33066
33064
|
state: flow.state,
|
|
33067
33065
|
controller: flow.controller,
|
|
33068
33066
|
generatePromptPath: flowStart.generatePromptPath,
|
|
33069
|
-
onExit: setImportExitCode
|
|
33070
|
-
onStepChange: inkClear
|
|
33067
|
+
onExit: setImportExitCode
|
|
33071
33068
|
}
|
|
33072
33069
|
);
|
|
33073
33070
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { FileCounts as LocalFileCounts, ScanResult } from '../logic.js';
|
|
3
|
-
type CollectedFilesOutcome = ReturnType<typeof collectFiles>;
|
|
4
|
-
type PipelineFileCounts = Extract<CollectedFilesOutcome, {
|
|
5
|
-
ok: true;
|
|
6
|
-
}>['result']['counts'];
|
|
1
|
+
import type { ScanResult } from '../logic.js';
|
|
7
2
|
export declare function scanFiles(directory: string): ScanResult;
|
|
8
|
-
export declare function toScanResult(outcome: CollectedFilesOutcome): ScanResult;
|
|
9
|
-
export declare function foldSvelteAndMdIntoOther(counts: PipelineFileCounts): LocalFileCounts;
|
|
10
|
-
export {};
|
|
@@ -32,10 +32,6 @@ interface Key {
|
|
|
32
32
|
escape: boolean;
|
|
33
33
|
return: boolean;
|
|
34
34
|
}
|
|
35
|
-
export declare function emptyCounts(): FileCounts;
|
|
36
|
-
export declare function addFile(counts: FileCounts, fileName: string): FileCounts;
|
|
37
|
-
export declare function mergeCounts(a: FileCounts, b: FileCounts): FileCounts;
|
|
38
|
-
export declare function failureFromErrorCode(code: string | undefined): ScanFailureCode;
|
|
39
35
|
export declare function describeFailure(failure: ScanFailureCode, path: string): FailureMessage;
|
|
40
36
|
export declare function summarize(counts: FileCounts): Summary;
|
|
41
37
|
export declare function phaseOf(scan: ScanResult | undefined): PathPhase;
|
|
@@ -4,8 +4,6 @@ export interface ScopeComponentLike {
|
|
|
4
4
|
name: string;
|
|
5
5
|
}
|
|
6
6
|
import type { Decision } from './types.js';
|
|
7
|
-
export declare const SCOPE_GATE_MAIN_COLUMN_WIDTH = 54;
|
|
8
|
-
export declare const ACCEPTED_COMPONENTS_COLUMN_WIDTH = 36;
|
|
9
7
|
export interface ScopeGatePanelLayout {
|
|
10
8
|
height: number;
|
|
11
9
|
mainVisibleCount: number;
|
|
@@ -3,27 +3,5 @@ export interface LineageParentEdge {
|
|
|
3
3
|
parent: string;
|
|
4
4
|
slotName: string;
|
|
5
5
|
}
|
|
6
|
-
export interface LineageEdge {
|
|
7
|
-
from: string;
|
|
8
|
-
slotName: string;
|
|
9
|
-
to: string;
|
|
10
|
-
}
|
|
11
|
-
export type LineageChain = LineageEdge[];
|
|
12
6
|
export declare function findDirectParents(target: string, components: ComponentGraphNode[]): LineageParentEdge[];
|
|
13
7
|
export declare function findAllAncestors(target: string, components: ComponentGraphNode[]): Set<string>;
|
|
14
|
-
export declare function findAllAncestorChains(target: string, components: ComponentGraphNode[]): LineageChain[];
|
|
15
|
-
export interface AncestorTreeNode {
|
|
16
|
-
name: string;
|
|
17
|
-
incomingSlotName?: string;
|
|
18
|
-
depth: number;
|
|
19
|
-
shared: boolean;
|
|
20
|
-
cycle: boolean;
|
|
21
|
-
parents: AncestorTreeNode[];
|
|
22
|
-
}
|
|
23
|
-
export declare function buildAncestorTree(target: string, components: ComponentGraphNode[]): AncestorTreeNode;
|
|
24
|
-
export interface AncestorTreeLine {
|
|
25
|
-
text: string;
|
|
26
|
-
jumpTarget?: string;
|
|
27
|
-
depth: number;
|
|
28
|
-
}
|
|
29
|
-
export declare function renderAncestorTree(node: AncestorTreeNode): AncestorTreeLine[];
|
|
@@ -56,38 +56,5 @@ export declare function buildVisibleRows(props: {
|
|
|
56
56
|
graph: ComponentGraphNode[];
|
|
57
57
|
filterVisibleKeys?: Set<string>;
|
|
58
58
|
}): VisibleRow[];
|
|
59
|
-
export declare function visibleItemOrder(props: {
|
|
60
|
-
items: GroupedSidebarItem[];
|
|
61
|
-
cycleParticipants: Set<string>;
|
|
62
|
-
expandedGroups: Set<string>;
|
|
63
|
-
alwaysExpanded?: boolean;
|
|
64
|
-
showFlatTier?: boolean;
|
|
65
|
-
graph: ComponentGraphNode[];
|
|
66
|
-
}): number[];
|
|
67
|
-
export declare function labelStyleFor(input: {
|
|
68
|
-
row: VisibleRow;
|
|
69
|
-
isCursor: boolean;
|
|
70
|
-
wouldDim: boolean;
|
|
71
|
-
}): {
|
|
72
|
-
color: string | undefined;
|
|
73
|
-
bold: boolean;
|
|
74
|
-
dim: boolean;
|
|
75
|
-
};
|
|
76
|
-
export declare function selectionGlyphStyleFor(selState: 'accepted' | 'rejected' | 'undecided' | undefined, isCycleRow: boolean): {
|
|
77
|
-
glyph: string | null;
|
|
78
|
-
color: string | undefined;
|
|
79
|
-
dim: boolean;
|
|
80
|
-
bold: boolean;
|
|
81
|
-
};
|
|
82
|
-
export declare function inheritanceGlyphStyleFor(input: {
|
|
83
|
-
status: RenderStatus['status'] | undefined;
|
|
84
|
-
isOwn: boolean;
|
|
85
|
-
isCursor: boolean;
|
|
86
|
-
}): {
|
|
87
|
-
glyph: string | null;
|
|
88
|
-
color: string | undefined;
|
|
89
|
-
dim: boolean;
|
|
90
|
-
bold: boolean;
|
|
91
|
-
};
|
|
92
59
|
export declare function GroupedSidebar(props: GroupedSidebarProps): React.ReactElement;
|
|
93
60
|
export {};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/** Maximum layout rows; the active terminal height determines the actual budget. */
|
|
2
|
-
export declare const VISIBLE_COUNT = 200;
|
|
3
|
-
/** Maximum supported panel window; normal terminals remain terminal-sized. */
|
|
4
|
-
export declare const MAX_PANEL_ROWS = 200;
|
|
5
|
-
/** Floors — both surfaces stay usable even on a small terminal. */
|
|
6
|
-
export declare const SIDEBAR_MIN = 4;
|
|
7
|
-
export declare const MIN_PANEL_ROWS = 4;
|
|
8
1
|
/**
|
|
9
2
|
* Fallback when `stdout.rows` is unavailable (piped output, tests). No TTY
|
|
10
3
|
* means Ink is not interactively repainting, so there is no flicker risk — we
|
|
@@ -12,23 +5,6 @@ export declare const MIN_PANEL_ROWS = 4;
|
|
|
12
5
|
* render is complete and unclipped.
|
|
13
6
|
*/
|
|
14
7
|
export declare const FALLBACK_ROWS = 40;
|
|
15
|
-
/**
|
|
16
|
-
* Vertical space consumed by everything ABOVE/BELOW the columns row. The panel
|
|
17
|
-
* shares the columns row, so the fit constraint while open is simply
|
|
18
|
-
* `FIXED_OVERHEAD + panelBoxHeight <= rows`.
|
|
19
|
-
*/
|
|
20
|
-
export declare const FIXED_OVERHEAD: number;
|
|
21
|
-
export declare const PANEL_BOX_CHROME = 6;
|
|
22
|
-
/**
|
|
23
|
-
* L2e — fixed vertical chrome around the sidebar in the BASE (no-panel) case,
|
|
24
|
-
* counting EVERYTHING that is not a variable sidebar entry row: the wizard
|
|
25
|
-
* header bar, the counter strip (with its blank separator), the cycle banner,
|
|
26
|
-
* the nothing-selected /
|
|
27
|
-
* AI-exclusion hint, the GroupedSidebar box borders + scroll indicator, the
|
|
28
|
-
* focused-detail block, and the wrapping legend region. The value intentionally
|
|
29
|
-
* leaves a small safety margin so resize-induced wrapping does not overflow.
|
|
30
|
-
*/
|
|
31
|
-
export declare const BASE_CHROME_OVERHEAD = 18;
|
|
32
8
|
export interface LineageLayoutInput {
|
|
33
9
|
/** Terminal height in rows (`stdout.rows`, or the fallback). */
|
|
34
10
|
rows: number;
|
|
@@ -37,18 +13,6 @@ export interface LineageLayoutInput {
|
|
|
37
13
|
/** Number of lineage entries — caps the panel window so it never over-allocates. */
|
|
38
14
|
entryCount?: number;
|
|
39
15
|
}
|
|
40
|
-
export interface LineageLayout {
|
|
41
|
-
/** Rows the sidebar should render (`visibleCount`). Constant across open/closed. */
|
|
42
|
-
sidebarVisible: number;
|
|
43
|
-
/** Rows a sidebar replacement panel should window to (`maxRows`). */
|
|
44
|
-
panelMaxRows: number;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The sidebar height is constant (the panel replaces it in the same slot, so
|
|
48
|
-
* there is nothing to shrink). Both values are derived from the terminal so
|
|
49
|
-
* resizing grows or shrinks the viewport without content-driven layout changes.
|
|
50
|
-
*/
|
|
51
|
-
export declare function computeLineageLayout({ rows, panelOpen, entryCount }: LineageLayoutInput): LineageLayout;
|
|
52
16
|
export interface SidebarBudget {
|
|
53
17
|
/** Rows the GroupedSidebar should render (`visibleCount`). */
|
|
54
18
|
sidebarVisibleCount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ComponentSlotInfo } from '../../07-scope-gate/graph/cycle-detection.js';
|
|
3
3
|
type PropMetadata = {
|
|
4
4
|
rationale?: string | null;
|
|
5
5
|
sourceStartLine?: number | null;
|
|
@@ -46,22 +46,5 @@ export type FieldEditorProps = {
|
|
|
46
46
|
header?: React.ReactNode;
|
|
47
47
|
headerHeight?: number;
|
|
48
48
|
};
|
|
49
|
-
export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
50
|
-
name: string;
|
|
51
|
-
allowedComponents: string[];
|
|
52
|
-
}[], targetSlotName: string, candidate: string): ComponentSlotInfo[];
|
|
53
|
-
export declare function introducesNewCycle(before: ReturnType<typeof findSlotCycles>, next: ReturnType<typeof findSlotCycles>): boolean;
|
|
54
|
-
export declare function computeAllowedComponentCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
55
|
-
name: string;
|
|
56
|
-
allowedComponents: string[];
|
|
57
|
-
}[], targetSlotName: string): string[];
|
|
58
|
-
export declare function simulateGraphWithReplacement(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
59
|
-
name: string;
|
|
60
|
-
allowedComponents: string[];
|
|
61
|
-
}[], targetSlotName: string, replaceIndex: number, candidate: string): ComponentSlotInfo[];
|
|
62
|
-
export declare function computeAllowedComponentReplacementCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
63
|
-
name: string;
|
|
64
|
-
allowedComponents: string[];
|
|
65
|
-
}[], targetSlotName: string, replaceIndex: number): string[];
|
|
66
49
|
export declare function FieldEditor({ value, width, height, fixedHeight, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, showInlineRationales, header, headerHeight, }: FieldEditorProps): React.ReactElement;
|
|
67
50
|
export {};
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
3
2
|
import type { UseFinalizePreviewReturn } from '../use-finalize-preview.js';
|
|
4
3
|
import type { UseReviewSurfaceStateResult } from '../use-review-surface-state.js';
|
|
5
4
|
import { type ReviewStatusEntry } from './ReviewStatus.js';
|
|
6
|
-
export type ReviewFinalizeDialogsProps = {
|
|
7
|
-
showFinalize: boolean;
|
|
8
|
-
showQuit: boolean;
|
|
9
|
-
components: ReadonlyArray<ReviewStatusEntry>;
|
|
10
|
-
removed?: ComponentTypeSummary[];
|
|
11
|
-
previewStatus?: 'idle' | 'running' | 'done' | 'error';
|
|
12
|
-
removedScrollOffset?: number;
|
|
13
|
-
onFinalizeConfirm: () => void;
|
|
14
|
-
onFinalizeCancel: () => void;
|
|
15
|
-
onQuitConfirm: () => void;
|
|
16
|
-
onQuitCancel: () => void;
|
|
17
|
-
};
|
|
18
|
-
export declare function ReviewFinalizeDialogs({ showFinalize, showQuit, components, removed, previewStatus, removedScrollOffset, onFinalizeConfirm, onFinalizeCancel, onQuitConfirm, onQuitCancel, }: ReviewFinalizeDialogsProps): React.ReactElement;
|
|
19
5
|
export declare function ReviewStepDialogs({ surfaceState, components, finalizePreview, onFinalize, onQuit, }: {
|
|
20
6
|
surfaceState: UseReviewSurfaceStateResult;
|
|
21
7
|
components: ReadonlyArray<ReviewStatusEntry>;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
2
|
export type TokenPropSuggestion = {
|
|
4
3
|
propName: string;
|
|
5
4
|
paths: string[];
|
|
6
5
|
suggested: string[];
|
|
7
6
|
allowed: string[];
|
|
8
7
|
};
|
|
9
|
-
export type TokenReviewToken = {
|
|
10
|
-
path: string;
|
|
11
|
-
kind: string;
|
|
12
|
-
};
|
|
13
8
|
/**
|
|
14
9
|
* Design-token props on `entry` with a declared token kind. `paths` is the
|
|
15
10
|
* full compatible token universe when a token catalog is available; `allowed`
|
|
16
11
|
* remains the current subset.
|
|
17
12
|
*/
|
|
18
|
-
export declare function collectTokenSuggestions(entry: CDFComponentEntry, availableTokens?: TokenReviewToken[]): TokenPropSuggestion[];
|
|
19
13
|
export type TokenReviewPanelProps = {
|
|
20
14
|
componentName: string;
|
|
21
15
|
suggestions: TokenPropSuggestion[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BreakingChange, CDFComponentEntry, ComponentTypeSummary, DownstreamImpact, ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
3
2
|
type GenerateReviewStepProps = {
|
|
4
3
|
extractSessionId: string | null;
|
|
5
4
|
tokenSessionId?: string | null;
|
|
@@ -13,25 +12,5 @@ type GenerateReviewStepProps = {
|
|
|
13
12
|
tokensPath?: string;
|
|
14
13
|
initialFinalizeError?: string | null;
|
|
15
14
|
};
|
|
16
|
-
export declare function sortComponentsForSidebar<T extends {
|
|
17
|
-
key: string;
|
|
18
|
-
entry: CDFComponentEntry;
|
|
19
|
-
}>(components: T[], cycleParticipants?: Set<string>): T[];
|
|
20
|
-
export { computeCycleAutoRejectTargets } from './graph/cycle-auto-reject.js';
|
|
21
|
-
export interface BreakingComponent {
|
|
22
|
-
componentName: string;
|
|
23
|
-
changes: BreakingChange[];
|
|
24
|
-
impact?: DownstreamImpact;
|
|
25
|
-
current?: ComponentTypeSummary;
|
|
26
|
-
}
|
|
27
|
-
export interface BreakingRow {
|
|
28
|
-
label: string;
|
|
29
|
-
componentName: string;
|
|
30
|
-
focusTarget?: {
|
|
31
|
-
kind: 'prop' | 'slot';
|
|
32
|
-
name: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export declare function buildBreakingRows(breakingChanges: BreakingComponent[]): BreakingRow[];
|
|
36
|
-
export declare function deriveBreakingChanges(response: ServerPreviewResponse): BreakingComponent[];
|
|
37
15
|
export declare function GenerateReviewStep(props: GenerateReviewStepProps): React.ReactElement;
|
|
16
|
+
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export declare const CYCLE_PANEL_PREAMBLE_LINES = 4;
|
|
2
1
|
export interface CyclePanelLineCountable {
|
|
3
2
|
suggestedBreak?: unknown;
|
|
4
3
|
}
|
|
5
|
-
export declare function cycleLineCount(cycle: CyclePanelLineCountable): number;
|
|
6
|
-
export declare function cycleLineOffsets(cycles: readonly CyclePanelLineCountable[], preamble?: number): number[];
|
|
7
|
-
export declare function totalCyclePanelLines(cycles: readonly CyclePanelLineCountable[], preamble?: number): number;
|
|
8
4
|
export declare function followCycleScroll(currentScroll: number, cursorIdx: number, cycles: readonly CyclePanelLineCountable[], panelHeight: number, preamble?: number): number;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
2
|
-
export declare class TimeoutError extends Error {
|
|
3
|
-
constructor(message?: string);
|
|
4
|
-
}
|
|
5
2
|
export type LivePreviewResult = {
|
|
6
3
|
generation: number;
|
|
7
4
|
response: ServerPreviewResponse | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
2
2
|
type FinalizePreviewStatus = 'idle' | 'running' | 'done' | 'error';
|
|
3
|
-
|
|
3
|
+
type UseFinalizePreviewOptions = {
|
|
4
4
|
/** True while the Finalize dialog is open. Toggling true (re)fires the preview. */
|
|
5
5
|
open: boolean;
|
|
6
6
|
extractSessionId: string | null;
|
|
@@ -26,14 +26,4 @@ export type UseReviewFinalizePreviewOptions = Omit<UseFinalizePreviewOptions, 'a
|
|
|
26
26
|
}>;
|
|
27
27
|
};
|
|
28
28
|
export declare function useReviewFinalizePreview({ components, ...options }: UseReviewFinalizePreviewOptions): UseFinalizePreviewReturn;
|
|
29
|
-
/**
|
|
30
|
-
* Shared Finalize-dialog preview, used by both the composite and atomic
|
|
31
|
-
* generate-review steps.
|
|
32
|
-
*
|
|
33
|
-
* When the dialog opens it fires a preview scoped to the ACCEPTED set (so the
|
|
34
|
-
* result reflects exactly what the push does, independent of the session's
|
|
35
|
-
* not-yet-reclassified generated rows), tracks loading/error, and owns the
|
|
36
|
-
* scroll offset for the preview list.
|
|
37
|
-
*/
|
|
38
|
-
export declare function useFinalizePreview(opts: UseFinalizePreviewOptions): UseFinalizePreviewReturn;
|
|
39
29
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type PreviewValidationError } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
1
|
import type { ImportHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
3
2
|
import { type PreviewDeps } from './preview.js';
|
|
4
3
|
import { type PushDeps } from './push.js';
|
|
5
4
|
import { type SaveDeps } from './save.js';
|
|
6
|
-
import { type
|
|
5
|
+
import { type FlowState } from './types.js';
|
|
7
6
|
/** What the flow starts from: what the earlier stages produced, and the user's saved settings. */
|
|
8
7
|
export interface FlowStart {
|
|
9
8
|
handoff: ImportHandoff;
|
|
@@ -38,15 +37,15 @@ export interface FlowDeps {
|
|
|
38
37
|
/** Writes one line of the wizard's step log. */
|
|
39
38
|
log: (entry: Record<string, unknown>) => void;
|
|
40
39
|
stderr: (text: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Called when the step is about to change, before anything is told about the new one. The host clears the terminal
|
|
42
|
+
* here so the next screen is drawn on a clean one. It has to be before: Ink paints as soon as it is told, and a clear
|
|
43
|
+
* after the paint wipes a static screen like the done step, which nothing draws again.
|
|
44
|
+
*/
|
|
45
|
+
beforeStepChange?: () => void;
|
|
41
46
|
}
|
|
42
47
|
export declare function startWizardLog(): void;
|
|
43
48
|
export declare function realFlowDeps(): FlowDeps;
|
|
44
|
-
/** The state the flow begins in, from what the earlier stages handed over. */
|
|
45
|
-
export declare function initialFlowState(start: FlowStart): FlowState;
|
|
46
|
-
/** What the log gets: the state change without the token, the document, or the whole of a large server response. */
|
|
47
|
-
export declare function sanitizeForLog(partial: FlowPatch): Record<string, unknown>;
|
|
48
|
-
/** The names of the components the errors are about, once each. */
|
|
49
|
-
export declare function namesToSkip(errors: readonly PreviewValidationError[]): string[];
|
|
50
49
|
export interface FlowController {
|
|
51
50
|
getState(): FlowState;
|
|
52
51
|
subscribe(listener: () => void): () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
-
import {
|
|
2
|
+
import { patchReviewStateWithValidationErrors } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
3
|
import { type CDFDocument, type DTCGTokenEntry, type ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
4
4
|
import type { FlowPatch, FlowState } from './types.js';
|
|
5
5
|
type PreviewClient = {
|
|
@@ -30,20 +30,6 @@ export interface RunPreviewInput {
|
|
|
30
30
|
/** Set when nothing was accepted, so the document is present but empty and the server shows what would be deleted. */
|
|
31
31
|
deleteAll: boolean;
|
|
32
32
|
}
|
|
33
|
-
/** What to do with a 422 from the preview: show the components that failed, or fall through to the generic error. */
|
|
34
|
-
type Preview422Outcome = {
|
|
35
|
-
kind: 'validation-error';
|
|
36
|
-
errors: PreviewValidationError[];
|
|
37
|
-
missingNames: string[];
|
|
38
|
-
} | {
|
|
39
|
-
kind: 'unparseable';
|
|
40
|
-
message: string;
|
|
41
|
-
} | {
|
|
42
|
-
kind: 'not-422';
|
|
43
|
-
};
|
|
44
|
-
export declare function handlePreview422(err: ApiError, extractSessionId: string | null, patchFn: PreviewDeps['patchReviewState']): Promise<Preview422Outcome>;
|
|
45
|
-
/** The patch to spread into any update that leaves the validation error step, so stale errors do not linger. */
|
|
46
|
-
export declare function clearedValidationErrorState(): Pick<FlowState, 'previewValidationErrors' | 'previewValidationMissingNames'>;
|
|
47
33
|
/**
|
|
48
34
|
* Loads what would be pushed and asks the server what that would change. Returns the patch the wizard applied: the
|
|
49
35
|
* preview gate, a terminal "done" when nothing would change, the validation error step for a 422, or an error.
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
import { appendRun, buildSourceFingerprint } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
|
-
import { type
|
|
3
|
+
import { type DTCGTokenEntry } from '@contentful/experience-design-system-types';
|
|
4
4
|
import type { FlowPatch, FlowState } from './types.js';
|
|
5
|
-
/** How long the confirmation of a written file stays up before the flow moves on to the preview. */
|
|
6
|
-
export declare const SAVE_CONFIRMATION_DELAY_MS = 1000;
|
|
7
|
-
/** The document written to `components.json`: the components and tokens as one schema-valid CDF. */
|
|
8
|
-
export declare function buildSavedCDF(components: Array<{
|
|
9
|
-
key: string;
|
|
10
|
-
entry: CDFComponentEntry;
|
|
11
|
-
}>, tokens: DTCGTokenEntry[], opts?: {
|
|
12
|
-
deleteAll?: boolean;
|
|
13
|
-
}): CDFDocument;
|
|
14
5
|
/** The outside world saving talks to, so each branch can be tested without a disk, a database or a clock. */
|
|
15
6
|
export interface SaveDeps {
|
|
16
7
|
openDb: () => DatabaseSync;
|
|
@@ -8,12 +8,6 @@ interface FlowScreenProps {
|
|
|
8
8
|
generatePromptPath?: string;
|
|
9
9
|
/** Leaves the import with the exit code the wizard would have exited with. */
|
|
10
10
|
onExit: (exitCode: number) => void;
|
|
11
|
-
/** Called when the step changes so the host can clear Ink's render buffer without scrollback pollution. */
|
|
12
|
-
onStepChange?: () => void;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
|
-
export declare function totalStepsFor(state: Pick<FlowState, 'tokensPath' | 'rawTokensPath' | 'mapTokensEligible'>): number;
|
|
16
|
-
/** Whether the preview gate offers "[e] Edit definitions": only when the document has components to edit. */
|
|
17
|
-
export declare function canEditFromPreview(cdf: FlowState['cdf']): boolean;
|
|
18
|
-
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, onStepChange, }: FlowScreenProps): React.ReactElement;
|
|
12
|
+
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, }: FlowScreenProps): React.ReactElement;
|
|
19
13
|
export {};
|
|
@@ -3,7 +3,10 @@ import { type FlowController, type FlowDeps, type FlowStart } from './controller
|
|
|
3
3
|
* The flow for a start, once. `start` is undefined until the generation stage has finished, so the hook can be called
|
|
4
4
|
* unconditionally; the step log is started with the controller, as the wizard started it with its first render.
|
|
5
5
|
*/
|
|
6
|
-
export declare function useFlow(start: FlowStart | undefined,
|
|
6
|
+
export declare function useFlow(start: FlowStart | undefined, options?: {
|
|
7
|
+
beforeStepChange?: () => void;
|
|
8
|
+
deps?: () => FlowDeps;
|
|
9
|
+
}): {
|
|
7
10
|
controller: FlowController;
|
|
8
11
|
state: ReturnType<FlowController['getState']>;
|
|
9
12
|
} | undefined;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
3
|
-
export interface PreviewDiffLine {
|
|
4
|
-
key: string;
|
|
5
|
-
color: string;
|
|
6
|
-
text: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function buildPreviewSummaryLines(preview: ServerPreviewResponse): PreviewDiffLine[];
|
|
9
3
|
type WizardPreviewStepProps = {
|
|
10
4
|
preview: ServerPreviewResponse;
|
|
11
5
|
spaceId: string;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Expands a leading `~` to the user's home directory.
|
|
3
|
-
* Exported separately so it can be unit-tested and reused.
|
|
4
|
-
*/
|
|
5
|
-
export declare function expandTilde(input: string): string;
|
|
6
1
|
/**
|
|
7
2
|
* Normalizes a user-entered path to an absolute path, handling all common
|
|
8
3
|
* terminal path styles:
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { ChangeClassification, ComponentTypeSummary
|
|
1
|
+
import type { ChangeClassification, ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
2
2
|
export interface PropertyDiffLine {
|
|
3
3
|
key: string;
|
|
4
4
|
color: 'green' | 'red' | 'yellow';
|
|
5
5
|
text: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function computeComponentDiffLines(current: ComponentTypeSummary, proposed: Record<string, unknown>, changeClassification?: ChangeClassification): PropertyDiffLine[];
|
|
8
|
-
export declare function diffProperty(name: string, old: PropertySummary, newDef: Record<string, unknown>): PropertyDiffLine[];
|
|
9
|
-
export declare function formatOldProp(prop: PropertySummary): string;
|
|
10
|
-
export declare function formatPropDef(def: Record<string, unknown>): string;
|
|
@@ -3,10 +3,7 @@ export interface PreviewValidationError {
|
|
|
3
3
|
path: string;
|
|
4
4
|
message: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function failedComponentNames(errors: readonly PreviewValidationError[]): string[];
|
|
7
6
|
export declare function matchedComponentNames(errors: readonly PreviewValidationError[], missingNames: readonly string[]): string[];
|
|
8
|
-
export declare function formatErrorLine(error: PreviewValidationError): string;
|
|
9
7
|
export declare function formatErrorLines(errors: readonly PreviewValidationError[]): string;
|
|
10
|
-
export declare function missingNote(missingNames: readonly string[]): string;
|
|
11
8
|
export declare function contextText(errors: readonly PreviewValidationError[], missingNames: readonly string[]): string;
|
|
12
9
|
export declare function skipLabel(matchedNames: readonly string[]): string;
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-c3f4df22.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-c3f4df22.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-c3f4df22.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|