@contentful/experience-design-system-cli 2.35.1-dev-build-fa950e44.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 (53) hide show
  1. package/dist/app.js +127 -262
  2. package/dist/index.js +131 -289
  3. package/dist/package.json +1 -1
  4. package/dist/src/tui/import/spawn-v1-import.d.ts +0 -1
  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/index.js +2683 -2245
  44. package/legacy/dist/src/lib/pluralize.d.ts +1 -0
  45. package/legacy/dist/src/map-tokens/controller/run-map-tokens.d.ts +12 -0
  46. package/legacy/dist/src/map-tokens/services/render-map-tokens-result.d.ts +2 -0
  47. package/legacy/dist/src/map-tokens/services/resolve-token-name-paths.d.ts +8 -0
  48. package/legacy/package.json +1 -1
  49. package/package.json +2 -2
  50. package/dist/src/tui/import/steps/02-token-input/controls.d.ts +0 -11
  51. package/dist/src/tui/import/steps/02-token-input/logic.d.ts +0 -9
  52. package/dist/src/tui/import/steps/02-token-input/screen.d.ts +0 -8
  53. 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,9 +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
334
  return args;
455
335
  }
456
336
  async function spawnV1Import(options = {}) {
@@ -474,7 +354,7 @@ function getTerminalHandle() {
474
354
  return process.stdin._handle;
475
355
  }
476
356
  async function stopReadingTerminal() {
477
- await new Promise((resolve2) => setImmediate(resolve2));
357
+ await new Promise((resolve) => setImmediate(resolve));
478
358
  const handle = getTerminalHandle();
479
359
  if (!handle?.readStop) return;
480
360
  handle.reading = false;
@@ -489,7 +369,7 @@ function startReadingTerminal() {
489
369
 
490
370
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
491
371
  import { useEffect as useEffect3 } from "react";
492
- 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";
493
373
 
494
374
  // packages/experience-design-system-cli/src/tui/debug-store.ts
495
375
  import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
@@ -663,7 +543,7 @@ process.once("SIGINT", () => {
663
543
  });
664
544
 
665
545
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
666
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
546
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
667
547
  function HelpScreen({ onDone }) {
668
548
  useEffect3(() => {
669
549
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
@@ -672,7 +552,7 @@ function HelpScreen({ onDone }) {
672
552
  void finishDebugRun({ outputs: {}, status: "success", exitMethod });
673
553
  onDone();
674
554
  };
675
- useInput5((input, key) => {
555
+ useInput4((input, key) => {
676
556
  if (key.return) {
677
557
  leave("saved");
678
558
  return;
@@ -682,30 +562,30 @@ function HelpScreen({ onDone }) {
682
562
  return;
683
563
  }
684
564
  });
685
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
686
- /* @__PURE__ */ jsx5(Text5, { bold: true, children: "Help" }),
687
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
688
- /* @__PURE__ */ jsx5(Text5, { children: "This is a placeholder screen for v2 help content." }),
689
- /* @__PURE__ */ jsx5(Text5, { children: " " }),
690
- /* @__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" })
691
571
  ] });
692
572
  }
693
573
 
694
574
  // packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
695
- import { useState as useState5 } from "react";
696
- import { Box as Box6, Text as Text6, useInput as useInput6 } from "ink";
697
- 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";
698
578
  function SettingsScreen({
699
579
  onNavigate,
700
580
  onBack
701
581
  }) {
702
- const [focusIdx, setFocusIdx] = useState5(0);
582
+ const [focusIdx, setFocusIdx] = useState4(0);
703
583
  const items = [
704
584
  { label: "Configuration", screen: "settings-configuration" },
705
585
  { label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
706
586
  { label: "Debug Mode", screen: "settings-debug-mode" }
707
587
  ];
708
- useInput6((input, key) => {
588
+ useInput5((input, key) => {
709
589
  if (key.upArrow) {
710
590
  setFocusIdx((i) => (i - 1 + items.length) % items.length);
711
591
  return;
@@ -725,27 +605,27 @@ function SettingsScreen({
725
605
  onBack();
726
606
  }
727
607
  });
728
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
729
- /* @__PURE__ */ jsx6(Text6, { bold: true, children: "Settings" }),
730
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
731
- 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: [
732
612
  i === focusIdx ? "> " : " ",
733
613
  item.label
734
614
  ] }, item.label)),
735
- /* @__PURE__ */ jsx6(Text6, { children: " " }),
736
- /* @__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" })
737
617
  ] });
738
618
  }
739
619
 
740
620
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
741
- import { useEffect as useEffect4, useState as useState6 } from "react";
742
- 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";
743
623
 
744
624
  // packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
745
625
  import { readFile as readFile2, writeFile as writeFile3, mkdir as mkdir3 } from "node:fs/promises";
746
626
  import { join as join6 } from "node:path";
747
- import { homedir as homedir2 } from "node:os";
748
- 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");
749
629
  async function readV1Store() {
750
630
  try {
751
631
  const raw = await readFile2(V1_STORE_PATH, "utf8");
@@ -755,7 +635,7 @@ async function readV1Store() {
755
635
  }
756
636
  }
757
637
  async function writeV1Store(data) {
758
- await mkdir3(join6(homedir2(), ".config", "experiences"), { recursive: true });
638
+ await mkdir3(join6(homedir(), ".config", "experiences"), { recursive: true });
759
639
  await writeFile3(V1_STORE_PATH, `${JSON.stringify(data, null, 2)}
760
640
  `, { mode: 384 });
761
641
  }
@@ -783,7 +663,7 @@ async function writeCredentials(config) {
783
663
  }
784
664
 
785
665
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
786
- 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";
787
667
  var FIELD_ORDER = ["spaceId", "environmentId", "cmaToken", "host"];
788
668
  function debugFields(config) {
789
669
  return {
@@ -800,10 +680,10 @@ var FIELD_LABELS = {
800
680
  host: "API Host (optional)"
801
681
  };
802
682
  function ConfigurationScreen({ onDone }) {
803
- const [stage, setStage] = useState6("loading");
804
- const [config, setConfig] = useState6(null);
805
- const [activeField, setActiveField] = useState6("spaceId");
806
- 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);
807
687
  useEffect4(() => {
808
688
  readCredentials().then((cfg) => {
809
689
  setConfig(cfg);
@@ -836,7 +716,7 @@ function ConfigurationScreen({ onDone }) {
836
716
  setStage("form");
837
717
  });
838
718
  }
839
- useInput7((input, key) => {
719
+ useInput6((input, key) => {
840
720
  if (stage === "loading" || stage === "saving") return;
841
721
  if (stage === "saved") {
842
722
  if (key.return || key.escape || input === "q") {
@@ -879,57 +759,57 @@ function ConfigurationScreen({ onDone }) {
879
759
  }
880
760
  });
881
761
  if (stage === "loading") {
882
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
883
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
884
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
885
- /* @__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..." })
886
766
  ] });
887
767
  }
888
768
  if (stage === "saved") {
889
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
890
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
891
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
892
- /* @__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: [
893
773
  "\u2713 ",
894
774
  message
895
775
  ] }),
896
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
897
- /* @__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" })
898
778
  ] });
899
779
  }
900
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
901
- /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
902
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
903
- /* @__PURE__ */ jsx7(Text7, { children: "Contentful API Credentials" }),
904
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
905
- /* @__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) => {
906
786
  const isActive = activeField === field;
907
787
  const value = fieldValue(field);
908
788
  const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
909
- return /* @__PURE__ */ jsxs7(Box7, { gap: 1, children: [
910
- /* @__PURE__ */ jsx7(Text7, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
911
- /* @__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: [
912
792
  FIELD_LABELS[field],
913
793
  ":"
914
794
  ] }),
915
- /* @__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)" }) })
916
796
  ] }, field);
917
797
  }) }),
918
- message && /* @__PURE__ */ jsxs7(Fragment, { children: [
919
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
920
- /* @__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: [
921
801
  "\u2717 ",
922
802
  message
923
803
  ] })
924
804
  ] }),
925
- /* @__PURE__ */ jsx7(Text7, { children: " " }),
926
- /* @__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" })
927
807
  ] });
928
808
  }
929
809
 
930
810
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
931
- import { useEffect as useEffect5, useState as useState7 } from "react";
932
- 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";
933
813
 
934
814
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
935
815
  async function readAnalyticsSetting() {
@@ -947,10 +827,10 @@ async function writeAnalyticsSetting(setting) {
947
827
  }
948
828
 
949
829
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
950
- 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";
951
831
  function OptInAnalyticsScreen({ onDone }) {
952
- const [loading, setLoading] = useState7(true);
953
- const [enabled, setEnabled] = useState7(true);
832
+ const [loading, setLoading] = useState6(true);
833
+ const [enabled, setEnabled] = useState6(true);
954
834
  useEffect5(() => {
955
835
  readAnalyticsSetting().then((setting) => {
956
836
  setEnabled(setting.enabled);
@@ -963,7 +843,7 @@ function OptInAnalyticsScreen({ onDone }) {
963
843
  });
964
844
  });
965
845
  }, []);
966
- useInput8((input, key) => {
846
+ useInput7((input, key) => {
967
847
  if (loading) return;
968
848
  if (key.return || input === " ") {
969
849
  setEnabled((current) => {
@@ -978,31 +858,31 @@ function OptInAnalyticsScreen({ onDone }) {
978
858
  onDone();
979
859
  }
980
860
  });
981
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
982
- /* @__PURE__ */ jsx8(Text8, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
983
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
984
- loading ? /* @__PURE__ */ jsx8(Text8, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment2, { children: [
985
- /* @__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: [
986
866
  "Share anonymous usage data:",
987
867
  " ",
988
- /* @__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" })
989
869
  ] }),
990
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
991
- /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
992
- /* @__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." })
993
873
  ] }),
994
- /* @__PURE__ */ jsx8(Text8, { children: " " }),
995
- /* @__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" })
996
876
  ] });
997
877
  }
998
878
 
999
879
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
1000
- import { useEffect as useEffect6, useState as useState8 } from "react";
1001
- import { Box as Box9, Text as Text9, useInput as useInput9 } from "ink";
1002
- 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";
1003
883
  var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
1004
884
  function UpgradeScreen({ onDone }) {
1005
- const [upgradeCheck, setUpgradeCheck] = useState8();
885
+ const [upgradeCheck, setUpgradeCheck] = useState7();
1006
886
  useEffect6(() => {
1007
887
  startDebugRun({
1008
888
  flow: "upgrade",
@@ -1012,7 +892,7 @@ function UpgradeScreen({ onDone }) {
1012
892
  });
1013
893
  checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
1014
894
  }, []);
1015
- useInput9((_input, key) => {
895
+ useInput8((_input, key) => {
1016
896
  if (key.return) {
1017
897
  void finishDebugRun({
1018
898
  outputs: upgradeCheck ?? {},
@@ -1023,12 +903,12 @@ function UpgradeScreen({ onDone }) {
1023
903
  return;
1024
904
  }
1025
905
  });
1026
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1027
- /* @__PURE__ */ jsx9(Text9, { bold: true, children: "Upgrade" }),
1028
- /* @__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: " " }),
1029
909
  renderBody(upgradeCheck),
1030
- /* @__PURE__ */ jsx9(Text9, { children: " " }),
1031
- /* @__PURE__ */ jsxs9(Text9, { bold: true, color: PALETTE.accent, children: [
910
+ /* @__PURE__ */ jsx8(Text8, { children: " " }),
911
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, color: PALETTE.accent, children: [
1032
912
  FOCUS_MARKER,
1033
913
  " Go Back"
1034
914
  ] })
@@ -1036,44 +916,44 @@ function UpgradeScreen({ onDone }) {
1036
916
  }
1037
917
  function renderBody(upgradeCheck) {
1038
918
  if (!upgradeCheck) {
1039
- 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" });
1040
920
  }
1041
921
  if (upgradeCheck.status === "error") {
1042
- 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." });
1043
923
  }
1044
924
  if (upgradeCheck.status === "up-to-date") {
1045
- return /* @__PURE__ */ jsxs9(Text9, { color: PALETTE.success, children: [
925
+ return /* @__PURE__ */ jsxs8(Text8, { color: PALETTE.success, children: [
1046
926
  "You're already on the latest version (v",
1047
927
  upgradeCheck.current,
1048
928
  ")."
1049
929
  ] });
1050
930
  }
1051
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
1052
- /* @__PURE__ */ jsxs9(Text9, { color: PALETTE.muted, children: [
1053
- /* @__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: [
1054
934
  "v",
1055
935
  upgradeCheck.latest
1056
936
  ] }),
1057
937
  " ",
1058
938
  "is available (you're on ",
1059
- /* @__PURE__ */ jsxs9(Text9, { bold: true, children: [
939
+ /* @__PURE__ */ jsxs8(Text8, { bold: true, children: [
1060
940
  "v",
1061
941
  upgradeCheck.current
1062
942
  ] }),
1063
943
  "). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
1064
944
  ] }),
1065
- /* @__PURE__ */ jsx9(Text9, { children: " " }),
1066
- /* @__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)) })
1067
947
  ] });
1068
948
  }
1069
949
 
1070
950
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
1071
- import { useEffect as useEffect7, useState as useState9 } from "react";
1072
- import { Box as Box10, Text as Text10, useInput as useInput10 } from "ink";
1073
- 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";
1074
954
  function DebugModeScreen({ onDone }) {
1075
- const [loading, setLoading] = useState9(true);
1076
- const [enabled, setEnabled] = useState9(true);
955
+ const [loading, setLoading] = useState8(true);
956
+ const [enabled, setEnabled] = useState8(true);
1077
957
  useEffect7(() => {
1078
958
  readDebugModeSetting().then((setting) => {
1079
959
  setEnabled(setting.enabled);
@@ -1086,7 +966,7 @@ function DebugModeScreen({ onDone }) {
1086
966
  });
1087
967
  });
1088
968
  }, []);
1089
- useInput10((input, key) => {
969
+ useInput9((input, key) => {
1090
970
  if (loading) return;
1091
971
  if (key.return || input === " ") {
1092
972
  setEnabled((current) => {
@@ -1101,74 +981,59 @@ function DebugModeScreen({ onDone }) {
1101
981
  onDone();
1102
982
  }
1103
983
  });
1104
- return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
1105
- /* @__PURE__ */ jsx10(Text10, { bold: true, children: "Settings \u203A Debug Mode" }),
1106
- /* @__PURE__ */ jsx10(Text10, { children: " " }),
1107
- 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: [
1108
988
  "Debug logging:",
1109
989
  " ",
1110
- /* @__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" })
1111
991
  ] }),
1112
- /* @__PURE__ */ jsx10(Text10, { children: " " }),
1113
- /* @__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" })
1114
994
  ] });
1115
995
  }
1116
996
 
1117
997
  // packages/experience-design-system-cli/app.tsx
1118
- import { jsx as jsx11 } from "react/jsx-runtime";
998
+ import { jsx as jsx10 } from "react/jsx-runtime";
1119
999
  function App({ onLaunchImport, importExitCode }) {
1120
1000
  const returnedFromImport = importExitCode !== void 0;
1121
- const [screen, setScreen] = useState10(returnedFromImport ? "import" : "start");
1122
- const [showImportResult, setShowImportResult] = useState10(returnedFromImport);
1123
- const [projectPath, setProjectPath] = useState10();
1001
+ const [screen, setScreen] = useState9(returnedFromImport ? "import" : "start");
1002
+ const [showImportResult, setShowImportResult] = useState9(returnedFromImport);
1124
1003
  const goToStart = () => setScreen("start");
1125
1004
  const goToSettings = () => setScreen("settings");
1126
1005
  const finishImportResult = () => {
1127
1006
  setShowImportResult(false);
1128
- setProjectPath(void 0);
1129
- goToStart();
1130
- };
1131
- const leaveImport = () => {
1132
- setProjectPath(void 0);
1133
1007
  goToStart();
1134
1008
  };
1135
1009
  switch (screen) {
1136
1010
  case "import":
1137
- if (showImportResult) return /* @__PURE__ */ jsx11(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
1138
- if (projectPath === void 0) return /* @__PURE__ */ jsx11(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport });
1139
- return /* @__PURE__ */ jsx11(
1140
- TokenInputScreen,
1141
- {
1142
- onConfirm: (tokens) => onLaunchImport?.({ project: projectPath, tokens }),
1143
- onSkip: () => onLaunchImport?.({ project: projectPath }),
1144
- onBack: () => setProjectPath(void 0)
1145
- }
1146
- );
1011
+ return showImportResult ? /* @__PURE__ */ jsx10(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult }) : /* @__PURE__ */ jsx10(WelcomeScreen, { onContinue: (projectPath) => onLaunchImport?.(projectPath), onQuit: goToStart });
1147
1012
  case "help":
1148
- return /* @__PURE__ */ jsx11(HelpScreen, { onDone: goToStart });
1013
+ return /* @__PURE__ */ jsx10(HelpScreen, { onDone: goToStart });
1149
1014
  case "upgrade":
1150
- return /* @__PURE__ */ jsx11(UpgradeScreen, { onDone: goToStart });
1015
+ return /* @__PURE__ */ jsx10(UpgradeScreen, { onDone: goToStart });
1151
1016
  case "settings":
1152
- return /* @__PURE__ */ jsx11(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1017
+ return /* @__PURE__ */ jsx10(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
1153
1018
  case "settings-configuration":
1154
- return /* @__PURE__ */ jsx11(ConfigurationScreen, { onDone: goToSettings });
1019
+ return /* @__PURE__ */ jsx10(ConfigurationScreen, { onDone: goToSettings });
1155
1020
  case "settings-opt-in-analytics":
1156
- return /* @__PURE__ */ jsx11(OptInAnalyticsScreen, { onDone: goToSettings });
1021
+ return /* @__PURE__ */ jsx10(OptInAnalyticsScreen, { onDone: goToSettings });
1157
1022
  case "settings-debug-mode":
1158
- return /* @__PURE__ */ jsx11(DebugModeScreen, { onDone: goToSettings });
1023
+ return /* @__PURE__ */ jsx10(DebugModeScreen, { onDone: goToSettings });
1159
1024
  case "start":
1160
- return /* @__PURE__ */ jsx11(HomeScreen, { onNavigate: setScreen });
1025
+ return /* @__PURE__ */ jsx10(HomeScreen, { onNavigate: setScreen });
1161
1026
  }
1162
1027
  }
1163
1028
  async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1164
- let requestedImport;
1029
+ let requestedProjectPath;
1165
1030
  const instance = renderApp(
1166
- /* @__PURE__ */ jsx11(
1031
+ /* @__PURE__ */ jsx10(
1167
1032
  App,
1168
1033
  {
1169
1034
  importExitCode,
1170
- onLaunchImport: (options) => {
1171
- requestedImport = options;
1035
+ onLaunchImport: (projectPath) => {
1036
+ requestedProjectPath = projectPath;
1172
1037
  instance.unmount();
1173
1038
  }
1174
1039
  }
@@ -1176,15 +1041,15 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
1176
1041
  );
1177
1042
  await instance.waitUntilExit();
1178
1043
  await stopReadingTerminal();
1179
- return requestedImport;
1044
+ return requestedProjectPath;
1180
1045
  }
1181
1046
  async function runApp(renderApp) {
1182
1047
  let importExitCode;
1183
- let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1184
- while (requestedImport !== void 0) {
1185
- importExitCode = (await spawnV1Import(requestedImport)).exitCode;
1048
+ let projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1049
+ while (projectPath !== void 0) {
1050
+ importExitCode = (await spawnV1Import({ project: projectPath })).exitCode;
1186
1051
  startReadingTerminal();
1187
- requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1052
+ projectPath = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
1188
1053
  }
1189
1054
  }
1190
1055
  export {