@thorprovider/storefront 0.4.0-mvp.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/assets/templates/app/app/[[...slug]]/page.tsx +32 -1
- package/assets/templates/app/app/[[...slug]]/renderer.tsx +43 -12
- package/assets/templates/app/lib/__STOREFRONT__/account-boundary.client.tsx +76 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-lifecycle.client.tsx +461 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-mutation.client.ts +46 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-private.core.ts +103 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-reconcile.client.ts +465 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-session.core.ts +177 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-session.ts +44 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-user.core.ts +65 -0
- package/assets/templates/app/lib/__STOREFRONT__/actions.ts +76 -27
- package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +4 -4
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +0 -10
- package/assets/templates/app/lib/__STOREFRONT__/composition.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +3 -3
- package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +17 -18
- package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.client.tsx +209 -0
- package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.ts +247 -0
- package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +60 -29
- package/assets/templates/app/lib/__STOREFRONT__/schema.ts +83 -15
- package/assets/templates/app/lib/__STOREFRONT__/section-sources.ts +3 -5
- package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +25 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +7 -10
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.client.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.client.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/logoCloud.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/pricing.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.client.tsx +16 -16
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.products.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +26 -19
- package/assets/templates/features/checkout/state.ts +0 -5
- package/assets/templates/features/customer-auth/handlers.ts +19 -23
- package/assets/templates/features/customer-auth/state.ts +21 -0
- package/assets/templates/views/account/index.tsx +19 -7
- package/assets/templates/views/account/registry.tsx +263 -155
- package/assets/templates/views/account/schema.ts +1 -1
- package/assets/templates/views/cart/data.ts +7 -7
- package/assets/templates/views/cart/registry.tsx +4 -3
- package/assets/templates/views/category/assembly/assembly.json +2 -2
- package/assets/templates/views/category/assembly/index.skeleton.tsx +11 -7
- package/assets/templates/views/category/assembly/registry.skeleton.tsx +9 -9
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/binding.json +1 -1
- package/assets/templates/views/category/assembly/slots/filter/CategoryListing/catalog.part +5 -0
- package/assets/templates/views/category/assembly/slots/filter/{CategoryFilter2 → CategoryListing}/element.part +5 -3
- package/assets/templates/views/category/assembly/slots/filter/{CategoryFilter2 → CategoryListing}/registry.part +9 -5
- package/assets/templates/views/category/content.ts +2 -1
- package/assets/templates/views/category/index.tsx +19 -13
- package/assets/templates/views/category/props.ts +1 -1
- package/assets/templates/views/category/registry.tsx +19 -15
- package/assets/templates/views/category/schema.ts +48 -21
- package/assets/templates/views/checkout/content.ts +60 -0
- package/assets/templates/views/checkout/props.ts +4 -5
- package/assets/templates/views/checkout/registry.tsx +12 -10
- package/assets/templates/views/checkout/schema.ts +10 -16
- package/assets/templates/views/home/assembly/assembly.json +4 -4
- package/assets/templates/views/home/assembly/index.skeleton.tsx +2 -3
- package/assets/templates/views/home/assembly/registry.skeleton.tsx +4 -1
- package/assets/templates/views/home/assembly/slots/benefits/cards/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/cards/registry.part +17 -0
- package/assets/templates/views/home/assembly/slots/benefits/split/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → split}/registry.part +6 -2
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +8 -0
- package/assets/templates/views/home/assembly/slots/categories/{ProductCategory2 → CategoryGrid}/element.part +1 -1
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +31 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/registry.part +3 -1
- package/assets/templates/views/home/content.ts +22 -0
- package/assets/templates/views/home/index.tsx +11 -8
- package/assets/templates/views/home/props.ts +1 -0
- package/assets/templates/views/home/registry.tsx +39 -15
- package/assets/templates/views/home/schema.ts +141 -24
- package/assets/templates/views/product/data.ts +1 -1
- package/assets/templates/views/product/registry.tsx +10 -6
- package/assets/templates/views/product/schema.ts +36 -1
- package/examples/merchandising/category-led.json +1 -1
- package/examples/merchandising/collection-led.json +1 -1
- package/package.json +4 -5
- package/recipes/archetypes.json +39 -43
- package/recipes/catalog.json +212 -202
- package/recipes/catalog.mjs +10 -0
- package/recipes/catalog.schema.json +4 -0
- package/recipes/features.json +5 -5
- package/recipes/recipes.json +137 -43
- package/recipes/sections.json +4 -4
- package/recipes/validate.mjs +21 -4
- package/scripts/candidate.mjs +2 -2
- package/scripts/composers.mjs +2 -2
- package/scripts/file-classes.mjs +10 -0
- package/scripts/logical-controls.mjs +4 -4
- package/scripts/operation-registry.mjs +1 -1
- package/scripts/ownership-conflict.mjs +5 -2
- package/scripts/view-assembly.mjs +12 -4
- package/scripts/view-selection.mjs +1 -1
- package/skills/sf-view-gen/assets/recipes/archetypes.json +39 -43
- package/skills/sf-view-gen/assets/recipes/catalog.json +212 -202
- package/skills/sf-view-gen/assets/recipes/catalog.schema.json +4 -0
- package/skills/sf-view-gen/assets/recipes/features.json +5 -5
- package/skills/sf-view-gen/assets/recipes/recipes.json +137 -43
- package/skills/sf-view-gen/assets/recipes/sections.json +4 -4
- package/skills/sf-view-gen/assets/templates/views/sections/cta.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/faq.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/pricing.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/products.client.tsx +16 -16
- package/skills/sf-view-gen/assets/templates/views/sections/schema.products.ts +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/schema.testimonials.ts +21 -11
- package/skills/sf-view-gen/assets/templates/views/sections/statistics.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +2 -8
- package/skills/sf-view-gen/scripts/catalog.mjs +10 -0
- package/skills/sf-view-gen/scripts/validate.mjs +21 -4
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/catalog.part +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/registry.part +0 -10
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/catalog.part +0 -4
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/registry.part +0 -16
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/catalog.part +0 -4
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/catalog.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/element.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/catalog.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/element.part +0 -0
- /package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/element.part +0 -0
package/recipes/catalog.json
CHANGED
|
@@ -1,60 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./catalog.schema.json",
|
|
3
3
|
"catalogVersion": 1,
|
|
4
|
-
"description": "Initial semantic executable catalog (E1 tasks 1.2-1.3), classified by source-shape inspection of the @thorprovider/blocks prop contracts and the view templates. Scope: every slot the curated MVP views (home, product, category, checkout, account) render by default, covering both the selectable archetype slots declared by recipes/archetypes.json and the nested default slots that have no archetype (category.productCard, checkout.confirmation) so no legacy default support is dropped. The account view
|
|
4
|
+
"description": "Initial semantic executable catalog (E1 tasks 1.2-1.3), classified by source-shape inspection of the @thorprovider/blocks prop contracts and the view templates. Scope: every slot the curated MVP views (home, product, category, checkout, account) render by default, covering both the selectable archetype slots declared by recipes/archetypes.json and the nested default slots that have no archetype (category.productCard, checkout.confirmation) so no legacy default support is dropped. The account view declares canonical LoginPage card/social presentations and SignUpPage1; legacy LoginPage1/LoginPage2 names resolve to card/social through legacyAliases, with social remaining held pending verified account lifecycle wiring. A variant is `executable` only when the slot's canonical data shape can feed its block props without a prop bridge and without inventing data; every other non-default variant is `held` with the specific reason. The one non-default structural choice is home.benefits, which selects between the two bounded presentations (`cards`, `split`) of the single canonical `Feature` block (identical item contract, no bridge); the retired numbered names `Feature1`/`Feature2` resolve through the slot's `legacyAliases`. E2 task 6.1 declares the base listing slot category.filter CategoryFilter2 as the single controlled listing (dataShape `CatalogQuery & CatalogResults`, state controlled) with the search/filter controls contributed by the logical mounts category.search / category.filters (no second block). Source-shape compatibility is not end-to-end backend behavior proof: the render is executable, but the category.search.apply / category.filter.apply actions remain held under the capability catalog (owner: storefront-catalog-search-filters, E2) until a real runtime proof. The `capabilities` map declares those operational capabilities with their requirements and verification state; E1 declares the held category.filter.apply action, E2 adds the held category.search.apply action and the held category.price.range capability that gates the category-filters showPrice option; no capability is claimed verified. The home.hero variants of the retired numbered family (StorefrontHero1/2/5/6) resolve through the slot's `legacyAliases` to the single canonical `StorefrontHero`, whose bounded presentation options (`compact`, `showcase`, `editorial`, `promotional`) preserve the four structural identities; the extended editorial/promotional sections render only from host-supplied data and are omitted otherwise. The category.productCard slot's retired numbered family (ProductCard1/2/3/5) and the previous `ProductCard` variant resolve through the slot's `legacyAliases` to the single canonical `ProductGrid` listing, which renders `ProductCard` item cells with bounded presentation options (`classic`, `minimal`, `rich`) that preserve the three structural identities; the rich presentation's wishlist and view-similar affordances are host-owned and optional, evidence (rating, badge, compare-at) renders only from host-supplied data, and the comparison-table variant `ProductCard5` was discarded as a listing controller, not a card presentation.",
|
|
5
5
|
"slots": {
|
|
6
6
|
"home.hero": {
|
|
7
|
-
"default": "
|
|
7
|
+
"default": "StorefrontHero",
|
|
8
|
+
"legacyAliases": {
|
|
9
|
+
"StorefrontHero1": "StorefrontHero",
|
|
10
|
+
"StorefrontHero2": "StorefrontHero",
|
|
11
|
+
"StorefrontHero5": "StorefrontHero",
|
|
12
|
+
"StorefrontHero6": "StorefrontHero"
|
|
13
|
+
},
|
|
8
14
|
"variants": {
|
|
9
|
-
"
|
|
15
|
+
"StorefrontHero": {
|
|
10
16
|
"status": "executable",
|
|
11
17
|
"block": "StorefrontHero",
|
|
12
18
|
"dataShape": "FeaturedProduct[]",
|
|
13
|
-
"events": [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"requirements": ["heroProducts"]
|
|
25
|
-
},
|
|
26
|
-
"StorefrontHero5": {
|
|
27
|
-
"status": "held",
|
|
28
|
-
"reason": "featuredDeals[].description is absent from the canonical product shape and Department.count would require inventing counts; no truthful prop bridge can be derived from source",
|
|
29
|
-
"block": "StorefrontHero",
|
|
30
|
-
"dataShape": "FeaturedDeal[] & Department[]",
|
|
31
|
-
"events": ["departmentClick", "shopNow", "locateStores"],
|
|
32
|
-
"state": "uncontrolled",
|
|
33
|
-
"requirements": ["featuredDeals", "departments"]
|
|
34
|
-
},
|
|
35
|
-
"StorefrontHero6": {
|
|
36
|
-
"status": "held",
|
|
37
|
-
"reason": "block requires deals with discount/endTime and categories with a required count; the canonical shape supplies neither without invention and no verified prop bridge exists",
|
|
38
|
-
"block": "StorefrontHero",
|
|
39
|
-
"dataShape": "HeroDeal[] & HeroCategory[]",
|
|
40
|
-
"events": ["shopNow", "categoryClick"],
|
|
19
|
+
"events": [
|
|
20
|
+
"addToCart",
|
|
21
|
+
"buyNow",
|
|
22
|
+
"selectColor",
|
|
23
|
+
"search",
|
|
24
|
+
"productClick",
|
|
25
|
+
"departmentClick",
|
|
26
|
+
"shopNow",
|
|
27
|
+
"locateStores",
|
|
28
|
+
"categoryClick"
|
|
29
|
+
],
|
|
41
30
|
"state": "uncontrolled",
|
|
42
|
-
"requirements": [
|
|
31
|
+
"requirements": [
|
|
32
|
+
"heroProducts"
|
|
33
|
+
]
|
|
43
34
|
}
|
|
44
35
|
}
|
|
45
36
|
},
|
|
46
37
|
"home.benefits": {
|
|
47
|
-
"default": "
|
|
38
|
+
"default": "cards",
|
|
39
|
+
"legacyAliases": {
|
|
40
|
+
"Feature1": "cards",
|
|
41
|
+
"Feature2": "split"
|
|
42
|
+
},
|
|
48
43
|
"variants": {
|
|
49
|
-
"
|
|
44
|
+
"cards": {
|
|
50
45
|
"status": "executable",
|
|
51
46
|
"block": "Feature",
|
|
52
47
|
"dataShape": "BenefitsItem[]",
|
|
53
|
-
"events": [
|
|
48
|
+
"events": [
|
|
49
|
+
"ctaClick",
|
|
50
|
+
"learnMore"
|
|
51
|
+
],
|
|
54
52
|
"state": "uncontrolled",
|
|
55
53
|
"requirements": []
|
|
56
54
|
},
|
|
57
|
-
"
|
|
55
|
+
"split": {
|
|
58
56
|
"status": "executable",
|
|
59
57
|
"block": "Feature",
|
|
60
58
|
"dataShape": "BenefitsItem[]",
|
|
@@ -65,73 +63,45 @@
|
|
|
65
63
|
}
|
|
66
64
|
},
|
|
67
65
|
"home.categories": {
|
|
68
|
-
"default": "
|
|
66
|
+
"default": "CategoryGrid",
|
|
67
|
+
"legacyAliases": {
|
|
68
|
+
"ProductCategory": "CategoryGrid"
|
|
69
|
+
},
|
|
69
70
|
"variants": {
|
|
70
|
-
"
|
|
71
|
+
"CategoryGrid": {
|
|
71
72
|
"status": "executable",
|
|
72
|
-
"block": "
|
|
73
|
+
"block": "CategoryGrid",
|
|
73
74
|
"dataShape": "CategoryCard[]",
|
|
74
|
-
"events": [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"events": [],
|
|
84
|
-
"state": "uncontrolled",
|
|
85
|
-
"requirements": ["categories"]
|
|
86
|
-
},
|
|
87
|
-
"ProductCategory4": {
|
|
88
|
-
"status": "held",
|
|
89
|
-
"reason": "block requires categories with title/icon/customers/products/avatarImages, which the canonical CategoryCard shape does not supply; no verified prop bridge exists",
|
|
90
|
-
"block": "CategoryCards",
|
|
91
|
-
"dataShape": "ProductCategory4Category[]",
|
|
92
|
-
"events": ["categoryClick"],
|
|
93
|
-
"state": "uncontrolled",
|
|
94
|
-
"requirements": ["categories"]
|
|
95
|
-
},
|
|
96
|
-
"ProductCategory5": {
|
|
97
|
-
"status": "held",
|
|
98
|
-
"reason": "block requires categories with subcategories and a required itemCount plus a search control, which the canonical CategoryCard shape does not supply; no verified prop bridge exists",
|
|
99
|
-
"block": "CategoryCards",
|
|
100
|
-
"dataShape": "ProductCategory5Category[]",
|
|
101
|
-
"events": ["browse", "viewAll"],
|
|
102
|
-
"state": "uncontrolled",
|
|
103
|
-
"requirements": ["categories"]
|
|
75
|
+
"events": [
|
|
76
|
+
"browse",
|
|
77
|
+
"viewAll",
|
|
78
|
+
"queryChange"
|
|
79
|
+
],
|
|
80
|
+
"state": "controlled",
|
|
81
|
+
"requirements": [
|
|
82
|
+
"categories"
|
|
83
|
+
]
|
|
104
84
|
}
|
|
105
85
|
}
|
|
106
86
|
},
|
|
107
87
|
"product.overview": {
|
|
108
|
-
"default": "
|
|
88
|
+
"default": "ProductOverview",
|
|
109
89
|
"variants": {
|
|
110
|
-
"
|
|
90
|
+
"ProductOverview": {
|
|
111
91
|
"status": "executable",
|
|
112
92
|
"block": "ProductOverview",
|
|
113
93
|
"dataShape": "ProductDetailProduct",
|
|
114
|
-
"events": [
|
|
94
|
+
"events": [
|
|
95
|
+
"selectVariant",
|
|
96
|
+
"quantityChange",
|
|
97
|
+
"addToCart",
|
|
98
|
+
"toggleWishlist"
|
|
99
|
+
],
|
|
115
100
|
"state": "controlled",
|
|
116
|
-
"requirements": [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"reason": "block requires a product with brand/sku/sizes/colors and wishlist events, a shape the canonical ProductDetailProduct does not supply; no verified prop bridge exists",
|
|
121
|
-
"block": "ProductOverview",
|
|
122
|
-
"dataShape": "ProductOverview2Product",
|
|
123
|
-
"events": ["addToCart", "toggleWishlist"],
|
|
124
|
-
"state": "uncontrolled",
|
|
125
|
-
"requirements": ["selectedProduct"]
|
|
126
|
-
},
|
|
127
|
-
"ProductOverview5": {
|
|
128
|
-
"status": "held",
|
|
129
|
-
"reason": "block requires specifications/features/mainImages/galleryImages/userReviews, a shape the canonical ProductDetailProduct does not supply; no verified prop bridge exists",
|
|
130
|
-
"block": "ProductOverview",
|
|
131
|
-
"dataShape": "ProductOverview5Product",
|
|
132
|
-
"events": ["addToCart", "toggleWishlist"],
|
|
133
|
-
"state": "uncontrolled",
|
|
134
|
-
"requirements": ["selectedProduct"]
|
|
101
|
+
"requirements": [
|
|
102
|
+
"selectedProduct",
|
|
103
|
+
"selectedVariantId"
|
|
104
|
+
]
|
|
135
105
|
}
|
|
136
106
|
}
|
|
137
107
|
},
|
|
@@ -142,18 +112,28 @@
|
|
|
142
112
|
"status": "executable",
|
|
143
113
|
"block": "Reviews",
|
|
144
114
|
"dataShape": "Review[]",
|
|
145
|
-
"events": [
|
|
115
|
+
"events": [
|
|
116
|
+
"toggleReviewLike",
|
|
117
|
+
"submitReview"
|
|
118
|
+
],
|
|
146
119
|
"state": "uncontrolled",
|
|
147
|
-
"requirements": [
|
|
120
|
+
"requirements": [
|
|
121
|
+
"productReviews"
|
|
122
|
+
]
|
|
148
123
|
},
|
|
149
124
|
"ReviewRating2": {
|
|
150
125
|
"status": "held",
|
|
151
126
|
"reason": "block requires an aggregate averageRating/ratingDistribution and carousel controls the canonical Review[] shape does not supply; no verified prop bridge exists",
|
|
152
127
|
"block": "Reviews",
|
|
153
128
|
"dataShape": "Review[] & RatingSummary",
|
|
154
|
-
"events": [
|
|
129
|
+
"events": [
|
|
130
|
+
"like",
|
|
131
|
+
"comment"
|
|
132
|
+
],
|
|
155
133
|
"state": "uncontrolled",
|
|
156
|
-
"requirements": [
|
|
134
|
+
"requirements": [
|
|
135
|
+
"productReviews"
|
|
136
|
+
]
|
|
157
137
|
}
|
|
158
138
|
}
|
|
159
139
|
},
|
|
@@ -166,29 +146,49 @@
|
|
|
166
146
|
"dataShape": "BreadcrumbItemData[]",
|
|
167
147
|
"events": [],
|
|
168
148
|
"state": "uncontrolled",
|
|
169
|
-
"requirements": [
|
|
149
|
+
"requirements": [
|
|
150
|
+
"productBreadcrumb"
|
|
151
|
+
]
|
|
170
152
|
}
|
|
171
153
|
}
|
|
172
154
|
},
|
|
173
155
|
"cart.view": {
|
|
174
|
-
"default": "
|
|
156
|
+
"default": "ShoppingCart",
|
|
157
|
+
"legacyAliases": {
|
|
158
|
+
"ShoppingCart1": "ShoppingCart",
|
|
159
|
+
"ShoppingCart2": "ShoppingCart",
|
|
160
|
+
"ShoppingCart3": "ShoppingCart",
|
|
161
|
+
"ShoppingCart4": "ShoppingCart"
|
|
162
|
+
},
|
|
175
163
|
"variants": {
|
|
176
|
-
"
|
|
164
|
+
"ShoppingCart": {
|
|
177
165
|
"status": "executable",
|
|
178
|
-
"block": "
|
|
166
|
+
"block": "ShoppingCart",
|
|
179
167
|
"dataShape": "CartLineState[] & CartTotalsState",
|
|
180
|
-
"events": [
|
|
168
|
+
"events": [
|
|
169
|
+
"refreshCart",
|
|
170
|
+
"updateQuantity",
|
|
171
|
+
"removeFromCart",
|
|
172
|
+
"checkout",
|
|
173
|
+
"continueShopping"
|
|
174
|
+
],
|
|
181
175
|
"state": "controlled",
|
|
182
|
-
"requirements": [
|
|
176
|
+
"requirements": [
|
|
177
|
+
"cart",
|
|
178
|
+
"cartTotals"
|
|
179
|
+
]
|
|
183
180
|
}
|
|
184
181
|
}
|
|
185
182
|
},
|
|
186
183
|
"category.filter": {
|
|
187
|
-
"default": "
|
|
184
|
+
"default": "CategoryListing",
|
|
185
|
+
"legacyAliases": {
|
|
186
|
+
"CategoryFilter2": "CategoryListing"
|
|
187
|
+
},
|
|
188
188
|
"variants": {
|
|
189
|
-
"
|
|
189
|
+
"CategoryListing": {
|
|
190
190
|
"status": "executable",
|
|
191
|
-
"block": "
|
|
191
|
+
"block": "CategoryListing",
|
|
192
192
|
"dataShape": "CatalogQuery & CatalogResults",
|
|
193
193
|
"events": [
|
|
194
194
|
"productClick",
|
|
@@ -203,96 +203,63 @@
|
|
|
203
203
|
"removeFilter"
|
|
204
204
|
],
|
|
205
205
|
"state": "controlled",
|
|
206
|
-
"requirements": [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
"block": "CategoryFilter",
|
|
212
|
-
"dataShape": "CategoryFilter1Filters",
|
|
213
|
-
"events": ["filterChange"],
|
|
214
|
-
"state": "uncontrolled",
|
|
215
|
-
"requirements": ["categoryProducts"]
|
|
216
|
-
},
|
|
217
|
-
"CategoryFilter4": {
|
|
218
|
-
"status": "held",
|
|
219
|
-
"reason": "block requires an advanced facets contract (modelTypes/rangeBands/frameSizes/colourways/features) the canonical listing does not supply; no verified prop bridge exists",
|
|
220
|
-
"block": "CategoryFilter",
|
|
221
|
-
"dataShape": "CategoryFilter4Facets",
|
|
222
|
-
"events": ["filterChange"],
|
|
223
|
-
"state": "uncontrolled",
|
|
224
|
-
"requirements": ["categoryProducts"]
|
|
206
|
+
"requirements": [
|
|
207
|
+
"categoryProducts",
|
|
208
|
+
"categoryQuery",
|
|
209
|
+
"facetSupport"
|
|
210
|
+
]
|
|
225
211
|
}
|
|
226
212
|
}
|
|
227
213
|
},
|
|
228
214
|
"category.productCard": {
|
|
229
|
-
"default": "
|
|
215
|
+
"default": "ProductGrid",
|
|
216
|
+
"legacyAliases": {
|
|
217
|
+
"ProductCard": "ProductGrid",
|
|
218
|
+
"ProductCard1": "ProductGrid",
|
|
219
|
+
"ProductCard2": "ProductGrid",
|
|
220
|
+
"ProductCard3": "ProductGrid",
|
|
221
|
+
"ProductCard5": "ProductGrid"
|
|
222
|
+
},
|
|
230
223
|
"variants": {
|
|
231
|
-
"
|
|
224
|
+
"ProductGrid": {
|
|
232
225
|
"status": "executable",
|
|
233
|
-
"block": "
|
|
234
|
-
"dataShape": "
|
|
235
|
-
"events": [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
"reason": "block requires a product with a required rating, a shape the canonical CardProduct listing does not supply; no verified prop bridge exists",
|
|
242
|
-
"block": "ProductCard",
|
|
243
|
-
"dataShape": "ProductCard2Product[]",
|
|
244
|
-
"events": [],
|
|
226
|
+
"block": "ProductGrid",
|
|
227
|
+
"dataShape": "ProductPresentation[]",
|
|
228
|
+
"events": [
|
|
229
|
+
"addToCart",
|
|
230
|
+
"openProduct",
|
|
231
|
+
"toggleWishlist",
|
|
232
|
+
"viewSimilar"
|
|
233
|
+
],
|
|
245
234
|
"state": "uncontrolled",
|
|
246
|
-
"requirements": [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
"status": "held",
|
|
250
|
-
"reason": "block requires a product with subtitle/originalPrice/reviewCount/discountPercentage and a badge, a shape the canonical CardProduct listing does not supply; no verified prop bridge exists",
|
|
251
|
-
"block": "ProductCard",
|
|
252
|
-
"dataShape": "ProductCard3Product[]",
|
|
253
|
-
"events": ["toggleWishlist", "viewSimilar", "productClick"],
|
|
254
|
-
"state": "controlled",
|
|
255
|
-
"requirements": ["categoryProducts"]
|
|
256
|
-
},
|
|
257
|
-
"ProductCard5": {
|
|
258
|
-
"status": "held",
|
|
259
|
-
"reason": "block requires a product with name/category/stock/specifications/brand, a shape the canonical CardProduct listing does not supply; no verified prop bridge exists",
|
|
260
|
-
"block": "ProductCard",
|
|
261
|
-
"dataShape": "ProductCard5Product[]",
|
|
262
|
-
"events": ["toggleWishlist", "addToCart", "quickView", "compare", "export"],
|
|
263
|
-
"state": "controlled",
|
|
264
|
-
"requirements": ["categoryProducts"]
|
|
235
|
+
"requirements": [
|
|
236
|
+
"categoryProducts"
|
|
237
|
+
]
|
|
265
238
|
}
|
|
266
239
|
}
|
|
267
240
|
},
|
|
268
241
|
"checkout.checkout": {
|
|
269
|
-
"default": "
|
|
242
|
+
"default": "Checkout",
|
|
243
|
+
"legacyAliases": {
|
|
244
|
+
"CheckoutForm1": "Checkout"
|
|
245
|
+
},
|
|
270
246
|
"variants": {
|
|
271
|
-
"
|
|
247
|
+
"Checkout": {
|
|
272
248
|
"status": "executable",
|
|
273
249
|
"block": "Checkout",
|
|
274
|
-
"dataShape": "
|
|
275
|
-
"events": [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
"block": "Checkout",
|
|
283
|
-
"dataShape": "CheckoutForm2Data",
|
|
284
|
-
"events": ["submit"],
|
|
285
|
-
"state": "controlled",
|
|
286
|
-
"requirements": ["checkoutCountries", "checkoutPaymentMethods"]
|
|
287
|
-
},
|
|
288
|
-
"CheckoutForm3": {
|
|
289
|
-
"status": "held",
|
|
290
|
-
"reason": "unproven checkout variant: E1 keeps only the default CheckoutForm1, whose behavior is unchanged; no verified prop bridge exists",
|
|
291
|
-
"block": "Checkout",
|
|
292
|
-
"dataShape": "CheckoutForm3FormData",
|
|
293
|
-
"events": ["submit"],
|
|
250
|
+
"dataShape": "CheckoutValues & CheckoutOrderSummary & PaymentMethod[]",
|
|
251
|
+
"events": [
|
|
252
|
+
"retryTotals",
|
|
253
|
+
"selectShippingOption",
|
|
254
|
+
"applyPromo",
|
|
255
|
+
"submit",
|
|
256
|
+
"stepChange"
|
|
257
|
+
],
|
|
294
258
|
"state": "controlled",
|
|
295
|
-
"requirements": [
|
|
259
|
+
"requirements": [
|
|
260
|
+
"checkoutCountries",
|
|
261
|
+
"checkoutPaymentMethods"
|
|
262
|
+
]
|
|
296
263
|
}
|
|
297
264
|
}
|
|
298
265
|
},
|
|
@@ -303,31 +270,52 @@
|
|
|
303
270
|
"status": "executable",
|
|
304
271
|
"block": "CheckoutConfirmation",
|
|
305
272
|
"dataShape": "Receipt",
|
|
306
|
-
"events": [
|
|
273
|
+
"events": [
|
|
274
|
+
"continueShopping"
|
|
275
|
+
],
|
|
307
276
|
"state": "uncontrolled",
|
|
308
|
-
"requirements": [
|
|
277
|
+
"requirements": [
|
|
278
|
+
"lastReceipt"
|
|
279
|
+
]
|
|
309
280
|
}
|
|
310
281
|
}
|
|
311
282
|
},
|
|
312
283
|
"account.login": {
|
|
313
|
-
"default": "
|
|
284
|
+
"default": "card",
|
|
285
|
+
"legacyAliases": {
|
|
286
|
+
"LoginPage1": "card",
|
|
287
|
+
"LoginPage2": "social"
|
|
288
|
+
},
|
|
314
289
|
"variants": {
|
|
315
|
-
"
|
|
290
|
+
"card": {
|
|
316
291
|
"status": "executable",
|
|
317
|
-
"block": "
|
|
318
|
-
"dataShape": "
|
|
319
|
-
"events": [
|
|
292
|
+
"block": "LoginPage",
|
|
293
|
+
"dataShape": "LoginPageFormData & AccountAuthResult",
|
|
294
|
+
"events": [
|
|
295
|
+
"submit",
|
|
296
|
+
"createAccount"
|
|
297
|
+
],
|
|
320
298
|
"state": "controlled",
|
|
321
|
-
"requirements": [
|
|
299
|
+
"requirements": [
|
|
300
|
+
"accountCustomer",
|
|
301
|
+
"accountAuthenticated"
|
|
302
|
+
]
|
|
322
303
|
},
|
|
323
|
-
"
|
|
304
|
+
"social": {
|
|
324
305
|
"status": "held",
|
|
325
|
-
"reason": "
|
|
326
|
-
"block": "
|
|
327
|
-
"dataShape": "
|
|
328
|
-
"events": [
|
|
306
|
+
"reason": "The social presentation remains held for the Storefront account slot until social-auth lifecycle wiring is verified.",
|
|
307
|
+
"block": "LoginPage",
|
|
308
|
+
"dataShape": "LoginPageFormData & AccountAuthResult",
|
|
309
|
+
"events": [
|
|
310
|
+
"submit",
|
|
311
|
+
"forgotPassword",
|
|
312
|
+
"signUp"
|
|
313
|
+
],
|
|
329
314
|
"state": "controlled",
|
|
330
|
-
"requirements": [
|
|
315
|
+
"requirements": [
|
|
316
|
+
"accountCustomer",
|
|
317
|
+
"accountAuthenticated"
|
|
318
|
+
]
|
|
331
319
|
}
|
|
332
320
|
}
|
|
333
321
|
},
|
|
@@ -338,9 +326,15 @@
|
|
|
338
326
|
"status": "executable",
|
|
339
327
|
"block": "SignUpPage1",
|
|
340
328
|
"dataShape": "SignUpPage1Data & AccountAuthResult",
|
|
341
|
-
"events": [
|
|
329
|
+
"events": [
|
|
330
|
+
"submit",
|
|
331
|
+
"signIn"
|
|
332
|
+
],
|
|
342
333
|
"state": "controlled",
|
|
343
|
-
"requirements": [
|
|
334
|
+
"requirements": [
|
|
335
|
+
"accountCustomer",
|
|
336
|
+
"accountAuthenticated"
|
|
337
|
+
]
|
|
344
338
|
}
|
|
345
339
|
}
|
|
346
340
|
},
|
|
@@ -351,9 +345,14 @@
|
|
|
351
345
|
"status": "executable",
|
|
352
346
|
"block": "OrderHistory2",
|
|
353
347
|
"dataShape": "AccountOrderView[] & OrderHistory2Labels",
|
|
354
|
-
"events": [
|
|
348
|
+
"events": [
|
|
349
|
+
"viewDetails"
|
|
350
|
+
],
|
|
355
351
|
"state": "controlled",
|
|
356
|
-
"requirements": [
|
|
352
|
+
"requirements": [
|
|
353
|
+
"accountCustomer",
|
|
354
|
+
"accountAuthenticated"
|
|
355
|
+
]
|
|
357
356
|
},
|
|
358
357
|
"OrderHistory1": {
|
|
359
358
|
"status": "held",
|
|
@@ -362,7 +361,10 @@
|
|
|
362
361
|
"dataShape": "OrderHistory1Order[]",
|
|
363
362
|
"events": [],
|
|
364
363
|
"state": "controlled",
|
|
365
|
-
"requirements": [
|
|
364
|
+
"requirements": [
|
|
365
|
+
"accountCustomer",
|
|
366
|
+
"accountAuthenticated"
|
|
367
|
+
]
|
|
366
368
|
}
|
|
367
369
|
}
|
|
368
370
|
},
|
|
@@ -375,24 +377,32 @@
|
|
|
375
377
|
"dataShape": "BreadcrumbItemData[]",
|
|
376
378
|
"events": [],
|
|
377
379
|
"state": "uncontrolled",
|
|
378
|
-
"requirements": [
|
|
380
|
+
"requirements": [
|
|
381
|
+
"categoryBreadcrumb"
|
|
382
|
+
]
|
|
379
383
|
}
|
|
380
384
|
}
|
|
381
385
|
}
|
|
382
386
|
},
|
|
383
387
|
"capabilities": {
|
|
384
388
|
"category.search.apply": {
|
|
385
|
-
"requirements": [
|
|
389
|
+
"requirements": [
|
|
390
|
+
"adapter.getCatalogProducts(query).text"
|
|
391
|
+
],
|
|
386
392
|
"verification": "unverified",
|
|
387
393
|
"owner": "storefront-catalog-search-filters"
|
|
388
394
|
},
|
|
389
395
|
"category.filter.apply": {
|
|
390
|
-
"requirements": [
|
|
396
|
+
"requirements": [
|
|
397
|
+
"adapter.getProducts(query)"
|
|
398
|
+
],
|
|
391
399
|
"verification": "unverified",
|
|
392
400
|
"owner": "storefront-catalog-search-filters"
|
|
393
401
|
},
|
|
394
402
|
"category.price.range": {
|
|
395
|
-
"requirements": [
|
|
403
|
+
"requirements": [
|
|
404
|
+
"adapter.getAvailableFilters(query).priceRange"
|
|
405
|
+
],
|
|
396
406
|
"verification": "unverified",
|
|
397
407
|
"owner": "storefront-catalog-search-filters"
|
|
398
408
|
}
|
package/recipes/catalog.mjs
CHANGED
|
@@ -100,6 +100,16 @@ export function validateCatalog(catalog) {
|
|
|
100
100
|
if (typeof slot.default === 'string' && !hasOwn(variants, slot.default)) {
|
|
101
101
|
errors.push(`Slot "${slotId}" default "${slot.default}" is not a declared variant.`)
|
|
102
102
|
}
|
|
103
|
+
// A legacy alias must land on a declared variant of the same slot: an alias
|
|
104
|
+
// pointing outside the variant set would resolve selections to nothing.
|
|
105
|
+
const aliases = isPlainObject(slot.legacyAliases) ? slot.legacyAliases : {}
|
|
106
|
+
for (const [alias, target] of Object.entries(aliases)) {
|
|
107
|
+
if (!hasOwn(variants, target)) {
|
|
108
|
+
errors.push(
|
|
109
|
+
`Slot "${slotId}" legacy alias "${alias}" maps to "${target}", which is not a declared variant.`
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
103
113
|
for (const [variantName, entry] of Object.entries(variants)) {
|
|
104
114
|
if (!isPlainObject(entry)) continue
|
|
105
115
|
if (entry.status === 'held' && !(typeof entry.reason === 'string' && entry.reason.length > 0)) {
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"additionalProperties": false,
|
|
19
19
|
"properties": {
|
|
20
20
|
"default": { "type": "string", "minLength": 1 },
|
|
21
|
+
"legacyAliases": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": { "type": "string", "minLength": 1 }
|
|
24
|
+
},
|
|
21
25
|
"variants": {
|
|
22
26
|
"type": "object",
|
|
23
27
|
"additionalProperties": {
|