@contentful/experience-design-system-cli 2.35.1-dev-build-215f38d1.0 → 2.35.1-dev-build-236b6909.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.
Files changed (55) hide show
  1. package/dist/app.js +127 -265
  2. package/dist/index.js +131 -292
  3. package/dist/package.json +1 -1
  4. package/dist/src/tui/import/spawn-v1-import.d.ts +0 -2
  5. package/dist/src/tui/import/steps/index.d.ts +0 -1
  6. package/legacy/dist/src/analyze/controller/run-analyze-extract.d.ts +12 -0
  7. package/legacy/dist/src/analyze/extract-command.d.ts +2 -5
  8. package/legacy/dist/src/analyze/helpers/resolve-composition-agent.d.ts +9 -0
  9. package/legacy/dist/src/analyze/helpers/resolve-no-cache.d.ts +4 -0
  10. package/legacy/dist/src/analyze/helpers/resolve-unreachable-mode.d.ts +1 -0
  11. package/legacy/dist/src/analyze/helpers/retry-db-write.d.ts +1 -0
  12. package/legacy/dist/src/analyze/orchestrator/execute-analyze-extract.d.ts +21 -0
  13. package/legacy/dist/src/analyze/services/collect-source-files.d.ts +1 -0
  14. package/legacy/dist/src/analyze/services/extract-with-cache.d.ts +17 -0
  15. package/legacy/dist/src/analyze/services/persist-extract-results.d.ts +11 -0
  16. package/legacy/dist/src/analyze/services/resolve-composition-mapping.d.ts +22 -0
  17. package/legacy/dist/src/analyze/services/resolve-source-directory.d.ts +1 -0
  18. package/legacy/dist/src/apply/command.d.ts +3 -41
  19. package/legacy/dist/src/apply/controller/run-apply.d.ts +1 -0
  20. package/legacy/dist/src/apply/helpers/build-apply-output.d.ts +55 -0
  21. package/legacy/dist/src/apply/helpers/has-breaking-changes.d.ts +2 -0
  22. package/legacy/dist/src/apply/helpers/poll-apply-operation.d.ts +9 -0
  23. package/legacy/dist/src/apply/helpers/read-token-files.d.ts +7 -0
  24. package/legacy/dist/src/apply/helpers/slot-validation.d.ts +20 -0
  25. package/legacy/dist/src/apply/services/apply-interactive.d.ts +13 -0
  26. package/legacy/dist/src/apply/services/apply-non-interactive.d.ts +10 -0
  27. package/legacy/dist/src/apply/services/resolve-apply-inputs.d.ts +14 -0
  28. package/legacy/dist/src/generate/command.d.ts +18 -0
  29. package/legacy/dist/src/generate/controller/run-generate-components.d.ts +2 -0
  30. package/legacy/dist/src/generate/controller/run-generate-tokens.d.ts +2 -0
  31. package/legacy/dist/src/generate/helpers/assert-file-exists.d.ts +1 -0
  32. package/legacy/dist/src/generate/helpers/normalize-component-for-cache.d.ts +6 -0
  33. package/legacy/dist/src/generate/helpers/parse-precomputed-cached-names.d.ts +1 -0
  34. package/legacy/dist/src/generate/helpers/print-fallback-instructions.d.ts +6 -0
  35. package/legacy/dist/src/generate/helpers/read-file-inline.d.ts +1 -0
  36. package/legacy/dist/src/generate/services/invoke-all-component-agents.d.ts +6 -0
  37. package/legacy/dist/src/generate/services/invoke-component-agent.d.ts +36 -0
  38. package/legacy/dist/src/generate/services/load-accepted-names.d.ts +1 -0
  39. package/legacy/dist/src/generate/services/resolve-component-cache.d.ts +13 -0
  40. package/legacy/dist/src/generate/services/resolve-generate-agent.d.ts +9 -0
  41. package/legacy/dist/src/generate/services/show-generate-view.d.ts +2 -0
  42. package/legacy/dist/src/generate/services/verify-agent-binary.d.ts +2 -0
  43. package/legacy/dist/src/import/command.d.ts +1 -1
  44. package/legacy/dist/src/import/tui/WizardApp.d.ts +1 -2
  45. package/legacy/dist/src/index.js +2685 -2252
  46. package/legacy/dist/src/lib/pluralize.d.ts +1 -0
  47. package/legacy/dist/src/map-tokens/controller/run-map-tokens.d.ts +12 -0
  48. package/legacy/dist/src/map-tokens/services/render-map-tokens-result.d.ts +2 -0
  49. package/legacy/dist/src/map-tokens/services/resolve-token-name-paths.d.ts +8 -0
  50. package/legacy/package.json +1 -1
  51. package/package.json +2 -2
  52. package/dist/src/tui/import/steps/02-token-input/controls.d.ts +0 -11
  53. package/dist/src/tui/import/steps/02-token-input/logic.d.ts +0 -9
  54. package/dist/src/tui/import/steps/02-token-input/screen.d.ts +0 -8
  55. package/dist/src/tui/import/steps/02-token-input/validate-path.d.ts +0 -12
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // packages/experience-design-system-cli/app.tsx
2
- import { useState as useState10 } from "react";
2
+ import { useState as useState9 } from "react";
3
3
 
