@contentful/experience-design-system-cli 2.41.1-dev-build-d507b86c.0 → 2.41.1-dev-build-ca05819e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -313,7 +313,7 @@ async function finishDebugRun({
313
313
  if (!await isDebugModeEnabled()) return;
314
314
  const durationMs = Date.now() - run.startedAt;
315
315
  const log = {
316
- flow: logFolder(run.flow, run.step),
316
+ folder: logFolder(run.flow, run.step),
317
317
  menuOption: run.menuOption,
318
318
  content: renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs })
319
319
  };
@@ -328,7 +328,7 @@ function logFolder(flow, step) {
328
328
  return flow.startsWith("import/") && /^\d+-/.test(step) ? `import/${step}` : flow;
329
329
  }
330
330
  async function writeLog(root, log) {
331
- const dir = join5(root, ...log.flow.split("/"));
331
+ const dir = join5(root, ...log.folder.split("/"));
332
332
  await mkdir2(dir, { recursive: true });
333
333
  const filename = nextAttemptFilename(dir, log.menuOption);
334
334
  await writeFile2(join5(dir, filename), log.content, { mode: 384 });
@@ -21921,27 +21921,12 @@ var HELP_SECTIONS = [
21921
21921
  ]
21922
21922
  }
21923
21923
  ];
