@contentful/experience-design-system-cli 2.35.1-dev-build-7780c1f7.0 → 2.35.1-dev-build-a963233a.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/index.js CHANGED
@@ -297,6 +297,105 @@ var init_PageContainer = __esm({
297
297
  }
298
298
  });
299
299
 
300
+ // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts
301
+ function shouldQuit(value, input, key) {
302
+ if (key.escape) return true;
303
+ return value === "" && input === "q" && !key.ctrl && !key.meta;
304
+ }
305
+ function toProjectPath(value) {
306
+ const projectPath = value.trim();
307
+ return projectPath === "" ? null : projectPath;
308
+ }
309
+ var init_logic = __esm({
310
+ "packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts"() {
311
+ "use strict";
312
+ }
313
+ });
314
+
315
+ // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts
316
+ import { useInput as useInput3 } from "ink";
317
+ function useWelcomeControls(projectPath, onQuit) {
318
+ useInput3((input, key) => {
319
+ if (shouldQuit(projectPath, input, key)) onQuit();
320
+ });
321
+ }
322
+ var WELCOME_CONTROLS;
323
+ var init_controls = __esm({
324
+ "packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts"() {
325
+ "use strict";
326
+ init_logic();
327
+ WELCOME_CONTROLS = [
328
+ { keys: "Enter", label: "Continue" },
329
+ { keys: "Esc/q", label: "Back to menu" }
330
+ ];
331
+ }
332
+ });
333
+
334
+ // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
335
+ import { useState as useState3 } from "react";
336
+ import { Box as Box3, Text as Text3 } from "ink";
337
+ import TextInput from "ink-text-input";
338
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
339
+ function WelcomeScreen({ onContinue, onQuit }) {
340
+ const [projectPath, setProjectPath] = useState3("");
341
+ useWelcomeControls(projectPath, onQuit);
342
+ const submit = (value) => {
343
+ const path = toProjectPath(value);
344
+ if (path) onContinue(path);
345
+ };
346
+ return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
347
+ /* @__PURE__ */ jsx3(Text3, { bold: true, color: PALETTE.success, children: "\u{1F44B} Hey! Let's import your design system into Contentful." }),
348
+ /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "I'll walk you through 5 steps to get your components into Contentful ExO." }),
349
+ /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
350
+ /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: RULE }),
351
+ OVERVIEW.map((item) => /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
352
+ /* @__PURE__ */ jsx3(Text3, { bold: true, children: item.label }),
353
+ /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: item.description })
354
+ ] }, item.label)),
355
+ /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: RULE })
356
+ ] }),
357
+ /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
358
+ /* @__PURE__ */ jsx3(Text3, { children: "Where is your component library?" }),
359
+ /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
360
+ /* @__PURE__ */ jsx3(Text3, { color: PALETTE.accent, children: "?" }),
361
+ /* @__PURE__ */ jsx3(Text3, { children: "Project path:" }),
362
+ /* @__PURE__ */ jsx3(TextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
363
+ ] })
364
+ ] }),
365
+ /* @__PURE__ */ jsx3(Box3, { marginTop: 1, gap: 3, children: WELCOME_CONTROLS.map((control) => /* @__PURE__ */ jsxs3(Text3, { dimColor: true, children: [
366
+ "[",
367
+ control.keys,
368
+ "] ",
369
+ control.label
370
+ ] }, control.keys)) })
371
+ ] });
372
+ }
373
+ var RULE, OVERVIEW;
374
+ var init_screen = __esm({
375
+ "packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
376
+ "use strict";
377
+ init_home_theme();
378
+ init_controls();
379
+ init_logic();
380
+ RULE = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
381
+ OVERVIEW = [
382
+ { label: "Step 1", description: "Extract components from your codebase" },
383
+ { label: "Step 2", description: "Review what was extracted" },
384
+ { label: "Step 3", description: "Generate CDF definitions with Claude" },
385
+ { label: "Step 4", description: "Review generated definitions" },
386
+ { label: "Step 5", description: "Push to Contentful" }
387
+ ];
388
+ }
389
+ });
390
+
391
+ // packages/experience-design-system-cli/src/tui/import/steps/index.ts
392
+ var init_steps = __esm({
393
+ "packages/experience-design-system-cli/src/tui/import/steps/index.ts"() {
394
+ "use strict";
395
+ init_screen();
396
+ }
397
+ });
398
+
300
399
  // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
