@contentful/experience-design-system-cli 2.37.1-dev-build-eca14dd7.0 → 2.37.1-dev-build-6c9e5304.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.d.ts +1 -0
- package/dist/app.js +39 -22
- package/dist/index.js +39 -22
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +3 -1
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/app.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import type { ImportOptions } from './src/commands/import-options.js';
|
|
|
3
3
|
export type Screen = 'start' | 'import' | 'help' | 'settings' | 'settings-configuration' | 'settings-opt-in-analytics' | 'settings-debug-mode' | 'upgrade';
|
|
4
4
|
export declare function runApp(renderApp: (element: React.ReactElement) => {
|
|
5
5
|
waitUntilExit: () => Promise<unknown>;
|
|
6
|
+
clear?: () => void;
|
|
6
7
|
}, importOptions: ImportOptions): Promise<void>;
|
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 useEffect27, 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";
|
|
@@ -20489,6 +20489,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
20489
20489
|
}
|
|
20490
20490
|
}
|
|
20491
20491
|
update({ mapTokens: "complete" });
|
|
20492
|
+
await new Promise((r) => setImmediate(r));
|
|
20492
20493
|
const generatedCount = generated.results.filter((r) => !r.failed).length;
|
|
20493
20494
|
return {
|
|
20494
20495
|
ok: true,
|
|
@@ -20583,6 +20584,7 @@ function buildFlowStart(input) {
|
|
|
20583
20584
|
}
|
|
20584
20585
|
|
|
20585
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";
|
|
20586
20588
|
import { Box as Box41 } from "ink";
|
|
20587
20589
|
|
|
20588
20590
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
@@ -26983,10 +26985,18 @@ function FlowScreen({
|
|
|
26983
26985
|
controller,
|
|
26984
26986
|
livePreview = true,
|
|
26985
26987
|
generatePromptPath,
|
|
26986
|
-
onExit
|
|
26988
|
+
onExit,
|
|
26989
|
+
onStepChange
|
|
26987
26990
|
}) {
|
|
26988
26991
|
const totalSteps = totalStepsFor(state);
|
|
26989
26992
|
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]);
|
|
26990
27000
|
const content = (() => {
|
|
26991
27001
|
switch (state.step) {
|
|
26992
27002
|
case "final-review":
|
|
@@ -27112,7 +27122,7 @@ function FlowScreen({
|
|
|
27112
27122
|
}
|
|
27113
27123
|
|
|
27114
27124
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27115
|
-
import { useEffect as
|
|
27125
|
+
import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
|
|
27116
27126
|
|
|
27117
27127
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
|
|
27118
27128
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
@@ -27840,7 +27850,7 @@ function createFlowController(start, deps) {
|
|
|
27840
27850
|
|
|
27841
27851
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
27842
27852
|
function useFlow(start, deps = realFlowDeps) {
|
|
27843
|
-
const controller =
|
|
27853
|
+
const controller = useRef13();
|
|
27844
27854
|
if (start && !controller.current) {
|
|
27845
27855
|
try {
|
|
27846
27856
|
startWizardLog();
|
|
@@ -27853,14 +27863,14 @@ function useFlow(start, deps = realFlowDeps) {
|
|
|
27853
27863
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
27854
27864
|
() => current?.getState()
|
|
27855
27865
|
);
|
|
27856
|
-
|
|
27866
|
+
useEffect21(() => {
|
|
27857
27867
|
if (!start) controller.current = void 0;
|
|
27858
27868
|
}, [start]);
|
|
27859
27869
|
return current && state ? { controller: current, state } : void 0;
|
|
27860
27870
|
}
|
|
27861
27871
|
|
|
27862
27872
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
27863
|
-
import { useEffect as
|
|
27873
|
+
import { useEffect as useEffect22, useState as useState27 } from "react";
|
|
27864
27874
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
27865
27875
|
|
|
27866
27876
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
@@ -28054,7 +28064,7 @@ function Section({ title, rows }) {
|
|
|
28054
28064
|
}
|
|
28055
28065
|
function HelpScreen({ onDone }) {
|
|
28056
28066
|
const [info, setInfo] = useState27();
|
|
28057
|
-
|
|
28067
|
+
useEffect22(() => {
|
|
28058
28068
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
28059
28069
|
void readHelpInfo().then(setInfo);
|
|
28060
28070
|
}, []);
|
|
@@ -28147,7 +28157,7 @@ function SettingsScreen({
|
|
|
28147
28157
|
}
|
|
28148
28158
|
|
|
28149
28159
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28150
|
-
import { useEffect as
|
|
28160
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
28151
28161
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28152
28162
|
import TextInput4 from "ink-text-input";
|
|
28153
28163
|
|
|
@@ -28215,7 +28225,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28215
28225
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
28216
28226
|
const [editing, setEditing] = useState29(false);
|
|
28217
28227
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28218
|
-
|
|
28228
|
+
useEffect23(() => {
|
|
28219
28229
|
readCredentials().then((cfg) => {
|
|
28220
28230
|
setConfig(cfg);
|
|
28221
28231
|
setStage("form");
|
|
@@ -28352,7 +28362,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28352
28362
|
}
|
|
28353
28363
|
|
|
28354
28364
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28355
|
-
import { useEffect as
|
|
28365
|
+
import { useEffect as useEffect24, useState as useState30 } from "react";
|
|
28356
28366
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
28357
28367
|
|
|
28358
28368
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
@@ -28375,7 +28385,7 @@ import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-
|
|
|
28375
28385
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28376
28386
|
const [loading, setLoading] = useState30(true);
|
|
28377
28387
|
const [enabled, setEnabled] = useState30(true);
|
|
28378
|
-
|
|
28388
|
+
useEffect24(() => {
|
|
28379
28389
|
readAnalyticsSetting().then((setting) => {
|
|
28380
28390
|
setEnabled(setting.enabled);
|
|
28381
28391
|
setLoading(false);
|
|
@@ -28429,13 +28439,13 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28429
28439
|
}
|
|
28430
28440
|
|
|
28431
28441
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28432
|
-
import { useEffect as
|
|
28442
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
28433
28443
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
28434
28444
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28435
28445
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28436
28446
|
function UpgradeScreen({ onDone }) {
|
|
28437
28447
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28438
|
-
|
|
28448
|
+
useEffect25(() => {
|
|
28439
28449
|
startDebugRun({
|
|
28440
28450
|
flow: "upgrade",
|
|
28441
28451
|
step: "01-upgrade",
|
|
@@ -28500,13 +28510,13 @@ function renderBody(upgradeCheck) {
|
|
|
28500
28510
|
}
|
|
28501
28511
|
|
|
28502
28512
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28503
|
-
import { useEffect as
|
|
28513
|
+
import { useEffect as useEffect26, useState as useState32 } from "react";
|
|
28504
28514
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
28505
28515
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28506
28516
|
function DebugModeScreen({ onDone }) {
|
|
28507
28517
|
const [loading, setLoading] = useState32(true);
|
|
28508
28518
|
const [enabled, setEnabled] = useState32(true);
|
|
28509
|
-
|
|
28519
|
+
useEffect26(() => {
|
|
28510
28520
|
readDebugModeSetting().then((setting) => {
|
|
28511
28521
|
setEnabled(setting.enabled);
|
|
28512
28522
|
setLoading(false);
|
|
@@ -28556,7 +28566,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
28556
28566
|
|
|
28557
28567
|
// packages/experience-design-system-cli/app.tsx
|
|
28558
28568
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
28559
|
-
function App({ importOptions }) {
|
|
28569
|
+
function App({ importOptions, inkClear }) {
|
|
28560
28570
|
const [screen, setScreen] = useState33("start");
|
|
28561
28571
|
const [importExitCode, setImportExitCode] = useState33();
|
|
28562
28572
|
const showImportResult = importExitCode !== void 0;
|
|
@@ -28586,7 +28596,7 @@ function App({ importOptions }) {
|
|
|
28586
28596
|
const [flowStart, setFlowStart] = useState33();
|
|
28587
28597
|
const flow = useFlow(flowStart);
|
|
28588
28598
|
const [importDefaults, setImportDefaults] = useState33();
|
|
28589
|
-
|
|
28599
|
+
useEffect27(() => {
|
|
28590
28600
|
if (screen !== "import") {
|
|
28591
28601
|
setImportDefaults(void 0);
|
|
28592
28602
|
return;
|
|
@@ -28644,12 +28654,12 @@ function App({ importOptions }) {
|
|
|
28644
28654
|
}
|
|
28645
28655
|
});
|
|
28646
28656
|
};
|
|
28647
|
-
|
|
28657
|
+
useEffect27(() => {
|
|
28648
28658
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
28649
28659
|
setExtractionRun(void 0);
|
|
28650
28660
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
28651
28661
|
}, [extraction, extractionRun]);
|
|
28652
|
-
|
|
28662
|
+
useEffect27(() => {
|
|
28653
28663
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
28654
28664
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28655
28665
|
setGenerationInput({
|
|
@@ -28667,9 +28677,10 @@ function App({ importOptions }) {
|
|
|
28667
28677
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
28668
28678
|
});
|
|
28669
28679
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
28670
|
-
|
|
28680
|
+
useEffect27(() => {
|
|
28671
28681
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
28672
28682
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
28683
|
+
inkClear();
|
|
28673
28684
|
setScopeRun(void 0);
|
|
28674
28685
|
setGenerationInput(void 0);
|
|
28675
28686
|
setFlowStart(
|
|
@@ -28717,7 +28728,8 @@ function App({ importOptions }) {
|
|
|
28717
28728
|
state: flow.state,
|
|
28718
28729
|
controller: flow.controller,
|
|
28719
28730
|
generatePromptPath: flowStart.generatePromptPath,
|
|
28720
|
-
onExit: setImportExitCode
|
|
28731
|
+
onExit: setImportExitCode,
|
|
28732
|
+
onStepChange: inkClear
|
|
28721
28733
|
}
|
|
28722
28734
|
);
|
|
28723
28735
|
}
|
|
@@ -28836,7 +28848,12 @@ function App({ importOptions }) {
|
|
|
28836
28848
|
}
|
|
28837
28849
|
}
|
|
28838
28850
|
async function runApp(renderApp, importOptions) {
|
|
28839
|
-
|
|
28851
|
+
const inkClear = () => {
|
|
28852
|
+
instance.clear?.();
|
|
28853
|
+
process.stdout.write("\x1B[H\x1B[0J");
|
|
28854
|
+
};
|
|
28855
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
28856
|
+
await instance.waitUntilExit();
|
|
28840
28857
|
}
|
|
28841
28858
|
export {
|
|
28842
28859
|
runApp
|
package/dist/index.js
CHANGED
|
@@ -24106,6 +24106,7 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24106
24106
|
}
|
|
24107
24107
|
}
|
|
24108
24108
|
update({ mapTokens: "complete" });
|
|
24109
|
+
await new Promise((r) => setImmediate(r));
|
|
24109
24110
|
const generatedCount = generated.results.filter((r) => !r.failed).length;
|
|
24110
24111
|
return {
|
|
24111
24112
|
ok: true,
|
|
@@ -31133,6 +31134,7 @@ var init_run_teaser = __esm({
|
|
|
31133
31134
|
});
|
|
31134
31135
|
|
|
31135
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";
|
|
31136
31138
|
import { Box as Box41 } from "ink";
|
|
31137
31139
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31138
31140
|
function totalStepsFor(state) {
|
|
@@ -31148,10 +31150,18 @@ function FlowScreen({
|
|
|
31148
31150
|
controller,
|
|
31149
31151
|
livePreview = true,
|
|
31150
31152
|
generatePromptPath,
|
|
31151
|
-
onExit
|
|
31153
|
+
onExit,
|
|
31154
|
+
onStepChange
|
|
31152
31155
|
}) {
|
|
31153
31156
|
const totalSteps = totalStepsFor(state);
|
|
31154
31157
|
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]);
|
|
31155
31165
|
const content = (() => {
|
|
31156
31166
|
switch (state.step) {
|
|
31157
31167
|
case "final-review":
|
|
@@ -32071,9 +32081,9 @@ var init_controller = __esm({
|
|
|
32071
32081
|
});
|
|
32072
32082
|
|
|
32073
32083
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
32074
|
-
import { useEffect as
|
|
32084
|
+
import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
|
|
32075
32085
|
function useFlow(start, deps = realFlowDeps) {
|
|
32076
|
-
const controller =
|
|
32086
|
+
const controller = useRef13();
|
|
32077
32087
|
if (start && !controller.current) {
|
|
32078
32088
|
try {
|
|
32079
32089
|
startWizardLog();
|
|
@@ -32086,7 +32096,7 @@ function useFlow(start, deps = realFlowDeps) {
|
|
|
32086
32096
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
32087
32097
|
() => current?.getState()
|
|
32088
32098
|
);
|
|
32089
|
-
|
|
32099
|
+
useEffect21(() => {
|
|
32090
32100
|
if (!start) controller.current = void 0;
|
|
32091
32101
|
}, [start]);
|
|
32092
32102
|
return current && state ? { controller: current, state } : void 0;
|
|
@@ -32299,7 +32309,7 @@ var init_help_info = __esm({
|
|
|
32299
32309
|
});
|
|
32300
32310
|
|
|
32301
32311
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32302
|
-
import { useEffect as
|
|
32312
|
+
import { useEffect as useEffect22, useState as useState27 } from "react";
|
|
32303
32313
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
32304
32314
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
32305
32315
|
function Section({ title, rows }) {
|
|
@@ -32313,7 +32323,7 @@ function Section({ title, rows }) {
|
|
|
32313
32323
|
}
|
|
32314
32324
|
function HelpScreen({ onDone }) {
|
|
32315
32325
|
const [info, setInfo] = useState27();
|
|
32316
|
-
|
|
32326
|
+
useEffect22(() => {
|
|
32317
32327
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
32318
32328
|
void readHelpInfo().then(setInfo);
|
|
32319
32329
|
}, []);
|
|
@@ -32462,7 +32472,7 @@ var init_config_store = __esm({
|
|
|
32462
32472
|
});
|
|
32463
32473
|
|
|
32464
32474
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
32465
|
-
import { useEffect as
|
|
32475
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
32466
32476
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
32467
32477
|
import TextInput4 from "ink-text-input";
|
|
32468
32478
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -32484,7 +32494,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32484
32494
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
32485
32495
|
const [editing, setEditing] = useState29(false);
|
|
32486
32496
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
32487
|
-
|
|
32497
|
+
useEffect23(() => {
|
|
32488
32498
|
readCredentials().then((cfg) => {
|
|
32489
32499
|
setConfig(cfg);
|
|
32490
32500
|
setStage("form");
|
|
@@ -32668,13 +32678,13 @@ var init_analytics_store = __esm({
|
|
|
32668
32678
|
});
|
|
32669
32679
|
|
|
32670
32680
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
32671
|
-
import { useEffect as
|
|
32681
|
+
import { useEffect as useEffect24, useState as useState30 } from "react";
|
|
32672
32682
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
32673
32683
|
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32674
32684
|
function OptInAnalyticsScreen({ onDone }) {
|
|
32675
32685
|
const [loading, setLoading] = useState30(true);
|
|
32676
32686
|
const [enabled, setEnabled] = useState30(true);
|
|
32677
|
-
|
|
32687
|
+
useEffect24(() => {
|
|
32678
32688
|
readAnalyticsSetting().then((setting) => {
|
|
32679
32689
|
setEnabled(setting.enabled);
|
|
32680
32690
|
setLoading(false);
|
|
@@ -32737,12 +32747,12 @@ var init_screen11 = __esm({
|
|
|
32737
32747
|
});
|
|
32738
32748
|
|
|
32739
32749
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
32740
|
-
import { useEffect as
|
|
32750
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
32741
32751
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
32742
32752
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32743
32753
|
function UpgradeScreen({ onDone }) {
|
|
32744
32754
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
32745
|
-
|
|
32755
|
+
useEffect25(() => {
|
|
32746
32756
|
startDebugRun({
|
|
32747
32757
|
flow: "upgrade",
|
|
32748
32758
|
step: "01-upgrade",
|
|
@@ -32817,13 +32827,13 @@ var init_PageContainer4 = __esm({
|
|
|
32817
32827
|
});
|
|
32818
32828
|
|
|
32819
32829
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32820
|
-
import { useEffect as
|
|
32830
|
+
import { useEffect as useEffect26, useState as useState32 } from "react";
|
|
32821
32831
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
32822
32832
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32823
32833
|
function DebugModeScreen({ onDone }) {
|
|
32824
32834
|
const [loading, setLoading] = useState32(true);
|
|
32825
32835
|
const [enabled, setEnabled] = useState32(true);
|
|
32826
|
-
|
|
32836
|
+
useEffect26(() => {
|
|
32827
32837
|
readDebugModeSetting().then((setting) => {
|
|
32828
32838
|
setEnabled(setting.enabled);
|
|
32829
32839
|
setLoading(false);
|
|
@@ -32886,9 +32896,9 @@ __export(app_exports, {
|
|
|
32886
32896
|
runApp: () => runApp
|
|
32887
32897
|
});
|
|
32888
32898
|
import { join as join27 } from "node:path";
|
|
32889
|
-
import { useEffect as
|
|
32899
|
+
import { useEffect as useEffect27, useState as useState33 } from "react";
|
|
32890
32900
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
32891
|
-
function App({ importOptions }) {
|
|
32901
|
+
function App({ importOptions, inkClear }) {
|
|
32892
32902
|
const [screen, setScreen] = useState33("start");
|
|
32893
32903
|
const [importExitCode, setImportExitCode] = useState33();
|
|
32894
32904
|
const showImportResult = importExitCode !== void 0;
|
|
@@ -32918,7 +32928,7 @@ function App({ importOptions }) {
|
|
|
32918
32928
|
const [flowStart, setFlowStart] = useState33();
|
|
32919
32929
|
const flow = useFlow(flowStart);
|
|
32920
32930
|
const [importDefaults, setImportDefaults] = useState33();
|
|
32921
|
-
|
|
32931
|
+
useEffect27(() => {
|
|
32922
32932
|
if (screen !== "import") {
|
|
32923
32933
|
setImportDefaults(void 0);
|
|
32924
32934
|
return;
|
|
@@ -32976,12 +32986,12 @@ function App({ importOptions }) {
|
|
|
32976
32986
|
}
|
|
32977
32987
|
});
|
|
32978
32988
|
};
|
|
32979
|
-
|
|
32989
|
+
useEffect27(() => {
|
|
32980
32990
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
32981
32991
|
setExtractionRun(void 0);
|
|
32982
32992
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
32983
32993
|
}, [extraction, extractionRun]);
|
|
32984
|
-
|
|
32994
|
+
useEffect27(() => {
|
|
32985
32995
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
32986
32996
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
32987
32997
|
setGenerationInput({
|
|
@@ -32999,9 +33009,10 @@ function App({ importOptions }) {
|
|
|
32999
33009
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33000
33010
|
});
|
|
33001
33011
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33002
|
-
|
|
33012
|
+
useEffect27(() => {
|
|
33003
33013
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33004
33014
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33015
|
+
inkClear();
|
|
33005
33016
|
setScopeRun(void 0);
|
|
33006
33017
|
setGenerationInput(void 0);
|
|
33007
33018
|
setFlowStart(
|
|
@@ -33049,7 +33060,8 @@ function App({ importOptions }) {
|
|
|
33049
33060
|
state: flow.state,
|
|
33050
33061
|
controller: flow.controller,
|
|
33051
33062
|
generatePromptPath: flowStart.generatePromptPath,
|
|
33052
|
-
onExit: setImportExitCode
|
|
33063
|
+
onExit: setImportExitCode,
|
|
33064
|
+
onStepChange: inkClear
|
|
33053
33065
|
}
|
|
33054
33066
|
);
|
|
33055
33067
|
}
|
|
@@ -33168,7 +33180,12 @@ function App({ importOptions }) {
|
|
|
33168
33180
|
}
|
|
33169
33181
|
}
|
|
33170
33182
|
async function runApp(renderApp, importOptions) {
|
|
33171
|
-
|
|
33183
|
+
const inkClear = () => {
|
|
33184
|
+
instance.clear?.();
|
|
33185
|
+
process.stdout.write("\x1B[H\x1B[0J");
|
|
33186
|
+
};
|
|
33187
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
33188
|
+
await instance.waitUntilExit();
|
|
33172
33189
|
}
|
|
33173
33190
|
var init_app = __esm({
|
|
33174
33191
|
"packages/experience-design-system-cli/app.tsx"() {
|
package/dist/package.json
CHANGED
|
@@ -8,10 +8,12 @@ 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;
|
|
11
13
|
}
|
|
12
14
|
/** How many steps the import has, as the wizard counted them. */
|
|
13
15
|
export declare function totalStepsFor(state: Pick<FlowState, 'tokensPath' | 'rawTokensPath' | 'mapTokensEligible'>): number;
|
|
14
16
|
/** Whether the preview gate offers "[e] Edit definitions": only when the document has components to edit. */
|
|
15
17
|
export declare function canEditFromPreview(cdf: FlowState['cdf']): boolean;
|
|
16
|
-
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, }: FlowScreenProps): React.ReactElement;
|
|
18
|
+
export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, onStepChange, }: FlowScreenProps): React.ReactElement;
|
|
17
19
|
export {};
|
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-6c9e5304.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-6c9e5304.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-6c9e5304.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|