21924
- function ScopeGateScreen(props) {
21925
- if (props.components.length === 0) return /* @__PURE__ */ jsx29(NoComponents, {});
21926
- return /* @__PURE__ */ jsx29(ScopeGateView, { ...props });
21927
- }
21928
- function NoComponents() {
21929
- useEffect14(() => {
21930
- startDebugRun({
21931
- flow: "import/scope-gate",
21932
- step: "07-scope-gate",
21933
- menuOption: "Scope gate",
21934
- inputs: scopeGateLogInputs([], 0)
21935
- });
21936
- void finishDebugRun({
21937
- outputs: { outcome: "nothing to decide", error: "No components were found for this session." },
21938
- status: "error",
21939
- exitMethod: "discarded"
21940
- });
21941
- }, []);
21942
- return /* @__PURE__ */ jsx29(Box25, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx29(Text26, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
21943
- }
21944
- function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
21924
+ function ScopeGateScreen({
21925
+ components,
21926
+ tokensPath,
21927
+ onConfirm,
21928
+ onQuit
21929
+ }) {
21945
21930
  const tokens = useMemo4(() => {
21946
21931
  const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
21947
21932
  return loaded?.ok ? loaded.rows : [];
@@ -22627,6 +22612,14 @@ function entryErrors(node, prefix) {
22627
22612
  const type = value["$type"];
22628
22613
  const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
22629
22614
  if (!check) {
22615
+ if (type !== void 0) {
22616
+ errors.push({
22617
+ path: `${path5}/$type`,
22618
+ message: `Unknown $type "${String(type)}"`,
22619
+ expected: "component or a design token type",
22620
+ actual: String(type)
22621
+ });
22622
+ }
22630
22623
  errors.push(...entryErrors(value, path5));
22631
22624
  } else if (!check(value)) {
22632
22625
  errors.push(...toValidationErrors(check.errors, path5));
@@ -26958,7 +26951,7 @@ function openReviewTrail(components, now) {
26958
26951
  };
26959
26952
  }
26960
26953
  function recordReviewAction(trail, label) {
26961
- const kind = label.split(":")[0] ?? label;
26954
+ const kind = label.split(":")[0];
26962
26955
  trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
26963
26956
  if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
26964
26957
  }
@@ -29293,6 +29286,8 @@ function flowContext(state2) {
29293
29286
  }
29294
29287
  function arrive(trail, state2) {
29295
29288
  const next = { ...trail, at: state2.step };
29289
+ delete next.failure;
29290
+ delete next.validation;
29296
29291
  if (state2.step === "error") {
29297
29292
  next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
29298
29293
  }
package/dist/index.js CHANGED
@@ -19616,7 +19616,7 @@ async function finishDebugRun({
19616
19616
  if (!await isDebugModeEnabled()) return;
19617
19617
  const durationMs = Date.now() - run.startedAt;
19618
19618
  const log = {
19619
- flow: logFolder(run.flow, run.step),
19619
+ folder: logFolder(run.flow, run.step),
19620
19620
  menuOption: run.menuOption,
19621
19621
  content: renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs })
19622
19622
  };
@@ -19631,7 +19631,7 @@ function logFolder(flow, step) {
19631
19631
  return flow.startsWith("import/") && /^\d+-/.test(step) ? `import/${step}` : flow;
19632
19632
  }
19633
19633
  async function writeLog(root, log) {
19634
- const dir = join19(root, ...log.flow.split("/"));
19634
+ const dir = join19(root, ...log.folder.split("/"));
19635
19635
  await mkdir7(dir, { recursive: true });
19636
19636
  const filename = nextAttemptFilename(dir, log.menuOption);
19637
19637
  await writeFile7(join19(dir, filename), log.content, { mode: 384 });
@@ -24978,27 +24978,12 @@ var init_use_scope_gate = __esm({
24978
24978
  import { useEffect as useEffect14, useMemo as useMemo4 } from "react";
24979
24979
  import { Box as Box25, Text as Text26 } from "ink";
24980
24980
  import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
24981
- function ScopeGateScreen(props) {
24982
- if (props.components.length === 0) return /* @__PURE__ */ jsx29(NoComponents, {});
24983
- return /* @__PURE__ */ jsx29(ScopeGateView, { ...props });
24984
- }
24985
- function NoComponents() {
24986
- useEffect14(() => {
24987
- startDebugRun({
24988
- flow: "import/scope-gate",
24989
- step: "07-scope-gate",
24990
- menuOption: "Scope gate",
24991
- inputs: scopeGateLogInputs([], 0)
24992
- });
24993
- void finishDebugRun({
24994
- outputs: { outcome: "nothing to decide", error: "No components were found for this session." },
24995
- status: "error",
24996
- exitMethod: "discarded"
24997
- });
24998
- }, []);
24999
- return /* @__PURE__ */ jsx29(Box25, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx29(Text26, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
25000
- }
25001
- function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
24981
+ function ScopeGateScreen({
24982
+ components,
24983
+ tokensPath,
24984
+ onConfirm,
24985
+ onQuit
24986
+ }) {
25002
24987
  const tokens = useMemo4(() => {
25003
24988
  const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
25004
24989
  return loaded?.ok ? loaded.rows : [];
@@ -25818,6 +25803,14 @@ function entryErrors(node, prefix) {
25818
25803
  const type = value["$type"];
25819
25804
  const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
25820
25805
  if (!check) {
25806
+ if (type !== void 0) {
25807
+ errors.push({
25808
+ path: `${path5}/$type`,
25809
+ message: `Unknown $type "${String(type)}"`,
25810
+ expected: "component or a design token type",
25811
+ actual: String(type)
25812
+ });
25813
+ }
25821
25814
  errors.push(...entryErrors(value, path5));
25822
25815
  } else if (!check(value)) {
25823
25816
  errors.push(...toValidationErrors(check.errors, path5));
@@ -30527,7 +30520,7 @@ function openReviewTrail(components, now) {
30527
30520
  };
30528
30521
  }
30529
30522
  function recordReviewAction(trail, label) {
30530
- const kind = label.split(":")[0] ?? label;
30523
+ const kind = label.split(":")[0];
30531
30524
  trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
30532
30525
  if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
30533
30526
  }
@@ -33018,6 +33011,8 @@ function flowContext(state2) {
33018
33011
  }
33019
33012
  function arrive(trail, state2) {
33020
33013
  const next = { ...trail, at: state2.step };
33014
+ delete next.failure;
33015
+ delete next.validation;
33021
33016
  if (state2.step === "error") {
33022
33017
  next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
33023
33018
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.41.1-dev-build-d507b86c.0",
3
+ "version": "2.41.1-dev-build-ca05819e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -6,5 +6,5 @@ interface ScopeGateScreenProps {
6
6
  onConfirm: (decisions: ScopeDecisions) => void;
7
7
  onQuit: () => void;
8
8
  }
9
- export declare function ScopeGateScreen(props: ScopeGateScreenProps): React.ReactElement;
9
+ export declare function ScopeGateScreen({ components, tokensPath, onConfirm, onQuit, }: ScopeGateScreenProps): React.ReactElement;
10
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.41.1-dev-build-d507b86c.0",
3
+ "version": "2.41.1-dev-build-ca05819e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.41.1-dev-build-d507b86c.0"
48
+ "@contentful/experience-design-system-types": "2.41.1-dev-build-ca05819e.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/node24": "^24.0.4",
@@ -59,7 +59,7 @@
59
59
  "ink-testing-library": "^4.0.0",
60
60
  "typescript-eslint": "^8.67.0",
61
61
  "vitest": "^4.0.16",
62
- "@contentful/experience-design-system-backend-pipeline": "2.41.1-dev-build-d507b86c.0"
62
+ "@contentful/experience-design-system-backend-pipeline": "2.41.1-dev-build-ca05819e.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",