@contentful/experience-design-system-cli 2.35.1-dev-build-3ab9e99e.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,159 @@ 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
+
399
+ // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
400
+ import { spawn as spawn2 } from "node:child_process";
401
+ function buildArgs(options) {
402
+ const args = ["import"];
403
+ if (options.project) {
404
+ args.push("--project", options.project);
405
+ }
406
+ return args;
407
+ }
408
+ async function spawnV1Import(options = {}) {
409
+ const cliPath = findLegacyCliPath();
410
+ const args = buildArgs(options);
411
+ return new Promise((resolvePromise) => {
412
+ const child = spawn2("node", [cliPath, ...args], {
413
+ stdio: "inherit"
414
+ });
415
+ child.on("close", (code) => {
416
+ resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
417
+ });
418
+ child.on("error", (err) => {
419
+ resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
420
+ });
421
+ });
422
+ }
423
+ var init_spawn_v1_import = __esm({
424
+ "packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts"() {
425
+ "use strict";
426
+ init_legacy_cli_path();
427
+ }
428
+ });
429
+
430
+ // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
431
+ function getTerminalHandle() {
432
+ return process.stdin._handle;
433
+ }
434
+ async function stopReadingTerminal() {
435
+ await new Promise((resolve) => setImmediate(resolve));
436
+ const handle = getTerminalHandle();
437
+ if (!handle?.readStop) return;
438
+ handle.reading = false;
439
+ handle.readStop();
440
+ }
441
+ function startReadingTerminal() {
442
+ const handle = getTerminalHandle();
443
+ if (!handle?.readStart) return;
444
+ handle.reading = true;
445
+ handle.readStart();
446
+ }
447
+ var init_terminal_input = __esm({
448
+ "packages/experience-design-system-cli/src/tui/import/terminal-input.ts"() {
449
+ "use strict";
450
+ }
451
+ });
452
+
300
453
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/debug-mode-store.ts
301
454
  import { mkdir, readFile, writeFile } from "node:fs/promises";
302
455
  import { dirname as dirname2, join as join4 } from "node:path";
