@contentful/experience-design-system-cli 2.43.1-dev-build-b2134432.0 → 2.43.1-dev-build-30e824d7.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
@@ -2736,6 +2736,9 @@ var IMPORT_TARGET_OPTIONS = [
2736
2736
  { target: "tokens", label: "Design tokens only" },
2737
2737
  { target: "components", label: "Components only" }
2738
2738
  ];
2739
+ function importModeLabel(target) {
2740
+ return IMPORT_TARGET_OPTIONS.find((option) => option.target === target).label;
2741
+ }
2739
2742
  var COMPONENTS_OVERVIEW = [
2740
2743
  { description: "Extract components from your codebase", ai: true },
2741
2744
  { description: "Review what was extracted", ai: false },
@@ -17642,9 +17645,8 @@ async function collectPreflightContext() {
17642
17645
  }
17643
17646
  function preflightLog(chosen, terminal, context) {
17644
17647
  const { columns, rows } = terminal;
17645
- const label = IMPORT_TARGET_OPTIONS.find((option) => option.target === chosen)?.label;
17646
17648
  const summary = [
17647
- label ? `Chose: ${label}` : "Left the import without choosing",
17649
+ chosen ? `Chose: ${importModeLabel(chosen)}` : "Left the import without choosing",
17648
17650
  columns && rows ? `Terminal: ${columns} \xD7 ${rows}` : "Terminal: size unknown"
17649
17651
  ];
17650
17652
  if (context) {
@@ -18237,29 +18239,46 @@ function useWelcomeControls(onQuit) {
18237
18239
  });
18238
18240
  }
18239
18241
 
18242
+ // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts
18243
+ function welcomeLog({
18244
+ mode,
18245
+ projectPath,
18246
+ initialPath,
18247
+ emptySubmits
18248
+ }) {
18249
+ const kept = projectPath !== null && initialPath.trim() !== "" && projectPath === initialPath.trim();
18250
+ const source = projectPath === null ? null : kept ? "prefilled" : "typed";
18251
+ const summary = [
18252
+ `Import mode: ${importModeLabel(mode)}`,
18253
+ projectPath === null ? "Project path: none (left the import)" : `Project path: ${projectPath}`,
18254
+ ...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
18255
+ `Empty submits: ${emptySubmits}`
18256
+ ];
18257
+ return {
18258
+ summary,
18259
+ data: { import_mode: mode, project_path: projectPath, path_source: source, empty_submits: emptySubmits }
18260
+ };
18261
+ }
18262
+
18240
18263
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
18241
18264
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
18242
18265
  function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
18243
18266
  const [projectPath, setProjectPath] = useState6(initialPath);
18244
18267
  const visit = useRef3({ emptySubmits: 0 }).current;
18245
18268
  useEffect6(() => {
18246
- startDebugRun({
18247
- flow: "import/welcome",
18248
- step: "01-welcome",
18249
- menuOption: "Welcome",
18250
- inputs: { import_mode: mode, initial_path: initialPath }
18251
- });
18269
+ startDebugRun({ flow: "import/welcome", step: "01-welcome", menuOption: "Welcome" });
18252
18270
  }, []);
18253
- const quit = () => {
18254
- void finishDebugRun({
18255
- outputs: {
18256
- project_path: null,
18257
- typed_something: toProjectPath(projectPath) !== null,
18258
- empty_submits: visit.emptySubmits
18259
- },
18260
- status: "success",
18261
- exitMethod: "discarded"
18271
+ const finish = (path5) => {
18272
+ const { summary, data } = welcomeLog({
18273
+ mode,
18274
+ projectPath: path5,
18275
+ initialPath,
18276
+ emptySubmits: visit.emptySubmits
18262
18277
  });
18278
+ void finishDebugRun({ summary, outputs: data, status: "success", exitMethod: path5 ? "saved" : "discarded" });
18279
+ };
18280
+ const quit = () => {
18281
+ finish(null);
18263
18282
  onQuit();
18264
18283
  };
18265
18284
  useWelcomeControls(quit);
@@ -18269,15 +18288,7 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
18269
18288
  visit.emptySubmits += 1;
18270
18289
  return;
18271
18290
  }
18272
- void finishDebugRun({
18273
- outputs: {
18274
- project_path: path5,
18275
- changed_from_initial: path5 !== initialPath.trim(),
18276
- empty_submits: visit.emptySubmits
18277
- },
18278
- status: "success",
18279
- exitMethod: "saved"
18280
- });
18291
+ finish(path5);
18281
18292
  onContinue(path5);
18282
18293
  };
18283
18294
  return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
package/dist/index.js CHANGED
@@ -19758,6 +19758,9 @@ var init_debug_store = __esm({
19758
19758
  });
19759
19759
 
19760
19760
  // packages/experience-design-system-cli/src/tui/import/steps/00-preflight/logic.ts
19761
+ function importModeLabel(target) {
19762
+ return IMPORT_TARGET_OPTIONS.find((option) => option.target === target).label;
19763
+ }
19761
19764
  function overviewFor(target) {
19762
19765
  return target === "tokens" ? TOKENS_ONLY_OVERVIEW : COMPONENTS_OVERVIEW;
19763
19766
  }
@@ -20154,9 +20157,8 @@ async function collectPreflightContext() {
20154
20157
  }
20155
20158
  function preflightLog(chosen, terminal, context) {
20156
20159
  const { columns, rows } = terminal;
20157
- const label = IMPORT_TARGET_OPTIONS.find((option) => option.target === chosen)?.label;
20158
20160
  const summary = [
20159
- label ? `Chose: ${label}` : "Left the import without choosing",
20161
+ chosen ? `Chose: ${importModeLabel(chosen)}` : "Left the import without choosing",
20160
20162
  columns && rows ? `Terminal: ${columns} \xD7 ${rows}` : "Terminal: size unknown"
20161
20163
  ];
20162
20164
  if (context) {
@@ -20889,6 +20891,33 @@ var init_controls4 = __esm({
20889
20891
  }
20890
20892
  });
20891
20893
 
20894
+ // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts
20895
+ function welcomeLog({
20896
+ mode,
20897
+ projectPath,
20898
+ initialPath,
20899
+ emptySubmits
20900
+ }) {
20901
+ const kept = projectPath !== null && initialPath.trim() !== "" && projectPath === initialPath.trim();
20902
+ const source = projectPath === null ? null : kept ? "prefilled" : "typed";
20903
+ const summary = [
20904
+ `Import mode: ${importModeLabel(mode)}`,
20905
+ projectPath === null ? "Project path: none (left the import)" : `Project path: ${projectPath}`,
20906
+ ...source ? [`Path source: ${source === "prefilled" ? "pre-filled, kept as is" : "typed by the user"}`] : [],
20907
+ `Empty submits: ${emptySubmits}`
20908
+ ];
20909
+ return {
20910
+ summary,
20911
+ data: { import_mode: mode, project_path: projectPath, path_source: source, empty_submits: emptySubmits }
20912
+ };
20913
+ }
20914
+ var init_log2 = __esm({
20915
+ "packages/experience-design-system-cli/src/tui/import/steps/01-welcome/log.ts"() {
20916
+ "use strict";
20917
+ init_logic();
20918
+ }
20919
+ });
20920
+
20892
20921
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
20893
20922
  import { useEffect as useEffect6, useRef as useRef3, useState as useState6 } from "react";
20894
20923
  import { Box as Box10, Text as Text10 } from "ink";
@@ -20897,23 +20926,19 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
20897
20926
  const [projectPath, setProjectPath] = useState6(initialPath);
20898
20927
  const visit = useRef3({ emptySubmits: 0 }).current;
20899
20928
  useEffect6(() => {
20900
- startDebugRun({
20901
- flow: "import/welcome",
20902
- step: "01-welcome",
20903
- menuOption: "Welcome",
20904
- inputs: { import_mode: mode, initial_path: initialPath }
20905
- });
20929
+ startDebugRun({ flow: "import/welcome", step: "01-welcome", menuOption: "Welcome" });
20906
20930
  }, []);
20907
- const quit = () => {
20908
- void finishDebugRun({
20909
- outputs: {
20910
- project_path: null,
20911
- typed_something: toProjectPath(projectPath) !== null,
20912
- empty_submits: visit.emptySubmits
20913
- },
20914
- status: "success",
20915
- exitMethod: "discarded"
20931
+ const finish = (path5) => {
20932
+ const { summary, data } = welcomeLog({
20933
+ mode,
20934
+ projectPath: path5,
20935
+ initialPath,
20936
+ emptySubmits: visit.emptySubmits
20916
20937
  });
20938
+ void finishDebugRun({ summary, outputs: data, status: "success", exitMethod: path5 ? "saved" : "discarded" });
20939
+ };
20940
+ const quit = () => {
20941
+ finish(null);
20917
20942
  onQuit();
20918
20943
  };
20919
20944
  useWelcomeControls(quit);
@@ -20923,15 +20948,7 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
20923
20948
  visit.emptySubmits += 1;
20924
20949
  return;
20925
20950
  }
20926
- void finishDebugRun({
20927
- outputs: {
20928
- project_path: path5,
20929
- changed_from_initial: path5 !== initialPath.trim(),
20930
- empty_submits: visit.emptySubmits
20931
- },
20932
- status: "success",
20933
- exitMethod: "saved"
20934
- });
20951
+ finish(path5);
20935
20952
  onContinue(path5);
20936
20953
  };
20937
20954
  return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
@@ -20956,6 +20973,7 @@ var init_screen2 = __esm({
20956
20973
  init_debug_store();
20957
20974
  init_ClearableTextInput();
20958
20975
  init_controls4();
20976
+ init_log2();
20959
20977
  init_logic5();
20960
20978
  init_ControlHints();
20961
20979
  init_StepHeader();
@@ -22745,7 +22763,7 @@ function scopeGateLogOutputs(components, decisions) {
22745
22763
  };
22746
22764
  }
22747
22765
  var MAX_NAMES, capped;
22748
- var init_log2 = __esm({
22766
+ var init_log3 = __esm({
22749
22767
  "packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/log.ts"() {
22750
22768
  "use strict";
22751
22769
  MAX_NAMES = 20;
@@ -25644,7 +25662,7 @@ var init_screen8 = __esm({
25644
25662
  "use strict";
25645
25663
  init_debug_store();
25646
25664
  init_StepHeader();
25647
- init_log2();
25665
+ init_log3();
25648
25666
  init_tokens_column();
25649
25667
  init_load();
25650
25668
  init_logic10();
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.43.1-dev-build-b2134432.0",
3
+ "version": "2.43.1-dev-build-30e824d7.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,6 +4,8 @@ export declare const IMPORT_TARGET_OPTIONS: ReadonlyArray<{
4
4
  target: ImportTarget;
5
5
  label: string;
6
6
  }>;
7
+ /** The words the user saw for a choice. The logs of the steps after the preflight say it, since it decides which steps run. */
8
+ export declare function importModeLabel(target: ImportTarget): string;
7
9
  export declare function overviewFor(target: ImportTarget): readonly OverviewStep[];
8
10
  export type ImportStepId = 'project' | 'token-file' | 'path-validation' | 'credentials' | 'component-extraction' | 'token-generation' | 'scope-gate' | 'generation' | 'review' | 'save-push';
9
11
  export declare function stepsFor(target: ImportTarget): readonly ImportStepId[];
@@ -0,0 +1,13 @@
1
+ import { type ImportTarget } from '../00-preflight/logic.js';
2
+ /** The log's two sections: `summary` for a person, `data` for AI, both carrying the same facts. */
3
+ export declare function welcomeLog({ mode, projectPath, initialPath, emptySubmits, }: {
4
+ mode: ImportTarget;
5
+ /** The path the user continued with, or null when they left the import. */
6
+ projectPath: string | null;
7
+ initialPath: string;
8
+ /** How many times Enter was pressed on an empty field, which does nothing and can look like a stuck screen. */
9
+ emptySubmits: number;
10
+ }): {
11
+ summary: string[];
12
+ data: Record<string, unknown>;
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.43.1-dev-build-b2134432.0",
3
+ "version": "2.43.1-dev-build-30e824d7.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.43.1-dev-build-b2134432.0"
48
+ "@contentful/experience-design-system-types": "2.43.1-dev-build-30e824d7.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/node24": "^24.0.4",
@@ -59,7 +59,7 @@
59
59
  "ink-testing-library": "^4.0.0",
60
60
  "typescript-eslint": "^8.67.0",
61
61
  "vitest": "^4.0.16",
62
- "@contentful/experience-design-system-backend-pipeline": "2.43.1-dev-build-b2134432.0"
62
+ "@contentful/experience-design-system-backend-pipeline": "2.43.1-dev-build-30e824d7.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",