@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.
@@ -144,7 +144,7 @@
144
144
  "version": "0.10.18"
145
145
  },
146
146
  "@marktiderman/genesis-cli": {
147
- "version": "1.22.0"
147
+ "version": "1.22.1"
148
148
  },
149
149
  "@marktiderman/genesis-media": {
150
150
  "version": "0.2.0"
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 routeFrames = figma.frames.filter((f) => platformOf(f.page));
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 (move to Proposals, or add the route)", ["page", "frame", "id"], r.framesWithoutRoute.map((f) => [f.page, f.name, f.id]));
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"]));