4
4
  // packages/experience-design-system-cli/src/tui/home/home.tsx
5
5
  import { useEffect as useEffect2, useState as useState2 } from "react";
@@ -304,123 +304,6 @@ function WelcomeScreen({ onContinue, onQuit }) {
304
304
  ] });
305
305
  }
306
306
 
307
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
308
- import { useState as useState4 } from "react";
309
- import { Box as Box4, Text as Text4 } from "ink";
310
- import TextInput2 from "ink-text-input";
311
-
312
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
313
- import { useInput as useInput4 } from "ink";
314
-
315
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts
316
- function isPlainKeyOnEmptyField(value, input, key, expected) {
317
- return value === "" && input === expected && !key.ctrl && !key.meta;
318
- }
319
- function shouldGoBack(value, input, key) {
320
- return key.escape || isPlainKeyOnEmptyField(value, input, key, "q");
321
- }
322
- function shouldSkip(value, input, key) {
323
- return isPlainKeyOnEmptyField(value, input, key, "s");
324
- }
325
- function toTokenPath(value) {
326
- const tokenPath = value.trim();
327
- return tokenPath === "" ? null : tokenPath;
328
- }
329
-
330
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
331
- var TOKEN_INPUT_CONTROLS = [
332
- { keys: "Enter", label: "Continue (skips if empty)" },
333
- { keys: "s", label: "Skip" },
334
- { keys: "Esc/q", label: "Back" }
335
- ];
336
- function useTokenInputControls(tokenPath, onSkip, onBack) {
337
- useInput4((input, key) => {
338
- if (shouldGoBack(tokenPath, input, key)) onBack();
339
- else if (shouldSkip(tokenPath, input, key)) onSkip();
340
- });
341
- }
342
-
343
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/validate-path.ts
344
- import { statSync } from "node:fs";
345
- import { homedir } from "node:os";
346
- import { resolve } from "node:path";
347
- function stripQuotes(value) {
348
- const quoted = value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'");
349
- return value.length >= 2 && quoted ? value.slice(1, -1) : value;
350
- }
351
- function expandHome(value) {
352
- return value === "~" || value.startsWith("~/") || value.startsWith("~\\") ? homedir() + value.slice(1) : value;
353
- }
354
- function validateTokenPath(rawPath) {
355
- const path = resolve(expandHome(stripQuotes(rawPath.trim())));
356
- let stats;
357
- try {
358
- stats = statSync(path);
359
- } catch {
360
- return { ok: false, error: `Path not found: ${path}`, resolvedPath: path };
361
- }
362
- if (stats.isDirectory()) {
363
- return {
364
- ok: false,
365
- error: "That's a directory \u2014 provide a path to a token file (e.g. tokens.json), not a folder.",
366
- resolvedPath: path
367
- };
368
- }
369
- if (!stats.isFile()) {
370
- return { ok: false, error: `Not a regular file: ${path}`, resolvedPath: path };
371
- }
372
- return { ok: true, path };
373
- }
374
-
375
- // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
376
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
377
- function TokenInputScreen({ onConfirm, onSkip, onBack }) {
378
- const [tokenPath, setTokenPath] = useState4("");
379
- const [failure, setFailure] = useState4(null);
380
- useTokenInputControls(tokenPath, onSkip, onBack);
381
- const change = (value) => {
382
- setTokenPath(value);
383
- setFailure(null);
384
- };
385
- const submit = (value) => {
386
- const rawPath = toTokenPath(value);
387
- if (!rawPath) {
388
- onSkip();
389
- return;
390
- }
391
- const check = validateTokenPath(rawPath);
392
- if (check.ok) onConfirm(check.path);
393
- else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
394
- };
395
- return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
396
- /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Design tokens" }),
397
- /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to DTCG format." }),
398
- /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginTop: 1, children: [
399
- /* @__PURE__ */ jsxs4(Box4, { gap: 1, children: [
400
- /* @__PURE__ */ jsx4(Text4, { color: PALETTE.accent, children: "?" }),
401
- /* @__PURE__ */ jsx4(Text4, { children: "Token path:" }),
402
- /* @__PURE__ */ jsx4(TextInput2, { value: tokenPath, onChange: change, onSubmit: submit })
403
- ] }),
404
- failure && /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
405
- /* @__PURE__ */ jsxs4(Text4, { color: PALETTE.error, children: [
406
- "\u2717 ",
407
- failure.error
408
- ] }),
409
- /* @__PURE__ */ jsxs4(Text4, { dimColor: true, children: [
410
- " Resolved to: ",
411
- failure.resolvedPath
412
- ] })
413
- ] })
414
- ] }),
415
- /* @__PURE__ */ jsx4(Box4, { marginTop: 1, gap: 3, children: TOKEN_INPUT_CONTROLS.map((control) => /* @__PURE__ */ jsxs4(Text4, { dimColor: true, children: [
416
- "[",
417
- control.keys,
418
- "] ",
419
- control.label
420
- ] }, control.keys)) })
421
- ] });
422
- }
423
-
424
307
  // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
