@marktiderman/genesis-cli 1.22.0 → 1.22.1
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/README.md +5 -3
- package/dist/cli.js +6 -5
- package/dist/cli.js.map +1 -1
- package/dist/doctor.js +5 -4
- package/dist/doctor.js.map +1 -1
- package/dist/genesis-catalog.json +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/vite.js +5 -4
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1258,7 +1258,8 @@ if (!result.ok) throw new Error(formatReport(result));
|
|
|
1258
1258
|
A read-only check that an app's Figma app file covers its routes, so CI reports the drift and an
|
|
1259
1259
|
agent closes it (through the Figma MCP; this command never writes to Figma). The file layout it
|
|
1260
1260
|
expects is in [docs/FIGMA-GUIDELINES.md](../../docs/FIGMA-GUIDELINES.md): frames named by route,
|
|
1261
|
-
`<route> · <state>` for a state, and
|
|
1261
|
+
`<route> · <state>` for a state, and proposals in `Proposal · <status> · <slug>` sections on
|
|
1262
|
+
their route page (an older `Proposals` page is still read).
|
|
1262
1263
|
|
|
1263
1264
|
```json
|
|
1264
1265
|
{ "figma": { "file": "<file key>", "pages": { "web": "<page name>", "native": "<page name>" }, "proposalsPage": "Proposals" } }
|
|
@@ -1305,8 +1306,9 @@ hotspot is any node in it with `interactions[].actions[]` of `type: "NODE"` and
|
|
|
1305
1306
|
(`(tabs)/settings`) or names the same URL (`settings`).
|
|
1306
1307
|
|
|
1307
1308
|
**The report.** A summary (routes, route frames, covered routes and percent, hotspots, missing),
|
|
1308
|
-
then: routes with no frame; frames on a route page with no route
|
|
1309
|
-
the route);
|
|
1309
|
+
then: routes with no frame; frames on a route page with no route, outside a proposal section (put
|
|
1310
|
+
them in one, or add the route); proposals by section, from the route pages' `Proposal ·`
|
|
1311
|
+
sections and the Proposals page; navigation in a route file whose screen has a
|
|
1310
1312
|
frame but no hotspot to the target's frame; hotspots whose destination frame has no route;
|
|
1311
1313
|
`// figma:` ids that don't match; and navigation that isn't a string literal (not checked).
|
|
1312
1314
|
|
package/dist/cli.js
CHANGED
|
@@ -9104,7 +9104,8 @@ async function readFigma(config, token, fetchImpl = fetch, timeoutMs = FIGMA_TIM
|
|
|
9104
9104
|
}
|
|
9105
9105
|
function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
9106
9106
|
const platformOf = (page) => config.pages.web === page ? "web" : config.pages.native === page ? "native" : void 0;
|
|
9107
|
-
const
|
|
9107
|
+
const inProposal = (f) => /^Proposal\s*·/.test(f.section ?? "");
|
|
9108
|
+
const routeFrames = figma.frames.filter((f) => platformOf(f.page) && !inProposal(f));
|
|
9108
9109
|
const framesFor = (r) => routeFrames.filter((f) => platformOf(f.page) === r.platform && (sameScreen(f.route, r.route) || r.route === "index" && f.route === "/"));
|
|
9109
9110
|
const byId = new Map(figma.frames.map((f) => [f.id, f]));
|
|
9110
9111
|
const framed = new Set(routes.flatMap((r) => framesFor(r).map((f) => f.id)));
|
|
@@ -9112,7 +9113,7 @@ function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
|
9112
9113
|
const routesWithoutFrame = routes.filter((r) => framesFor(r).length === 0);
|
|
9113
9114
|
const framesWithoutRoute = routeFrames.filter((f) => !framed.has(f.id));
|
|
9114
9115
|
const proposals = {};
|
|
9115
|
-
for (const f of figma.frames.filter((x) => x.page === config.proposalsPage)) (proposals[f.section ?? "(no section)"] ??= []).push(f);
|
|
9116
|
+
for (const f of figma.frames.filter((x) => x.page === config.proposalsPage || platformOf(x.page) && inProposal(x))) (proposals[f.section ?? "(no section)"] ??= []).push(f);
|
|
9116
9117
|
const missingHotspots = [];
|
|
9117
9118
|
const seen = /* @__PURE__ */ new Set();
|
|
9118
9119
|
for (const t of targets) {
|
|
@@ -9133,11 +9134,11 @@ function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
|
9133
9134
|
for (const h of figma.hotspots) {
|
|
9134
9135
|
const from = byId.get(h.from);
|
|
9135
9136
|
const to = byId.get(h.to);
|
|
9136
|
-
if (from && to && platformOf(to.page) && !framed.has(to.id)) deadHotspots.push({ from, to });
|
|
9137
|
+
if (from && to && platformOf(to.page) && !inProposal(to) && !framed.has(to.id)) deadHotspots.push({ from, to });
|
|
9137
9138
|
}
|
|
9138
9139
|
const idMismatches = routes.filter((r) => r.figmaId && !framesFor(r).some((f) => f.id === r.figmaId)).map((r) => ({ ...r, frames: framesFor(r).map((f) => f.id) }));
|
|
9139
9140
|
const wantedPages = [...Object.values(config.pages), config.proposalsPage];
|
|
9140
|
-
const missingPages = wantedPages.filter((p) => !figma.pages.includes(p));
|
|
9141
|
+
const missingPages = wantedPages.filter((p) => p !== config.proposalsPage && !figma.pages.includes(p));
|
|
9141
9142
|
const uncheckedNavigation = dynamicTargets.filter((t) => routes.some((r) => r.file === t.file));
|
|
9142
9143
|
return {
|
|
9143
9144
|
file: config.file,
|
|
@@ -9178,7 +9179,7 @@ function formatCoverage(r) {
|
|
|
9178
9179
|
};
|
|
9179
9180
|
if (r.missingPages.length) lines.push("", `Pages not in the file: ${r.missingPages.join(", ")}`);
|
|
9180
9181
|
table("Routes with no frame", ["platform", "route", "file"], r.routesWithoutFrame.map((x) => [x.platform, x.route, x.file]));
|
|
9181
|
-
table("Frames with no route (
|
|
9182
|
+
table("Frames with no route (put them in a Proposal section, or add the route)", ["page", "frame", "id"], r.framesWithoutRoute.map((f) => [f.page, f.name, f.id]));
|
|
9182
9183
|
table("Navigation with no hotspot", ["from", "to", "at"], r.missingHotspots.map((m) => [m.from, `${m.to}${m.targetHasFrame ? "" : " (no frame)"}`, `${m.file}:${m.line}`]));
|
|
9183
9184
|
table("Hotspots to a frame with no route", ["from", "to"], r.deadHotspots.map((d) => [d.from.name, d.to.name]));
|
|
9184
9185
|
table("figma: ids that don't match the route's frame", ["route", "comment", "frames"], r.idMismatches.map((m) => [m.route, m.figmaId, m.frames.join(", ") || "none"]));
|