@@ -363,9 +516,6 @@ function generateSessionId() {
363
516
  function sessionDebugDir() {
364
517
  return join5(sessionsRootDir(), SESSION_ID);
365
518
  }
366
- async function debugSessionDirIfEnabled() {
367
- return await isDebugModeEnabled() ? sessionDebugDir() : void 0;
368
- }
369
519
  async function isDebugModeEnabled() {
370
520
  try {
371
521
  return (await readDebugModeSetting()).enabled;
@@ -484,67 +634,10 @@ var init_debug_store = __esm({
484
634
  }
485
635
  });
486
636
 
487
- // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
488
- import { spawn as spawn2 } from "node:child_process";
489
- function buildArgs(options) {
490
- const args = ["import"];
491
- if (options.project) {
492
- args.push("--project", options.project);
493
- }
494
- return args;
495
- }
496
- async function spawnV1Import(options = {}) {
497
- const cliPath = findLegacyCliPath();
498
- const args = buildArgs(options);
499
- const debugSessionDir = await debugSessionDirIfEnabled();
500
- return new Promise((resolvePromise) => {
501
- const child = spawn2("node", [cliPath, ...args], {
502
- stdio: "inherit",
503
- env: debugSessionDir ? { ...process.env, EDS_DEBUG_SESSION_DIR: debugSessionDir } : process.env
504
- });
505
- child.on("close", (code) => {
506
- resolvePromise({ exitCode: code ?? 1, result: void 0, stdout: "", stderr: "" });
507
- });
508
- child.on("error", (err) => {
509
- resolvePromise({ exitCode: 1, result: void 0, stdout: "", stderr: err.message });
510
- });
511
- });
512
- }
513
- var init_spawn_v1_import = __esm({
514
- "packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts"() {
515
- "use strict";
516
- init_legacy_cli_path();
517
- init_debug_store();
518
- }
519
- });
520
-
521
- // packages/experience-design-system-cli/src/tui/import/terminal-input.ts
522
- function getTerminalHandle() {
523
- return process.stdin._handle;
524
- }
525
- async function stopReadingTerminal() {
526
- await new Promise((resolve) => setImmediate(resolve));
527
- const handle = getTerminalHandle();
528
- if (!handle?.readStop) return;
529
- handle.reading = false;
530
- handle.readStop();
531
- }
532
- function startReadingTerminal() {
533
- const handle = getTerminalHandle();
534
- if (!handle?.readStart) return;
535
- handle.reading = true;
536
- handle.readStart();
537
- }
538
- var init_terminal_input = __esm({
539
- "packages/experience-design-system-cli/src/tui/import/terminal-input.ts"() {
540
- "use strict";
541
- }
542
- });
543
-
544
637
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
545
638
  import { useEffect as useEffect3 } from "react";
546
- import { Box as Box3, Text as Text3, useInput as useInput3 } from "ink";
547
- 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";
548
641
  function HelpScreen({ onDone }) {
549
642
  useEffect3(() => {
550
643
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
@@ -553,7 +646,7 @@ function HelpScreen({ onDone }) {
553
646
  void finishDebugRun({ outputs: {}, status: "success", exitMethod });
554
647
  onDone();
555
648
  };
556
- useInput3((input, key) => {
649
+ useInput4((input, key) => {
557
650
  if (key.return) {
558
651
  leave("saved");
559
652
  return;
@@ -563,12 +656,12 @@ function HelpScreen({ onDone }) {
563
656
  return;
564
657
  }
565
658
  });
566
- return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
567
- /* @__PURE__ */ jsx3(Text3, { bold: true, children: "Help" }),
568
- /* @__PURE__ */ jsx3(Text3, { children: " " }),
569
- /* @__PURE__ */ jsx3(Text3, { children: "This is a placeholder screen for v2 help content." }),
570
- /* @__PURE__ */ jsx3(Text3, { children: " " }),
571
- /* @__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" })
572
665
  ] });
573
666
  }
574
667
  var init_PageContainer2 = __esm({
@@ -579,20 +672,20 @@ var init_PageContainer2 = __esm({
579
672
  });
580
673
 
581
674
  // packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
582
- import { useState as useState3 } from "react";
583
- import { Box as Box4, Text as Text4, useInput as useInput4 } from "ink";
584
- 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";
585
678
  function SettingsScreen({
586
679
  onNavigate,
587
680
  onBack
588
681
  }) {
589
- const [focusIdx, setFocusIdx] = useState3(0);
682
+ const [focusIdx, setFocusIdx] = useState4(0);
590
683
  const items = [
591
684
  { label: "Configuration", screen: "settings-configuration" },
592
685
  { label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
593
686
  { label: "Debug Mode", screen: "settings-debug-mode" }
594
687
  ];
595
- useInput4((input, key) => {
688
+ useInput5((input, key) => {
596
689
  if (key.upArrow) {
597
690
  setFocusIdx((i) => (i - 1 + items.length) % items.length);
598
691
  return;
@@ -612,15 +705,15 @@ function SettingsScreen({
612
705
  onBack();
613
706
  }
614
707
  });
615
- return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
616
- /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Settings" }),
617
- /* @__PURE__ */ jsx4(Text4, { children: " " }),
618
- 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: [
619
712
  i === focusIdx ? "> " : " ",
620
713
  item.label
621
714
  ] }, item.label)),
622
- /* @__PURE__ */ jsx4(Text4, { children: " " }),
623
- /* @__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" })
624
717
  ] });
625
718
  }
626
719
  var init_PageContainer3 = __esm({
@@ -683,9 +776,9 @@ var init_config_store = __esm({
683
776
  });
684
777
 
685
778
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
686
- import { useEffect as useEffect4, useState as useState4 } from "react";
687
- import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
688
- 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";
689
782
  function debugFields(config) {
690
783
  return {
691
784
  space_id: config?.spaceId ?? "",
@@ -695,10 +788,10 @@ function debugFields(config) {
695
788
  };
696
789
  }
697
790
  function ConfigurationScreen({ onDone }) {
698
- const [stage, setStage] = useState4("loading");
699
- const [config, setConfig] = useState4(null);
700
- const [activeField, setActiveField] = useState4("spaceId");
701
- 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);
702
795
  useEffect4(() => {
703
796
  readCredentials().then((cfg) => {
704
797
  setConfig(cfg);
@@ -731,7 +824,7 @@ function ConfigurationScreen({ onDone }) {
731
824
  setStage("form");
732
825
  });
733
826
  }
734
- useInput5((input, key) => {
827
+ useInput6((input, key) => {
735
828
  if (stage === "loading" || stage === "saving") return;
736
829
  if (stage === "saved") {
737
830
  if (key.return || key.escape || input === "q") {
@@ -774,51 +867,51 @@ function ConfigurationScreen({ onDone }) {
774
867
  }
775
868
  });
776
869
  if (stage === "loading") {
777
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
778
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
779
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
780
- /* @__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..." })
781
874
  ] });
782
875
  }
783
876
  if (stage === "saved") {
784
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
785
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
786
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
787
- /* @__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: [
788
881
  "\u2713 ",
789
882
  message
790
883
  ] }),
791
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
792
- /* @__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" })
793
886
  ] });
794
887
  }
795
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
796
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Configuration" }),
797
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
798
- /* @__PURE__ */ jsx5(Text5, { children: "Contentful API Credentials" }),
799
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
800
- /* @__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) => {
801
894
  const isActive = activeField === field;
802
895
  const value = fieldValue(field);
803
896
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
804
- return /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
805
- /* @__PURE__ */ jsx5(Text5, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
806
- /* @__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: [
807
900
  FIELD_LABELS[field],
808
901
  ":"
809
902
  ] }),
810
- /* @__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)" }) })
811
904
  ] }, field);
812
905
  }) }),
813
- message && /* @__PURE__ */ jsxs5(Fragment, { children: [
814
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
815
- /* @__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: [
816
909
  "\u2717 ",
817
910
  message
818
911
  ] })
819
912
  ] }),
820
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
821
- /* @__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" })
822
915
  ] });
823
916
  }
824
917
  var FIELD_ORDER, FIELD_LABELS;
@@ -860,12 +953,12 @@ var init_analytics_store = __esm({
860
953
  });
861
954
 
862
955
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
863
- import { useEffect as useEffect5, useState as useState5 } from "react";
864
- import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
865
- 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";
866
959
  function OptInAnalyticsScreen({ onDone }) {
867
- const [loading, setLoading] = useState5(true);
868
- const [enabled, setEnabled] = useState5(true);
960
+ const [loading, setLoading] = useState6(true);
961
+ const [enabled, setEnabled] = useState6(true);
869
962
  useEffect5(() => {
870
963
  readAnalyticsSetting().then((setting) => {
871
964
  setEnabled(setting.enabled);
@@ -878,7 +971,7 @@ function OptInAnalyticsScreen({ onDone }) {
878
971
  });
879
972
  });
880
973
  }, []);
881
- useInput6((input, key) => {
974
+ useInput7((input, key) => {
882
975
  if (loading) return;
883
976
  if (key.return || input === " ") {
884
977
  setEnabled((current) => {
@@ -893,24 +986,24 @@ function OptInAnalyticsScreen({ onDone }) {
893
986
  onDone();
894
987
  }
895
988
  });
896
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
897
- /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
898
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
899
- loading ? /* @__PURE__ */ jsx6(Text6, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
900
- /* @__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: [
901
994
  "Share anonymous usage data:",
902
995
  " ",
903
- /* @__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" })
904
997
  ] }),
905
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
906
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
907
- /* @__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." })
908
1001
  ] }),
909
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
910
- /* @__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" })
911
1004
  ] });
912
1005
  }
913
- var init_screen = __esm({
1006
+ var init_screen2 = __esm({
914
1007
  "packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
915
1008
  "use strict";
916
1009
  init_home_theme();
@@ -920,11 +1013,11 @@ var init_screen = __esm({
920
1013
  });
921
1014
 
922
1015
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
923
- import { useEffect as useEffect6, useState as useState6 } from "react";
924
- import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
925
- 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";
926
1019
  function UpgradeScreen({ onDone }) {
927
- const [upgradeCheck, setUpgradeCheck] = useState6();
1020
+ const [upgradeCheck, setUpgradeCheck] = useState7();
928
1021
  useEffect6(() => {
929
1022
  startDebugRun({
930
1023
  flow: "upgrade",
@@ -934,7 +1027,7 @@ function UpgradeScreen({ onDone }) {
934
1027
  });
935
1028
  checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
936
1029
  }, []);
937
- useInput7((_input, key) => {
1030
+ useInput8((_input, key) => {
938
1031
  if (key.return) {
939
1032
  void finishDebugRun({
940
1033
  outputs: upgradeCheck ?? {},
@@ -945,12 +1038,12 @@ function UpgradeScreen({ onDone }) {
945
1038
  return;
946
1039
  }
947
1040
  });
948
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
949
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Upgrade" }),
950
- /* @__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: " " }),
951
1044
  renderBody(upgradeCheck),
952
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
953
- /* @__PURE__ */ jsxs7(Text7, { bold: true, color: PALETTE.accent, children: [
1045
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
1046
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.accent, children: [
954
1047
  FOCUS_MARKER,
955
1048
  " Go Back"
956
1049
  ] })
@@ -958,34 +1051,34 @@ function UpgradeScreen({ onDone }) {
958
1051
  }
959
1052
  function renderBody(upgradeCheck) {
960
1053
  if (!upgradeCheck) {
961
- 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" });
962
1055
  }
963
1056
  if (upgradeCheck.status === "error") {
964
- 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." });
965
1058
  }
966
1059
  if (upgradeCheck.status === "up-to-date") {
967
- return /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
1060
+ return /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.success, children: [
968
1061
  "You're already on the latest version (v",
969
1062
  upgradeCheck.current,
970
1063
  ")."
971
1064
  ] });
972
1065
  }
973
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
974
- /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.muted, children: [
975
- /* @__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: [
976
1069
  "v",
977
1070
  upgradeCheck.latest
978
1071
  ] }),
979
1072
  " ",
980
1073
  "is available (you're on ",
981
- /* @__PURE__ */ jsxs7(Text7, { bold: true, children: [
1074
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
982
1075
  "v",
983
1076
  upgradeCheck.current
984
1077
  ] }),
985
1078
  "). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
986
1079
  ] }),
987
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
988
- /* @__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)) })
989
1082
  ] });
990
1083
  }
991
1084
  var UPGRADE_COMMANDS;
@@ -1000,12 +1093,12 @@ var init_PageContainer4 = __esm({
1000
1093
  });
1001
1094
 
1002
1095
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
1003
- import { useEffect as useEffect7, useState as useState7 } from "react";
1004
- import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
1005
- 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";
1006
1099
  function DebugModeScreen({ onDone }) {
1007
- const [loading, setLoading] = useState7(true);
1008
- const [enabled, setEnabled] = useState7(true);
1100
+ const [loading, setLoading] = useState8(true);
1101
+ const [enabled, setEnabled] = useState8(true);
1009
1102
  useEffect7(() => {
1010
1103
  readDebugModeSetting().then((setting) => {
1011
1104
  setEnabled(setting.enabled);
@@ -1018,7 +1111,7 @@ function DebugModeScreen({ onDone }) {
1018
1111
  });
1019
1112
  });
1020
1113
  }, []);
1021
- useInput8((input, key) => {
1114
+ useInput9((input, key) => {
1022
1115
  if (loading) return;
1023
1116
  if (key.return || input === " ") {
1024
1117
  setEnabled((current) => {
@@ -1033,19 +1126,19 @@ function DebugModeScreen({ onDone }) {
1033
1126
  onDone();
1034
1127
  }
1035
1128
  });
1036
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1037
- /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Debug Mode" }),
1038
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
1039
- 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: [
1040
1133
  "Debug logging:",
1041
1134
  " ",
1042
- /* @__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" })
1043
1136
  ] }),
1044
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
1045
- /* @__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" })
1046
1139
  ] });
1047
1140
  }
1048
- var init_screen2 = __esm({
1141
+ var init_screen3 = __esm({
1049
1142
  "packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
1050
1143
  "use strict";
1051
1144
  init_home_theme();
@@ -1059,48 +1152,46 @@ var app_exports = {};
1059
1152
  __export(app_exports, {
1060
1153
  runApp: () => runApp
1061
1154
  });
1062
- import { useState as useState8 } from "react";
1063
- import { jsx as jsx9 } from "react/jsx-runtime";
1155
+ import { useState as useState9 } from "react";
1156
+ import { jsx as jsx10 } from "react/jsx-runtime";
1064
1157
  function App({ onLaunchImport, importExitCode }) {
1065
1158
  const returnedFromImport = importExitCode !== void 0;
1066
- const [screen, setScreen] = useState8(returnedFromImport ? "import" : "start");
1159
+ const [screen, setScreen] = useState9(returnedFromImport ? "import" : "start");
1160
+ const [showImportResult, setShowImportResult] = useState9(returnedFromImport);
1067
1161
  const goToStart = () => setScreen("start");
1068
1162
  const goToSettings = () => setScreen("settings");
1069
- const navigateFromHome = (next) => {
1070
- if (next === "import" && onLaunchImport) {
1071
- onLaunchImport();
1072
- return;
1073
- }
1074
- setScreen(next);
1163
+ const finishImportResult = () => {
1164
+ setShowImportResult(false);
1165
+ goToStart();
1075
1166
  };
1076
1167
  switch (screen) {
1077
1168
  case "import":
1078
- 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 });
1079
1170
  case "help":
1080
- return /* @__PURE__ */ jsx9(HelpScreen, { onDone: goToStart });
1171
+ return /* @__PURE__ */ jsx10(HelpScreen, { onDone: goToStart });
1081
1172
  case "upgrade":
1082
- return /* @__PURE__ */ jsx9(UpgradeScreen, { onDone: goToStart });
1173
+ return /* @__PURE__ */ jsx10(UpgradeScreen, { onDone: goToStart });
1083
1174
  case "settings":
1084
- return /* @__PURE__ */ jsx9(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1175
+ return /* @__PURE__ */ jsx10(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1085
1176
  case "settings-configuration":
1086
- return /* @__PURE__ */ jsx9(ConfigurationScreen, { onDone: goToSettings });
1177
+ return /* @__PURE__ */ jsx10(ConfigurationScreen, { onDone: goToSettings });
1087
1178
  case "settings-opt-in-analytics":
1088
- return /* @__PURE__ */ jsx9(OptInAnalyticsScreen, { onDone: goToSettings });
1179
+ return /* @__PURE__ */ jsx10(OptInAnalyticsScreen, { onDone: goToSettings });
1089
1180
  case "settings-debug-mode":
1090
- return /* @__PURE__ */ jsx9(DebugModeScreen, { onDone: goToSettings });
1181
+ return /* @__PURE__ */ jsx10(DebugModeScreen, { onDone: goToSettings });
1091
1182
  case "start":
1092
- return /* @__PURE__ */ jsx9(HomeScreen, { onNavigate: navigateFromHome });
1183
+ return /* @__PURE__ */ jsx10(HomeScreen, { onNavigate: setScreen });
1093
1184
  }
1094
1185
  }
1095
1186
  async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1096
- let importRequested = false;
1187
+ let requestedProjectPath;
1097
1188
  const instance = renderApp(
1098
- /* @__PURE__ */ jsx9(
1189
+ /* @__PURE__ */ jsx10(
1099
1190
  App,
1100
1191
  {
1101
1192
  importExitCode,
1102
- onLaunchImport: () => {
1103
- importRequested = true;
1193
+ onLaunchImport: (projectPath) => {
1194
+ requestedProjectPath = projectPath;
1104
1195
  instance.unmount();
1105
1196
  }
1106
1197
  }
@@ -1108,13 +1199,15 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1108
1199
  );
1109
1200
  await instance.waitUntilExit();
1110
1201
  await stopReadingTerminal();
1111
- return importRequested;
1202
+ return requestedProjectPath;
1112
1203
  }
1113
1204
  async function runApp(renderApp) {
1114
1205
  let importExitCode;
1115
- while (await renderUntilImportRequestedOrExit(renderApp, importExitCode)) {
1116
- importExitCode = (await spawnV1Import({})).exitCode;
1206
+ let projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1207
+ while (projectPath !== void 0) {
1208
+ importExitCode = (await spawnV1Import({ project: projectPath })).exitCode;
1117
1209
  startReadingTerminal();
1210
+ projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1118
1211
  }
1119
1212
  }
1120
1213
  var init_app = __esm({
@@ -1122,14 +1215,15 @@ var init_app = __esm({
1122
1215
  "use strict";
1123
1216
  init_home();
1124
1217
  init_PageContainer();
1218
+ init_steps();
1125
1219
  init_spawn_v1_import();
1126
1220
  init_terminal_input();
1127
1221
  init_PageContainer2();
1128
1222
  init_PageContainer3();
1129
1223
  init_ContentfulConfigScreen();
1130
- init_screen();
1131
- init_PageContainer4();
1132
1224
  init_screen2();
1225
+ init_PageContainer4();
1226
+ init_screen3();
1133
1227
  }
1134
1228
  });
1135
1229