Skip to content

Docs: surface adopter constraints (registry.extend for new top-level types; refs index only object.*; dbImport/dialect required for DB-less projects) #194

Description

@dmealing

Three constraints surfaced while building a real consumer project (a CLI system monitor — all value objects, no database). Each was resolvable, but none was obvious from the docs.

1. metadata.root childRules are closed

Adding new top-level node types (e.g. custom adapter.* / probe.* subtypes via a provider) requires registry.extend; without it the model fails to load with ERR_CHILD_NOT_ALLOWED. Worth a short "defining custom top-level types" doc section.

2. Declarative reference resolution only indexes object.* nodes

Cross-references from a template/adapter to a non-object.* node aren't resolved by the built-in resolver and must be hand-walked in a provider validate hook. Adopters modeling references to non-object nodes should know this up front.

3. MetaobjectsGenConfig requires dbImport + dialect even when no DB code is generated

A project that declares only value objects (no write-through entities) generates zero DB / query / route code — yet omitting dbImport/dialect is a tsc type error, so they end up as dead-but-mandatory config.

Ask: make dbImport/dialect optional when the model has no write-through entities, or document that they're required regardless and inert for value-object-only models.

Context

All three came up in a from-scratch TypeScript adopter (the smon system monitor). Happy to link the repo/config if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions