feat(docs-site): thread consumer providers into the meta docs --site surface#172
Merged
Merged
Conversation
The markdown docs surfaces load metadata via the sdk loadMemory({ providers }),
so `meta docs --model/--api` already honor a project's metaobjects.config.ts
`providers` (custom field/view/object subtypes). The HTML `--site` surface has
its OWN loader (docs-site's loadModel) with a hard-coded registry, so a model
using a consumer subtype (e.g. a custom `view.*` on a field) failed there alone
with `Unknown type "…" — not registered`, even though the config declared its
provider and every other surface resolved it.
- docs-site: loadModel(sourceDirs, extraProviders = []) composes the consumer
providers AFTER the built-in bundle (core-types/db/doc/prompt/ui), mirroring
loadMemory's `providers`; SiteOptions gains `extraProviders`; re-export
MetaDataTypeProvider. Additive — default none, so config-less callers are
unchanged (acme golden byte-identical).
- cli: emitSite threads the configProviders the docs command already loads from
metaobjects.config.ts into generateSite (both the site-only and the additive-
with-markdown paths), so `meta docs --site` resolves custom subtypes the same
way the markdown surfaces do.
Tests: docs-site provider-extension (a custom field subtype fails to load
without its provider, then resolves via extraProviders and renders a site); cli
docs-command reuses the existing custom-type project fixture to prove
`meta docs --site` now honors config providers. docs-site + cli typecheck clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
meta docs --model/--api(markdown surfaces) load metadata via the sdkloadMemory({ providers }), so they already honor a project'smetaobjects.config.tsproviders— custom field/view/object subtypes. The HTML--sitesurface has its own loader (docs-site'sloadModel) with ahard-coded registry, so a model using a consumer subtype (e.g. a custom
view.*on a field) failed on
--sitealone withUnknown type "…" — not registered,even though the config declared its provider and every other surface resolved it.
Found by dogfooding a real ~660-page downstream model whose admin-UI metadata
carries custom
view.*subtypes: markdown docs rendered,--sitethrew.Fix
loadModel(sourceDirs, extraProviders = [])composes consumerproviders AFTER the built-in bundle (core-types/db/doc/prompt/ui), mirroring
loadMemory'sproviders;SiteOptionsgainsextraProviders; re-exportMetaDataTypeProvider. Additive — default none, so config-less callers areunchanged (acme golden byte-identical).
emitSitethreads theconfigProvidersthe docs command alreadyloads from
metaobjects.config.tsintogenerateSite(both the site-only andthe additive-with-markdown paths), so
meta docs --siteresolves customsubtypes the same way the markdown surfaces do.
Tests
docs-site/test/provider-extension.test.ts— a custom field subtype fails toload without its provider, then resolves via
extraProvidersand renders a site.cli/test/docs-command.test.ts— reuses the existing custom-type projectfixture to prove
meta docs --sitenow honors config providers (end-to-endthrough the real command).
build green.
🤖 Generated with Claude Code