301
400
  import { spawn as spawn2 } from "node:child_process";
302
401
  function buildArgs(options) {
@@ -537,8 +636,8 @@ var init_debug_store = __esm({
537
636
 
538
637
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
539
638
  import { useEffect as useEffect3 } from "react";
540
- import { Box as Box3, Text as Text3, useInput as useInput3 } from "ink";
541
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
639
+ import { Box as Box4, Text as Text4, useInput as useInput4 } from "ink";
640
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
542
641
  function HelpScreen({ onDone }) {
543
642
  useEffect3(() => {
544
643
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
@@ -547,7 +646,7 @@ function HelpScreen({ onDone }) {
547
646
  void finishDebugRun({ outputs: {}, status: "success", exitMethod });
548
647
  onDone();
549
648
  };
550
- useInput3((input, key) => {
649
+ useInput4((input, key) => {
551
650
  if (key.return) {
552
651
  leave("saved");
553
652
  return;
@@ -557,12 +656,12 @@ function HelpScreen({ onDone }) {
557
656
  return;
558
657
  }
559
658
  });
560
- return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
561
- /* @__PURE__ */ jsx3(Text3, { bold: true, children: "Help" }),
562
- /* @__PURE__ */ jsx3(Text3, { children: " " }),
563
- /* @__PURE__ */ jsx3(Text3, { children: "This is a placeholder screen for v2 help content." }),
564
- /* @__PURE__ */ jsx3(Text3, { children: " " }),
565
- /* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
659
+ return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
660
+ /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Help" }),
661
+ /* @__PURE__ */ jsx4(Text4, { children: " " }),
662
+ /* @__PURE__ */ jsx4(Text4, { children: "This is a placeholder screen for v2 help content." }),
663
+ /* @__PURE__ */ jsx4(Text4, { children: " " }),
664
+ /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
566
665
  ] });
567
666
  }
568
667
  var init_PageContainer2 = __esm({
@@ -573,20 +672,20 @@ var init_PageContainer2 = __esm({
573
672
  });
574
673
 
575
674
  // packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
576
- import { useState as useState3 } from "react";
577
- import { Box as Box4, Text as Text4, useInput as useInput4 } from "ink";
578
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
675
+ import { useState as useState4 } from "react";
676
+ import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
677
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
579
678
  function SettingsScreen({
580
679
  onNavigate,
581
680
  onBack
582
681
  }) {
583
- const [focusIdx, setFocusIdx] = useState3(0);
682
+ const [focusIdx, setFocusIdx] = useState4(0);
584
683
  const items = [
585
684
  { label: "Configuration", screen: "settings-configuration" },
586
685
  { label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
587
686
  { label: "Debug Mode", screen: "settings-debug-mode" }
588
687
  ];
589
- useInput4((input, key) => {
688
+ useInput5((input, key) => {
590
689
  if (key.upArrow) {
591
690
  setFocusIdx((i) => (i - 1 + items.length) % items.length);
592
691
  return;
@@ -606,15 +705,15 @@ function SettingsScreen({
606
705
  onBack();
607
706
  }
608
707
  });
609
- return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
610
- /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Settings" }),
611
- /* @__PURE__ */ jsx4(Text4, { children: " " }),
612
- items.map((item, i) => /* @__PURE__ */ jsxs4(Text4, { color: i === focusIdx ? "cyan" : void 0, children: [
708
+ return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
709
+ /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Settings" }),
710
+ /* @__PURE__ */ jsx5(Text5, { children: " " }),
711
+ items.map((item, i) => /* @__PURE__ */ jsxs5(Text5, { color: i === focusIdx ? "cyan" : void 0, children: [
613
712
  i === focusIdx ? "> " : " ",
614
713
  item.label
615
714
  ] }, item.label)),
616
- /* @__PURE__ */ jsx4(Text4, { children: " " }),
617
- /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "[\u2191/\u2193] Navigate [Enter] Select [Esc/q] Back to Start" })
715
+ /* @__PURE__ */ jsx5(Text5, { children: " " }),
716
+ /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[\u2191/\u2193] Navigate [Enter] Select [Esc/q] Back to Start" })
618
717
  ] });
619
718
  }
620
719
  var init_PageContainer3 = __esm({
@@ -677,9 +776,9 @@ var init_config_store = __esm({
677
776
  });
678
777
 
679
778
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
680
- import { useEffect as useEffect4, useState as useState4 } from "react";
681
- import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
682
- import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
779
+ import { useEffect as useEffect4, useState as useState5 } from "react";
780
+ import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
781
+ import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
683
782
  function debugFields(config) {
684
783
  return {
685
784
  space_id: config?.spaceId ?? "",
@@ -689,10 +788,10 @@ function debugFields(config) {
689
788
  };
690
789
  }
691
790
  function ConfigurationScreen({ onDone }) {
692
- const [stage, setStage] = useState4("loading");
693
- const [config, setConfig] = useState4(null);
694
- const [activeField, setActiveField] = useState4("spaceId");
695
- const [message, setMessage] = useState4(null);
791
+ const [stage, setStage] = useState5("loading");
792
+ const [config, setConfig] = useState5(null);
793
+ const [activeField, setActiveField] = useState5("spaceId");
794
+ const [message, setMessage] = useState5(null);
696
795
  useEffect4(() => {
697
796
  readCredentials().then((cfg) => {
698
797
  setConfig(cfg);
@@ -725,7 +824,7 @@ function ConfigurationScreen({ onDone }) {
725
824
  setStage("form");
726
825
  });
727
826
  }
728
- useInput5((input, key) => {
827
+ useInput6((input, key) => {
729
828
  if (stage === "loading" || stage === "saving") return;
730
829
  if (stage === "saved") {
731
830
  if (key.return || key.escape || input === "q") {
@@ -768,51 +867,51 @@ function ConfigurationScreen({ onDone }) {
768
867
  }
769
868
  });
770
869
  if (stage === "loading") {
771
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
772
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
773
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
774
- /* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "Loading..." })
870
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
871
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
872
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
873
+ /* @__PURE__ */ jsx6(Text6, { color: PALETTE.accent, children: "Loading..." })
775
874
  ] });
776
875
  }
777
876
  if (stage === "saved") {
778
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
779
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
780
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
781
- /* @__PURE__ */ jsxs5(Text5, { color: PALETTE.success, children: [
877
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
878
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
879
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
880
+ /* @__PURE__ */ jsxs6(Text6, { color: PALETTE.success, children: [
782
881
  "\u2713 ",
783
882
  message
784
883
  ] }),
785
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
786
- /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[Enter] Back to Settings" })
884
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
885
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[Enter] Back to Settings" })
787
886
  ] });
788
887
  }
789
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
790
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
791
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
792
- /* @__PURE__ */ jsx5(Text5, { children: "Contentful API Credentials" }),
793
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
794
- /* @__PURE__ */ jsx5(Box5, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
888
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
889
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
890
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
891
+ /* @__PURE__ */ jsx6(Text6, { children: "Contentful API Credentials" }),
892
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
893
+ /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
795
894
  const isActive = activeField === field;
796
895
  const value = fieldValue(field);
797
896
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
798
- return /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
799
- /* @__PURE__ */ jsx5(Text5, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
800
- /* @__PURE__ */ jsxs5(Text5, { bold: isActive, children: [
897
+ return /* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
898
+ /* @__PURE__ */ jsx6(Text6, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
899
+ /* @__PURE__ */ jsxs6(Text6, { bold: isActive, children: [
801
900
  FIELD_LABELS[field],
802
901
  ":"
803
902
  ] }),
804
- /* @__PURE__ */ jsx5(Text5, { children: display || /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "(empty)" }) })
903
+ /* @__PURE__ */ jsx6(Text6, { children: display || /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "(empty)" }) })
805
904
  ] }, field);
806
905
  }) }),
807
- message && /* @__PURE__ */ jsxs5(Fragment, { children: [
808
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
809
- /* @__PURE__ */ jsxs5(Text5, { color: PALETTE.error, children: [
906
+ message && /* @__PURE__ */ jsxs6(Fragment, { children: [
907
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
908
+ /* @__PURE__ */ jsxs6(Text6, { color: PALETTE.error, children: [
810
909
  "\u2717 ",
811
910
  message
812
911
  ] })
813
912
  ] }),
814
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
815
- /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
913
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
914
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
816
915
  ] });
817
916
  }
818
917
  var FIELD_ORDER, FIELD_LABELS;
@@ -854,12 +953,12 @@ var init_analytics_store = __esm({
854
953
  });
855
954
 
856
955
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
857
- import { useEffect as useEffect5, useState as useState5 } from "react";
858
- import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
859
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
956
+ import { useEffect as useEffect5, useState as useState6 } from "react";
957
+ import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
958
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
860
959
  function OptInAnalyticsScreen({ onDone }) {
861
- const [loading, setLoading] = useState5(true);
862
- const [enabled, setEnabled] = useState5(true);
960
+ const [loading, setLoading] = useState6(true);
961
+ const [enabled, setEnabled] = useState6(true);
863
962
  useEffect5(() => {
864
963
  readAnalyticsSetting().then((setting) => {
865
964
  setEnabled(setting.enabled);
@@ -872,7 +971,7 @@ function OptInAnalyticsScreen({ onDone }) {
872
971
  });
873
972
  });
874
973
  }, []);
875
- useInput6((input, key) => {
974
+ useInput7((input, key) => {
876
975
  if (loading) return;
877
976
  if (key.return || input === " ") {
878
977
  setEnabled((current) => {
@@ -887,24 +986,24 @@ function OptInAnalyticsScreen({ onDone }) {
887
986
  onDone();
888
987
  }
889
988
  });
890
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
891
- /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
892
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
893
- loading ? /* @__PURE__ */ jsx6(Text6, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
894
- /* @__PURE__ */ jsxs6(Text6, { children: [
989
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
990
+ /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
991
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
992
+ loading ? /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
993
+ /* @__PURE__ */ jsxs7(Text7, { children: [
895
994
  "Share anonymous usage data:",
896
995
  " ",
897
- /* @__PURE__ */ jsx6(Text6, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
996
+ /* @__PURE__ */ jsx7(Text7, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
898
997
  ] }),
899
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
900
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
901
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
998
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
999
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
1000
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
902
1001
  ] }),
903
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
904
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
1002
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
1003
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
905
1004
  ] });
906
1005
  }
907
- var init_screen = __esm({
1006
+ var init_screen2 = __esm({
908
1007
  "packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
909
1008
  "use strict";
910
1009
  init_home_theme();
@@ -914,11 +1013,11 @@ var init_screen = __esm({
914
1013
  });
915
1014
 
916
1015
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
917
- import { useEffect as useEffect6, useState as useState6 } from "react";
918
- import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
919
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
1016
+ import { useEffect as useEffect6, useState as useState7 } from "react";
1017
+ import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
1018
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
920
1019
  function UpgradeScreen({ onDone }) {
921
- const [upgradeCheck, setUpgradeCheck] = useState6();
1020
+ const [upgradeCheck, setUpgradeCheck] = useState7();
922
1021
  useEffect6(() => {
923
1022
  startDebugRun({
924
1023
  flow: "upgrade",
@@ -928,7 +1027,7 @@ function UpgradeScreen({ onDone }) {
928
1027
  });
929
1028
  checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
930
1029
  }, []);
931
- useInput7((_input, key) => {
1030
+ useInput8((_input, key) => {
932
1031
  if (key.return) {
933
1032
  void finishDebugRun({
934
1033
  outputs: upgradeCheck ?? {},
@@ -939,12 +1038,12 @@ function UpgradeScreen({ onDone }) {
939
1038
  return;
940
1039
  }
941
1040
  });
942
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
943
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Upgrade" }),
944
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
1041
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1042
+ /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Upgrade" }),
1043
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
945
1044
  renderBody(upgradeCheck),
946
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
947
- /* @__PURE__ */ jsxs7(Text7, { bold: true, color: PALETTE.accent, children: [
1045
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
1046
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.accent, children: [
948
1047
  FOCUS_MARKER,
949
1048
  " Go Back"
950
1049
  ] })
@@ -952,34 +1051,34 @@ function UpgradeScreen({ onDone }) {
952
1051
  }
953
1052
  function renderBody(upgradeCheck) {
954
1053
  if (!upgradeCheck) {
955
- return /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Checking for updates\u2026" });
1054
+ return /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Checking for updates\u2026" });
956
1055
  }
957
1056
  if (upgradeCheck.status === "error") {
958
- return /* @__PURE__ */ jsx7(Text7, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
1057
+ return /* @__PURE__ */ jsx8(Text8, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
959
1058
  }
960
1059
  if (upgradeCheck.status === "up-to-date") {
961
- return /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
1060
+ return /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.success, children: [
962
1061
  "You're already on the latest version (v",
963
1062
  upgradeCheck.current,
964
1063
  ")."
965
1064
  ] });
966
1065
  }
967
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
968
- /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.muted, children: [
969
- /* @__PURE__ */ jsxs7(Text7, { bold: true, color: PALETTE.success, children: [
1066
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
1067
+ /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.muted, children: [
1068
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.success, children: [
970
1069
  "v",
971
1070
  upgradeCheck.latest
972
1071
  ] }),
973
1072
  " ",
974
1073
  "is available (you're on ",
975
- /* @__PURE__ */ jsxs7(Text7, { bold: true, children: [
1074
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
976
1075
  "v",
977
1076
  upgradeCheck.current
978
1077
  ] }),
979
1078
  "). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
980
1079
  ] }),
981
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
982
- /* @__PURE__ */ jsx7(Box7, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx7(Text7, { bold: true, children: cmd }, cmd)) })
1080
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
1081
+ /* @__PURE__ */ jsx8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx8(Text8, { bold: true, children: cmd }, cmd)) })
983
1082
  ] });
984
1083
  }
985
1084
  var UPGRADE_COMMANDS;
@@ -994,12 +1093,12 @@ var init_PageContainer4 = __esm({
994
1093
  });
995
1094
 
996
1095
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
997
- import { useEffect as useEffect7, useState as useState7 } from "react";
998
- import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
999
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1096
+ import { useEffect as useEffect7, useState as useState8 } from "react";
1097
+ import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
1098
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1000
1099
  function DebugModeScreen({ onDone }) {
1001
- const [loading, setLoading] = useState7(true);
1002
- const [enabled, setEnabled] = useState7(true);
1100
+ const [loading, setLoading] = useState8(true);
1101
+ const [enabled, setEnabled] = useState8(true);
1003
1102
  useEffect7(() => {
1004
1103
  readDebugModeSetting().then((setting) => {
1005
1104
  setEnabled(setting.enabled);
@@ -1012,7 +1111,7 @@ function DebugModeScreen({ onDone }) {
1012
1111
  });
1013
1112
  });
1014
1113
  }, []);
1015
- useInput8((input, key) => {
1114
+ useInput9((input, key) => {
1016
1115
  if (loading) return;
1017
1116
  if (key.return || input === " ") {
1018
1117
  setEnabled((current) => {
@@ -1027,19 +1126,19 @@ function DebugModeScreen({ onDone }) {
1027
1126
  onDone();
1028
1127
  }
1029
1128
  });
1030
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1031
- /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Debug Mode" }),
1032
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
1033
- loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Text8, { children: [
1129
+ return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1130
+ /* @__PURE__ */ jsx9(Text9, { bold: true, children: "Settings \u203A Debug Mode" }),
1131
+ /* @__PURE__ */ jsx9(Text9, { children: " " }),
1132
+ loading ? /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs9(Text9, { children: [
1034
1133
  "Debug logging:",
1035
1134
  " ",
1036
- /* @__PURE__ */ jsx8(Text8, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
1135
+ /* @__PURE__ */ jsx9(Text9, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
1037
1136
  ] }),
1038
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
1039
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
1137
+ /* @__PURE__ */ jsx9(Text9, { children: " " }),
1138
+ /* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
1040
1139
  ] });
1041
1140
  }
1042
- var init_screen2 = __esm({
1141
+ var init_screen3 = __esm({
1043
1142
  "packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
1044
1143
  "use strict";
1045
1144
  init_home_theme();
@@ -1053,48 +1152,46 @@ var app_exports = {};
1053
1152
  __export(app_exports, {
1054
1153
  runApp: () => runApp
1055
1154
  });
1056
- import { useState as useState8 } from "react";
1057
- import { jsx as jsx9 } from "react/jsx-runtime";
1155
+ import { useState as useState9 } from "react";
1156
+ import { jsx as jsx10 } from "react/jsx-runtime";
1058
1157
  function App({ onLaunchImport, importExitCode }) {
1059
1158
  const returnedFromImport = importExitCode !== void 0;
1060
- const [screen, setScreen] = useState8(returnedFromImport ? "import" : "start");
1159
+ const [screen, setScreen] = useState9(returnedFromImport ? "import" : "start");
1160
+ const [showImportResult, setShowImportResult] = useState9(returnedFromImport);
1061
1161
  const goToStart = () => setScreen("start");
1062
1162
  const goToSettings = () => setScreen("settings");
1063
- const navigateFromHome = (next) => {
1064
- if (next === "import" && onLaunchImport) {
1065
- onLaunchImport();
1066
- return;
1067
- }
1068
- setScreen(next);
1163
+ const finishImportResult = () => {
1164
+ setShowImportResult(false);
1165
+ goToStart();
1069
1166
  };
1070
1167
  switch (screen) {
1071
1168
  case "import":
1072
- return /* @__PURE__ */ jsx9(ImportScreen, { exitCode: importExitCode, onDone: goToStart });
1169
+ return showImportResult ? /* @__PURE__ */ jsx10(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult }) : /* @__PURE__ */ jsx10(WelcomeScreen, { onContinue: (projectPath) => onLaunchImport?.(projectPath), onQuit: goToStart });
1073
1170
  case "help":
1074
- return /* @__PURE__ */ jsx9(HelpScreen, { onDone: goToStart });
1171
+ return /* @__PURE__ */ jsx10(HelpScreen, { onDone: goToStart });
1075
1172
  case "upgrade":
1076
- return /* @__PURE__ */ jsx9(UpgradeScreen, { onDone: goToStart });
1173
+ return /* @__PURE__ */ jsx10(UpgradeScreen, { onDone: goToStart });
1077
1174
  case "settings":
1078
- return /* @__PURE__ */ jsx9(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1175
+ return /* @__PURE__ */ jsx10(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1079
1176
  case "settings-configuration":
1080
- return /* @__PURE__ */ jsx9(ConfigurationScreen, { onDone: goToSettings });
1177
+ return /* @__PURE__ */ jsx10(ConfigurationScreen, { onDone: goToSettings });
1081
1178
  case "settings-opt-in-analytics":
1082
- return /* @__PURE__ */ jsx9(OptInAnalyticsScreen, { onDone: goToSettings });
1179
+ return /* @__PURE__ */ jsx10(OptInAnalyticsScreen, { onDone: goToSettings });
1083
1180
  case "settings-debug-mode":
1084
- return /* @__PURE__ */ jsx9(DebugModeScreen, { onDone: goToSettings });
1181
+ return /* @__PURE__ */ jsx10(DebugModeScreen, { onDone: goToSettings });
1085
1182
  case "start":
1086
- return /* @__PURE__ */ jsx9(HomeScreen, { onNavigate: navigateFromHome });
1183
+ return /* @__PURE__ */ jsx10(HomeScreen, { onNavigate: setScreen });
1087
1184
  }
1088
1185
  }
1089
1186
  async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1090
- let importRequested = false;
1187
+ let requestedProjectPath;
1091
1188
  const instance = renderApp(
1092
- /* @__PURE__ */ jsx9(
1189
+ /* @__PURE__ */ jsx10(
1093
1190
  App,
1094
1191
  {
1095
1192
  importExitCode,
1096
- onLaunchImport: () => {
1097
- importRequested = true;
1193
+ onLaunchImport: (projectPath) => {
1194
+ requestedProjectPath = projectPath;
1098
1195
  instance.unmount();
1099
1196
  }
1100
1197
  }
@@ -1102,13 +1199,15 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1102
1199
  );
1103
1200
  await instance.waitUntilExit();
1104
1201
  await stopReadingTerminal();
1105
- return importRequested;
1202
+ return requestedProjectPath;
1106
1203
  }
1107
1204
  async function runApp(renderApp) {
1108
1205
  let importExitCode;
1109
- while (await renderUntilImportRequestedOrExit(renderApp, importExitCode)) {
1110
- importExitCode = (await spawnV1Import({})).exitCode;
1206
+ let projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1207
+ while (projectPath !== void 0) {
1208
+ importExitCode = (await spawnV1Import({ project: projectPath })).exitCode;
1111
1209
  startReadingTerminal();
1210
+ projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1112
1211
  }
1113
1212
  }
1114
1213
  var init_app = __esm({
@@ -1116,14 +1215,15 @@ var init_app = __esm({
1116
1215
  "use strict";
1117
1216
  init_home();
1118
1217
  init_PageContainer();
1218
+ init_steps();
1119
1219
  init_spawn_v1_import();
1120
1220
  init_terminal_input();
1121
1221
  init_PageContainer2();
1122
1222
  init_PageContainer3();
1123
1223
  init_ContentfulConfigScreen();
1124
- init_screen();
1125
- init_PageContainer4();
1126
1224
  init_screen2();
1225
+ init_PageContainer4();
1226
+ init_screen3();
1127
1227
  }
1128
1228
  });
1129
1229
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.35.1-dev-build-7780c1f7.0",
3
+ "version": "2.35.1-dev-build-a963233a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,6 +44,7 @@
44
44
  "contentful-management": "^12.17.0",
45
45
  "figures": "6.1.0",
46
46
  "ink": "^5.2.1",
47
+ "ink-text-input": "^6.0.0",
47
48
  "react": "^18.3.1",
48
49
  "react-devtools-core": "^4.19.1",
49
50
  "semver": "^7.7.2",
@@ -0,0 +1,8 @@
1
+ export declare const WELCOME_CONTROLS: readonly [{
2
+ readonly keys: "Enter";
3
+ readonly label: "Continue";
4
+ }, {
5
+ readonly keys: "Esc/q";
6
+ readonly label: "Back to menu";
7
+ }];
8
+ export declare function useWelcomeControls(projectPath: string, onQuit: () => void): void;