Commit 6ebb797
fix(core): pass field.options through to admin manifest for plugin field widgets (#353)
The manifest builder in EmDashRuntime.getManifest() only mapped
field.validation.options (the legacy enum-style select widget shape) into
the manifest's field entry, ignoring field.options entirely. The seed
schema types SeedField.options as Record<string, unknown> for arbitrary
plugin field-widget config, the DB column exists, and SchemaRegistry
correctly reads it — but the manifest builder dropped it on the floor.
As a result, plugin field widgets had no way to receive their per-field
configuration from the seed file. Any plugin needing per-instance config
(rather than hardcoded defaults like the reference color picker) was
silently broken.
Pass field.options through to entry.options before the legacy
validation.options mapping, and widen ManifestCollection.fields options
to a union of the legacy Array<{value, label}> shape and
Record<string, unknown> so plugin widgets are first-class.
Discovered while building a checkbox-grid widget for a "harvest calendar"
json field — the plugin needed options.months and options.symbols from
the seed schema and was receiving undefined.
No test added: the manifest builder is an instance method on
EmDashRuntime, and there are no existing tests in packages/core/tests
that construct an EmDashRuntime. Adding the runtime test scaffolding
would be a much larger change. Verified manually with a working plugin
(a custom checkbox-grid field widget) — the manifest now includes the
field's options object and the plugin renders correctly.
Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Matt Kane <mkane@cloudflare.com>1 parent 6474dae commit 6ebb797
3 files changed
Lines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1158 | 1161 | | |
1159 | 1162 | | |
1160 | 1163 | | |
| |||
1166 | 1169 | | |
1167 | 1170 | | |
1168 | 1171 | | |
1169 | | - | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1170 | 1180 | | |
1171 | 1181 | | |
1172 | 1182 | | |
| |||
0 commit comments