Commit 90c2b15
`registerMetadataTypeSchema` and `registerMetadataTypeActions` both told
plugins to call them "from their `onInstall` hook", and named
`/api/v1/meta/types/:type` as the endpoint that would serve the result.
Neither is real.
The kernel's plugin contract is `init` / `start` / `destroy`
(`packages/core/src/types.ts`): `kernel.use()` validates and stores,
`bootstrap()` calls `init` then `start`. The `onInstall` / `onEnable` /
`onDisable` / `onUninstall` / `onUpgrade` family declared on
`PluginLifecycleSchema` has no invocation site anywhere in the runtime — its
only importer repo-wide is its own test. So a plugin following the documented
advice registered nothing and got no error saying so, and its custom metadata
type silently served no JSON Schema.
`/api/v1/meta/types/:type` is likewise not a registered route; the route
ledger carries `GET /meta/types` and the public surface is `GET /api/v1/meta`.
Both TSDoc blocks and `content/docs/plugins/adding-a-metadata-type.mdx` now
name the hook that runs and the endpoint that exists, with the example written
as a real `Plugin` with an `init(ctx)`. That matches
`DatasourceAdminServicePlugin` — the single production caller of
`registerMetadataTypeActions` — which has always used `init` rather than the
`onInstall` the docs prescribed.
Two facts the old text obscured, now stated because both change how an author
writes the code:
- `getMetaTypes()` reads these registries at REQUEST time, not from a boot
snapshot, so a type registered during `init` is served from the first call.
- Registering a schema does not by itself put a type in the listing.
`getMetaTypes()` enumerates `engine.registry.getRegisteredTypes()` unioned
with the metadata service's, then decorates each with its schema — a type
present only in the schema registry is never reached.
Documentation only; no behaviour change. Whether the five uninvoked lifecycle
hooks get implemented or retired (ADR-0049) is #4212 — this stops the
registry's own docs from sending authors at the dead one meanwhile.
Claude-Session: https://claude.ai/code/session_01HrRNgrWaRtggzmrHpbomyh
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 698cbc2 commit 90c2b15
3 files changed
Lines changed: 96 additions & 19 deletions
File tree
- .changeset
- content/docs/plugins
- packages/spec/src/kernel
Lines changed: 41 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
221 | 234 | | |
222 | 235 | | |
223 | 236 | | |
224 | | - | |
| 237 | + | |
225 | 238 | | |
226 | 239 | | |
227 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
136 | 156 | | |
137 | 157 | | |
138 | 158 | | |
| |||
154 | 174 | | |
155 | 175 | | |
156 | 176 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
161 | 181 | | |
162 | 182 | | |
163 | 183 | | |
164 | 184 | | |
165 | 185 | | |
166 | 186 | | |
167 | | - | |
168 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
169 | 192 | | |
170 | 193 | | |
171 | 194 | | |
| |||
0 commit comments