@contentful/experience-design-system-cli 2.37.1-dev-build-64f41b0b.0 → 2.37.1-dev-build-97b615d3.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 -33
- package/dist/index.js +33 -33
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +6 -0
- package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +1 -3
- package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +4 -1
- 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";
|
|
@@ -20584,7 +20584,6 @@ function buildFlowStart(input) {
|
|
|
20584
20584
|
}
|
|
20585
20585
|
|
|
20586
20586
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
20587
|
-
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
20588
20587
|
import { Box as Box41 } from "ink";
|
|
20589
20588
|
|
|
20590
20589
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
@@ -26985,18 +26984,10 @@ function FlowScreen({
|
|
|
26985
26984
|
controller,
|
|
26986
26985
|
livePreview = true,
|
|
26987
26986
|
generatePromptPath,
|
|
26988
|
-
onExit
|
|
26989
|
-
onStepChange
|
|
26987
|
+
onExit
|
|
26990
26988
|
}) {
|
|
26991
26989
|
const totalSteps = totalStepsFor(state);
|
|
26992
26990
|
const quit = () => onExit(0);
|
|
26993
|
-
const previousStep = useRef12(state.step);
|
|
26994
|
-
useEffect20(() => {
|
|
26995
|
-
if (previousStep.current !== state.step) {
|
|
26996
|
-
onStepChange?.();
|
|
26997
|
-
previousStep.current = state.step;
|
|
26998
|
-
}
|
|
26999
|
-
}, [state.step, onStepChange]);
|
|
27000
26991
|
const content = (() => {
|
|
27001
26992
|
switch (state.step) {
|
|
27002
26993
|
case "final-review":
|
|
@@ -27122,7 +27113,7 @@ function FlowScreen({
|
|
|
27122
27113
|
}
|
|
27123
27114
|
|
|
27124
27115
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27125
|
-
import { useEffect as
|
|
27116
|
+
import { useEffect as useEffect20, useRef as useRef12, useSyncExternalStore } from "react";
|
|
27126
27117
|
|
|
27127
27118
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
27128
27119
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -27712,6 +27703,12 @@ function createFlowController(start, deps) {
|
|
|
27712
27703
|
deps.log({ update: sanitizeForLog(patch) });
|
|
27713
27704
|
} catch {
|
|
27714
27705
|
}
|
|
27706
|
+
if (patch.step !== void 0 && patch.step !== state.step) {
|
|
27707
|
+
try {
|
|
27708
|
+
deps.beforeStepChange?.();
|
|
27709
|
+
} catch {
|
|
27710
|
+
}
|
|
27711
|
+
}
|
|
27715
27712
|
state = { ...state, ...patch };
|
|
27716
27713
|
for (const listener of listeners) listener();
|
|
27717
27714
|
};
|
|
@@ -27849,28 +27846,32 @@ function createFlowController(start, deps) {
|
|
|
27849
27846
|
}
|
|
27850
27847
|
|
|
27851
27848
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27852
|
-
function useFlow(start,
|
|
27853
|
-
const controller =
|
|
27849
|
+
function useFlow(start, options = {}) {
|
|
27850
|
+
const controller = useRef12();
|
|
27854
27851
|
if (start && !controller.current) {
|
|
27855
27852
|
try {
|
|
27856
27853
|
startWizardLog();
|
|
27857
27854
|
} catch {
|
|
27858
27855
|
}
|
|
27859
|
-
|
|
27856
|
+
const flowDeps = (options.deps ?? realFlowDeps)();
|
|
27857
|
+
controller.current = createFlowController(start, {
|
|
27858
|
+
...flowDeps,
|
|
27859
|
+
...options.beforeStepChange ? { beforeStepChange: options.beforeStepChange } : {}
|
|
27860
|
+
});
|
|
27860
27861
|
}
|
|
27861
27862
|
const current = controller.current;
|
|
27862
27863
|
const state = useSyncExternalStore(
|
|
27863
27864
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
27864
27865
|
() => current?.getState()
|
|
27865
27866
|
);
|
|
27866
|
-
|
|
27867
|
+
useEffect20(() => {
|
|
27867
27868
|
if (!start) controller.current = void 0;
|
|
27868
27869
|
}, [start]);
|
|
27869
27870
|
return current && state ? { controller: current, state } : void 0;
|
|
27870
27871
|
}
|
|
27871
27872
|
|
|
27872
27873
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
27873
|
-
import { useEffect as
|
|
27874
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
27874
27875
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
27875
27876
|
|
|
27876
27877
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
@@ -28064,7 +28065,7 @@ function Section({ title, rows }) {
|
|
|
28064
28065
|
}
|
|
28065
28066
|
function HelpScreen({ onDone }) {
|
|
28066
28067
|
const [info, setInfo] = useState27();
|
|
28067
|
-
|
|
28068
|
+
useEffect21(() => {
|
|
28068
28069
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
28069
28070
|
void readHelpInfo().then(setInfo);
|
|
28070
28071
|
}, []);
|
|
@@ -28157,7 +28158,7 @@ function SettingsScreen({
|
|
|
28157
28158
|
}
|
|
28158
28159
|
|
|
28159
28160
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28160
|
-
import { useEffect as
|
|
28161
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28161
28162
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28162
28163
|
import TextInput4 from "ink-text-input";
|
|
28163
28164
|
|
|
@@ -28225,7 +28226,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28225
28226
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
28226
28227
|
const [editing, setEditing] = useState29(false);
|
|
28227
28228
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28228
|
-
|
|
28229
|
+
useEffect22(() => {
|
|
28229
28230
|
readCredentials().then((cfg) => {
|
|
28230
28231
|
setConfig(cfg);
|
|
28231
28232
|
setStage("form");
|
|
@@ -28362,7 +28363,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28362
28363
|
}
|
|
28363
28364
|
|
|
28364
28365
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28365
|
-
import { useEffect as
|
|
28366
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
28366
28367
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
28367
28368
|
|
|
28368
28369
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -28385,7 +28386,7 @@ import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-
|
|
|
28385
28386
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28386
28387
|
const [loading, setLoading] = useState30(true);
|
|
28387
28388
|
const [enabled, setEnabled] = useState30(true);
|
|
28388
|
-
|
|
28389
|
+
useEffect23(() => {
|
|
28389
28390
|
readAnalyticsSetting().then((setting) => {
|
|
28390
28391
|
setEnabled(setting.enabled);
|
|
28391
28392
|
setLoading(false);
|
|
@@ -28439,13 +28440,13 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28439
28440
|
}
|
|
28440
28441
|
|
|
28441
28442
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28442
|
-
import { useEffect as
|
|
28443
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
28443
28444
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
28444
28445
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28445
28446
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28446
28447
|
function UpgradeScreen({ onDone }) {
|
|
28447
28448
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28448
|
-
|
|
28449
|
+
useEffect24(() => {
|
|
28449
28450
|
startDebugRun({
|
|
28450
28451
|
flow: "upgrade",
|
|
28451
28452
|
step: "01-upgrade",
|
|
@@ -28510,13 +28511,13 @@ function renderBody(upgradeCheck) {
|
|
|
28510
28511
|
}
|
|
28511
28512
|
|
|
28512
28513
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28513
|
-
import { useEffect as
|
|
28514
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
28514
28515
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
28515
28516
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28516
28517
|
function DebugModeScreen({ onDone }) {
|
|
28517
28518
|
const [loading, setLoading] = useState32(true);
|
|
28518
28519
|
const [enabled, setEnabled] = useState32(true);
|
|
28519
|
-
|
|
28520
|
+
useEffect25(() => {
|
|
28520
28521
|
readDebugModeSetting().then((setting) => {
|
|
28521
28522
|
setEnabled(setting.enabled);
|
|
28522
28523
|
setLoading(false);
|
|
@@ -28594,9 +28595,9 @@ function App({ importOptions, inkClear }) {
|
|
|
28594
28595
|
const [generationInput, setGenerationInput] = useState33();
|
|
28595
28596
|
const generation = useGeneration(generationInput);
|
|
28596
28597
|
const [flowStart, setFlowStart] = useState33();
|
|
28597
|
-
const flow = useFlow(flowStart);
|
|
28598
|
+
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
28598
28599
|
const [importDefaults, setImportDefaults] = useState33();
|
|
28599
|
-
|
|
28600
|
+
useEffect26(() => {
|
|
28600
28601
|
if (screen !== "import") {
|
|
28601
28602
|
setImportDefaults(void 0);
|
|
28602
28603
|
return;
|
|
@@ -28654,12 +28655,12 @@ function App({ importOptions, inkClear }) {
|
|
|
28654
28655
|
}
|
|
28655
28656
|
});
|
|
28656
28657
|
};
|
|
28657
|
-
|
|
28658
|
+
useEffect26(() => {
|
|
28658
28659
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
28659
28660
|
setExtractionRun(void 0);
|
|
28660
28661
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
28661
28662
|
}, [extraction, extractionRun]);
|
|
28662
|
-
|
|
28663
|
+
useEffect26(() => {
|
|
28663
28664
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
28664
28665
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28665
28666
|
setGenerationInput({
|
|
@@ -28677,7 +28678,7 @@ function App({ importOptions, inkClear }) {
|
|
|
28677
28678
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
28678
28679
|
});
|
|
28679
28680
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
28680
|
-
|
|
28681
|
+
useEffect26(() => {
|
|
28681
28682
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
28682
28683
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28683
28684
|
inkClear();
|
|
@@ -28728,8 +28729,7 @@ function App({ importOptions, inkClear }) {
|
|
|
28728
28729
|
state: flow.state,
|
|
28729
28730
|
controller: flow.controller,
|
|
28730
28731
|
generatePromptPath: flowStart.generatePromptPath,
|
|
28731
|
-
onExit: setImportExitCode
|
|
28732
|
-
onStepChange: inkClear
|
|
28732
|
+
onExit: setImportExitCode
|
|
28733
28733
|
}
|
|
28734
28734
|
);
|
|
28735
28735
|
}
|
package/dist/index.js
CHANGED
|
@@ -31134,7 +31134,6 @@ var init_run_teaser = __esm({
|
|
|
31134
31134
|
});
|
|
31135
31135
|
|
|
31136
31136
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
31137
|
-
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
31138
31137
|
import { Box as Box41 } from "ink";
|
|
31139
31138
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31140
31139
|
function totalStepsFor(state) {
|
|
@@ -31150,18 +31149,10 @@ function FlowScreen({
|
|
|
31150
31149
|
controller,
|
|
31151
31150
|
livePreview = true,
|
|
31152
31151
|
generatePromptPath,
|
|
31153
|
-
onExit
|
|
31154
|
-
onStepChange
|
|
31152
|
+
onExit
|
|
31155
31153
|
}) {
|
|
31156
31154
|
const totalSteps = totalStepsFor(state);
|
|
31157
31155
|
const quit = () => onExit(0);
|
|
31158
|
-
const previousStep = useRef12(state.step);
|
|
31159
|
-
useEffect20(() => {
|
|
31160
|
-
if (previousStep.current !== state.step) {
|
|
31161
|
-
onStepChange?.();
|
|
31162
|
-
previousStep.current = state.step;
|
|
31163
|
-
}
|
|
31164
|
-
}, [state.step, onStepChange]);
|
|
31165
31156
|
const content = (() => {
|
|
31166
31157
|
switch (state.step) {
|
|
31167
31158
|
case "final-review":
|
|
@@ -31929,6 +31920,12 @@ function createFlowController(start, deps) {
|
|
|
31929
31920
|
deps.log({ update: sanitizeForLog(patch) });
|
|
31930
31921
|
} catch {
|
|
31931
31922
|
}
|
|
31923
|
+
if (patch.step !== void 0 && patch.step !== state.step) {
|
|
31924
|
+
try {
|
|
31925
|
+
deps.beforeStepChange?.();
|
|
31926
|
+
} catch {
|
|
31927
|
+
}
|
|
31928
|
+
}
|
|
31932
31929
|
state = { ...state, ...patch };
|
|
31933
31930
|
for (const listener of listeners) listener();
|
|
31934
31931
|
};
|
|
@@ -32081,22 +32078,26 @@ var init_controller = __esm({
|
|
|
32081
32078
|
});
|
|
32082
32079
|
|
|
32083
32080
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
32084
|
-
import { useEffect as
|
|
32085
|
-
function useFlow(start,
|
|
32086
|
-
const controller =
|
|
32081
|
+
import { useEffect as useEffect20, useRef as useRef12, useSyncExternalStore } from "react";
|
|
32082
|
+
function useFlow(start, options = {}) {
|
|
32083
|
+
const controller = useRef12();
|
|
32087
32084
|
if (start && !controller.current) {
|
|
32088
32085
|
try {
|
|
32089
32086
|
startWizardLog();
|
|
32090
32087
|
} catch {
|
|
32091
32088
|
}
|
|
32092
|
-
|
|
32089
|
+
const flowDeps = (options.deps ?? realFlowDeps)();
|
|
32090
|
+
controller.current = createFlowController(start, {
|
|
32091
|
+
...flowDeps,
|
|
32092
|
+
...options.beforeStepChange ? { beforeStepChange: options.beforeStepChange } : {}
|
|
32093
|
+
});
|
|
32093
32094
|
}
|
|
32094
32095
|
const current = controller.current;
|
|
32095
32096
|
const state = useSyncExternalStore(
|
|
32096
32097
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
32097
32098
|
() => current?.getState()
|
|
32098
32099
|
);
|
|
32099
|
-
|
|
32100
|
+
useEffect20(() => {
|
|
32100
32101
|
if (!start) controller.current = void 0;
|
|
32101
32102
|
}, [start]);
|
|
32102
32103
|
return current && state ? { controller: current, state } : void 0;
|
|
@@ -32309,7 +32310,7 @@ var init_help_info = __esm({
|
|
|
32309
32310
|
});
|
|
32310
32311
|
|
|
32311
32312
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32312
|
-
import { useEffect as
|
|
32313
|
+
import { useEffect as useEffect21, useState as useState27 } from "react";
|
|
32313
32314
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
32314
32315
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
32315
32316
|
function Section({ title, rows }) {
|
|
@@ -32323,7 +32324,7 @@ function Section({ title, rows }) {
|
|
|
32323
32324
|
}
|
|
32324
32325
|
function HelpScreen({ onDone }) {
|
|
32325
32326
|
const [info, setInfo] = useState27();
|
|
32326
|
-
|
|
32327
|
+
useEffect21(() => {
|
|
32327
32328
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
32328
32329
|
void readHelpInfo().then(setInfo);
|
|
32329
32330
|
}, []);
|
|
@@ -32472,7 +32473,7 @@ var init_config_store = __esm({
|
|
|
32472
32473
|
});
|
|
32473
32474
|
|
|
32474
32475
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
32475
|
-
import { useEffect as
|
|
32476
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
32476
32477
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
32477
32478
|
import TextInput4 from "ink-text-input";
|
|
32478
32479
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -32494,7 +32495,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32494
32495
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
32495
32496
|
const [editing, setEditing] = useState29(false);
|
|
32496
32497
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
32497
|
-
|
|
32498
|
+
useEffect22(() => {
|
|
32498
32499
|
readCredentials().then((cfg) => {
|
|
32499
32500
|
setConfig(cfg);
|
|
32500
32501
|
setStage("form");
|
|
@@ -32678,13 +32679,13 @@ var init_analytics_store = __esm({
|
|
|
32678
32679
|
});
|
|
32679
32680
|
|
|
32680
32681
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
32681
|
-
import { useEffect as
|
|
32682
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
32682
32683
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
32683
32684
|
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32684
32685
|
function OptInAnalyticsScreen({ onDone }) {
|
|
32685
32686
|
const [loading, setLoading] = useState30(true);
|
|
32686
32687
|
const [enabled, setEnabled] = useState30(true);
|
|
32687
|
-
|
|
32688
|
+
useEffect23(() => {
|
|
32688
32689
|
readAnalyticsSetting().then((setting) => {
|
|
32689
32690
|
setEnabled(setting.enabled);
|
|
32690
32691
|
setLoading(false);
|
|
@@ -32747,12 +32748,12 @@ var init_screen11 = __esm({
|
|
|
32747
32748
|
});
|
|
32748
32749
|
|
|
32749
32750
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
32750
|
-
import { useEffect as
|
|
32751
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
32751
32752
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
32752
32753
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32753
32754
|
function UpgradeScreen({ onDone }) {
|
|
32754
32755
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
32755
|
-
|
|
32756
|
+
useEffect24(() => {
|
|
32756
32757
|
startDebugRun({
|
|
32757
32758
|
flow: "upgrade",
|
|
32758
32759
|
step: "01-upgrade",
|
|
@@ -32827,13 +32828,13 @@ var init_PageContainer4 = __esm({
|
|
|
32827
32828
|
});
|
|
32828
32829
|
|
|
32829
32830
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32830
|
-
import { useEffect as
|
|
32831
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
32831
32832
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
32832
32833
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32833
32834
|
function DebugModeScreen({ onDone }) {
|
|
32834
32835
|
const [loading, setLoading] = useState32(true);
|
|
32835
32836
|
const [enabled, setEnabled] = useState32(true);
|
|
32836
|
-
|
|
32837
|
+
useEffect25(() => {
|
|
32837
32838
|
readDebugModeSetting().then((setting) => {
|
|
32838
32839
|
setEnabled(setting.enabled);
|
|
32839
32840
|
setLoading(false);
|
|
@@ -32896,7 +32897,7 @@ __export(app_exports, {
|
|
|
32896
32897
|
runApp: () => runApp
|
|
32897
32898
|
});
|
|
32898
32899
|
import { join as join27 } from "node:path";
|
|
32899
|
-
import { useEffect as
|
|
32900
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
32900
32901
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
32901
32902
|
function App({ importOptions, inkClear }) {
|
|
32902
32903
|
const [screen, setScreen] = useState33("start");
|
|
@@ -32926,9 +32927,9 @@ function App({ importOptions, inkClear }) {
|
|
|
32926
32927
|
const [generationInput, setGenerationInput] = useState33();
|
|
32927
32928
|
const generation = useGeneration(generationInput);
|
|
32928
32929
|
const [flowStart, setFlowStart] = useState33();
|
|
32929
|
-
const flow = useFlow(flowStart);
|
|
32930
|
+
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
32930
32931
|
const [importDefaults, setImportDefaults] = useState33();
|
|
32931
|
-
|
|
32932
|
+
useEffect26(() => {
|
|
32932
32933
|
if (screen !== "import") {
|
|
32933
32934
|
setImportDefaults(void 0);
|
|
32934
32935
|
return;
|
|
@@ -32986,12 +32987,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32986
32987
|
}
|
|
32987
32988
|
});
|
|
32988
32989
|
};
|
|
32989
|
-
|
|
32990
|
+
useEffect26(() => {
|
|
32990
32991
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
32991
32992
|
setExtractionRun(void 0);
|
|
32992
32993
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
32993
32994
|
}, [extraction, extractionRun]);
|
|
32994
|
-
|
|
32995
|
+
useEffect26(() => {
|
|
32995
32996
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
32996
32997
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32997
32998
|
setGenerationInput({
|
|
@@ -33009,7 +33010,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33009
33010
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33010
33011
|
});
|
|
33011
33012
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33012
|
-
|
|
33013
|
+
useEffect26(() => {
|
|
33013
33014
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33014
33015
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33015
33016
|
inkClear();
|
|
@@ -33060,8 +33061,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33060
33061
|
state: flow.state,
|
|
33061
33062
|
controller: flow.controller,
|
|
33062
33063
|
generatePromptPath: flowStart.generatePromptPath,
|
|
33063
|
-
onExit: setImportExitCode
|
|
33064
|
-
onStepChange: inkClear
|
|
33064
|
+
onExit: setImportExitCode
|
|
33065
33065
|
}
|
|
33066
33066
|
);
|
|
33067
33067
|
}
|
package/dist/package.json
CHANGED
|
@@ -38,6 +38,12 @@ export interface FlowDeps {
|
|
|
38
38
|
/** Writes one line of the wizard's step log. */
|
|
39
39
|
log: (entry: Record<string, unknown>) => void;
|
|
40
40
|
stderr: (text: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the step is about to change, before anything is told about the new one. The host clears the terminal
|
|
43
|
+
* 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
|
|
44
|
+
* after the paint wipes a static screen like the done step, which nothing draws again.
|
|
45
|
+
*/
|
|
46
|
+
beforeStepChange?: () => void;
|
|
41
47
|
}
|
|
42
48
|
export declare function startWizardLog(): void;
|
|
43
49
|
export declare function realFlowDeps(): FlowDeps;
|
|
@@ -8,12 +8,10 @@ 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
12
|
/** How many steps the import has, as the wizard counted them. */
|
|
15
13
|
export declare function totalStepsFor(state: Pick<FlowState, 'tokensPath' | 'rawTokensPath' | 'mapTokensEligible'>): number;
|
|
16
14
|
/** Whether the preview gate offers "[e] Edit definitions": only when the document has components to edit. */
|
|
17
15
|
export declare function canEditFromPreview(cdf: FlowState['cdf']): boolean;
|
|
18
|
-
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit,
|
|
16
|
+
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, }: FlowScreenProps): React.ReactElement;
|
|
19
17
|
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;
|
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-97b615d3.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"skills/"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-
|
|
33
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
32
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-97b615d3.0",
|
|
33
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-97b615d3.0",
|
|
34
34
|
"@inkjs/ui": "^2.0.0",
|
|
35
35
|
"@segment/analytics-node": "^3.0.0",
|
|
36
36
|
"@vue/compiler-sfc": "^3.5.31",
|