@thorprovider/storefront 0.4.0-mvp.0 → 0.4.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 +174 -156
- package/VENDOR.md +69 -0
- package/assets/openspec/config.yaml +38 -0
- package/assets/templates/AGENTS.md +76 -0
- package/assets/templates/app/app/[[...slug]]/page.tsx +56 -2
- package/assets/templates/app/app/[[...slug]]/renderer.tsx +44 -2
- package/assets/templates/app/app/globals.css +5 -8
- package/assets/templates/app/app/layout.tsx +1 -5
- package/assets/templates/app/app/robots.ts +9 -3
- package/assets/templates/app/app/sitemap.ts +64 -5
- 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 +135 -16
- package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +19 -9
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +61 -0
- package/assets/templates/app/lib/__STOREFRONT__/composition.ts +26 -0
- package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +36 -4
- 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 +123 -62
- package/assets/templates/app/lib/__STOREFRONT__/runtime.ts +3 -0
- package/assets/templates/app/lib/__STOREFRONT__/schema.ts +78 -25
- package/assets/templates/app/lib/__STOREFRONT__/section-observation.ts +182 -0
- package/assets/templates/app/lib/__STOREFRONT__/section-sources.ts +128 -0
- package/assets/templates/app/lib/__STOREFRONT__/shell/content.ts +31 -7
- package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +4 -0
- package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +81 -26
- package/assets/templates/app/lib/__STOREFRONT__/spec/seo.ts +165 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +4 -2
- package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +26 -7
- 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/index.ts +2 -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 +100 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.tsx +19 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.products.ts +39 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +1 -1
- package/assets/templates/features/checkout/handlers.ts +6 -0
- package/assets/templates/features/customer-auth/handlers.ts +19 -23
- package/assets/templates/features/customer-auth/state.ts +31 -1
- package/assets/templates/views/account/index.tsx +20 -8
- package/assets/templates/views/account/registry.tsx +294 -154
- package/assets/templates/views/account/schema.ts +1 -0
- package/assets/templates/views/cart/content.ts +11 -0
- package/assets/templates/views/cart/data.ts +23 -0
- package/assets/templates/views/cart/index.tsx +53 -0
- package/assets/templates/views/cart/props.ts +12 -0
- package/assets/templates/views/cart/registry.tsx +82 -0
- package/assets/templates/views/cart/schema.ts +52 -0
- package/assets/templates/views/category/assembly/assembly.json +2 -1
- package/assets/templates/views/category/assembly/index.skeleton.tsx +64 -6
- package/assets/templates/views/category/assembly/registry.skeleton.tsx +7 -6
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/binding.json +5 -0
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/catalog.part +4 -0
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/element.part +7 -0
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/registry.part +18 -0
- package/assets/templates/views/category/index.tsx +76 -7
- package/assets/templates/views/category/props.ts +7 -0
- package/assets/templates/views/category/registry.tsx +25 -6
- package/assets/templates/views/category/schema.ts +13 -0
- package/assets/templates/views/checkout/registry.tsx +3 -5
- package/assets/templates/views/home/assembly/assembly.json +12 -3
- package/assets/templates/views/home/assembly/index.skeleton.tsx +24 -5
- 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/StorefrontHero/element.part +5 -0
- package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/registry.part +5 -3
- package/assets/templates/views/home/content.ts +22 -0
- package/assets/templates/views/home/data.ts +9 -0
- package/assets/templates/views/home/index.tsx +34 -11
- package/assets/templates/views/home/props.ts +1 -0
- package/assets/templates/views/home/registry.tsx +41 -17
- package/assets/templates/views/home/schema.ts +141 -24
- package/assets/templates/views/product/data.ts +5 -3
- package/assets/templates/views/product/index.tsx +49 -5
- package/assets/templates/views/product/props.ts +7 -0
- package/assets/templates/views/product/registry.tsx +34 -5
- package/assets/templates/views/product/schema.ts +49 -1
- package/assets/templates/views/static/content.ts +4 -4
- package/assets/templates/views/static/index.tsx +1 -1
- package/bin/storefront.js +1231 -154
- package/examples/merchandising/category-led.json +37 -0
- package/examples/merchandising/collection-led.json +37 -0
- package/package.json +10 -7
- package/recipes/archetypes.json +33 -46
- package/recipes/catalog.json +245 -153
- package/recipes/catalog.mjs +10 -0
- package/recipes/catalog.schema.json +4 -0
- package/recipes/features.json +28 -5
- package/recipes/recipe.schema.json +1 -1
- package/recipes/recipes.json +159 -59
- package/recipes/sections.json +10 -0
- package/recipes/validate.mjs +75 -4
- package/scripts/candidate.mjs +4 -4
- package/scripts/composers.mjs +25 -5
- package/scripts/env-file.mjs +86 -0
- package/scripts/file-classes.mjs +15 -0
- package/scripts/migrate-english-routes.mjs +276 -0
- package/scripts/ownership-conflict.mjs +5 -2
- package/scripts/pinning.mjs +74 -5
- package/scripts/plan-apply.mjs +149 -5
- package/scripts/reconcile.mjs +49 -11
- package/scripts/render-templates.mjs +97 -44
- package/scripts/section-config.mjs +253 -0
- package/scripts/starter.mjs +17 -0
- package/scripts/theme/color.mjs +185 -0
- package/scripts/theme/css-theme.mjs +233 -0
- package/scripts/theme/fonts.mjs +123 -0
- package/scripts/theme/import-export.mjs +125 -0
- package/scripts/theme/preset.mjs +93 -0
- package/scripts/theme/theme-plan.mjs +292 -0
- package/scripts/theme/tokens.mjs +137 -0
- package/scripts/view-assembly.mjs +57 -3
- package/scripts/view-selection.mjs +1 -1
- package/skills/sf-feature/SKILL.md +32 -19
- package/skills/sf-setup/SKILL.md +79 -0
- package/skills/sf-theme-gen/SKILL.md +99 -36
- package/skills/sf-theme-gen/references/shadcn-theming.md +87 -0
- package/skills/{shadcn-theming/references/templates → sf-theme-gen/references}/theme-setup.md +15 -19
- package/skills/{shadcn-theming → sf-theme-gen}/references/theming-guide.md +6 -11
- package/skills/sf-view-gen/SKILL.md +63 -40
- package/skills/sf-view-gen/assets/recipes/archetypes.json +33 -46
- package/skills/sf-view-gen/assets/recipes/catalog.json +245 -153
- package/skills/sf-view-gen/assets/recipes/catalog.schema.json +4 -0
- package/skills/sf-view-gen/assets/recipes/features.json +28 -5
- package/skills/sf-view-gen/assets/recipes/recipes.json +159 -59
- package/skills/sf-view-gen/assets/recipes/sections.json +10 -0
- 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 +100 -0
- package/skills/sf-view-gen/assets/templates/views/sections/products.tsx +19 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.products.ts +39 -0
- 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 +1 -1
- package/skills/{json-render-core/SKILL.md → sf-view-gen/references/json-render-core.md} +4 -27
- package/skills/{json-render-next/SKILL.md → sf-view-gen/references/json-render-next.md} +5 -8
- package/skills/{json-render-react/SKILL.md → sf-view-gen/references/json-render-react.md} +3 -5
- package/skills/{json-render-shadcn/SKILL.md → sf-view-gen/references/json-render-shadcn.md} +3 -5
- package/skills/sf-view-gen/references/views.md +28 -37
- package/skills/sf-view-gen/scripts/catalog.mjs +10 -0
- package/skills/sf-view-gen/scripts/validate.mjs +75 -4
- package/skills/storefront-workflow/SKILL.md +94 -31
- package/skills/{storefront-best-practices/reference/design.md → storefront-workflow/references/design-consistency.md} +13 -29
- package/CHANGELOG.md +0 -84
- 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/hero/StorefrontHero1/element.part +0 -5
- package/assets/templates/views/user-panel/index.tsx +0 -106
- package/assets/templates/views/user-panel/registry.tsx +0 -54
- package/assets/templates/views/user-panel/schema.ts +0 -79
- package/commands/sf-add-view.md +0 -57
- package/commands/sf-feature.md +0 -28
- package/commands/sf-theme.md +0 -26
- package/commands/sf-view.md +0 -67
- package/skills/building-storefronts/SKILL.md +0 -178
- package/skills/building-storefronts/references/frontend-integration.md +0 -229
- package/skills/json-render-remotion/SKILL.md +0 -111
- package/skills/json-render-solid/SKILL.md +0 -204
- package/skills/nextjs-shadcn/SKILL.md +0 -367
- package/skills/nextjs-shadcn/references/architecture.md +0 -499
- package/skills/nextjs-shadcn/references/project-setup.md +0 -162
- package/skills/nextjs-shadcn/references/shadcn-platform.md +0 -261
- package/skills/nextjs-shadcn/references/sidebar.md +0 -274
- package/skills/nextjs-shadcn/references/styling.md +0 -555
- package/skills/shadcn-component-discovery/SKILL.md +0 -273
- package/skills/shadcn-component-discovery/references/registries.md +0 -226
- package/skills/shadcn-theming/SKILL.md +0 -104
- package/skills/storefront-best-practices/SKILL.md +0 -421
- package/skills/storefront-best-practices/reference/components/breadcrumbs.md +0 -123
- package/skills/storefront-best-practices/reference/components/cart-popup.md +0 -189
- package/skills/storefront-best-practices/reference/components/country-selector.md +0 -298
- package/skills/storefront-best-practices/reference/components/footer.md +0 -112
- package/skills/storefront-best-practices/reference/components/hero.md +0 -241
- package/skills/storefront-best-practices/reference/components/megamenu.md +0 -239
- package/skills/storefront-best-practices/reference/components/navbar.md +0 -397
- package/skills/storefront-best-practices/reference/components/popups.md +0 -221
- package/skills/storefront-best-practices/reference/components/product-card.md +0 -125
- package/skills/storefront-best-practices/reference/components/product-reviews.md +0 -217
- package/skills/storefront-best-practices/reference/components/product-slider.md +0 -174
- package/skills/storefront-best-practices/reference/components/search.md +0 -101
- package/skills/storefront-best-practices/reference/connecting-to-backend.md +0 -391
- package/skills/storefront-best-practices/reference/features/promotions.md +0 -307
- package/skills/storefront-best-practices/reference/features/wishlist.md +0 -230
- package/skills/storefront-best-practices/reference/layouts/account.md +0 -380
- package/skills/storefront-best-practices/reference/layouts/cart.md +0 -316
- package/skills/storefront-best-practices/reference/layouts/checkout.md +0 -486
- package/skills/storefront-best-practices/reference/layouts/home-page.md +0 -264
- package/skills/storefront-best-practices/reference/layouts/order-confirmation.md +0 -231
- package/skills/storefront-best-practices/reference/layouts/product-details.md +0 -527
- package/skills/storefront-best-practices/reference/layouts/product-listing.md +0 -520
- package/skills/storefront-best-practices/reference/layouts/static-pages.md +0 -356
- package/skills/storefront-best-practices/reference/medusa.md +0 -307
- /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/skills/{storefront-best-practices/reference → storefront-workflow/references}/mobile-responsiveness.md +0 -0
- /package/skills/{storefront-best-practices/reference → storefront-workflow/references}/seo.md +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 (change: storefront-customer-auth) declares the login/register slots: LoginPage1/SignUpPage1 are executable while LoginPage2 is held for its divergent callback contract. 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
|
|
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 (change: storefront-customer-auth) declares the login/register slots: LoginPage1/SignUpPage1 are executable while LoginPage2 is held for its divergent callback contract. 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,71 @@
|
|
|
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
|
+
]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"product.breadcrumb": {
|
|
141
|
+
"default": "Breadcrumb",
|
|
142
|
+
"variants": {
|
|
143
|
+
"Breadcrumb": {
|
|
144
|
+
"status": "executable",
|
|
145
|
+
"block": "Breadcrumb",
|
|
146
|
+
"dataShape": "BreadcrumbItemData[]",
|
|
147
|
+
"events": [],
|
|
148
|
+
"state": "uncontrolled",
|
|
149
|
+
"requirements": [
|
|
150
|
+
"productBreadcrumb"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"cart.view": {
|
|
156
|
+
"default": "ShoppingCart",
|
|
157
|
+
"legacyAliases": {
|
|
158
|
+
"ShoppingCart1": "ShoppingCart",
|
|
159
|
+
"ShoppingCart2": "ShoppingCart",
|
|
160
|
+
"ShoppingCart3": "ShoppingCart",
|
|
161
|
+
"ShoppingCart4": "ShoppingCart"
|
|
162
|
+
},
|
|
163
|
+
"variants": {
|
|
164
|
+
"ShoppingCart": {
|
|
165
|
+
"status": "executable",
|
|
166
|
+
"block": "ShoppingCart",
|
|
167
|
+
"dataShape": "CartLineState[] & CartTotalsState",
|
|
168
|
+
"events": [
|
|
169
|
+
"refreshCart",
|
|
170
|
+
"updateQuantity",
|
|
171
|
+
"removeFromCart",
|
|
172
|
+
"checkout",
|
|
173
|
+
"continueShopping"
|
|
174
|
+
],
|
|
175
|
+
"state": "controlled",
|
|
176
|
+
"requirements": [
|
|
177
|
+
"cart",
|
|
178
|
+
"cartTotals"
|
|
179
|
+
]
|
|
157
180
|
}
|
|
158
181
|
}
|
|
159
182
|
},
|
|
@@ -177,65 +200,64 @@
|
|
|
177
200
|
"removeFilter"
|
|
178
201
|
],
|
|
179
202
|
"state": "controlled",
|
|
180
|
-
"requirements": [
|
|
203
|
+
"requirements": [
|
|
204
|
+
"categoryProducts",
|
|
205
|
+
"categoryQuery",
|
|
206
|
+
"facetSupport"
|
|
207
|
+
]
|
|
181
208
|
},
|
|
182
209
|
"CategoryFilter1": {
|
|
183
210
|
"status": "held",
|
|
184
211
|
"reason": "block requires categories/priceRanges/sortOptions with counts the canonical CardProduct[] listing does not supply; no verified prop bridge exists",
|
|
185
212
|
"block": "CategoryFilter",
|
|
186
213
|
"dataShape": "CategoryFilter1Filters",
|
|
187
|
-
"events": [
|
|
214
|
+
"events": [
|
|
215
|
+
"filterChange"
|
|
216
|
+
],
|
|
188
217
|
"state": "uncontrolled",
|
|
189
|
-
"requirements": [
|
|
218
|
+
"requirements": [
|
|
219
|
+
"categoryProducts"
|
|
220
|
+
]
|
|
190
221
|
},
|
|
191
222
|
"CategoryFilter4": {
|
|
192
223
|
"status": "held",
|
|
193
224
|
"reason": "block requires an advanced facets contract (modelTypes/rangeBands/frameSizes/colourways/features) the canonical listing does not supply; no verified prop bridge exists",
|
|
194
225
|
"block": "CategoryFilter",
|
|
195
226
|
"dataShape": "CategoryFilter4Facets",
|
|
196
|
-
"events": [
|
|
227
|
+
"events": [
|
|
228
|
+
"filterChange"
|
|
229
|
+
],
|
|
197
230
|
"state": "uncontrolled",
|
|
198
|
-
"requirements": [
|
|
231
|
+
"requirements": [
|
|
232
|
+
"categoryProducts"
|
|
233
|
+
]
|
|
199
234
|
}
|
|
200
235
|
}
|
|
201
236
|
},
|
|
202
237
|
"category.productCard": {
|
|
203
|
-
"default": "
|
|
238
|
+
"default": "ProductGrid",
|
|
239
|
+
"legacyAliases": {
|
|
240
|
+
"ProductCard": "ProductGrid",
|
|
241
|
+
"ProductCard1": "ProductGrid",
|
|
242
|
+
"ProductCard2": "ProductGrid",
|
|
243
|
+
"ProductCard3": "ProductGrid",
|
|
244
|
+
"ProductCard5": "ProductGrid"
|
|
245
|
+
},
|
|
204
246
|
"variants": {
|
|
205
|
-
"
|
|
247
|
+
"ProductGrid": {
|
|
206
248
|
"status": "executable",
|
|
207
|
-
"block": "
|
|
208
|
-
"dataShape": "
|
|
209
|
-
"events": [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"reason": "block requires a product with a required rating, a shape the canonical CardProduct listing does not supply; no verified prop bridge exists",
|
|
216
|
-
"block": "ProductCard",
|
|
217
|
-
"dataShape": "ProductCard2Product[]",
|
|
218
|
-
"events": [],
|
|
249
|
+
"block": "ProductGrid",
|
|
250
|
+
"dataShape": "ProductPresentation[]",
|
|
251
|
+
"events": [
|
|
252
|
+
"addToCart",
|
|
253
|
+
"openProduct",
|
|
254
|
+
"toggleWishlist",
|
|
255
|
+
"viewSimilar"
|
|
256
|
+
],
|
|
219
257
|
"state": "uncontrolled",
|
|
220
|
-
"requirements": [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"status": "held",
|
|
224
|
-
"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",
|
|
225
|
-
"block": "ProductCard",
|
|
226
|
-
"dataShape": "ProductCard3Product[]",
|
|
227
|
-
"events": ["toggleWishlist", "viewSimilar", "productClick"],
|
|
228
|
-
"state": "controlled",
|
|
229
|
-
"requirements": ["categoryProducts"]
|
|
230
|
-
},
|
|
231
|
-
"ProductCard5": {
|
|
232
|
-
"status": "held",
|
|
233
|
-
"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",
|
|
234
|
-
"block": "ProductCard",
|
|
235
|
-
"dataShape": "ProductCard5Product[]",
|
|
236
|
-
"events": ["toggleWishlist", "addToCart", "quickView", "compare", "export"],
|
|
237
|
-
"state": "controlled",
|
|
238
|
-
"requirements": ["categoryProducts"]
|
|
258
|
+
"requirements": [
|
|
259
|
+
"categoryProducts"
|
|
260
|
+
]
|
|
239
261
|
}
|
|
240
262
|
}
|
|
241
263
|
},
|
|
@@ -246,27 +268,45 @@
|
|
|
246
268
|
"status": "executable",
|
|
247
269
|
"block": "Checkout",
|
|
248
270
|
"dataShape": "CheckoutForm1FormData",
|
|
249
|
-
"events": [
|
|
271
|
+
"events": [
|
|
272
|
+
"retryTotals",
|
|
273
|
+
"selectShippingOption",
|
|
274
|
+
"applyPromo",
|
|
275
|
+
"submit"
|
|
276
|
+
],
|
|
250
277
|
"state": "controlled",
|
|
251
|
-
"requirements": [
|
|
278
|
+
"requirements": [
|
|
279
|
+
"checkoutCountries",
|
|
280
|
+
"checkoutPaymentMethods"
|
|
281
|
+
]
|
|
252
282
|
},
|
|
253
283
|
"CheckoutForm2": {
|
|
254
284
|
"status": "held",
|
|
255
285
|
"reason": "unproven checkout variant: E1 keeps only the default CheckoutForm1, whose behavior is unchanged; no verified prop bridge exists",
|
|
256
286
|
"block": "Checkout",
|
|
257
287
|
"dataShape": "CheckoutForm2Data",
|
|
258
|
-
"events": [
|
|
288
|
+
"events": [
|
|
289
|
+
"submit"
|
|
290
|
+
],
|
|
259
291
|
"state": "controlled",
|
|
260
|
-
"requirements": [
|
|
292
|
+
"requirements": [
|
|
293
|
+
"checkoutCountries",
|
|
294
|
+
"checkoutPaymentMethods"
|
|
295
|
+
]
|
|
261
296
|
},
|
|
262
297
|
"CheckoutForm3": {
|
|
263
298
|
"status": "held",
|
|
264
299
|
"reason": "unproven checkout variant: E1 keeps only the default CheckoutForm1, whose behavior is unchanged; no verified prop bridge exists",
|
|
265
300
|
"block": "Checkout",
|
|
266
301
|
"dataShape": "CheckoutForm3FormData",
|
|
267
|
-
"events": [
|
|
302
|
+
"events": [
|
|
303
|
+
"submit"
|
|
304
|
+
],
|
|
268
305
|
"state": "controlled",
|
|
269
|
-
"requirements": [
|
|
306
|
+
"requirements": [
|
|
307
|
+
"checkoutCountries",
|
|
308
|
+
"checkoutPaymentMethods"
|
|
309
|
+
]
|
|
270
310
|
}
|
|
271
311
|
}
|
|
272
312
|
},
|
|
@@ -277,9 +317,13 @@
|
|
|
277
317
|
"status": "executable",
|
|
278
318
|
"block": "CheckoutConfirmation",
|
|
279
319
|
"dataShape": "Receipt",
|
|
280
|
-
"events": [
|
|
320
|
+
"events": [
|
|
321
|
+
"continueShopping"
|
|
322
|
+
],
|
|
281
323
|
"state": "uncontrolled",
|
|
282
|
-
"requirements": [
|
|
324
|
+
"requirements": [
|
|
325
|
+
"lastReceipt"
|
|
326
|
+
]
|
|
283
327
|
}
|
|
284
328
|
}
|
|
285
329
|
},
|
|
@@ -290,18 +334,31 @@
|
|
|
290
334
|
"status": "executable",
|
|
291
335
|
"block": "LoginPage1",
|
|
292
336
|
"dataShape": "LoginPage1FormData & AccountAuthResult",
|
|
293
|
-
"events": [
|
|
337
|
+
"events": [
|
|
338
|
+
"submit",
|
|
339
|
+
"createAccount"
|
|
340
|
+
],
|
|
294
341
|
"state": "controlled",
|
|
295
|
-
"requirements": [
|
|
342
|
+
"requirements": [
|
|
343
|
+
"accountCustomer",
|
|
344
|
+
"accountAuthenticated"
|
|
345
|
+
]
|
|
296
346
|
},
|
|
297
347
|
"LoginPage2": {
|
|
298
348
|
"status": "held",
|
|
299
349
|
"reason": "block's onSubmit takes positional (email, password) with no remember-me field and renders a 2-column social grid; no verified prop bridge from the account element contract exists",
|
|
300
350
|
"block": "LoginPage2",
|
|
301
351
|
"dataShape": "LoginPage2Credentials & AccountAuthResult",
|
|
302
|
-
"events": [
|
|
352
|
+
"events": [
|
|
353
|
+
"submit",
|
|
354
|
+
"forgotPassword",
|
|
355
|
+
"signUp"
|
|
356
|
+
],
|
|
303
357
|
"state": "controlled",
|
|
304
|
-
"requirements": [
|
|
358
|
+
"requirements": [
|
|
359
|
+
"accountCustomer",
|
|
360
|
+
"accountAuthenticated"
|
|
361
|
+
]
|
|
305
362
|
}
|
|
306
363
|
}
|
|
307
364
|
},
|
|
@@ -312,9 +369,15 @@
|
|
|
312
369
|
"status": "executable",
|
|
313
370
|
"block": "SignUpPage1",
|
|
314
371
|
"dataShape": "SignUpPage1Data & AccountAuthResult",
|
|
315
|
-
"events": [
|
|
372
|
+
"events": [
|
|
373
|
+
"submit",
|
|
374
|
+
"signIn"
|
|
375
|
+
],
|
|
316
376
|
"state": "controlled",
|
|
317
|
-
"requirements": [
|
|
377
|
+
"requirements": [
|
|
378
|
+
"accountCustomer",
|
|
379
|
+
"accountAuthenticated"
|
|
380
|
+
]
|
|
318
381
|
}
|
|
319
382
|
}
|
|
320
383
|
},
|
|
@@ -325,9 +388,14 @@
|
|
|
325
388
|
"status": "executable",
|
|
326
389
|
"block": "OrderHistory2",
|
|
327
390
|
"dataShape": "AccountOrderView[] & OrderHistory2Labels",
|
|
328
|
-
"events": [
|
|
391
|
+
"events": [
|
|
392
|
+
"viewDetails"
|
|
393
|
+
],
|
|
329
394
|
"state": "controlled",
|
|
330
|
-
"requirements": [
|
|
395
|
+
"requirements": [
|
|
396
|
+
"accountCustomer",
|
|
397
|
+
"accountAuthenticated"
|
|
398
|
+
]
|
|
331
399
|
},
|
|
332
400
|
"OrderHistory1": {
|
|
333
401
|
"status": "held",
|
|
@@ -336,24 +404,48 @@
|
|
|
336
404
|
"dataShape": "OrderHistory1Order[]",
|
|
337
405
|
"events": [],
|
|
338
406
|
"state": "controlled",
|
|
339
|
-
"requirements": [
|
|
407
|
+
"requirements": [
|
|
408
|
+
"accountCustomer",
|
|
409
|
+
"accountAuthenticated"
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"category.breadcrumb": {
|
|
415
|
+
"default": "Breadcrumb",
|
|
416
|
+
"variants": {
|
|
417
|
+
"Breadcrumb": {
|
|
418
|
+
"status": "executable",
|
|
419
|
+
"block": "Breadcrumb",
|
|
420
|
+
"dataShape": "BreadcrumbItemData[]",
|
|
421
|
+
"events": [],
|
|
422
|
+
"state": "uncontrolled",
|
|
423
|
+
"requirements": [
|
|
424
|
+
"categoryBreadcrumb"
|
|
425
|
+
]
|
|
340
426
|
}
|
|
341
427
|
}
|
|
342
428
|
}
|
|
343
429
|
},
|
|
344
430
|
"capabilities": {
|
|
345
431
|
"category.search.apply": {
|
|
346
|
-
"requirements": [
|
|
432
|
+
"requirements": [
|
|
433
|
+
"adapter.getCatalogProducts(query).text"
|
|
434
|
+
],
|
|
347
435
|
"verification": "unverified",
|
|
348
436
|
"owner": "storefront-catalog-search-filters"
|
|
349
437
|
},
|
|
350
438
|
"category.filter.apply": {
|
|
351
|
-
"requirements": [
|
|
439
|
+
"requirements": [
|
|
440
|
+
"adapter.getProducts(query)"
|
|
441
|
+
],
|
|
352
442
|
"verification": "unverified",
|
|
353
443
|
"owner": "storefront-catalog-search-filters"
|
|
354
444
|
},
|
|
355
445
|
"category.price.range": {
|
|
356
|
-
"requirements": [
|
|
446
|
+
"requirements": [
|
|
447
|
+
"adapter.getAvailableFilters(query).priceRange"
|
|
448
|
+
],
|
|
357
449
|
"verification": "unverified",
|
|
358
450
|
"owner": "storefront-catalog-search-filters"
|
|
359
451
|
}
|
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": {
|