Commit 3b0c8ef
feat(metafield): theme integration + single-field setter fix
Let themes declare custom fields and render their values, and fix the
long-broken single-field metafield setters.
Provisioning
- theme.json gains `metafieldDefinitions[]`, seeded through the theme
installer at `theme:active` and re-ensured idempotently at server boot
(covers baked-config deploys that never run the CLI). Strict manifest
schema; `required:true` refused; conflict + orphan reporting.
- Per-theme attribution via a nullable `metafield_definition
.provisioned_by_theme` column (base Version-1.0.7) — no separate table.
Drives the deletion guard, `theme:export` round-trip, and
`theme:status`; orphan/retired states derive at read time. Uninstall
leaves definitions in place.
Storefront read path
- `<Metafield>` component (components/common/metafield): purely
presentational, developer supplies the entity; render prop + scalar
default; hidden fields render nothing; defaults from the manifest
placeholder. Fed by a manifest-descriptor projection delivered through
the appConfig eContext seam.
- Request-scoped definition cache stashed at both GraphQL context sites so
grids don't multiply definition queries. Default productView/categoryView
masters select `metafields`.
Owners
- Blog (`blog_post`, `blog_category`) wired end to end: fold processors,
payload schemas, GraphQL, prune subscribers, admin cards, masters.
Page builder
- V1.1 guideline drawer: "Live data" chrome + informational drawer with
definition status, create-if-missing, immutable-conflict banner, and
deep links. Values are live entity data — never edited from the builder.
Bug fix
- The six single-field setters (setProductMetafield, …) shared an untyped
`jsonb_build_object` key param and failed to parse on every call. Now
routed through a shared `buildMetaDataUpdate` (::text cast); a blank
value removes the key instead of storing a JSON null residue.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7f06495 commit 3b0c8ef
69 files changed
Lines changed: 3490 additions & 178 deletions
File tree
- packages/evershop/src
- bin
- lib
- theme
- components
- admin/metafield
- common/metafield
- tests/unit
- lib
- metafield
- tests/unit
- theme
- modules
- base
- api
- createMetafieldDefinition
- deleteMetafieldDefinition
- migration
- services
- blog
- api
- createBlogCategory
- createBlogPost
- updateBlogCategory
- updateBlogPost
- graphql/types
- BlogCategory
- BlogPost
- pages
- admin
- blogCategoryEdit+blogCategoryNew
- blogPostEdit+blogPostNew
- frontStore
- blogCategoryView
- blogPostView
- subscribers/metafield_definition_deleted
- catalog
- graphql/types
- Category
- Collection
- Product
- pages/frontStore
- categoryView
- productView
- services
- category
- collection
- product
- customer
- graphql/types/Customer
- services/customer
- graphql
- pages/global
- services
- oms
- graphql/types/Order
- services
- pageBuilder/pages/admin/pageBuilderEdit
- setting/graphql/types/Setting
- types
- tests/e2e
- admin/specs/metafield
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
163 | 208 | | |
164 | 209 | | |
165 | 210 | | |
| |||
197 | 242 | | |
198 | 243 | | |
199 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
200 | 252 | | |
201 | 253 | | |
202 | 254 | | |
| |||
255 | 307 | | |
256 | 308 | | |
257 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
258 | 322 | | |
259 | 323 | | |
260 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
14 | 36 | | |
15 | 37 | | |
16 | 38 | | |
| |||
40 | 62 | | |
41 | 63 | | |
42 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
43 | 108 | | |
44 | 109 | | |
45 | 110 | | |
| |||
49 | 114 | | |
50 | 115 | | |
51 | 116 | | |
| 117 | + | |
52 | 118 | | |
| 119 | + | |
53 | 120 | | |
54 | 121 | | |
55 | 122 | | |
56 | 123 | | |
57 | 124 | | |
58 | 125 | | |
59 | 126 | | |
| 127 | + | |
60 | 128 | | |
61 | 129 | | |
62 | 130 | | |
| |||
72 | 140 | | |
73 | 141 | | |
74 | 142 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
78 | 152 | | |
| 153 | + | |
79 | 154 | | |
80 | 155 | | |
81 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| |||
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
154 | | - | |
| 162 | + | |
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
163 | | - | |
| 171 | + | |
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
| |||
169 | 177 | | |
170 | 178 | | |
171 | 179 | | |
172 | | - | |
| 180 | + | |
173 | 181 | | |
174 | 182 | | |
175 | 183 | | |
| |||
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
190 | | - | |
| 198 | + | |
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| |||
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
201 | | - | |
| 209 | + | |
| 210 | + | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
205 | 214 | | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
213 | | - | |
| 223 | + | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
| |||
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
224 | | - | |
| 234 | + | |
225 | 235 | | |
226 | 236 | | |
227 | 237 | | |
| |||
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
244 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
245 | 257 | | |
246 | 258 | | |
247 | 259 | | |
| |||
303 | 315 | | |
304 | 316 | | |
305 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
306 | 323 | | |
307 | 324 | | |
308 | 325 | | |
| |||
0 commit comments