@contentful/experience-design-system-cli 2.37.1-dev-build-0d4be259.0 → 2.37.1-dev-build-bdf99669.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 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 useEffect27, useState as useState33 } from "react";
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 useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
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, deps = realFlowDeps) {
27859
- const controller = useRef13();
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
- controller.current = createFlowController(start, deps());
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
- useEffect21(() => {
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 useEffect22, useState as useState27 } from "react";
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
- useEffect22(() => {
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 useEffect23, useState as useState29 } from "react";
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
- useEffect23(() => {
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 useEffect24, useState as useState30 } from "react";
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
- useEffect24(() => {
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 useEffect25, useState as useState31 } from "react";
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
- useEffect25(() => {
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 useEffect26, useState as useState32 } from "react";
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
- useEffect26(() => {
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
- useEffect27(() => {
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
- useEffect27(() => {
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
- useEffect27(() => {
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
- useEffect27(() => {
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) {
@@ -31140,7 +31138,6 @@ var init_run_teaser = __esm({
31140
31138
  });
31141
31139
 
31142
31140
  // 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
31141
  import { Box as Box41 } from "ink";
31145
31142
  import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
31146
31143
  function totalStepsFor(state) {
@@ -31156,18 +31153,10 @@ function FlowScreen({
31156
31153
  controller,
31157
31154
  livePreview = true,
31158
31155
  generatePromptPath,
31159
- onExit,
31160
- onStepChange
31156
+ onExit
31161
31157
  }) {
31162
31158
  const totalSteps = totalStepsFor(state);
31163
31159
  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
31160
  const content = (() => {
31172
31161
  switch (state.step) {
31173
31162
  case "final-review":
@@ -31935,6 +31924,12 @@ function createFlowController(start, deps) {
31935
31924
  deps.log({ update: sanitizeForLog(patch) });
31936
31925
  } catch {
31937
31926
  }
31927
+ if (patch.step !== void 0 && patch.step !== state.step) {
31928
+ try {
31929
+ deps.beforeStepChange?.();
31930
+ } catch {
31931
+ }
31932
+ }
31938
31933
  state = { ...state, ...patch };
31939
31934
  for (const listener of listeners) listener();
31940
31935
  };
@@ -32087,22 +32082,26 @@ var init_controller = __esm({
32087
32082
  });
32088
32083
 
32089
32084
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
32090
- import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
32091
- function useFlow(start, deps = realFlowDeps) {
32092
- const controller = useRef13();
32085
+ import { useEffect as useEffect20, useRef as useRef12, useSyncExternalStore } from "react";
32086
+ function useFlow(start, options = {}) {
32087
+ const controller = useRef12();
32093
32088
  if (start && !controller.current) {
32094
32089
  try {
32095
32090
  startWizardLog();
32096
32091
  } catch {
32097
32092
  }
32098
- controller.current = createFlowController(start, deps());
32093
+ const flowDeps = (options.deps ?? realFlowDeps)();
32094
+ controller.current = createFlowController(start, {
32095
+ ...flowDeps,
32096
+ ...options.beforeStepChange ? { beforeStepChange: options.beforeStepChange } : {}
32097
+ });
32099
32098
  }
32100
32099
  const current = controller.current;
32101
32100
  const state = useSyncExternalStore(
32102
32101
  (listener) => current?.subscribe(listener) ?? (() => void 0),
32103
32102
  () => current?.getState()
32104
32103
  );
32105
- useEffect21(() => {
32104
+ useEffect20(() => {
32106
32105
  if (!start) controller.current = void 0;
32107
32106
  }, [start]);
32108
32107
  return current && state ? { controller: current, state } : void 0;
@@ -32315,7 +32314,7 @@ var init_help_info = __esm({
32315
32314
  });
32316
32315
 
32317
32316
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
32318
- import { useEffect as useEffect22, useState as useState27 } from "react";
32317
+ import { useEffect as useEffect21, useState as useState27 } from "react";
32319
32318
  import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
32320
32319
  import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
32321
32320
  function Section({ title, rows }) {
@@ -32329,7 +32328,7 @@ function Section({ title, rows }) {
32329
32328
  }
32330
32329
  function HelpScreen({ onDone }) {
32331
32330
  const [info, setInfo] = useState27();
32332
- useEffect22(() => {
32331
+ useEffect21(() => {
32333
32332
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
32334
32333
  void readHelpInfo().then(setInfo);
32335
32334
  }, []);
@@ -32478,7 +32477,7 @@ var init_config_store = __esm({
32478
32477
  });
32479
32478
 
32480
32479
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
32481
- import { useEffect as useEffect23, useState as useState29 } from "react";
32480
+ import { useEffect as useEffect22, useState as useState29 } from "react";
32482
32481
  import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
32483
32482
  import TextInput4 from "ink-text-input";
32484
32483
  import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
@@ -32500,7 +32499,7 @@ function ConfigurationScreen({ onDone }) {
32500
32499
  const [lastSaved, setLastSaved] = useState29(null);
32501
32500
  const [editing, setEditing] = useState29(false);
32502
32501
  const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
32503
- useEffect23(() => {
32502
+ useEffect22(() => {
32504
32503
  readCredentials().then((cfg) => {
32505
32504
  setConfig(cfg);
32506
32505
  setStage("form");
@@ -32684,13 +32683,13 @@ var init_analytics_store = __esm({
32684
32683
  });
32685
32684
 
32686
32685
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
32687
- import { useEffect as useEffect24, useState as useState30 } from "react";
32686
+ import { useEffect as useEffect23, useState as useState30 } from "react";
32688
32687
  import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
32689
32688
  import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
32690
32689
  function OptInAnalyticsScreen({ onDone }) {
32691
32690
  const [loading, setLoading] = useState30(true);
32692
32691
  const [enabled, setEnabled] = useState30(true);
32693
- useEffect24(() => {
32692
+ useEffect23(() => {
32694
32693
  readAnalyticsSetting().then((setting) => {
32695
32694
  setEnabled(setting.enabled);
32696
32695
  setLoading(false);
@@ -32753,12 +32752,12 @@ var init_screen11 = __esm({
32753
32752
  });
32754
32753
 
32755
32754
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
32756
- import { useEffect as useEffect25, useState as useState31 } from "react";
32755
+ import { useEffect as useEffect24, useState as useState31 } from "react";
32757
32756
  import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
32758
32757
  import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
32759
32758
  function UpgradeScreen({ onDone }) {
32760
32759
  const [upgradeCheck, setUpgradeCheck] = useState31();
32761
- useEffect25(() => {
32760
+ useEffect24(() => {
32762
32761
  startDebugRun({
32763
32762
  flow: "upgrade",
32764
32763
  step: "01-upgrade",
@@ -32833,13 +32832,13 @@ var init_PageContainer4 = __esm({
32833
32832
  });
32834
32833
 
32835
32834
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
32836
- import { useEffect as useEffect26, useState as useState32 } from "react";
32835
+ import { useEffect as useEffect25, useState as useState32 } from "react";
32837
32836
  import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
32838
32837
  import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
32839
32838
  function DebugModeScreen({ onDone }) {
32840
32839
  const [loading, setLoading] = useState32(true);
32841
32840
  const [enabled, setEnabled] = useState32(true);
32842
- useEffect26(() => {
32841
+ useEffect25(() => {
32843
32842
  readDebugModeSetting().then((setting) => {
32844
32843
  setEnabled(setting.enabled);
32845
32844
  setLoading(false);
@@ -32902,7 +32901,7 @@ __export(app_exports, {
32902
32901
  runApp: () => runApp
32903
32902
  });
32904
32903
  import { join as join27 } from "node:path";
32905
- import { useEffect as useEffect27, useState as useState33 } from "react";
32904
+ import { useEffect as useEffect26, useState as useState33 } from "react";
32906
32905
  import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
32907
32906
  function App({ importOptions, inkClear }) {
32908
32907
  const [screen, setScreen] = useState33("start");
@@ -32932,9 +32931,9 @@ function App({ importOptions, inkClear }) {
32932
32931
  const [generationInput, setGenerationInput] = useState33();
32933
32932
  const generation = useGeneration(generationInput);
32934
32933
  const [flowStart, setFlowStart] = useState33();
32935
- const flow = useFlow(flowStart);
32934
+ const flow = useFlow(flowStart, { beforeStepChange: inkClear });
32936
32935
  const [importDefaults, setImportDefaults] = useState33();
32937
- useEffect27(() => {
32936
+ useEffect26(() => {
32938
32937
  if (screen !== "import") {
32939
32938
  setImportDefaults(void 0);
32940
32939
  return;
@@ -32992,12 +32991,12 @@ function App({ importOptions, inkClear }) {
32992
32991
  }
32993
32992
  });
32994
32993
  };
32995
- useEffect27(() => {
32994
+ useEffect26(() => {
32996
32995
  if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
32997
32996
  setExtractionRun(void 0);
32998
32997
  setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
32999
32998
  }, [extraction, extractionRun]);
33000
- useEffect27(() => {
32999
+ useEffect26(() => {
33001
33000
  if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
33002
33001
  const { extraction: produced, input, generatePromptPath } = scopeRun;
33003
33002
  setGenerationInput({
@@ -33015,7 +33014,7 @@ function App({ importOptions, inkClear }) {
33015
33014
  ...generatePromptPath ? { generatePromptPath } : {}
33016
33015
  });
33017
33016
  }, [scopeFlow, scopeRun, generationInput]);
33018
- useEffect27(() => {
33017
+ useEffect26(() => {
33019
33018
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
33020
33019
  const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
33021
33020
  inkClear();
@@ -33066,8 +33065,7 @@ function App({ importOptions, inkClear }) {
33066
33065
  state: flow.state,
33067
33066
  controller: flow.controller,
33068
33067
  generatePromptPath: flowStart.generatePromptPath,
33069
- onExit: setImportExitCode,
33070
- onStepChange: inkClear
33068
+ onExit: setImportExitCode
33071
33069
  }
33072
33070
  );
33073
33071
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-0d4be259.0",
3
+ "version": "2.37.1-dev-build-bdf99669.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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, onStepChange, }: FlowScreenProps): React.ReactElement;
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, deps?: () => FlowDeps): {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-0d4be259.0",
3
+ "version": "2.37.1-dev-build-bdf99669.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
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-0d4be259.0",
3
+ "version": "2.37.1-dev-build-bdf99669.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-0d4be259.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-0d4be259.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-bdf99669.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-bdf99669.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",