Skip to content

FE-1447: Emit layer facts and relations as structured data with card components - #9248

Draft
kube wants to merge 1 commit into
cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisiblefrom
cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data
Draft

FE-1447: Emit layer facts and relations as structured data with card components#9248
kube wants to merge 1 commit into
cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisiblefrom
cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data

Conversation

@kube

@kube kube commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Implements FE-1447: generated layer pages baked their facts into MDX prose (the Package/Layer id/Files/Lines line, "Declared in", and the "Depends on" / "Depended on by" heading-plus-table blocks), so a host could not restyle them. The pages now render two components shipped in the bundle, receiving structured props.

Top of stack #9226, on FE-1443 (its "Declared" edge tables fold into the relations component).

🔗 Related links

  • FE-1447 (internal): this PR
  • FE-1443 (internal): the declared edges this renders as dashed protocol pills

🔍 What does this change?

libs/@local/petrinaut-arch-docs:

  • Three shipped components, emitted into the bundle's components/ beside authored ones:
    • LayerFacts: an aligned Package / Layer id / Files / Lines grid with a Declared-in footer link, as one compact bordered card. The role reads as the page's plain lead paragraph above it, outside the card.
    • LayerRelations: both directions side by side (single column under 640px) with the column headings top-aligned, layer names left and count/pkg badges pinned right, and a dashed protocol pill on its own line for declared edges.
    • LayerSource: the file count and source root as a matching card, replacing the old "Source" heading and sentence.
  • Styling: plain CSS, colors derived from currentColor via color-mix, so both Starlight themes work without theme-specific rules.
  • Emission (mdx.ts): pages import the components by page-relative path and pass props as JSON expressions (JSX string attributes cannot escape a " in a role). One relation entry per line keeps diffs reviewable. Pages without edges emit no relations block. architecture.md keeps plain text.
  • The generator's tsconfig excludes the component sources: the Astro build compiles them, same as authored content/components/.

Contract note, documented in the README: hosts now need a React-capable MDX pipeline for generated layer pages, not only for authored pages.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies a workspace but not a publishable library

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • mdx.test.ts: import-path depth per page, structured props, declared-edge entries in the relations props, and the removal of the old heading-plus-table sections.
  • lint:arch-docs and turbo run build --filter @apps/petrinaut-docs prove the emitted MDX compiles and renders.

❓ How to test this?

  1. turbo run dev --filter @apps/petrinaut-docs
  2. Open any layer page (for example architecture/bindings): the facts card replaces the header prose, the relations card shows both directions, and the declared edge to cli renders as a dashed protocol pill.

🤖 Generated with Claude Code

@kube kube self-assigned this Aug 19, 2026
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 20, 2026 10:21am
petrinaut Ready Ready Preview Aug 20, 2026 10:21am
petrinaut-docs Ready Ready Preview Aug 20, 2026 10:21am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 20, 2026 10:21am

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/apps labels Aug 19, 2026
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 64bebcf to 56e9cf5 Compare August 19, 2026 14:35
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 19, 2026 14:35 Inactive
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 56e9cf5 to 15d1a3b Compare August 19, 2026 15:49
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 19, 2026 15:49 Inactive
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 15d1a3b to 8a29a39 Compare August 19, 2026 16:06
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 8a29a39 to a3d34a5 Compare August 19, 2026 16:15
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from a3d34a5 to 451917b Compare August 19, 2026 16:22
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 451917b to 0e2fd9c Compare August 19, 2026 16:47
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from a21f49e to 63d8388 Compare August 19, 2026 21:44
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 63d8388 to 1e0249a Compare August 19, 2026 21:53
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 1e0249a to e45990f Compare August 19, 2026 22:16
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from e45990f to 5c53235 Compare August 19, 2026 22:54
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 5c53235 to 5317791 Compare August 19, 2026 22:56
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 5317791 to 1d593c7 Compare August 19, 2026 23:45
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from 1d593c7 to fee271e Compare August 20, 2026 00:26
@kube
kube force-pushed the cf/fe-1447-arch-docs-emit-layer-facts-and-relations-as-structured-data branch from fee271e to 3513732 Compare August 20, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant