You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli,python): --provider hook to load a consumer provider; document custom providers (#158)
The metadata loaders already accept consumer providers in every language, but the
Python CLI's _load_root → from_directory convenience used core providers only, so
'metaobjects gen/verify/docs' could not load an app's custom subtype. Add a
repeatable '--provider module:symbol' that imports the consumer Provider (or a
list, or a zero-arg factory) and composes it on top of core_providers — parity
with TS metaobjects.config.ts providers. A provider carries a factory + optional
validator (code), so it must load as a native class, not JSON.
Docs: own-your-codegen.md gains a 'Custom types (custom providers)' section with
the per-port load mechanism — TS config.providers, Python --provider, JVM
ServiceLoader on the project classpath (META-INF/services); C# hook tracked as
future work.
Closes#158
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKaSE8U5cwN4ZGFwhJwxSY
|**Python**|`metaobjects gen \| verify \| docs --provider module:symbol` (repeatable). The symbol resolves to a `Provider` (or a list, or a zero-arg factory returning one) and is composed **on top of** the core providers — parity with TS `config.providers`. E.g. `metaobjects gen ./metaobjects --out ./gen --provider myapp.providers:view_provider`. |
66
+
|**Java / Kotlin**| Put your compiled `MetaDataTypeProvider` on the **project classpath** with a `META-INF/services/com.metaobjects.registry.MetaDataTypeProvider` entry. `metaobjects-maven-plugin` builds the loader with the project classloader, so **Java ServiceLoader auto-discovers it** — no plugin config needed. |
67
+
|**C#**| The loader accepts providers like every port; a first-class `dotnet meta` consumer-provider hook is tracked for a future release ([#158](https://github.com/metaobjectsdev/metaobjects/issues/158)). Today, extend the metamodel from an app that constructs the loader directly. |
68
+
69
+
This split follows each ecosystem's norms — interpreted ports (TS / Python) name or
70
+
import the provider module; compiled ports (JVM) discover it on the build classpath —
71
+
the same "idiomatic per port" principle as generator ownership (ADR-0035 §3).
72
+
48
73
## Deprecated (removed at 1.0)
49
74
50
75
Importing the built-in generators from `@metaobjectsdev/codegen-ts/generators`
0 commit comments