@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/dist/index.js
CHANGED
|
@@ -7658,7 +7658,8 @@ async function readFigma(config, token, fetchImpl = fetch, timeoutMs = FIGMA_TIM
|
|
|
7658
7658
|
}
|
|
7659
7659
|
function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
7660
7660
|
const platformOf = (page) => config.pages.web === page ? "web" : config.pages.native === page ? "native" : void 0;
|
|
7661
|
-
const
|
|
7661
|
+
const inProposal = (f) => /^Proposal\s*·/.test(f.section ?? "");
|
|
7662
|
+
const routeFrames = figma.frames.filter((f) => platformOf(f.page) && !inProposal(f));
|
|
7662
7663
|
const framesFor = (r) => routeFrames.filter((f) => platformOf(f.page) === r.platform && (sameScreen(f.route, r.route) || r.route === "index" && f.route === "/"));
|
|
7663
7664
|
const byId = new Map(figma.frames.map((f) => [f.id, f]));
|
|
7664
7665
|
const framed = new Set(routes.flatMap((r) => framesFor(r).map((f) => f.id)));
|
|
@@ -7666,7 +7667,7 @@ function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
|
7666
7667
|
const routesWithoutFrame = routes.filter((r) => framesFor(r).length === 0);
|
|
7667
7668
|
const framesWithoutRoute = routeFrames.filter((f) => !framed.has(f.id));
|
|
7668
7669
|
const proposals = {};
|
|
7669
|
-
for (const f of figma.frames.filter((x) => x.page === config.proposalsPage)) (proposals[f.section ?? "(no section)"] ??= []).push(f);
|
|
7670
|
+
for (const f of figma.frames.filter((x) => x.page === config.proposalsPage || platformOf(x.page) && inProposal(x))) (proposals[f.section ?? "(no section)"] ??= []).push(f);
|
|
7670
7671
|
const missingHotspots = [];
|
|
7671
7672
|
const seen = /* @__PURE__ */ new Set();
|
|
7672
7673
|
for (const t of targets) {
|
|
@@ -7687,11 +7688,11 @@ function compare(config, routes, targets, figma, dynamicTargets = []) {
|
|
|
7687
7688
|
for (const h of figma.hotspots) {
|
|
7688
7689
|
const from = byId.get(h.from);
|
|
7689
7690
|
const to = byId.get(h.to);
|
|
7690
|
-
if (from && to && platformOf(to.page) && !framed.has(to.id)) deadHotspots.push({ from, to });
|
|
7691
|
+
if (from && to && platformOf(to.page) && !inProposal(to) && !framed.has(to.id)) deadHotspots.push({ from, to });
|
|
7691
7692
|
}
|
|
7692
7693
|
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) }));
|
|
7693
7694
|
const wantedPages = [...Object.values(config.pages), config.proposalsPage];
|
|
7694
|
-
const missingPages = wantedPages.filter((p) => !figma.pages.includes(p));
|
|
7695
|
+
const missingPages = wantedPages.filter((p) => p !== config.proposalsPage && !figma.pages.includes(p));
|
|
7695
7696
|
const uncheckedNavigation = dynamicTargets.filter((t) => routes.some((r) => r.file === t.file));
|
|
7696
7697
|
return {
|
|
7697
7698
|
file: config.file,
|
|
@@ -7732,7 +7733,7 @@ function formatCoverage(r) {
|
|
|
7732
7733
|
};
|
|
7733
7734
|
if (r.missingPages.length) lines.push("", `Pages not in the file: ${r.missingPages.join(", ")}`);
|
|
7734
7735
|
table("Routes with no frame", ["platform", "route", "file"], r.routesWithoutFrame.map((x) => [x.platform, x.route, x.file]));
|
|
7735
|
-
table("Frames with no route (
|
|
7736
|
+
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]));
|
|
7736
7737
|
table("Navigation with no hotspot", ["from", "to", "at"], r.missingHotspots.map((m) => [m.from, `${m.to}${m.targetHasFrame ? "" : " (no frame)"}`, `${m.file}:${m.line}`]));
|
|
7737
7738
|
table("Hotspots to a frame with no route", ["from", "to"], r.deadHotspots.map((d) => [d.from.name, d.to.name]));
|
|
7738
7739
|
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"]));
|