@contentful/experience-design-system-cli 2.11.4-dev-build-7abd382.0 → 2.11.4-dev-build-f3b5300.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.11.4-dev-build-7abd382.0",
3
+ "version": "2.11.4-dev-build-f3b5300.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -202,10 +202,12 @@ async function retryComponentWithProject(component, ctx, project, warnings) {
202
202
  }
203
203
  if (!members || members.length === 0)
204
204
  return false;
205
- // If the only members are Snippet-typed (the partial-heritage signal that
206
- // tripped the original warning), we haven't actually recovered useful props.
207
- if (members.every((m) => m.isSnippet))
208
- return false;
205
+ // Snippet-only resolution is still useful it confirms the slot surface
206
+ // and lets us replace the original (which may have had fewer slot entries
207
+ // because the cold AST-only pass missed members declared in heritage).
208
+ // Apply the recovered slots, but DON'T drop `props-type-unresolved` from
209
+ // reasons (the prop side genuinely has no resolvable members).
210
+ const onlySnippets = members.every((m) => m.isSnippet);
209
211
  const { props, snippetSlots } = extractFromTypeMembersOnly(members);
210
212
  // Merge any template <slot> entries that survived the original pass — we
211
213
  // can't easily re-derive those without re-parsing the fragment, but the
@@ -218,17 +220,23 @@ async function retryComponentWithProject(component, ctx, project, warnings) {
218
220
  const slotNames = new Set(finalSlots.map((s) => s.name));
219
221
  component.props = props.filter((p) => !slotNames.has(p.name));
220
222
  component.slots = finalSlots;
221
- // Drop props-type-unresolved from reasons; recompute confidence.
222
- const remainingReasons = (component.reviewReasons ?? []).filter((r) => r !== 'props-type-unresolved');
223
+ // Recompute confidence. When only Snippets came back, keep the
224
+ // `props-type-unresolved` reason slot surface is real but the prop side
225
+ // is still legitimately unresolved (the extends-from-node_modules failed).
226
+ // When real props came back, drop the reason: full recovery.
227
+ const remainingReasons = onlySnippets
228
+ ? (component.reviewReasons ?? [])
229
+ : (component.reviewReasons ?? []).filter((r) => r !== 'props-type-unresolved');
223
230
  const score = computeExtractionScore(component, {
224
231
  additionalIssueCount: remainingReasons.length,
225
232
  additionalReasons: remainingReasons,
226
233
  });
227
234
  component.extractionConfidence = score.confidence;
228
235
  component.reviewReasons = score.reasons;
229
- component.needsReview = deriveNeedsReview(score.confidence);
230
- // Remove the per-component unresolved-type warning so it doesn't muddy the
231
- // summary line / TUI grouping after recovery.
236
+ component.needsReview = deriveNeedsReview(score.confidence) || remainingReasons.includes('props-type-unresolved');
237
+ // Remove the per-component unresolved-type warning. The `props-type-unresolved`
238
+ // reason on the component itself still carries the signal for TUI drill-down;
239
+ // the warnings array is replaced by the collapsed summary upstream.
232
240
  const componentName = component.name;
233
241
  const idx = warnings.findIndex((w) => w.startsWith(`${componentName}: declared Props type `) && /resolved to /.test(w));
234
242
  if (idx >= 0)
@@ -461,22 +469,26 @@ function extractTypesFromExports(exportsField) {
461
469
  * When a large fraction of components emit the same `declared Props type ...
462
470
  * resolved to ... properties` warning (typical of headless libraries like
463
471
  * skeleton-svelte that extend types from external packages we can't reach),
464
- * collapse them into a single summary line at the top + the per-component
465
- * details below. Per-component reviewReasons and needsReview stay intact;
466
- * this only affects the warnings array's readability.
472
+ * replace ALL of them with a single summary line. Per-component
473
+ * reviewReasons + needsReview flags stay intact, so the user can still
474
+ * drill into any individual component to see the issue — we just don't
475
+ * flood the top-level warnings panel with N near-identical lines.
467
476
  *
468
477
  * Threshold: 3 or more identical-shape warnings. Below that, the literal
469
- * per-component lines are clearer than a summary.
478
+ * per-component lines are short enough to keep as-is.
470
479
  */
471
480
  function collapseUnresolvedTypeWarnings(warnings) {
472
481
  const isUnresolvedWarning = (w) => /declared Props type .* resolved to/.test(w);
473
- const unresolved = warnings.filter(isUnresolvedWarning);
474
- if (unresolved.length < 3)
482
+ const unresolvedCount = warnings.filter(isUnresolvedWarning).length;
483
+ if (unresolvedCount < 3)
475
484
  return warnings;
476
- const summary = `Unresolved component types: ${unresolved.length} components have a declared Props type the parser couldn't fully resolve — ` +
485
+ const others = warnings.filter((w) => !isUnresolvedWarning(w));
486
+ const summary = `Unresolved component types: ${unresolvedCount} components have a declared Props type the parser couldn't fully resolve — ` +
477
487
  `most often a cross-package extends pattern (e.g. an interface that extends a type from a node_modules package). ` +
488
+ `Each affected component is flagged with reviewReasons: ['props-type-unresolved'] and needsReview = true; ` +
489
+ `select one in the TUI to drill in. ` +
478
490
  `See https://github.com/contentful/experience-design-system-sdk-public/pull/44 for context and partner workarounds.`;
479
- return [summary, ...warnings];
491
+ return [summary, ...others];
480
492
  }
481
493
  async function extractFromSvelteFile(filePath, source) {
482
494
  const warnings = [];
@@ -60,5 +60,5 @@ export function AnalyzeView({ result, onExit }) {
60
60
  .map((e, i) => (_jsx(Text, { color: "red", children: ' ✗ ' + e.component + ': ' + e.error }, i)))] })), result.totalWarnings > 0 && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: '─'.repeat(70) }), _jsx(Text, { bold: true, color: "yellow", children: 'Warnings (' + result.totalWarnings + ')' }), _jsx(Text, { dimColor: true, children: '─'.repeat(70) }), _jsx(Text, { children: " " }), result.components
61
61
  .filter((c) => c.warnings.length > 0)
62
62
  .flatMap((c) => c.warnings.map((w) => ({ component: c.name, warning: w })))
63
- .map((w, i) => (_jsx(Text, { color: "yellow", children: ' ⚠ ' + w.component + ': ' + w.warning }, i)))] })), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: 'Run: analyze select --session ' + result.sessionId }), _jsx(Text, { children: " " })] }), _jsx(Box, { borderStyle: "single", paddingX: 1, children: _jsx(Text, { dimColor: true, children: "Press Enter or q to exit" }) })] }));
63
+ .map((w, i) => (_jsx(Text, { color: "yellow", children: ' ⚠ ' + (w.warning.startsWith(w.component + ': ') ? w.warning : w.component + ': ' + w.warning) }, i)))] })), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: 'Run: analyze select --session ' + result.sessionId }), _jsx(Text, { children: " " })] }), _jsx(Box, { borderStyle: "single", paddingX: 1, children: _jsx(Text, { dimColor: true, children: "Press Enter or q to exit" }) })] }));
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.11.4-dev-build-7abd382.0",
3
+ "version": "2.11.4-dev-build-f3b5300.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "svelte": "^5.56.4",
38
38
  "ts-morph": "^27.0.2",
39
39
  "typescript": "^5.9.3",
40
- "@contentful/experience-design-system-types": "2.11.4-dev-build-7abd382.0"
40
+ "@contentful/experience-design-system-types": "2.11.4-dev-build-f3b5300.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@tsconfig/node24": "^24.0.3",