@contentful/experience-design-system-cli 2.11.4-dev-build-355c69b.0 → 2.11.4-dev-build-86a5f6e.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
|
@@ -159,15 +159,25 @@ export function registerAnalyzeCommand(program) {
|
|
|
159
159
|
filterWarnings.push(`${component.name}: ${reviewNotes}`);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
+
// Preserve any extractor-level review reasons (e.g. `props-type-unresolved`
|
|
163
|
+
// from the Svelte parser) by merging them into the post-processing recompute.
|
|
164
|
+
// Without this, recomputing here clobbers the per-extractor signal.
|
|
165
|
+
const extractorReasons = component.reviewReasons ?? [];
|
|
162
166
|
const { confidence, reasons } = computeExtractionScore(component, {
|
|
163
|
-
additionalIssueCount: wrapperConfidenceToIssueCount(inspection.wrapperConfidence),
|
|
164
|
-
additionalReasons: inspection.reviewReasons,
|
|
167
|
+
additionalIssueCount: wrapperConfidenceToIssueCount(inspection.wrapperConfidence) + extractorReasons.length,
|
|
168
|
+
additionalReasons: [...extractorReasons, ...inspection.reviewReasons],
|
|
165
169
|
});
|
|
166
170
|
filteredComponents.push({
|
|
167
171
|
...component,
|
|
168
172
|
extractionConfidence: confidence,
|
|
169
173
|
reviewReasons: reasons,
|
|
170
|
-
needsReview: deriveNeedsReview(confidence) ||
|
|
174
|
+
needsReview: deriveNeedsReview(confidence) ||
|
|
175
|
+
inspection.wrapperConfidence >= 4 ||
|
|
176
|
+
inspection.keepDespiteZeroSurface ||
|
|
177
|
+
// An extractor-level type-resolution failure is a strong signal regardless
|
|
178
|
+
// of the otherwise-derived confidence threshold; force review.
|
|
179
|
+
extractorReasons.includes('props-type-unresolved') ||
|
|
180
|
+
(component.needsReview ?? false),
|
|
171
181
|
});
|
|
172
182
|
}
|
|
173
183
|
const validatedComponents = validateExtractedComponents(filteredComponents);
|
|
@@ -30,7 +30,7 @@ export async function extractSvelteComponents(filePaths, onProgress) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
33
|
-
warnings.push(
|
|
33
|
+
warnings.push(`${getSvelteComponentName(filePath)}: failed to extract from ${filePath} — ${e instanceof Error ? e.message : String(e)}`);
|
|
34
34
|
}
|
|
35
35
|
filesProcessed++;
|
|
36
36
|
onProgress?.({ filesProcessed, componentsFound });
|
|
@@ -44,6 +44,9 @@ export async function extractSvelteComponents(filePaths, onProgress) {
|
|
|
44
44
|
}
|
|
45
45
|
async function extractFromSvelteFile(filePath, source) {
|
|
46
46
|
const warnings = [];
|
|
47
|
+
// Derive the component name up front so warning messages can prefix it for
|
|
48
|
+
// TUI grouping, even when parsing fails.
|
|
49
|
+
const name = getSvelteComponentName(filePath);
|
|
47
50
|
let ast;
|
|
48
51
|
try {
|
|
49
52
|
ast = parseSvelte(source, { modern: true });
|
|
@@ -51,16 +54,15 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
51
54
|
catch (e) {
|
|
52
55
|
return {
|
|
53
56
|
component: null,
|
|
54
|
-
warnings: [
|
|
57
|
+
warnings: [`${name}: parse error in ${filePath}: ${e instanceof Error ? e.message : String(e)}`],
|
|
55
58
|
};
|
|
56
59
|
}
|
|
57
|
-
const name = getSvelteComponentName(filePath);
|
|
58
60
|
const instance = ast['instance'];
|
|
59
61
|
const moduleScript = ast['module'];
|
|
60
62
|
const fragment = ast['fragment'];
|
|
61
63
|
// Detect Svelte 4 export-let syntax — currently unsupported.
|
|
62
64
|
if (instance && hasV4ExportLetProps(instance)) {
|
|
63
|
-
warnings.push(
|
|
65
|
+
warnings.push(`${name}: Svelte 4 export let syntax not yet supported (${filePath}); see INTEG-4267 for v5-only scope and follow-up`);
|
|
64
66
|
return { component: null, warnings };
|
|
65
67
|
}
|
|
66
68
|
// Find the $props() call (Svelte 5 runes).
|
|
@@ -78,6 +80,7 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
78
80
|
instance: instance,
|
|
79
81
|
moduleScript,
|
|
80
82
|
filePath,
|
|
83
|
+
componentName: name,
|
|
81
84
|
source,
|
|
82
85
|
snippetLocals,
|
|
83
86
|
});
|
|
@@ -95,13 +98,13 @@ async function extractFromSvelteFile(filePath, source) {
|
|
|
95
98
|
}
|
|
96
99
|
else {
|
|
97
100
|
// No script block at all — nothing to extract on the props side.
|
|
98
|
-
warnings.push(`${
|
|
101
|
+
warnings.push(`${name}: no instance script block (${filePath}); no props extracted`);
|
|
99
102
|
}
|
|
100
103
|
// --- Slot extraction ---
|
|
101
104
|
const templateSlots = fragment ? extractTemplateSlots(fragment) : [];
|
|
102
105
|
const { slots, mixedWarning } = mergeSlots(snippetSlotsFromProps, templateSlots);
|
|
103
106
|
if (mixedWarning) {
|
|
104
|
-
warnings.push(`${
|
|
107
|
+
warnings.push(`${name}: mixed Snippet and <slot> usage detected (${filePath}); preferring Snippet entries`);
|
|
105
108
|
}
|
|
106
109
|
const component = {
|
|
107
110
|
name,
|
|
@@ -248,7 +251,7 @@ async function extractPropsFromCall(ctx) {
|
|
|
248
251
|
if (unresolved) {
|
|
249
252
|
const refLabel = describeAnnotationForUser(annotation);
|
|
250
253
|
const heritageNote = unresolved === 'partial-heritage' ? ' (heritage clauses extending unreachable types)' : '';
|
|
251
|
-
warnings.push(`${ctx.
|
|
254
|
+
warnings.push(`${ctx.componentName}: declared Props type ${refLabel} resolved to ${unresolved === 'empty' ? '0' : 'only Snippet-typed'} properties${heritageNote} (${ctx.filePath}) — possible cross-package extends or unreachable type. ` +
|
|
252
255
|
`See https://github.com/contentful/experience-design-system-sdk-public/pull/44 for context and partner workarounds.`);
|
|
253
256
|
additionalReasons.push('props-type-unresolved');
|
|
254
257
|
}
|
|
@@ -261,11 +264,11 @@ async function extractPropsFromCall(ctx) {
|
|
|
261
264
|
return { ...extractFromTypeMembersOnly(typeMembers), warnings, additionalReasons };
|
|
262
265
|
}
|
|
263
266
|
if (!unresolved) {
|
|
264
|
-
warnings.push(`${ctx.
|
|
267
|
+
warnings.push(`${ctx.componentName}: $props() called without destructuring (${ctx.filePath}); cannot extract individual props`);
|
|
265
268
|
}
|
|
266
269
|
return { props: [], snippetNames: new Set(), snippetSlots: [], warnings, additionalReasons };
|
|
267
270
|
}
|
|
268
|
-
warnings.push(`${ctx.
|
|
271
|
+
warnings.push(`${ctx.componentName}: unrecognized $props() binding pattern '${idType}' (${ctx.filePath})`);
|
|
269
272
|
return { props: [], snippetNames: new Set(), snippetSlots: [], warnings, additionalReasons };
|
|
270
273
|
}
|
|
271
274
|
/**
|
|
@@ -710,7 +713,7 @@ function extractFromDestructure(propsCall, ctx, typeMembers, warnings, additiona
|
|
|
710
713
|
// contract = the destructure list. (Type-members-only path runs separately for the
|
|
711
714
|
// `const props: Props = $props()` no-destructure case.)
|
|
712
715
|
if (dropsRest) {
|
|
713
|
-
warnings.push(`${ctx.
|
|
716
|
+
warnings.push(`${ctx.componentName}: rest element in $props() destructure dropped (${ctx.filePath}); cannot enumerate`);
|
|
714
717
|
}
|
|
715
718
|
return {
|
|
716
719
|
props: props.sort((a, b) => sortStable(a.name, b.name, propertyOrder(properties))),
|
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-
|
|
3
|
+
"version": "2.11.4-dev-build-86a5f6e.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-
|
|
40
|
+
"@contentful/experience-design-system-types": "2.11.4-dev-build-86a5f6e.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@tsconfig/node24": "^24.0.3",
|