@contentful/experience-design-system-cli 2.37.1-dev-build-182ecd7e.0 → 2.37.1-dev-build-a0a57522.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
@@ -18438,6 +18438,9 @@ var GLYPH_TREE_MID = "\u251C\u2500";
18438
18438
  var GLYPH_TREE_LAST = "\u2514\u2500";
18439
18439
  var GLYPH_WARN = "\u26A0";
18440
18440
  var GLYPH_ERROR = "\u2717";
18441
+ function hasDirectChild(node) {
18442
+ return node.slots.some((slot) => (slot.allowedComponents ?? []).some((target) => target !== node.name));
18443
+ }
18441
18444
  function isEmpty(entry) {
18442
18445
  return Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
18443
18446
  }
@@ -18480,10 +18483,12 @@ function buildVisibleRows(props) {
18480
18483
  otherKeys2.sort();
18481
18484
  const otherKeySet2 = new Set(otherKeys2);
18482
18485
  const flatGraph = graph.filter((n) => otherKeySet2.has(n.name));
18483
- const closures2 = computeAllClosures(flatGraph);
18484
18486
  const depCountByKey = /* @__PURE__ */ new Map();
18485
- for (const [name, closure] of closures2) {
18486
- if (closure.nodes.length > 1) depCountByKey.set(name, closure.nodes.length - 1);
18487
+ for (const node of flatGraph) {
18488
+ const direct = new Set(
18489
+ node.slots.flatMap((slot) => slot.allowedComponents ?? []).filter((t) => t !== node.name && otherKeySet2.has(t))
18490
+ );
18491
+ if (direct.size > 0) depCountByKey.set(node.name, direct.size);
18487
18492
  }
18488
18493
  for (const key of cycleKeys2) {
18489
18494
  const rec = itemByKey2.get(key);
@@ -18528,28 +18533,11 @@ function buildVisibleRows(props) {
18528
18533
  const seenCycleTierChildOccurrence = /* @__PURE__ */ new Set();
18529
18534
  const computeCycleMemberSubtree = (root) => {
18530
18535
  const out = [];
18531
- const visited = /* @__PURE__ */ new Set([root]);
18532
- const queue = [{ name: root, depth: 0 }];
18533
- while (queue.length > 0) {
18534
- const cur = queue.shift();
18535
- const parentItem = itemByKey.get(cur.name)?.it;
18536
- if (!parentItem) continue;
18537
- const slotTargets2 = [];
18538
- const seenTarget = /* @__PURE__ */ new Set();
18539
- for (const target of allowedComponentNames(parentItem.entry)) {
18540
- if (!itemByKey.has(target)) continue;
18541
- if (seenTarget.has(target)) continue;
18542
- seenTarget.add(target);
18543
- slotTargets2.push(target);
18544
- }
18545
- slotTargets2.sort();
18546
- for (const target of slotTargets2) {
18547
- if (visited.has(target)) continue;
18548
- visited.add(target);
18549
- const isCycleMember = cycleParticipants.has(target);
18550
- out.push({ name: target, depth: cur.depth + 1, isCycleMember });
18551
- queue.push({ name: target, depth: cur.depth + 1 });
18552
- }
18536
+ const parentItem = itemByKey.get(root)?.it;
18537
+ if (!parentItem) return out;
18538
+ const slotTargets2 = [...new Set(allowedComponentNames(parentItem.entry))].filter((target) => target !== root && itemByKey.has(target)).sort();
18539
+ for (const target of slotTargets2) {
18540
+ out.push({ name: target, depth: 1, isCycleMember: cycleParticipants.has(target) });
18553
18541
  }
18554
18542
  return out;
18555
18543
  };
@@ -18611,7 +18599,15 @@ function buildVisibleRows(props) {
18611
18599
  }
18612
18600
  const otherKeySet = new Set(otherKeys);
18613
18601
  const subgraph = graph.filter((n) => otherKeySet.has(n.name));
18614
- const closures = computeAllClosures(subgraph);
18602
+ const closures = /* @__PURE__ */ new Map();
18603
+ const parentNames = /* @__PURE__ */ new Set([
18604
+ ...findRoots(subgraph),
18605
+ ...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
18606
+ ]);
18607
+ for (const name of [...parentNames].sort()) {
18608
+ const full = computeClosure(name, subgraph);
18609
+ closures.set(name, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
18610
+ }
18615
18611
  const sharedDeps = findSharedDeps(closures);
18616
18612
  const hasCycleDepDirect = (name) => {
18617
18613
  const it = itemByKey.get(name)?.it;
@@ -18648,7 +18644,6 @@ function buildVisibleRows(props) {
18648
18644
  }
18649
18645
  };
18650
18646
  countInjections(root);
18651
- for (const n of closure.nodes) if (n.name !== root) countInjections(n.name);
18652
18647
  const depCount = closure.nodes.length - 1 + injectedCycleCount;
18653
18648
  const expanded = alwaysExpanded ? true : props.expandedGroups.has(root);
18654
18649
  const glyphExpand = expanded ? GLYPH_EXPAND_EXPANDED : GLYPH_EXPAND_COLLAPSED;
@@ -18684,7 +18679,6 @@ function buildVisibleRows(props) {
18684
18679
  emitCycleChildrenOf(root, 0);
18685
18680
  for (const c2 of closureChildren) {
18686
18681
  injectedChildren.push({ name: c2.name, depth: c2.depth, isCycleChild: false });
18687
- emitCycleChildrenOf(c2.name, c2.depth);
18688
18682
  }
18689
18683
  const isLastAtDepth = (idx) => {
18690
18684
  const own = injectedChildren[idx].depth;
package/dist/index.js CHANGED
@@ -20888,6 +20888,9 @@ var init_badge = __esm({
20888
20888
  import figures4 from "figures";
20889
20889
  import { Box as Box17, Text as Text19 } from "ink";
20890
20890
  import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
20891
+ function hasDirectChild(node) {
20892
+ return node.slots.some((slot) => (slot.allowedComponents ?? []).some((target) => target !== node.name));
20893
+ }
20891
20894
  function isEmpty(entry) {
20892
20895
  return Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
20893
20896
  }
@@ -20930,10 +20933,12 @@ function buildVisibleRows(props) {
20930
20933
  otherKeys2.sort();
20931
20934
  const otherKeySet2 = new Set(otherKeys2);
20932
20935
  const flatGraph = graph.filter((n) => otherKeySet2.has(n.name));
20933
- const closures2 = computeAllClosures(flatGraph);
20934
20936
  const depCountByKey = /* @__PURE__ */ new Map();
20935
- for (const [name, closure] of closures2) {
20936
- if (closure.nodes.length > 1) depCountByKey.set(name, closure.nodes.length - 1);
20937
+ for (const node of flatGraph) {
20938
+ const direct = new Set(
20939
+ node.slots.flatMap((slot) => slot.allowedComponents ?? []).filter((t) => t !== node.name && otherKeySet2.has(t))
20940
+ );
20941
+ if (direct.size > 0) depCountByKey.set(node.name, direct.size);
20937
20942
  }
20938
20943
  for (const key of cycleKeys2) {
20939
20944
  const rec = itemByKey2.get(key);
@@ -20978,28 +20983,11 @@ function buildVisibleRows(props) {
20978
20983
  const seenCycleTierChildOccurrence = /* @__PURE__ */ new Set();
20979
20984
  const computeCycleMemberSubtree = (root) => {
20980
20985
  const out = [];
20981
- const visited = /* @__PURE__ */ new Set([root]);
20982
- const queue = [{ name: root, depth: 0 }];
20983
- while (queue.length > 0) {
20984
- const cur = queue.shift();
20985
- const parentItem = itemByKey.get(cur.name)?.it;
20986
- if (!parentItem) continue;
20987
- const slotTargets2 = [];
20988
- const seenTarget = /* @__PURE__ */ new Set();
20989
- for (const target of allowedComponentNames(parentItem.entry)) {
20990
- if (!itemByKey.has(target)) continue;
20991
- if (seenTarget.has(target)) continue;
20992
- seenTarget.add(target);
20993
- slotTargets2.push(target);
20994
- }
20995
- slotTargets2.sort();
20996
- for (const target of slotTargets2) {
20997
- if (visited.has(target)) continue;
20998
- visited.add(target);
20999
- const isCycleMember = cycleParticipants.has(target);
21000
- out.push({ name: target, depth: cur.depth + 1, isCycleMember });
21001
- queue.push({ name: target, depth: cur.depth + 1 });
21002
- }
20986
+ const parentItem = itemByKey.get(root)?.it;
20987
+ if (!parentItem) return out;
20988
+ const slotTargets2 = [...new Set(allowedComponentNames(parentItem.entry))].filter((target) => target !== root && itemByKey.has(target)).sort();
20989
+ for (const target of slotTargets2) {
20990
+ out.push({ name: target, depth: 1, isCycleMember: cycleParticipants.has(target) });
21003
20991
  }
21004
20992
  return out;
21005
20993
  };
@@ -21061,7 +21049,15 @@ function buildVisibleRows(props) {
21061
21049
  }
21062
21050
  const otherKeySet = new Set(otherKeys);
21063
21051
  const subgraph = graph.filter((n) => otherKeySet.has(n.name));
21064
- const closures = computeAllClosures(subgraph);
21052
+ const closures = /* @__PURE__ */ new Map();
21053
+ const parentNames = /* @__PURE__ */ new Set([
21054
+ ...findRoots(subgraph),
21055
+ ...subgraph.filter((n) => hasDirectChild(n)).map((n) => n.name)
21056
+ ]);
21057
+ for (const name of [...parentNames].sort()) {
21058
+ const full = computeClosure(name, subgraph);
21059
+ closures.set(name, { ...full, nodes: full.nodes.filter((n) => n.depth <= 1) });
21060
+ }
21065
21061
  const sharedDeps = findSharedDeps(closures);
21066
21062
  const hasCycleDepDirect = (name) => {
21067
21063
  const it = itemByKey.get(name)?.it;
@@ -21098,7 +21094,6 @@ function buildVisibleRows(props) {
21098
21094
  }
21099
21095
  };
21100
21096
  countInjections(root);
21101
- for (const n of closure.nodes) if (n.name !== root) countInjections(n.name);
21102
21097
  const depCount = closure.nodes.length - 1 + injectedCycleCount;
21103
21098
  const expanded = alwaysExpanded ? true : props.expandedGroups.has(root);
21104
21099
  const glyphExpand = expanded ? GLYPH_EXPAND_EXPANDED : GLYPH_EXPAND_COLLAPSED;
@@ -21134,7 +21129,6 @@ function buildVisibleRows(props) {
21134
21129
  emitCycleChildrenOf(root, 0);
21135
21130
  for (const c2 of closureChildren) {
21136
21131
  injectedChildren.push({ name: c2.name, depth: c2.depth, isCycleChild: false });
21137
- emitCycleChildrenOf(c2.name, c2.depth);
21138
21132
  }
21139
21133
  const isLastAtDepth = (idx) => {
21140
21134
  const own = injectedChildren[idx].depth;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-182ecd7e.0",
3
+ "version": "2.37.1-dev-build-a0a57522.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-182ecd7e.0",
3
+ "version": "2.37.1-dev-build-a0a57522.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-182ecd7e.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-182ecd7e.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-a0a57522.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-a0a57522.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",