@contentful/experience-design-system-cli 2.41.1-dev-build-a14ed2ff.0 → 2.42.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
- folder: logFolder(run.flow, run.step),
316
+ flow: 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.folder.split("/"));
331
+ const dir = join5(root, ...log.flow.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,12 +21921,27 @@ var HELP_SECTIONS = [
21921
21921
  ]
21922
21922
  }
21923
21923
  ];
21924
- function ScopeGateScreen({
21925
- components,
21926
- tokensPath,
21927
- onConfirm,
21928
- onQuit
21929
- }) {
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 }) {
21930
21945
  const tokens = useMemo4(() => {
21931
21946
  const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
21932
21947
  return loaded?.ok ? loaded.rows : [];
@@ -22612,14 +22627,6 @@ function entryErrors(node, prefix) {
22612
22627
  const type = value["$type"];
22613
22628
  const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
22614
22629
  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
- }
22623
22630
  errors.push(...entryErrors(value, path5));
22624
22631
  } else if (!check(value)) {
22625
22632
  errors.push(...toValidationErrors(check.errors, path5));
@@ -26951,7 +26958,7 @@ function openReviewTrail(components, now) {
26951
26958
  };
26952
26959
  }
26953
26960
  function recordReviewAction(trail, label) {
26954
- const kind = label.split(":")[0];
26961
+ const kind = label.split(":")[0] ?? label;
26955
26962
  trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
26956
26963
  if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
26957
26964
  }
@@ -29286,8 +29293,6 @@ function flowContext(state2) {
29286
29293
  }
29287
29294
  function arrive(trail, state2) {
29288
29295
  const next = { ...trail, at: state2.step };
29289
- delete next.failure;
29290
- delete next.validation;
29291
29296
  if (state2.step === "error") {
29292
29297
  next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
29293
29298
  }
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
- folder: logFolder(run.flow, run.step),
19619
+ flow: 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.folder.split("/"));
19634
+ const dir = join19(root, ...log.flow.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,12 +24978,27 @@ 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({
24982
- components,
24983
- tokensPath,
24984
- onConfirm,
24985
- onQuit
24986
- }) {
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 }) {
24987
25002
  const tokens = useMemo4(() => {
24988
25003
  const loaded = tokensPath ? loadTokenRows(tokensPath) : void 0;
24989
25004
  return loaded?.ok ? loaded.rows : [];
@@ -25803,14 +25818,6 @@ function entryErrors(node, prefix) {
25803
25818
  const type = value["$type"];
25804
25819
  const check = type === "component" ? validateComponentEntry : TOKEN_TYPE_SET3.has(type) ? validateTokenEntry : void 0;
25805
25820
  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
- }
25814
25821
  errors.push(...entryErrors(value, path5));
25815
25822
  } else if (!check(value)) {
25816
25823
  errors.push(...toValidationErrors(check.errors, path5));
@@ -30520,7 +30527,7 @@ function openReviewTrail(components, now) {
30520
30527
  };
30521
30528
  }
30522
30529
  function recordReviewAction(trail, label) {
30523
- const kind = label.split(":")[0];
30530
+ const kind = label.split(":")[0] ?? label;
30524
30531
  trail.kinds[kind] = (trail.kinds[kind] ?? 0) + 1;
30525
30532
  if (trail.actions.length < MAX_ACTIONS) trail.actions.push(label);
30526
30533
  }
@@ -33011,8 +33018,6 @@ function flowContext(state2) {
33011
33018
  }
33012
33019
  function arrive(trail, state2) {
33013
33020
  const next = { ...trail, at: state2.step };
33014
- delete next.failure;
33015
- delete next.validation;
33016
33021
  if (state2.step === "error") {
33017
33022
  next.failure = { step: state2.errorStep, message: scrub(state2.errorMessage, state2) };
33018
33023
  }
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-a14ed2ff.0",
3
+ "version": "2.42.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({ components, tokensPath, onConfirm, onQuit, }: ScopeGateScreenProps): React.ReactElement;
9
+ export declare function ScopeGateScreen(props: 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-a14ed2ff.0",
3
+ "version": "2.42.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-a14ed2ff.0"
48
+ "@contentful/experience-design-system-types": "2.42.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-a14ed2ff.0"
62
+ "@contentful/experience-design-system-backend-pipeline": "2.42.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",