@topogram/cli 0.3.50 → 0.3.51
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 +1 -1
- package/src/validator/index.js +42 -0
package/package.json
CHANGED
package/src/validator/index.js
CHANGED
|
@@ -2352,6 +2352,47 @@ function validateProjectionUiAppShell(errors, statement, fieldMap) {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
2354
|
|
|
2355
|
+
const SHARED_UI_SEMANTIC_BLOCKS = [
|
|
2356
|
+
"ui_screens",
|
|
2357
|
+
"ui_collections",
|
|
2358
|
+
"ui_actions",
|
|
2359
|
+
"ui_visibility",
|
|
2360
|
+
"ui_lookups",
|
|
2361
|
+
"ui_app_shell",
|
|
2362
|
+
"ui_navigation",
|
|
2363
|
+
"ui_screen_regions"
|
|
2364
|
+
];
|
|
2365
|
+
|
|
2366
|
+
function validateProjectionUiOwnership(errors, statement, fieldMap) {
|
|
2367
|
+
if (statement.kind !== "projection") {
|
|
2368
|
+
return;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
const platform = symbolValue(getFieldValue(statement, "platform"));
|
|
2372
|
+
for (const key of SHARED_UI_SEMANTIC_BLOCKS) {
|
|
2373
|
+
const field = fieldMap.get(key)?.[0];
|
|
2374
|
+
if (!field || field.value.type !== "block") {
|
|
2375
|
+
continue;
|
|
2376
|
+
}
|
|
2377
|
+
if (platform !== "ui_shared") {
|
|
2378
|
+
pushError(
|
|
2379
|
+
errors,
|
|
2380
|
+
`Projection ${statement.id} ${key} belongs on shared UI projections; concrete UI projections may define ui_routes and platform surface hints only`,
|
|
2381
|
+
field.loc
|
|
2382
|
+
);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
const routesField = fieldMap.get("ui_routes")?.[0];
|
|
2387
|
+
if (routesField?.value.type === "block" && !["ui_web", "ui_ios"].includes(platform || "")) {
|
|
2388
|
+
pushError(
|
|
2389
|
+
errors,
|
|
2390
|
+
`Projection ${statement.id} ui_routes belongs on concrete UI projections; shared UI projections own semantic screens and regions`,
|
|
2391
|
+
routesField.loc
|
|
2392
|
+
);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2355
2396
|
function validateProjectionUiDesign(errors, statement, fieldMap) {
|
|
2356
2397
|
if (statement.kind !== "projection") {
|
|
2357
2398
|
return;
|
|
@@ -3499,6 +3540,7 @@ export function validateWorkspace(workspaceAst) {
|
|
|
3499
3540
|
validateProjectionHttpDownload(errors, statement, fieldMap, registry);
|
|
3500
3541
|
validateProjectionHttpAuthz(errors, statement, fieldMap, registry);
|
|
3501
3542
|
validateProjectionHttpCallbacks(errors, statement, fieldMap, registry);
|
|
3543
|
+
validateProjectionUiOwnership(errors, statement, fieldMap);
|
|
3502
3544
|
validateProjectionUiScreens(errors, statement, fieldMap, registry);
|
|
3503
3545
|
validateProjectionUiCollections(errors, statement, fieldMap, registry);
|
|
3504
3546
|
validateProjectionUiActions(errors, statement, fieldMap, registry);
|