@topogram/cli 0.3.56 → 0.3.57
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/package.json
CHANGED
|
@@ -368,7 +368,7 @@ function uiAgentPacketForProjection(graph, projection) {
|
|
|
368
368
|
screenId: route.screenId,
|
|
369
369
|
path: route.path
|
|
370
370
|
})),
|
|
371
|
-
widgets: (ownerProjection.widgetBindings || []).map((usage) => widgetUsagePacket(usage)),
|
|
371
|
+
widgets: (ownerProjection.widgetBindings || []).map((usage) => widgetUsagePacket(usage, ownerProjection)),
|
|
372
372
|
designTokens: designIntentPacket(ownerProjection),
|
|
373
373
|
requiredGates: uiRequiredGates(projection.id)
|
|
374
374
|
};
|
|
@@ -387,7 +387,7 @@ function uiAgentPacketForWidget(graph, widget, projectionIds) {
|
|
|
387
387
|
type: projectionType,
|
|
388
388
|
ownership: projectionType === "ui_contract" ? "owner" : "concrete"
|
|
389
389
|
},
|
|
390
|
-
usage: widgetUsagePacket(usage),
|
|
390
|
+
usage: widgetUsagePacket(usage, projection),
|
|
391
391
|
designTokens: designIntentPacket(projection)
|
|
392
392
|
});
|
|
393
393
|
projectionSet.add(projection.id);
|
|
@@ -428,10 +428,31 @@ function sharedUiProjectionFor(graph, projection) {
|
|
|
428
428
|
return null;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
function widgetUsagePacket(usage) {
|
|
431
|
+
function widgetUsagePacket(usage, projection = null) {
|
|
432
|
+
const screen = (projection?.uiScreens || []).find((entry) => entry.id === usage.screenId) || null;
|
|
433
|
+
const region = (projection?.uiScreenRegions || []).find((entry) =>
|
|
434
|
+
entry.screenId === usage.screenId && entry.region === usage.region
|
|
435
|
+
) || null;
|
|
432
436
|
return {
|
|
433
437
|
screenId: usage.screenId || null,
|
|
438
|
+
screen: screen
|
|
439
|
+
? {
|
|
440
|
+
id: screen.id,
|
|
441
|
+
kind: screen.kind || null,
|
|
442
|
+
title: screen.title || screen.id
|
|
443
|
+
}
|
|
444
|
+
: null,
|
|
434
445
|
region: usage.region || null,
|
|
446
|
+
regionContract: region
|
|
447
|
+
? {
|
|
448
|
+
name: region.region || null,
|
|
449
|
+
pattern: region.pattern || null,
|
|
450
|
+
placement: region.placement || null,
|
|
451
|
+
title: region.title || null,
|
|
452
|
+
state: region.state || null,
|
|
453
|
+
variant: region.variant || null
|
|
454
|
+
}
|
|
455
|
+
: null,
|
|
435
456
|
widgetId: usage.widget?.id || null,
|
|
436
457
|
dataBindings: (usage.dataBindings || []).map((binding) => ({
|
|
437
458
|
prop: binding.prop || null,
|
|
@@ -222,6 +222,7 @@ function buildReactGenerationCoverage(contract, files, routeScreens) {
|
|
|
222
222
|
const marker = widgetId ? `data-topogram-widget="${widgetId}"` : null;
|
|
223
223
|
const support = reactWidgetUsageSupport(usage, contract.widgets);
|
|
224
224
|
const usageRendered = Boolean(marker && contents.includes(marker));
|
|
225
|
+
const status = !support.supported ? "unsupported" : usageRendered ? "rendered" : "failed";
|
|
225
226
|
if (widgetId && rendered && !support.supported) {
|
|
226
227
|
diagnostics.push({
|
|
227
228
|
code: "widget_pattern_not_supported",
|
|
@@ -238,7 +239,7 @@ function buildReactGenerationCoverage(contract, files, routeScreens) {
|
|
|
238
239
|
if (widgetId && rendered && !usageRendered) {
|
|
239
240
|
diagnostics.push({
|
|
240
241
|
code: "widget_usage_not_rendered",
|
|
241
|
-
severity: "
|
|
242
|
+
severity: "error",
|
|
242
243
|
screen: screen.id,
|
|
243
244
|
route: screen.route,
|
|
244
245
|
region: usage.region || null,
|
|
@@ -252,6 +253,7 @@ function buildReactGenerationCoverage(contract, files, routeScreens) {
|
|
|
252
253
|
region: usage.region || null,
|
|
253
254
|
pattern: support.pattern || null,
|
|
254
255
|
supported: support.supported,
|
|
256
|
+
status,
|
|
255
257
|
rendered: usageRendered,
|
|
256
258
|
marker
|
|
257
259
|
};
|
|
@@ -194,6 +194,13 @@ function buildSvelteKitGenerationCoverage(contract, files, implementationScreenI
|
|
|
194
194
|
const marker = widgetId ? `data-topogram-widget="${widgetId}"` : null;
|
|
195
195
|
const support = svelteKitWidgetUsageSupport(usage, contract.widgets);
|
|
196
196
|
const usageRendered = Boolean(marker && contents.includes(marker));
|
|
197
|
+
const status = !support.supported
|
|
198
|
+
? "unsupported"
|
|
199
|
+
: usageRendered
|
|
200
|
+
? "rendered"
|
|
201
|
+
: renderer === "implementation"
|
|
202
|
+
? "implementation_owned"
|
|
203
|
+
: "failed";
|
|
197
204
|
if (widgetId && rendered && renderer !== "implementation" && !support.supported) {
|
|
198
205
|
diagnostics.push({
|
|
199
206
|
code: "widget_pattern_not_supported",
|
|
@@ -210,7 +217,7 @@ function buildSvelteKitGenerationCoverage(contract, files, implementationScreenI
|
|
|
210
217
|
if (widgetId && rendered && !usageRendered) {
|
|
211
218
|
diagnostics.push({
|
|
212
219
|
code: "widget_usage_not_rendered",
|
|
213
|
-
severity: "warning",
|
|
220
|
+
severity: renderer === "implementation" ? "warning" : "error",
|
|
214
221
|
screen: screen.id,
|
|
215
222
|
route: screen.route,
|
|
216
223
|
region: usage.region || null,
|
|
@@ -224,6 +231,7 @@ function buildSvelteKitGenerationCoverage(contract, files, implementationScreenI
|
|
|
224
231
|
region: usage.region || null,
|
|
225
232
|
pattern: support.pattern || null,
|
|
226
233
|
supported: support.supported,
|
|
234
|
+
status,
|
|
227
235
|
rendered: usageRendered,
|
|
228
236
|
marker
|
|
229
237
|
};
|