425
308
  import { spawn } from "node:child_process";
426
309
 
@@ -448,12 +331,6 @@ function buildArgs(options) {
448
331
  if (options.project) {
449
332
  args.push("--project", options.project);
450
333
  }
451
- if (options.tokens) {
452
- args.push("--tokens", options.tokens);
453
- }
454
- if (options.skipTokenPrompt) {
455
- args.push("--skip-token-prompt");
456
- }
457
334
  return args;
458
335
  }
459
336
  async function spawnV1Import(options = {}) {
@@ -477,7 +354,7 @@ function getTerminalHandle() {
477
354
  return process.stdin._handle;
478
355
  }
479
356
  async function stopReadingTerminal() {
480
- await new Promise((resolve2) => setImmediate(resolve2));
357
+ await new Promise((resolve) => setImmediate(resolve));
481
358
  const handle = getTerminalHandle();
482
359
  if (!handle?.readStop) return;
483
360
  handle.reading = false;
@@ -492,7 +369,7 @@ function startReadingTerminal() {
492
369
 
493
370
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
494
371
  import { useEffect as useEffect3 } from "react";
495
- import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
372
+ import { Box as Box4, Text as Text4, useInput as useInput4 } from "ink";
496
373
 
497
374
  // packages/experience-design-system-cli/src/tui/debug-store.ts
498
375
  import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
@@ -666,7 +543,7 @@ process.once("SIGINT", () => {
666
543
  });
667
544
 
668
545
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
669
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
546
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
670
547
  function HelpScreen({ onDone }) {
671
548
  useEffect3(() => {
672
549
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
@@ -675,7 +552,7 @@ function HelpScreen({ onDone }) {
675
552
  void finishDebugRun({ outputs: {}, status: "success", exitMethod });
676
553
  onDone();
677
554
  };
678
- useInput5((input, key) => {
555
+ useInput4((input, key) => {
679
556
  if (key.return) {
680
557
  leave("saved");
681
558
  return;
@@ -685,30 +562,30 @@ function HelpScreen({ onDone }) {
685
562
  return;
686
563
  }
687
564
  });
688
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
689
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Help" }),
690
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
691
- /* @__PURE__ */ jsx5(Text5, { children: "This is a placeholder screen for v2 help content." }),
692
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
693
- /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
565
+ return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
566
+ /* @__PURE__ */ jsx4(Text4, { bold: true, children: "Help" }),
567
+ /* @__PURE__ */ jsx4(Text4, { children: " " }),
568
+ /* @__PURE__ */ jsx4(Text4, { children: "This is a placeholder screen for v2 help content." }),
569
+ /* @__PURE__ */ jsx4(Text4, { children: " " }),
570
+ /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "[Enter] Complete [Esc/q] Exit \u2014 both return to Start" })
694
571
  ] });
695
572
  }
696
573
 
697
574
  // packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
698
- import { useState as useState5 } from "react";
699
- import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
700
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
575
+ import { useState as useState4 } from "react";
576
+ import { Box as Box5, Text as Text5, useInput as useInput5 } from "ink";
577
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
701
578
  function SettingsScreen({
702
579
  onNavigate,
703
580
  onBack
704
581
  }) {
705
- const [focusIdx, setFocusIdx] = useState5(0);
582
+ const [focusIdx, setFocusIdx] = useState4(0);
706
583
  const items = [
707
584
  { label: "Configuration", screen: "settings-configuration" },
708
585
  { label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
709
586
  { label: "Debug Mode", screen: "settings-debug-mode" }
710
587
  ];
711
- useInput6((input, key) => {
588
+ useInput5((input, key) => {
712
589
  if (key.upArrow) {
713
590
  setFocusIdx((i) => (i - 1 + items.length) % items.length);
714
591
  return;
@@ -728,27 +605,27 @@ function SettingsScreen({
728
605
  onBack();
729
606
  }
730
607
  });
731
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
732
- /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Settings" }),
733
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
734
- items.map((item, i) => /* @__PURE__ */ jsxs6(Text6, { color: i === focusIdx ? "cyan" : void 0, children: [
608
+ return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
609
+ /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Settings" }),
610
+ /* @__PURE__ */ jsx5(Text5, { children: " " }),
611
+ items.map((item, i) => /* @__PURE__ */ jsxs5(Text5, { color: i === focusIdx ? "cyan" : void 0, children: [
735
612
  i === focusIdx ? "> " : " ",
736
613
  item.label
737
614
  ] }, item.label)),
738
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
739
- /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[\u2191/\u2193] Navigate [Enter] Select [Esc/q] Back to Start" })
615
+ /* @__PURE__ */ jsx5(Text5, { children: " " }),
616
+ /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "[\u2191/\u2193] Navigate [Enter] Select [Esc/q] Back to Start" })
740
617
  ] });
741
618
  }
742
619
 
743
620
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
744
- import { useEffect as useEffect4, useState as useState6 } from "react";
745
- import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
621
+ import { useEffect as useEffect4, useState as useState5 } from "react";
622
+ import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
746
623
 
747
624
  // packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
748
625
  import { readFile as readFile2, writeFile as writeFile3, mkdir as mkdir3 } from "node:fs/promises";
749
626
  import { join as join6 } from "node:path";
750
- import { homedir as homedir2 } from "node:os";
751
- var V1_STORE_PATH = join6(homedir2(), ".config", "experiences", "credentials.json");
627
+ import { homedir } from "node:os";
628
+ var V1_STORE_PATH = join6(homedir(), ".config", "experiences", "credentials.json");
752
629
  async function readV1Store() {
753
630
  try {
754
631
  const raw = await readFile2(V1_STORE_PATH, "utf8");
@@ -758,7 +635,7 @@ async function readV1Store() {
758
635
  }
759
636
  }
760
637
  async function writeV1Store(data) {
761
- await mkdir3(join6(homedir2(), ".config", "experiences"), { recursive: true });
638
+ await mkdir3(join6(homedir(), ".config", "experiences"), { recursive: true });
762
639
  await writeFile3(V1_STORE_PATH, `${JSON.stringify(data, null, 2)}
763
640
  `, { mode: 384 });
764
641
  }
@@ -786,7 +663,7 @@ async function writeCredentials(config) {
786
663
  }
787
664
 
788
665
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
789
- import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
666
+ import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
790
667
  var FIELD_ORDER = ["spaceId", "environmentId", "cmaToken", "host"];
791
668
  function debugFields(config) {
792
669
  return {
@@ -803,10 +680,10 @@ var FIELD_LABELS = {
803
680
  host: "API Host (optional)"
804
681
  };
805
682
  function ConfigurationScreen({ onDone }) {
806
- const [stage, setStage] = useState6("loading");
807
- const [config, setConfig] = useState6(null);
808
- const [activeField, setActiveField] = useState6("spaceId");
809
- const [message, setMessage] = useState6(null);
683
+ const [stage, setStage] = useState5("loading");
684
+ const [config, setConfig] = useState5(null);
685
+ const [activeField, setActiveField] = useState5("spaceId");
686
+ const [message, setMessage] = useState5(null);
810
687
  useEffect4(() => {
811
688
  readCredentials().then((cfg) => {
812
689
  setConfig(cfg);
@@ -839,7 +716,7 @@ function ConfigurationScreen({ onDone }) {
839
716
  setStage("form");
840
717
  });
841
718
  }
842
- useInput7((input, key) => {
719
+ useInput6((input, key) => {
843
720
  if (stage === "loading" || stage === "saving") return;
844
721
  if (stage === "saved") {
845
722
  if (key.return || key.escape || input === "q") {
@@ -882,57 +759,57 @@ function ConfigurationScreen({ onDone }) {
882
759
  }
883
760
  });
884
761
  if (stage === "loading") {
885
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
886
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
887
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
888
- /* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
762
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
763
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
764
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
765
+ /* @__PURE__ */ jsx6(Text6, { color: PALETTE.accent, children: "Loading..." })
889
766
  ] });
890
767
  }
891
768
  if (stage === "saved") {
892
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
893
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
894
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
895
- /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
769
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
770
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
771
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
772
+ /* @__PURE__ */ jsxs6(Text6, { color: PALETTE.success, children: [
896
773
  "\u2713 ",
897
774
  message
898
775
  ] }),
899
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
900
- /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
776
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
777
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[Enter] Back to Settings" })
901
778
  ] });
902
779
  }
903
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
904
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
905
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
906
- /* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
907
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
908
- /* @__PURE__ */ jsx7(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
780
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
781
+ /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Configuration" }),
782
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
783
+ /* @__PURE__ */ jsx6(Text6, { children: "Contentful API Credentials" }),
784
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
785
+ /* @__PURE__ */ jsx6(Box6, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
909
786
  const isActive = activeField === field;
910
787
  const value = fieldValue(field);
911
788
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
912
- return /* @__PURE__ */ jsxs7(Box7, { gap: 1, children: [
913
- /* @__PURE__ */ jsx7(Text7, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
914
- /* @__PURE__ */ jsxs7(Text7, { bold: isActive, children: [
789
+ return /* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
790
+ /* @__PURE__ */ jsx6(Text6, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
791
+ /* @__PURE__ */ jsxs6(Text6, { bold: isActive, children: [
915
792
  FIELD_LABELS[field],
916
793
  ":"
917
794
  ] }),
918
- /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
795
+ /* @__PURE__ */ jsx6(Text6, { children: display || /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "(empty)" }) })
919
796
  ] }, field);
920
797
  }) }),
921
- message && /* @__PURE__ */ jsxs7(Fragment, { children: [
922
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
923
- /* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
798
+ message && /* @__PURE__ */ jsxs6(Fragment, { children: [
799
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
800
+ /* @__PURE__ */ jsxs6(Text6, { color: PALETTE.error, children: [
924
801
  "\u2717 ",
925
802
  message
926
803
  ] })
927
804
  ] }),
928
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
929
- /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
805
+ /* @__PURE__ */ jsx6(Text6, { children: " " }),
806
+ /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "[\u2191/\u2193] Switch field \xB7 [Enter] Save/Next \xB7 [Esc/q] Back" })
930
807
  ] });
931
808
  }
932
809
 
933
810
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
934
- import { useEffect as useEffect5, useState as useState7 } from "react";
935
- import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
811
+ import { useEffect as useEffect5, useState as useState6 } from "react";
812
+ import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
936
813
 
937
814
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
938
815
  async function readAnalyticsSetting() {
@@ -950,10 +827,10 @@ async function writeAnalyticsSetting(setting) {
950
827
  }
951
828
 
952
829
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
953
- import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
830
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
954
831
  function OptInAnalyticsScreen({ onDone }) {
955
- const [loading, setLoading] = useState7(true);
956
- const [enabled, setEnabled] = useState7(true);
832
+ const [loading, setLoading] = useState6(true);
833
+ const [enabled, setEnabled] = useState6(true);
957
834
  useEffect5(() => {
958
835
  readAnalyticsSetting().then((setting) => {
959
836
  setEnabled(setting.enabled);
@@ -966,7 +843,7 @@ function OptInAnalyticsScreen({ onDone }) {
966
843
  });
967
844
  });
968
845
  }, []);
969
- useInput8((input, key) => {
846
+ useInput7((input, key) => {
970
847
  if (loading) return;
971
848
  if (key.return || input === " ") {
972
849
  setEnabled((current) => {
@@ -981,31 +858,31 @@ function OptInAnalyticsScreen({ onDone }) {
981
858
  onDone();
982
859
  }
983
860
  });
984
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
985
- /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
986
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
987
- loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
988
- /* @__PURE__ */ jsxs8(Text8, { children: [
861
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
862
+ /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
863
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
864
+ loading ? /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
865
+ /* @__PURE__ */ jsxs7(Text7, { children: [
989
866
  "Share anonymous usage data:",
990
867
  " ",
991
- /* @__PURE__ */ jsx8(Text8, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
868
+ /* @__PURE__ */ jsx7(Text7, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
992
869
  ] }),
993
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
994
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
995
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
870
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
871
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
872
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
996
873
  ] }),
997
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
998
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
874
+ /* @__PURE__ */ jsx7(Text7, { children: " " }),
875
+ /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
999
876
  ] });
1000
877
  }
1001
878
 
1002
879
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
1003
- import { useEffect as useEffect6, useState as useState8 } from "react";
1004
- import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
1005
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
880
+ import { useEffect as useEffect6, useState as useState7 } from "react";
881
+ import { Box as Box8, Text as Text8, useInput as useInput8 } from "ink";
882
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1006
883
  var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
1007
884
  function UpgradeScreen({ onDone }) {
1008
- const [upgradeCheck, setUpgradeCheck] = useState8();
885
+ const [upgradeCheck, setUpgradeCheck] = useState7();
1009
886
  useEffect6(() => {
1010
887
  startDebugRun({
1011
888
  flow: "upgrade",
@@ -1015,7 +892,7 @@ function UpgradeScreen({ onDone }) {
1015
892
  });
1016
893
  checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
1017
894
  }, []);
1018
- useInput9((_input, key) => {
895
+ useInput8((_input, key) => {
1019
896
  if (key.return) {
1020
897
  void finishDebugRun({
1021
898
  outputs: upgradeCheck ?? {},
@@ -1026,12 +903,12 @@ function UpgradeScreen({ onDone }) {
1026
903
  return;
1027
904
  }
1028
905
  });
1029
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1030
- /* @__PURE__ */ jsx9(Text9, { bold: true, children: "Upgrade" }),
1031
- /* @__PURE__ */ jsx9(Text9, { children: " " }),
906
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
907
+ /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Upgrade" }),
908
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
1032
909
  renderBody(upgradeCheck),
1033
- /* @__PURE__ */ jsx9(Text9, { children: " " }),
1034
- /* @__PURE__ */ jsxs9(Text9, { bold: true, color: PALETTE.accent, children: [
910
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
911
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.accent, children: [
1035
912
  FOCUS_MARKER,
1036
913
  " Go Back"
1037
914
  ] })
@@ -1039,44 +916,44 @@ function UpgradeScreen({ onDone }) {
1039
916
  }
1040
917
  function renderBody(upgradeCheck) {
1041
918
  if (!upgradeCheck) {
1042
- return /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: "Checking for updates\u2026" });
919
+ return /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Checking for updates\u2026" });
1043
920
  }
1044
921
  if (upgradeCheck.status === "error") {
1045
- return /* @__PURE__ */ jsx9(Text9, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
922
+ return /* @__PURE__ */ jsx8(Text8, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
1046
923
  }
1047
924
  if (upgradeCheck.status === "up-to-date") {
1048
- return /* @__PURE__ */ jsxs9(Text9, { color: PALETTE.success, children: [
925
+ return /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.success, children: [
1049
926
  "You're already on the latest version (v",
1050
927
  upgradeCheck.current,
1051
928
  ")."
1052
929
  ] });
1053
930
  }
1054
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
1055
- /* @__PURE__ */ jsxs9(Text9, { color: PALETTE.muted, children: [
1056
- /* @__PURE__ */ jsxs9(Text9, { bold: true, color: PALETTE.success, children: [
931
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
932
+ /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.muted, children: [
933
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.success, children: [
1057
934
  "v",
1058
935
  upgradeCheck.latest
1059
936
  ] }),
1060
937
  " ",
1061
938
  "is available (you're on ",
1062
- /* @__PURE__ */ jsxs9(Text9, { bold: true, children: [
939
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
1063
940
  "v",
1064
941
  upgradeCheck.current
1065
942
  ] }),
1066
943
  "). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
1067
944
  ] }),
1068
- /* @__PURE__ */ jsx9(Text9, { children: " " }),
1069
- /* @__PURE__ */ jsx9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx9(Text9, { bold: true, children: cmd }, cmd)) })
945
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
946
+ /* @__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)) })
1070
947
  ] });
1071
948
  }
1072
949
 
1073
950
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
1074
- import { useEffect as useEffect7, useState as useState9 } from "react";
1075
- import { Box as Box10, Text as Text10, useInput as useInput10 } from "ink";
1076
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
951
+ import { useEffect as useEffect7, useState as useState8 } from "react";
952
+ import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
953
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1077
954
  function DebugModeScreen({ onDone }) {
1078
- const [loading, setLoading] = useState9(true);
1079
- const [enabled, setEnabled] = useState9(true);
955
+ const [loading, setLoading] = useState8(true);
956
+ const [enabled, setEnabled] = useState8(true);
1080
957
  useEffect7(() => {
1081
958
  readDebugModeSetting().then((setting) => {
1082
959
  setEnabled(setting.enabled);
@@ -1089,7 +966,7 @@ function DebugModeScreen({ onDone }) {
1089
966
  });
1090
967
  });
1091
968
  }, []);
1092
- useInput10((input, key) => {
969
+ useInput9((input, key) => {
1093
970
  if (loading) return;
1094
971
  if (key.return || input === " ") {
1095
972
  setEnabled((current) => {
@@ -1104,74 +981,59 @@ function DebugModeScreen({ onDone }) {
1104
981
  onDone();
1105
982
  }
1106
983
  });
1107
- return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1108
- /* @__PURE__ */ jsx10(Text10, { bold: true, children: "Settings \u203A Debug Mode" }),
1109
- /* @__PURE__ */ jsx10(Text10, { children: " " }),
1110
- loading ? /* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs10(Text10, { children: [
984
+ return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
985
+ /* @__PURE__ */ jsx9(Text9, { bold: true, children: "Settings \u203A Debug Mode" }),
986
+ /* @__PURE__ */ jsx9(Text9, { children: " " }),
987
+ loading ? /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs9(Text9, { children: [
1111
988
  "Debug logging:",
1112
989
  " ",
1113
- /* @__PURE__ */ jsx10(Text10, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
990
+ /* @__PURE__ */ jsx9(Text9, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
1114
991
  ] }),
1115
- /* @__PURE__ */ jsx10(Text10, { children: " " }),
1116
- /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
992
+ /* @__PURE__ */ jsx9(Text9, { children: " " }),
993
+ /* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "[Enter/Space] Toggle [Esc/q] Back to Settings" })
1117
994
  ] });
1118
995
  }
1119
996
 
1120
997
  // packages/experience-design-system-cli/app.tsx
1121
- import { jsx as jsx11 } from "react/jsx-runtime";
998
+ import { jsx as jsx10 } from "react/jsx-runtime";
1122
999
  function App({ onLaunchImport, importExitCode }) {
1123
1000
  const returnedFromImport = importExitCode !== void 0;
1124
- const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
1125
- const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
1126
- const [projectPath, setProjectPath] = useState10();
1001
+ const [screen, setScreen] = useState9(returnedFromImport ? "import" : "start");
1002
+ const [showImportResult, setShowImportResult] = useState9(returnedFromImport);
1127
1003
  const goToStart = () => setScreen("start");
1128
1004
  const goToSettings = () => setScreen("settings");
1129
1005
  const finishImportResult = () => {
1130
1006
  setShowImportResult(false);
1131
- setProjectPath(void 0);
1132
- goToStart();
1133
- };
1134
- const leaveImport = () => {
1135
- setProjectPath(void 0);
1136
1007
  goToStart();
1137
1008
  };
1138
1009
  switch (screen) {
1139
1010
  case "import":
1140
- if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
1141
- if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
1142
- return /* @__PURE__ */ jsx11(
1143
- TokenInputScreen,
1144
- {
1145
- onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
1146
- onSkip: () => onLaunchImport?.({ project: projectPath, skipTokenPrompt: true }),
1147
- onBack: () => setProjectPath(void 0)
1148
- }
1149
- );
1011
+ return showImportResult ? /* @__PURE__ */ jsx10(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult }) : /* @__PURE__ */ jsx10(WelcomeScreen, { onContinue: (projectPath) => onLaunchImport?.(projectPath), onQuit: goToStart });
1150
1012
  case "help":
1151
- return /* @__PURE__ */ jsx11(HelpScreen, { onDone: goToStart });
1013
+ return /* @__PURE__ */ jsx10(HelpScreen, { onDone: goToStart });
1152
1014
  case "upgrade":
1153
- return /* @__PURE__ */ jsx11(UpgradeScreen, { onDone: goToStart });
1015
+ return /* @__PURE__ */ jsx10(UpgradeScreen, { onDone: goToStart });
1154
1016
  case "settings":
1155
- return /* @__PURE__ */ jsx11(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1017
+ return /* @__PURE__ */ jsx10(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1156
1018
  case "settings-configuration":
1157
- return /* @__PURE__ */ jsx11(ConfigurationScreen, { onDone: goToSettings });
1019
+ return /* @__PURE__ */ jsx10(ConfigurationScreen, { onDone: goToSettings });
1158
1020
  case "settings-opt-in-analytics":
1159
- return /* @__PURE__ */ jsx11(OptInAnalyticsScreen, { onDone: goToSettings });
1021
+ return /* @__PURE__ */ jsx10(OptInAnalyticsScreen, { onDone: goToSettings });
1160
1022
  case "settings-debug-mode":
1161
- return /* @__PURE__ */ jsx11(DebugModeScreen, { onDone: goToSettings });
1023
+ return /* @__PURE__ */ jsx10(DebugModeScreen, { onDone: goToSettings });
1162
1024
  case "start":
1163
- return /* @__PURE__ */ jsx11(HomeScreen, { onNavigate: setScreen });
1025
+ return /* @__PURE__ */ jsx10(HomeScreen, { onNavigate: setScreen });
1164
1026
  }
1165
1027
  }
1166
1028
  async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1167
- let requestedImport;
1029
+ let requestedProjectPath;
1168
1030
  const instance = renderApp(
1169
- /* @__PURE__ */ jsx11(
1031
+ /* @__PURE__ */ jsx10(
1170
1032
  App,
1171
1033
  {
1172
1034
  importExitCode,
1173
- onLaunchImport: (options) => {
1174
- requestedImport = options;
1035
+ onLaunchImport: (projectPath) => {
1036
+ requestedProjectPath = projectPath;
1175
1037
  instance.unmount();
1176
1038
  }
1177
1039
  }
@@ -1179,15 +1041,15 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1179
1041
  );
1180
1042
  await instance.waitUntilExit();
1181
1043
  await stopReadingTerminal();
1182
- return requestedImport;
1044
+ return requestedProjectPath;
1183
1045
  }
1184
1046
  async function runApp(renderApp) {
1185
1047
  let importExitCode;
1186
- let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1187
- while (requestedImport !== void 0) {
1188
- importExitCode = (await spawnV1Import(requestedImport)).exitCode;
1048
+ let projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1049
+ while (projectPath !== void 0) {
1050
+ importExitCode = (await spawnV1Import({ project: projectPath })).exitCode;
1189
1051
  startReadingTerminal();
1190
- requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1052
+ projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1191
1053
  }
1192
1054
  }
1193
1055
  export {