@contentful/experience-design-system-cli 2.37.1-dev-build-af058351.0 → 2.37.1-dev-build-5e79f794.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 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
@@ -26985,17 +26985,18 @@ function FlowScreen({
26985
26985
  controller,
26986
26986
  livePreview = true,
26987
26987
  generatePromptPath,
26988
- onExit
26988
+ onExit,
26989
+ onStepChange
26989
26990
  }) {
26990
26991
  const totalSteps = totalStepsFor(state);
26991
26992
  const quit = () => onExit(0);
26992
26993
  const previousStep = useRef12(state.step);
26993
26994
  useEffect20(() => {
26994
26995
  if (previousStep.current !== state.step) {
26995
- process.stdout.write("\x1B[2J\x1B[H");
26996
+ onStepChange?.();
26996
26997
  previousStep.current = state.step;
26997
26998
  }
26998
- }, [state.step]);
26999
+ }, [state.step, onStepChange]);
26999
27000
  const content = (() => {
27000
27001
  switch (state.step) {
27001
27002
  case "final-review":
@@ -28565,7 +28566,7 @@ function DebugModeScreen({ onDone }) {
28565
28566
 
28566
28567
  // packages/experience-design-system-cli/app.tsx
28567
28568
  import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
28568
- function App({ importOptions }) {
28569
+ function App({ importOptions, inkClear }) {
28569
28570
  const [screen, setScreen] = useState33("start");
28570
28571
  const [importExitCode, setImportExitCode] = useState33();
28571
28572
  const showImportResult = importExitCode !== void 0;
@@ -28679,6 +28680,7 @@ function App({ importOptions }) {
28679
28680
  useEffect27(() => {
28680
28681
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
28681
28682
  const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
28683
+ inkClear();
28682
28684
  setScopeRun(void 0);
28683
28685
  setGenerationInput(void 0);
28684
28686
  setFlowStart(
@@ -28726,7 +28728,8 @@ function App({ importOptions }) {
28726
28728
  state: flow.state,
28727
28729
  controller: flow.controller,
28728
28730
  generatePromptPath: flowStart.generatePromptPath,
28729
- onExit: setImportExitCode
28731
+ onExit: setImportExitCode,
28732
+ onStepChange: inkClear
28730
28733
  }
28731
28734
  );
28732
28735
  }
@@ -28845,7 +28848,8 @@ function App({ importOptions }) {
28845
28848
  }
28846
28849
  }
28847
28850
  async function runApp(renderApp, importOptions) {
28848
- await renderApp(/* @__PURE__ */ jsx59(App, { importOptions })).waitUntilExit();
28851
+ const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear: () => instance.clear?.() }));
28852
+ await instance.waitUntilExit();
28849
28853
  }
28850
28854
  export {
28851
28855
  runApp
package/dist/index.js CHANGED
@@ -31150,17 +31150,18 @@ function FlowScreen({
31150
31150
  controller,
31151
31151
  livePreview = true,
31152
31152
  generatePromptPath,
31153
- onExit
31153
+ onExit,
31154
+ onStepChange
31154
31155
  }) {
31155
31156
  const totalSteps = totalStepsFor(state);
31156
31157
  const quit = () => onExit(0);
31157
31158
  const previousStep = useRef12(state.step);
31158
31159
  useEffect20(() => {
31159
31160
  if (previousStep.current !== state.step) {
31160
- process.stdout.write("\x1B[2J\x1B[H");
31161
+ onStepChange?.();
31161
31162
  previousStep.current = state.step;
31162
31163
  }
31163
- }, [state.step]);
31164
+ }, [state.step, onStepChange]);
31164
31165
  const content = (() => {
31165
31166
  switch (state.step) {
31166
31167
  case "final-review":
@@ -32897,7 +32898,7 @@ __export(app_exports, {
32897
32898
  import { join as join27 } from "node:path";
32898
32899
  import { useEffect as useEffect27, useState as useState33 } from "react";
32899
32900
  import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
32900
- function App({ importOptions }) {
32901
+ function App({ importOptions, inkClear }) {
32901
32902
  const [screen, setScreen] = useState33("start");
32902
32903
  const [importExitCode, setImportExitCode] = useState33();
32903
32904
  const showImportResult = importExitCode !== void 0;
@@ -33011,6 +33012,7 @@ function App({ importOptions }) {
33011
33012
  useEffect27(() => {
33012
33013
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
33013
33014
  const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
33015
+ inkClear();
33014
33016
  setScopeRun(void 0);
33015
33017
  setGenerationInput(void 0);
33016
33018
  setFlowStart(
@@ -33058,7 +33060,8 @@ function App({ importOptions }) {
33058
33060
  state: flow.state,
33059
33061
  controller: flow.controller,
33060
33062
  generatePromptPath: flowStart.generatePromptPath,
33061
- onExit: setImportExitCode
33063
+ onExit: setImportExitCode,
33064
+ onStepChange: inkClear
33062
33065
  }
33063
33066
  );
33064
33067
  }
@@ -33177,7 +33180,8 @@ function App({ importOptions }) {
33177
33180
  }
33178
33181
  }
33179
33182
  async function runApp(renderApp, importOptions) {
33180
- await renderApp(/* @__PURE__ */ jsx59(App, { importOptions })).waitUntilExit();
33183
+ const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear: () => instance.clear?.() }));
33184
+ await instance.waitUntilExit();
33181
33185
  }
33182
33186
  var init_app = __esm({
33183
33187
  "packages/experience-design-system-cli/app.tsx"() {
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-af058351.0",
3
+ "version": "2.37.1-dev-build-5e79f794.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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 {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-af058351.0",
3
+ "version": "2.37.1-dev-build-5e79f794.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-af058351.0",
3
+ "version": "2.37.1-dev-build-5e79f794.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-af058351.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-af058351.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-5e79f794.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-5e79f794.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",