Commit 6d60744
feat(docs-site): HTML documentation-site generator wired as meta docs --site (#171)
* docs(spec): docs-site — HTML documentation site as a meta docs --site surface (3-phase design)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(plan): docs-site Phase 1 — port as @metaobjectsdev/docs-site + meta docs --site (3 tasks)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(docs-site): port HTML documentation-site generator as @metaobjectsdev/docs-site
Verbatim port of the model-agnostic generator (loader, link-graph, page builders,
mermaid emitters, site orchestrator, link-check) + templates + assets + generic acme
fixture + tests, wired as a workspace package. 29 tests pass; golden byte-identical.
Phase 1 of docs-site (meta docs --site); CLI wiring in a follow-up task.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* build(docs-site): strict-mode type fixes + confirm dist build/template resolution
The monorepo's tsconfig.base.json is stricter than the source bun project
(noUncheckedIndexedAccess + exactOptionalPropertyTypes). Applied minimal
type-only fixes so `tsc -p .` (build) and typecheck pass: non-null assertions
on in-bounds array/match accesses, default-destructure on guaranteed splits,
and `| undefined` on the optional interface props that receive explicit
undefined. No generator behavior change — golden byte-identical, 29 tests pass.
Verified the BUILT dist package resolves templates/assets via
resolve(import.meta.dir, "../templates") from dist/ (18 pages, 0 dangling on
the acme fixture). bun.lock registers the workspace package.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(cli): meta docs --site surface — emit the HTML documentation site
Adds a `--site` surface to `meta docs` that renders the browsable HTML
documentation site via @metaobjectsdev/docs-site, under `<out>/site`.
- `--site` is additive: combined with --model/--api it emits both the markdown
surfaces AND the site; when it is the ONLY surface flag, markdown emission is
suppressed (parseDocsArgs passes an explicit empty markdown surface list,
which resolveDocsConfig honors via `??`).
- The site has its OWN model loader (docs-site loadModel), so a site-only run
returns before the sdk loadMemory/GenContext path — decoupled, one fewer
failure surface, and no gen config required.
- `--templates <dir>` is threaded as the docs-site templatesDir override (the
scaffold-and-own seam; a consumer template of the same basename wins).
- Help text (top-level + `docs --help` FLAGS) documents --site/--model/--api/
--metamodel; cli.test.ts help snapshot updated for the one changed line.
- docs-command.test.ts covers site-only (markdown suppressed), --site --model
additive, and site determinism.
CLI typecheck green; 361 pass / 0 fail.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(spec): docs-site Phase 2 — consolidate the graph onto the shared relationship IR
Design for re-sourcing the site's relationship edges from the metadata
relationship PRIMITIVES (deriveM2MFields / findReferenceBetween /
MetaRelationship) rather than the lossy buildApiModel output or the
Drizzle-shaped buildRelationMap. Keeps LinkGraph as the graph shell; enriches
relationship edges (M:N-through-junction with the junction kept as a node,
belongs-to direction, directed + symmetric self-joins, onDelete); makes
structural edges inheritance-aware via resolved accessors; dedupes
relationship-vs-bare-FK. Extends the acme fixture (golden regenerates);
additive mermaid connector/dashed-M:N rendering; presentation + gates preserved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(plan): docs-site Phase 2 implementation plan (6 tasks, TDD)
Task-by-task plan: extend the acme fixture (M:N + directed/symmetric self-joins
+ onDelete); extend Ref + belongs-to enrichment + relationship-vs-FK dedupe;
M:N-through-junction edges via deriveM2MFields; }o--o{ / dashed-flowchart
rendering with junction kept as a node; genericize CURATED palette keys; full
verification. Golden regenerated per output-affecting task; determinism +
link-check + typecheck gates at each step.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test(docs-site): extend acme fixture with M:N + directed/symmetric self-joins + onDelete
Adds Product, OrderProduct, CustomerReferral, CustomerFriend to the acme::shop
fixture: Order.products (M:N via OrderProduct), Order.customer gains
@onDelete: cascade, Customer.referrals (directed self-join via
CustomerReferral, @sourceRefField: referrerId), Customer.friends (symmetric
self-join via CustomerFriend). Golden regenerated (4 new pages), determinism
verified via two independent regenerations (byte-identical).
Also updates load.test.ts and package-index-data.test.ts hardcoded
object name/count lists — pure structural fallout of the 4 new fixture
entities, unrelated to relationship-edge derivation.
link-graph.test.ts's pre-existing backlink/degree assertions on Customer
(refsTo length/degree == 3) are left failing on purpose: they assume the
FK-vs-relationship dedupe that Task 2 of this plan implements.
* feat(docs-site): enrich belongs-to relationship edges (cardinality/onDelete/subtype) + dedupe the bare FK
* fix(metadata): resolve M:N @through junction by FQN as well as bare name (deriveM2MFields)
deriveM2MFields resolved the @through junction via root.findObject, which
matches by bare object name only. Since @through is conventionally written
fully-qualified (package::Name) and the loader's own FQN-aware validation
(refMatchesObject) already accepts that form, every FQN @through passed
loading but then threw M2MDerivationError at derivation time, silently
dropping the M:N edge for any caller that swallows the error.
Fall back to the bare suffix after the last "::" when the direct lookup
misses, mirroring the existing resolvedTargetPkField idiom in
meta-identity.ts. Adds a regression test exercising a fully-qualified
@through.
* feat(docs-site): derive M:N through-junction edges (hetero/directed/symmetric) via deriveM2MFields
Replaces the Task 2 temporary addM2mEdge stub with the real derivation:
resolves the junction FQN via resolveRef, then calls deriveM2MFields to
compute sourceJoinField/targetJoinField (hetero match-by-target-entity,
directed self-join via @sourceRefField, symmetric self-join in declaration
order). A derivation failure (ambiguous self-join) skips the logical edge
rather than throwing out of generation — the junction's two FK edges still
render.
Unblocked by the upstream deriveM2MFields FQN-junction-lookup fix in the
metadata package (prior commit) — @through is conventionally written fully
qualified, which the bare-name-only lookup could not resolve.
* feat(docs-site): render M:N with }o--o{ (ER) + dashed flowchart edge; label onDelete/junction
* chore(docs-site): drop the hardcoded domain→color map; hash every package into a neutral palette
The CURATED map keyed diagram colors by domain-specific package names carried
over from the source project — a soft vocabulary leak in a public repo. Replace
it with a plain fixed PALETTE array and hash every package's leaf name into a
slot (the same deterministic slot the previously-unmapped packages already
used). No hardcoded domain vocabulary remains, and the fixture golden is
byte-identical (packages that matched a curated key now hash to an equivalent
slot).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(docs-site): explain the MetaData→MetaObject cast in the relationship derivation
Addresses the Task 2 review's Minor: the double-cast (as unknown as MetaObject)
now carries a comment noting the dn.kind === "object" runtime guarantee and why
the unknown bridge is required for tsc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(spec): docs-site Phase 3 — scaffold-and-own + rollout program
Sub-project A (this spec): meta docs --scaffold-site copies templates+assets into
codegen/docs-site/ (ADR-0034 write-only-if-absent); assetsDir override so owned
CSS/JS are used; auto-detect on meta docs --site; docs; validation via the real
meta CLI (scaffold→edit→regen→owned-copy-wins) + a scale/parity smoke against a
substantial model. Documents the sequenced rollout: cross-port deriveM2MFields
FQN sync (Python/Java in-repo), prerelease, and two downstream adopter conversions.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(plan): docs-site Phase 3 sub-project A implementation plan (4 tasks, TDD)
Task-by-task: assetsDir override in generateSite; export
SITE_TEMPLATE_NAMES/SITE_ASSET_NAMES/readSiteFile; meta docs --scaffold-site
(copy to codegen/docs-site, write-only-if-absent) + auto-detect owned copies on
--site; docs + real-CLI scaffold→edit→owned-wins validation + a scale smoke
against an in-repo conformance model. Determinism/link-check/typecheck gates per
task.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(docs-site): assetsDir override in generateSite (owned CSS/JS wins over bundled)
* feat(docs-site): export SITE_TEMPLATE_NAMES/SITE_ASSET_NAMES/readSiteFile for scaffolding
* feat(cli): meta docs --scaffold-site + auto-detect owned templates/assets on --site
* docs(docs-site): README + own-your-theme workflow; drop unused emitSite param + test import
Adds the docs-site README documenting `meta docs --scaffold-site` (copy templates+
assets into codegen/docs-site/, edit, regenerate — owned copies win, engine stays a
dep). Folds in two review Minors: emitSite's now-unused `flags` param dropped (+ both
call sites), and an unused mkdirSync import removed from the assetsDir test.
Validated end-to-end via the real meta CLI: --scaffold-site writes 11 files; an edited
owned template AND asset both win in the output; re-scaffold reports 0 created / 11
preserved (never clobbers); and generateSite renders a real in-repo conformance model
to 20 pages with 0 dangling links.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* no-mistakes(review): fix Node import.meta.dir crash and wire docs-site core config
* no-mistakes(document): sync docs for docs-site package and --site CLI flags
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5e809f8 commit 6d60744
96 files changed
Lines changed: 7570 additions & 8 deletions
File tree
- docs
- superpowers
- plans
- specs
- server/typescript/packages
- cli
- src
- commands
- test
- __snapshots__
- docs-site
- assets
- src
- builders
- templates
- test
- fixture
- golden
- acme
- ai
- common
- shop
- assets
- input/acme
- ai
- common
- shop
- metadata
- src/core/relationship
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
0 commit comments