@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.
Files changed (225) hide show
  1. package/README.md +174 -156
  2. package/VENDOR.md +69 -0
  3. package/assets/openspec/config.yaml +38 -0
  4. package/assets/templates/AGENTS.md +76 -0
  5. package/assets/templates/app/app/[[...slug]]/page.tsx +56 -2
  6. package/assets/templates/app/app/[[...slug]]/renderer.tsx +44 -2
  7. package/assets/templates/app/app/globals.css +5 -8
  8. package/assets/templates/app/app/layout.tsx +1 -5
  9. package/assets/templates/app/app/robots.ts +9 -3
  10. package/assets/templates/app/app/sitemap.ts +64 -5
  11. package/assets/templates/app/lib/__STOREFRONT__/account-boundary.client.tsx +76 -0
  12. package/assets/templates/app/lib/__STOREFRONT__/account-lifecycle.client.tsx +461 -0
  13. package/assets/templates/app/lib/__STOREFRONT__/account-mutation.client.ts +46 -0
  14. package/assets/templates/app/lib/__STOREFRONT__/account-private.core.ts +103 -0
  15. package/assets/templates/app/lib/__STOREFRONT__/account-reconcile.client.ts +465 -0
  16. package/assets/templates/app/lib/__STOREFRONT__/account-session.core.ts +177 -0
  17. package/assets/templates/app/lib/__STOREFRONT__/account-session.ts +44 -0
  18. package/assets/templates/app/lib/__STOREFRONT__/account-user.core.ts +65 -0
  19. package/assets/templates/app/lib/__STOREFRONT__/actions.ts +135 -16
  20. package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +19 -9
  21. package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +61 -0
  22. package/assets/templates/app/lib/__STOREFRONT__/composition.ts +26 -0
  23. package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +36 -4
  24. package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +17 -18
  25. package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.client.tsx +209 -0
  26. package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.ts +247 -0
  27. package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +123 -62
  28. package/assets/templates/app/lib/__STOREFRONT__/runtime.ts +3 -0
  29. package/assets/templates/app/lib/__STOREFRONT__/schema.ts +78 -25
  30. package/assets/templates/app/lib/__STOREFRONT__/section-observation.ts +182 -0
  31. package/assets/templates/app/lib/__STOREFRONT__/section-sources.ts +128 -0
  32. package/assets/templates/app/lib/__STOREFRONT__/shell/content.ts +31 -7
  33. package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +4 -0
  34. package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +81 -26
  35. package/assets/templates/app/lib/__STOREFRONT__/spec/seo.ts +165 -0
  36. package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +4 -2
  37. package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +26 -7
  38. package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.client.tsx +1 -1
  39. package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.client.tsx +1 -1
  40. package/assets/templates/app/lib/__STOREFRONT__/views/sections/index.ts +2 -1
  41. package/assets/templates/app/lib/__STOREFRONT__/views/sections/logoCloud.tsx +1 -1
  42. package/assets/templates/app/lib/__STOREFRONT__/views/sections/pricing.tsx +1 -1
  43. package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.client.tsx +100 -0
  44. package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.tsx +19 -0
  45. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.products.ts +39 -0
  46. package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +1 -1
  47. package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +1 -1
  48. package/assets/templates/features/checkout/handlers.ts +6 -0
  49. package/assets/templates/features/customer-auth/handlers.ts +19 -23
  50. package/assets/templates/features/customer-auth/state.ts +31 -1
  51. package/assets/templates/views/account/index.tsx +20 -8
  52. package/assets/templates/views/account/registry.tsx +294 -154
  53. package/assets/templates/views/account/schema.ts +1 -0
  54. package/assets/templates/views/cart/content.ts +11 -0
  55. package/assets/templates/views/cart/data.ts +23 -0
  56. package/assets/templates/views/cart/index.tsx +53 -0
  57. package/assets/templates/views/cart/props.ts +12 -0
  58. package/assets/templates/views/cart/registry.tsx +82 -0
  59. package/assets/templates/views/cart/schema.ts +52 -0
  60. package/assets/templates/views/category/assembly/assembly.json +2 -1
  61. package/assets/templates/views/category/assembly/index.skeleton.tsx +64 -6
  62. package/assets/templates/views/category/assembly/registry.skeleton.tsx +7 -6
  63. package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/binding.json +5 -0
  64. package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/catalog.part +4 -0
  65. package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/element.part +7 -0
  66. package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/registry.part +18 -0
  67. package/assets/templates/views/category/index.tsx +76 -7
  68. package/assets/templates/views/category/props.ts +7 -0
  69. package/assets/templates/views/category/registry.tsx +25 -6
  70. package/assets/templates/views/category/schema.ts +13 -0
  71. package/assets/templates/views/checkout/registry.tsx +3 -5
  72. package/assets/templates/views/home/assembly/assembly.json +12 -3
  73. package/assets/templates/views/home/assembly/index.skeleton.tsx +24 -5
  74. package/assets/templates/views/home/assembly/registry.skeleton.tsx +4 -1
  75. package/assets/templates/views/home/assembly/slots/benefits/cards/binding.json +5 -0
  76. package/assets/templates/views/home/assembly/slots/benefits/cards/registry.part +17 -0
  77. package/assets/templates/views/home/assembly/slots/benefits/split/binding.json +5 -0
  78. package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → split}/registry.part +6 -2
  79. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +5 -0
  80. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +8 -0
  81. package/assets/templates/views/home/assembly/slots/categories/{ProductCategory2 → CategoryGrid}/element.part +1 -1
  82. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +31 -0
  83. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/binding.json +5 -0
  84. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/catalog.part +4 -0
  85. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/element.part +5 -0
  86. package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/registry.part +5 -3
  87. package/assets/templates/views/home/content.ts +22 -0
  88. package/assets/templates/views/home/data.ts +9 -0
  89. package/assets/templates/views/home/index.tsx +34 -11
  90. package/assets/templates/views/home/props.ts +1 -0
  91. package/assets/templates/views/home/registry.tsx +41 -17
  92. package/assets/templates/views/home/schema.ts +141 -24
  93. package/assets/templates/views/product/data.ts +5 -3
  94. package/assets/templates/views/product/index.tsx +49 -5
  95. package/assets/templates/views/product/props.ts +7 -0
  96. package/assets/templates/views/product/registry.tsx +34 -5
  97. package/assets/templates/views/product/schema.ts +49 -1
  98. package/assets/templates/views/static/content.ts +4 -4
  99. package/assets/templates/views/static/index.tsx +1 -1
  100. package/bin/storefront.js +1231 -154
  101. package/examples/merchandising/category-led.json +37 -0
  102. package/examples/merchandising/collection-led.json +37 -0
  103. package/package.json +10 -7
  104. package/recipes/archetypes.json +33 -46
  105. package/recipes/catalog.json +245 -153
  106. package/recipes/catalog.mjs +10 -0
  107. package/recipes/catalog.schema.json +4 -0
  108. package/recipes/features.json +28 -5
  109. package/recipes/recipe.schema.json +1 -1
  110. package/recipes/recipes.json +159 -59
  111. package/recipes/sections.json +10 -0
  112. package/recipes/validate.mjs +75 -4
  113. package/scripts/candidate.mjs +4 -4
  114. package/scripts/composers.mjs +25 -5
  115. package/scripts/env-file.mjs +86 -0
  116. package/scripts/file-classes.mjs +15 -0
  117. package/scripts/migrate-english-routes.mjs +276 -0
  118. package/scripts/ownership-conflict.mjs +5 -2
  119. package/scripts/pinning.mjs +74 -5
  120. package/scripts/plan-apply.mjs +149 -5
  121. package/scripts/reconcile.mjs +49 -11
  122. package/scripts/render-templates.mjs +97 -44
  123. package/scripts/section-config.mjs +253 -0
  124. package/scripts/starter.mjs +17 -0
  125. package/scripts/theme/color.mjs +185 -0
  126. package/scripts/theme/css-theme.mjs +233 -0
  127. package/scripts/theme/fonts.mjs +123 -0
  128. package/scripts/theme/import-export.mjs +125 -0
  129. package/scripts/theme/preset.mjs +93 -0
  130. package/scripts/theme/theme-plan.mjs +292 -0
  131. package/scripts/theme/tokens.mjs +137 -0
  132. package/scripts/view-assembly.mjs +57 -3
  133. package/scripts/view-selection.mjs +1 -1
  134. package/skills/sf-feature/SKILL.md +32 -19
  135. package/skills/sf-setup/SKILL.md +79 -0
  136. package/skills/sf-theme-gen/SKILL.md +99 -36
  137. package/skills/sf-theme-gen/references/shadcn-theming.md +87 -0
  138. package/skills/{shadcn-theming/references/templates → sf-theme-gen/references}/theme-setup.md +15 -19
  139. package/skills/{shadcn-theming → sf-theme-gen}/references/theming-guide.md +6 -11
  140. package/skills/sf-view-gen/SKILL.md +63 -40
  141. package/skills/sf-view-gen/assets/recipes/archetypes.json +33 -46
  142. package/skills/sf-view-gen/assets/recipes/catalog.json +245 -153
  143. package/skills/sf-view-gen/assets/recipes/catalog.schema.json +4 -0
  144. package/skills/sf-view-gen/assets/recipes/features.json +28 -5
  145. package/skills/sf-view-gen/assets/recipes/recipes.json +159 -59
  146. package/skills/sf-view-gen/assets/recipes/sections.json +10 -0
  147. package/skills/sf-view-gen/assets/templates/views/sections/cta.client.tsx +1 -1
  148. package/skills/sf-view-gen/assets/templates/views/sections/faq.client.tsx +1 -1
  149. package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.client.tsx +1 -1
  150. package/skills/sf-view-gen/assets/templates/views/sections/pricing.client.tsx +1 -1
  151. package/skills/sf-view-gen/assets/templates/views/sections/products.client.tsx +100 -0
  152. package/skills/sf-view-gen/assets/templates/views/sections/products.tsx +19 -0
  153. package/skills/sf-view-gen/assets/templates/views/sections/schema.products.ts +39 -0
  154. package/skills/sf-view-gen/assets/templates/views/sections/statistics.client.tsx +1 -1
  155. package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +1 -1
  156. package/skills/{json-render-core/SKILL.md → sf-view-gen/references/json-render-core.md} +4 -27
  157. package/skills/{json-render-next/SKILL.md → sf-view-gen/references/json-render-next.md} +5 -8
  158. package/skills/{json-render-react/SKILL.md → sf-view-gen/references/json-render-react.md} +3 -5
  159. package/skills/{json-render-shadcn/SKILL.md → sf-view-gen/references/json-render-shadcn.md} +3 -5
  160. package/skills/sf-view-gen/references/views.md +28 -37
  161. package/skills/sf-view-gen/scripts/catalog.mjs +10 -0
  162. package/skills/sf-view-gen/scripts/validate.mjs +75 -4
  163. package/skills/storefront-workflow/SKILL.md +94 -31
  164. package/skills/{storefront-best-practices/reference/design.md → storefront-workflow/references/design-consistency.md} +13 -29
  165. package/CHANGELOG.md +0 -84
  166. package/assets/templates/views/home/assembly/slots/benefits/Feature1/binding.json +0 -5
  167. package/assets/templates/views/home/assembly/slots/benefits/Feature2/binding.json +0 -5
  168. package/assets/templates/views/home/assembly/slots/benefits/Feature2/registry.part +0 -10
  169. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/binding.json +0 -5
  170. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/catalog.part +0 -4
  171. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/registry.part +0 -16
  172. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/binding.json +0 -5
  173. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/catalog.part +0 -4
  174. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/element.part +0 -5
  175. package/assets/templates/views/user-panel/index.tsx +0 -106
  176. package/assets/templates/views/user-panel/registry.tsx +0 -54
  177. package/assets/templates/views/user-panel/schema.ts +0 -79
  178. package/commands/sf-add-view.md +0 -57
  179. package/commands/sf-feature.md +0 -28
  180. package/commands/sf-theme.md +0 -26
  181. package/commands/sf-view.md +0 -67
  182. package/skills/building-storefronts/SKILL.md +0 -178
  183. package/skills/building-storefronts/references/frontend-integration.md +0 -229
  184. package/skills/json-render-remotion/SKILL.md +0 -111
  185. package/skills/json-render-solid/SKILL.md +0 -204
  186. package/skills/nextjs-shadcn/SKILL.md +0 -367
  187. package/skills/nextjs-shadcn/references/architecture.md +0 -499
  188. package/skills/nextjs-shadcn/references/project-setup.md +0 -162
  189. package/skills/nextjs-shadcn/references/shadcn-platform.md +0 -261
  190. package/skills/nextjs-shadcn/references/sidebar.md +0 -274
  191. package/skills/nextjs-shadcn/references/styling.md +0 -555
  192. package/skills/shadcn-component-discovery/SKILL.md +0 -273
  193. package/skills/shadcn-component-discovery/references/registries.md +0 -226
  194. package/skills/shadcn-theming/SKILL.md +0 -104
  195. package/skills/storefront-best-practices/SKILL.md +0 -421
  196. package/skills/storefront-best-practices/reference/components/breadcrumbs.md +0 -123
  197. package/skills/storefront-best-practices/reference/components/cart-popup.md +0 -189
  198. package/skills/storefront-best-practices/reference/components/country-selector.md +0 -298
  199. package/skills/storefront-best-practices/reference/components/footer.md +0 -112
  200. package/skills/storefront-best-practices/reference/components/hero.md +0 -241
  201. package/skills/storefront-best-practices/reference/components/megamenu.md +0 -239
  202. package/skills/storefront-best-practices/reference/components/navbar.md +0 -397
  203. package/skills/storefront-best-practices/reference/components/popups.md +0 -221
  204. package/skills/storefront-best-practices/reference/components/product-card.md +0 -125
  205. package/skills/storefront-best-practices/reference/components/product-reviews.md +0 -217
  206. package/skills/storefront-best-practices/reference/components/product-slider.md +0 -174
  207. package/skills/storefront-best-practices/reference/components/search.md +0 -101
  208. package/skills/storefront-best-practices/reference/connecting-to-backend.md +0 -391
  209. package/skills/storefront-best-practices/reference/features/promotions.md +0 -307
  210. package/skills/storefront-best-practices/reference/features/wishlist.md +0 -230
  211. package/skills/storefront-best-practices/reference/layouts/account.md +0 -380
  212. package/skills/storefront-best-practices/reference/layouts/cart.md +0 -316
  213. package/skills/storefront-best-practices/reference/layouts/checkout.md +0 -486
  214. package/skills/storefront-best-practices/reference/layouts/home-page.md +0 -264
  215. package/skills/storefront-best-practices/reference/layouts/order-confirmation.md +0 -231
  216. package/skills/storefront-best-practices/reference/layouts/product-details.md +0 -527
  217. package/skills/storefront-best-practices/reference/layouts/product-listing.md +0 -520
  218. package/skills/storefront-best-practices/reference/layouts/static-pages.md +0 -356
  219. package/skills/storefront-best-practices/reference/medusa.md +0 -307
  220. /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/catalog.part +0 -0
  221. /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/element.part +0 -0
  222. /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/catalog.part +0 -0
  223. /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/element.part +0 -0
  224. /package/skills/{storefront-best-practices/reference → storefront-workflow/references}/mobile-responsiveness.md +0 -0
  225. /package/skills/{storefront-best-practices/reference → storefront-workflow/references}/seo.md +0 -0
@@ -1,9 +1,12 @@
1
- # View templates
1
+ # View modules reference
2
2
 
3
- Each folder here is a self-contained view module. `npx @thorprovider/storefront create`
4
- generates `home/` at init; `npx @thorprovider/storefront view add <view>`
5
- generates one view's derived files and reconciles the barrel. The CLI — not the
6
- agent — writes the barrel and every derived file.
3
+ Reference material for the `sf-view-gen` skill. Each view is a self-contained
4
+ module the CLI generates into `lib/<name>/views/<view>/`. The CLI — not the
5
+ agent — writes the barrel and every derived file; `npx @thorprovider/storefront
6
+ view add <view>` generates one view's derived files and reconciles the barrel.
7
+
8
+ The available views are whatever `npx @thorprovider/storefront views --json`
9
+ reports; this file names none of them as the authoritative set.
7
10
 
8
11
  ## Module shape
9
12
 
@@ -11,7 +14,7 @@ Each view is the **three-file split** (RSC):
11
14
 
12
15
  - `views/<view>/index.tsx` — pure Server Component module: name, elements,
13
16
  zod catalog, route, loader. Never imports values from `@json-render/react`
14
- or `@thorprovider/blocks`.
17
+ or `@thorprovider/blocks`. **Derived — the CLI writes it; never hand-edit it.**
15
18
  - `views/<view>/schema.ts` — pure Zod schemas mirroring the block contracts
16
19
  the view renders (props only). No React, no `'use client'`, no Next imports.
17
20
  - `views/<view>/registry.tsx` — `'use client'`: exports
@@ -50,25 +53,14 @@ not hand-edit them; add or remove a view with
50
53
  and one entry per installed view, so a view removed from the manifest cannot
51
54
  reappear through folder scanning.
52
55
 
53
- ## Variant substitution convention
54
-
55
- Every slot imports its block variant under a **stable alias** and ships the
56
- recipe's default variant:
57
-
58
- ```ts
59
- import { ProductOverview1 as ProductOverviewBlock } from '@thorprovider/blocks'
60
- ```
61
-
62
- To apply a different (recipe-allowed) variant, replace **only the imported
63
- identifier** — never the alias, never the props:
64
-
65
- ```ts
66
- import { ProductOverview5 as ProductOverviewBlock } from '@thorprovider/blocks'
67
- ```
56
+ ## Variants
68
57
 
69
- The alias is the element type's contract; the identifier is the presentation
70
- choice. Keeping props identical across variants is why the catalog declares the
71
- stable subset of each element's props.
58
+ A slot's variant is a presentation choice recorded in the manifest and applied by
59
+ the reconciler. Change it through the CLI — `view add`/`remove` with
60
+ `--variant slot=Name` (a supported variant the registry reports), or a
61
+ `section.add` / `section.reorder` operation for editorial sections. Do not
62
+ hand-edit a derived `index.tsx` or registry to swap an imported identifier; the
63
+ next `sync` would overwrite it and the manifest would disagree with the files.
72
64
 
73
65
  ## Data contracts and icons
74
66
 
@@ -76,21 +68,20 @@ Two rules that keep generated views from crashing at render time:
76
68
 
77
69
  1. **Mappers are applied at loaders, never in registries.** Adapter canon does
78
70
  not match block props 1:1 (e.g. a category may carry `productCount?: number`
79
- or no count at all, and `ProductCategory2.itemCount` is **optional**). The
80
- view's loader maps adapter data through `lib/<name>/mappers.ts`
81
- (`toFeaturedProduct`, `toCategoryCard`, `toOverviewProduct`) before it reaches
82
- state. Registries receive already-mapped, block-shaped props. When a value is
83
- unknown (e.g. no category count), **omit** it — never fabricate a `0` default,
84
- which would render a false "0 items". A genuine `0` from a richer source is
71
+ or no count at all, and some count props are optional). The view's loader maps
72
+ adapter data through `lib/<name>/mappers.ts` before it reaches state.
73
+ Registries receive already-mapped, block-shaped props. When a value is unknown
74
+ (e.g. no category count), **omit** it — never fabricate a `0` default, which
75
+ would render a false "0 items". A genuine `0` from a richer source is
85
76
  preserved.
86
77
 
87
- 2. **Icons cross registries as components, via `icon-map`.** Several blocks
88
- type icon props as `LucideIcon` (a component). A string like `'truck'`
89
- bound directly renders a literal `<truck>` tag in the DOM. Registries
90
- resolve icon names through `lib/<name>/icon-map.ts` (`resolveIcon(name)`,
91
- kebab-case → `LucideIcon`, neutral `Circle` fallback). When adding a view
92
- that uses a new icon, extend `icon-map.ts` with an entry — never inline a
93
- string where a component is expected.
78
+ 2. **Icons cross registries as components, via `icon-map`.** Several blocks type
79
+ icon props as `LucideIcon` (a component). A string like `'truck'` bound
80
+ directly renders a literal `<truck>` tag in the DOM. Registries resolve icon
81
+ names through `lib/<name>/icon-map.ts` (`resolveIcon(name)`, kebab-case →
82
+ `LucideIcon`, neutral `Circle` fallback). When adding a view that uses a new
83
+ icon, extend `icon-map.ts` with an entry — never inline a string where a
84
+ component is expected.
94
85
 
95
86
  Supporting rules for the same goal:
96
87
 
@@ -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)) {
@@ -455,6 +455,27 @@ export function sectionRegistry() {
455
455
  }))
456
456
  }
457
457
 
458
+ /**
459
+ * The full registry entry for a section type, or null when it is not
460
+ * registered. Unlike `sectionRegistry()` (the projected introspection view),
461
+ * this exposes every declared field — including `dataBound` and `variants` —
462
+ * so the CLI can tell which instances need user-owned source configuration.
463
+ */
464
+ export function sectionDefinitionByName(name) {
465
+ const list = Array.isArray(sections.sections) ? sections.sections : []
466
+ return list.find((entry) => isPlainObject(entry) && entry.name === name) ?? null
467
+ }
468
+
469
+ /**
470
+ * Whether a section type resolves its content from a data source configured by
471
+ * the user (for example the `products` type) rather than from static editorial
472
+ * content. Unregistered types are not data-bound.
473
+ */
474
+ export function sectionIsDataBound(name) {
475
+ const section = sectionDefinitionByName(name)
476
+ return section?.status === 'executable' && section.dataBound === true
477
+ }
478
+
458
479
  export function getRecipe(name) {
459
480
  return recipes.views.find((v) => v.name === name) ?? null
460
481
  }
@@ -485,6 +506,39 @@ export function isCuratedFeature(name) {
485
506
  return getFeature(name)?.mvp === true
486
507
  }
487
508
 
509
+ /**
510
+ * The starter composition: every curated (installable) feature plus every
511
+ * curated view no installed curated feature owns. A feature-owned view (for
512
+ * example `checkout`, owned by the `checkout` feature) is installed through its
513
+ * feature, not listed directly. The set is derived from the registry's
514
+ * `mvp: true` declaration — never a hand-maintained list — so a curated unit
515
+ * added or removed flows automatically and a held unit (`recommendations`, a
516
+ * held section) is excluded by construction.
517
+ *
518
+ * `registries` is the injection seam for tests: pass fixture `{ views }` /
519
+ * `{ features }` sources to exercise the derivation without mutating the loaded
520
+ * registry.
521
+ */
522
+ export function starterComposition(registries = {}) {
523
+ const recipeSource = registries.recipes ?? recipes
524
+ const featureSource = registries.features ?? features
525
+ const featureNames = featureSource.features
526
+ .filter((f) => f.mvp === true)
527
+ .map((f) => f.name)
528
+ const ownedViews = new Set()
529
+ for (const name of featureNames) {
530
+ const feature = featureSource.features.find((f) => f.name === name)
531
+ for (const view of Array.isArray(feature?.views) ? feature.views : []) {
532
+ ownedViews.add(view)
533
+ }
534
+ }
535
+ const viewNames = recipeSource.views
536
+ .filter((v) => v.mvp === true)
537
+ .map((v) => v.name)
538
+ .filter((name) => !ownedViews.has(name))
539
+ return { views: viewNames, features: featureNames }
540
+ }
541
+
488
542
  /**
489
543
  * The catalog entry for one slot ("<view>.<slot>"), or null when the slot is
490
544
  * outside the catalog scope (a held, non-curated view). The catalog is the
@@ -496,15 +550,30 @@ export function getCatalogSlot(viewName, slot) {
496
550
  return hasOwn(slots, key) ? slots[key] : null
497
551
  }
498
552
 
553
+ /**
554
+ * The legacy alias target for a slot variant name, or the input unchanged when
555
+ * it is not an alias. The canonical selection surface is the catalog's variant
556
+ * set (the canonical block's presentations); retired numbered names survive
557
+ * only as slot-level `legacyAliases` and resolve here, at the single catalog
558
+ * authority, before any validation or fragment lookup.
559
+ */
560
+ export function resolveLegacyVariant(viewName, slot, variant) {
561
+ const slotEntry = getCatalogSlot(viewName, slot)
562
+ const aliases = isPlainObject(slotEntry?.legacyAliases) ? slotEntry.legacyAliases : {}
563
+ return hasOwn(aliases, variant) ? aliases[variant] : variant
564
+ }
565
+
499
566
  /**
500
567
  * The catalog entry for one variant of a slot, or null when the slot or the
501
568
  * variant is outside the catalog scope. Used to name a held variant's reason at
502
- * the point a selection is rejected (E1 task 1.4 / CU-07).
569
+ * the point a selection is rejected (E1 task 1.4 / CU-07). Legacy alias names
570
+ * resolve to their canonical variant's entry.
503
571
  */
504
572
  export function getCatalogVariant(viewName, slot, variant) {
505
573
  const slotEntry = getCatalogSlot(viewName, slot)
506
574
  const variants = isPlainObject(slotEntry?.variants) ? slotEntry.variants : {}
507
- return hasOwn(variants, variant) ? variants[variant] : null
575
+ const canonical = resolveLegacyVariant(viewName, slot, variant)
576
+ return hasOwn(variants, canonical) ? variants[canonical] : null
508
577
  }
509
578
 
510
579
  /**
@@ -576,7 +645,7 @@ export function supportedVariant(viewName, slot) {
576
645
  }
577
646
 
578
647
  export function isSupportedVariant(viewName, slot, variant) {
579
- return executableVariants(viewName, slot).includes(variant)
648
+ return executableVariants(viewName, slot).includes(resolveLegacyVariant(viewName, slot, variant))
580
649
  }
581
650
 
582
651
  /**
@@ -608,7 +677,9 @@ export function isAllowedVariant(viewName, slot, variant) {
608
677
  const allowedBySlot = isPlainObject(recipe.allowedVariants) ? recipe.allowedVariants : {}
609
678
  if (!hasOwn(allowedBySlot, slot)) return false
610
679
  const allowed = allowedBySlot[slot]
611
- return Array.isArray(allowed) && allowed.includes(variant)
680
+ return (
681
+ Array.isArray(allowed) && allowed.includes(resolveLegacyVariant(viewName, slot, variant))
682
+ )
612
683
  }
613
684
 
614
685
  export function isAllowedSection(viewName, sectionName) {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: storefront-workflow
3
- description: The Thor Commerce storefront workflow model — bootstrap, compose, customize, verify — and the CLI/manifest authority. Read when working in a generated storefront, before adding/removing views or features, changing the theme, or editing storefront files.
3
+ description: The Thor Commerce storefront workflow model — bootstrap, compose, customize, verify — and the CLI/manifest authority. Use when working in a generated storefront, before adding/removing views or features, changing the theme, or editing storefront files.
4
4
  ---
5
5
 
6
6
  # Storefront workflow model
@@ -8,7 +8,8 @@ description: The Thor Commerce storefront workflow model — bootstrap, compose,
8
8
  A generated storefront is defined by a **manifest** (`storefront.config.json` at
9
9
  the project root) and produced by the `storefront` CLI. The manifest is the
10
10
  structural source of truth; the CLI is the only writer of derived files; the
11
- developer (or agent) edits only user-owned files.
11
+ developer (or agent) edits only user-owned files and the bounded surface of the
12
+ two external files.
12
13
 
13
14
  Run every command from inside the project (the CLI resolves the project from the
14
15
  current directory). The CLI is installed as a dependency of the project, so
@@ -24,9 +25,12 @@ Create the project. The CLI scaffolds Next.js, installs the pinned candidate
24
25
  toolset, writes the initial manifest, and reconciles.
25
26
 
26
27
  ```bash
27
- npx @thorprovider/storefront create <dir> --name <name> --preset <preset>
28
+ npx @thorprovider/storefront create <dir> --name <name> --preset <preset> [--starter]
28
29
  ```
29
30
 
31
+ Pass `--starter` to seed the full curated composition — every curated view and
32
+ feature — in the same pass; omit it for the minimal baseline.
33
+
30
34
  Authority: **CLI only.** Do not scaffold or copy templates by hand.
31
35
 
32
36
  ### 2. Compose
@@ -42,26 +46,45 @@ npx @thorprovider/storefront plan --operations <file> [--out <file>] [--json]
42
46
  npx @thorprovider/storefront apply --plan <file> [--json]
43
47
  ```
44
48
 
45
- Section composition (`section.add` / `section.remove` / `section.reorder` for
46
- `faq` / `cta`) goes through the same operations envelope
47
- (`{ "formatVersion": 1, "operations": [ ... ] }`): `plan` is read-only and
48
- validates the whole intended state, `apply --plan` is the only writer.
49
+ Section composition (`section.add` / `section.remove` / `section.reorder`) goes
50
+ through the same operations envelope (`{ "formatVersion": 1, "operations": [ ... ] }`):
51
+ `plan` is read-only and validates the whole intended state, `apply --plan` is the
52
+ only writer.
49
53
 
50
- Authority: **CLI only.** Agents choose *what* to compose by reading
51
- `views --json` / `features --json` / `recipes --json` — including each view's
52
- `registeredSlots` / `allowedSections` / `maxSections` and the top-level
53
- `sectionTypes` list — and then delegate the write to the CLI. The user states the
54
- change in natural language and never types a command. Held section types
55
- (`testimonials`, `statistics`, `logoCloud`, `pricing`) are refused with a bounded
56
- reason; only the executable types (`faq`, `cta`) may be composed.
54
+ Authority: **CLI only.** Agents choose *what* to compose by reading the curated
55
+ registry at runtime and then delegate the write to the CLI. The user states the
56
+ change in natural language and never types a command.
57
57
 
58
58
  ### 3. Customize
59
59
 
60
- Edit the **user-owned** files (content, props, data, local schema, mappers).
61
- Reconcile never rewrites them; it regenerates the thin derived wrappers around
62
- them.
60
+ Edit the **user-owned** files (content, props, data, local schema, mappers), and —
61
+ within narrow bounds — the two **external** files described below. Reconcile never
62
+ rewrites user-owned files; it regenerates the thin derived wrappers around them,
63
+ and appends CLI-managed markers to the external files idempotently.
64
+
65
+ Authority: **agent/developer.** Hand-edit only user-owned files and the bounded
66
+ external surface.
67
+
68
+ #### Trivial vs non-trivial — and the spec-driven loop
63
69
 
64
- Authority: **agent/developer.** Hand-edit only user-owned files.
70
+ Classify the customization before editing:
71
+
72
+ - **Trivial** — the CLI can perform it deterministically and record it in the
73
+ manifest (`storefront theme --mode`, `view add|remove`, `feature add|remove`,
74
+ `setup`). Run the CLI operation; it **does not** require an OpenSpec change —
75
+ `storefront.config.json` is its record.
76
+ - **Non-trivial** — the change needs judgment: content authoring, prop/data
77
+ mapping, composition reshaping, or a cross-file redesign whose acceptance is not
78
+ a CLI assertion. Drive it through the **spec-driven loop** and surface the five
79
+ stages to the user: **explore → plan → build → verify → inform**. Open the change
80
+ through the OpenSpec workflow (`openspec/config.yaml` is seeded with this model),
81
+ carry it to completion, and **never** ask the user to run `openspec`, name an
82
+ artifact, or approve one artifact at a time. Structural edits inside the loop
83
+ still go through the CLI; the loop adds intent and acceptance, not a second
84
+ writer.
85
+
86
+ A non-trivial change is not done until `storefront sync` and `storefront doctor`
87
+ pass and the change's acceptance is met.
65
88
 
66
89
  ### 4. Verify
67
90
 
@@ -75,17 +98,58 @@ npx @thorprovider/storefront doctor # composition drift + truthful version/BOM
75
98
  Authority: **CLI.** A build (`yarn build`) is the final acceptance; `doctor`
76
99
  must report no drift.
77
100
 
101
+ ## Read the curated registry through the CLI (never a copied list)
102
+
103
+ The installable set is whatever the registry reports; do not trust a list copied
104
+ into any skill. Read it at runtime, from the project root:
105
+
106
+ ```bash
107
+ npx @thorprovider/storefront views --json # curated views, routes, intents/variants, installed
108
+ npx @thorprovider/storefront features --json # feature bundles, owned views/routes, mounts
109
+ npx @thorprovider/storefront recipes --json # whole curated registry (views + features)
110
+ ```
111
+
112
+ - `views --json` and `recipes --json` include the top-level `sectionTypes` list
113
+ that marks each section type `executable` or `held` (with a reason). That list
114
+ is the authority for which section types may be composed.
115
+ - `npx @thorprovider/storefront sections --json` reports only the currently
116
+ **installed** section instances; use it when the current composition matters,
117
+ never as the set of available types.
118
+ - Publishing a fixed view/feature/section list in a skill is a bug: the registry
119
+ is the single source, so add or remove a unit there, not in this text.
120
+
121
+ A unit the registry does not expose is a **gap to report**, not a reason to
122
+ install another UI framework, hand-edit a derived file, or scaffold structure
123
+ outside the CLI.
124
+
78
125
  ## File ownership
79
126
 
80
127
  | Class | Examples | Who writes it |
81
128
  |---|---|---|
82
129
  | **Derived** | `views/index.ts`, `views/registry.ts`, `index.tsx`, `registry.tsx`, `catalog.ts`, `runtime.ts`, `spec/index.ts`, `state.ts`, `handlers.ts`, `features/*/adapter.ts` | CLI (reconcile); never hand-edited |
83
- | **User-owned** | `views/<view>/content.ts`, `props.ts`, `data.ts`, `schema.ts`, `mappers.ts` | developer/agent |
84
- | **External** | `app/layout.tsx`, `app/globals.css`, other create-next-app/shadcn files | create-next-app/shadcn; the CLI only appends idempotent markers |
130
+ | **User-owned** | `views/<view>/content.ts`, `props.ts`, `data.ts`, `schema.ts`, `mappers.ts`, `icon-map.ts`, `shell/**` | developer/agent |
131
+ | **External** | `app/globals.css`, `app/layout.tsx` (plus create-next-app/shadcn support files) | developer/agent within the bounded surface below; the CLI only appends idempotent markers |
85
132
 
86
133
  Removing a unit removes its derived wrapper but **preserves** any customized
87
134
  user-owned file and reports its location.
88
135
 
136
+ ## Bounded external customization
137
+
138
+ `app/globals.css` and `app/layout.tsx` are `external` files. The supported
139
+ customization surface is deliberately narrow:
140
+
141
+ - **`app/globals.css`** — theme tokens and their foreground pairs, the Tailwind
142
+ `@theme` bridge, font variable wiring.
143
+ - **`app/layout.tsx`** — font loading (`next/font`) and global identity/metadata
144
+ (title, description, Open Graph / Twitter).
145
+
146
+ Everything else in those files is CLI-managed and must survive: the stylesheet
147
+ import, the provider import and its marker, the theme-mode marker, and the block
148
+ token contract. The CLI appends idempotently, so a `sync` must not duplicate a
149
+ marker or drop an edit. Use the `sf-theme-gen` skill for these files; never edit
150
+ the mode wiring by hand. Per-entity SEO still comes from backend entities — global
151
+ customization cannot invent a canonical.
152
+
89
153
  ## Manifest authority
90
154
 
91
155
  - `storefront.config.json` declares the name, theme, installed views, installed
@@ -95,17 +159,7 @@ user-owned file and reports its location.
95
159
  version, declared compatibility ranges, resolved versions, lockfile hash,
96
160
  owned asset BOM). `doctor` validates it against the live project.
97
161
  - A **legacy** (pre-manifest) project is detected and refused with a no-write
98
- diagnostic; automatic migration is held post-MVP.
99
-
100
- ## Curated MVP defaults
101
-
102
- - Standalone views: `home`, `category`, `product`.
103
- - Feature: `checkout` (owns the `checkout` view; `view add checkout` is
104
- rejected — use `feature add checkout`).
105
- - Held post-MVP and rejected before writes: `user-panel` and recommendations.
106
- - Composable sections: `faq` and `cta` are executable per view; held types
107
- (`testimonials`, `statistics`, `logoCloud`, `pricing`) are refused with a
108
- bounded reason.
162
+ diagnostic.
109
163
 
110
164
  ## Pinning and prerequisites
111
165
 
@@ -114,3 +168,12 @@ user-owned file and reports its location.
114
168
  - The `checkout` feature ships structural wiring only; the purchase flow is
115
169
  owned by the separate `single-tenant-commerce-mvp` change. A generated
116
170
  storefront is not a complete commerce implementation on its own.
171
+
172
+ ## References
173
+
174
+ Relative to this `SKILL.md`:
175
+
176
+ - `references/design-consistency.md` — keeping UI changes consistent with the
177
+ scaffold's brand and tokens.
178
+ - `references/mobile-responsiveness.md` — mobile-first storefront patterns.
179
+ - `references/seo.md` — ecommerce SEO and structured data.
@@ -1,5 +1,11 @@
1
1
  # Design Guidelines
2
2
 
3
+ Reference material for the `storefront-workflow` skill: guardrails for keeping
4
+ UI changes consistent with an already-scaffolded storefront's brand. The CLI and
5
+ the manifest remain the structural authority; this file only guides visual
6
+ consistency inside the bounded surface (`app/globals.css` tokens, `app/layout.tsx`
7
+ fonts/identity) and `@thorprovider/blocks` usage.
8
+
3
9
  ## Contents
4
10
 
5
11
  - [Overview](#overview)
@@ -243,36 +249,14 @@ When starting a new project WITHOUT existing theme:
243
249
  This helps me understand your aesthetic preferences."
244
250
  ```
245
251
 
246
- ### Setup Theme Configuration
247
-
248
- After gathering preferences, configure Tailwind theme:
249
-
250
- ```typescript
251
- // tailwind.config.ts
252
- export default {
253
- theme: {
254
- extend: {
255
- colors: {
256
- primary: '#3B82F6', // User's primary color
257
- secondary: '#8B5CF6', // User's secondary
258
- accent: '#F59E0B', // Accent if needed
259
- // Full scales if sophisticated design
260
- brand: {
261
- 50: '#eff6ff',
262
- 500: '#3b82f6',
263
- 900: '#1e3a8a',
264
- }
265
- },
266
- fontFamily: {
267
- sans: ['Inter', 'system-ui', 'sans-serif'],
268
- heading: ['Poppins', 'sans-serif'],
269
- },
270
- },
271
- },
272
- }
273
- ```
252
+ ### Where tokens live
274
253
 
275
- **Use Tailwind CSS for all new projects** - industry standard for ecommerce, highly customizable, excellent DX.
254
+ The scaffold ships its design tokens as CSS variables in `app/globals.css`
255
+ (`:root` + `.dark`) with a Tailwind v4 `@theme` bridge. That file is `external`
256
+ with a bounded surface: change token values and foreground pairs, fonts, and
257
+ global identity only, and keep the CLI-managed imports/markers intact. Use the
258
+ `sf-theme-gen` skill for color, typography, and identity changes; do not
259
+ introduce a separate Tailwind theme configuration.
276
260
 
277
261
  ## Decision Tree
278
262
 
package/CHANGELOG.md DELETED
@@ -1,84 +0,0 @@
1
- # Changelog
2
-
3
- ## Unreleased
4
-
5
- - **Candidate pinning contract (local prerelease `0.4.0-mvp.0`, not published)**:
6
- the install record separates declared compatibility (Node `>=20.9.0`, Yarn 4,
7
- the `node-modules` linker, direct dependency ranges including `@thorprovider/types`
8
- and the CLI itself, and `cliVersion`) from the resolved pin (exact `node_modules`
9
- versions, the real `yarn.lock` content hash, and the package-owned asset BOM).
10
- `doctor`/`update` validate the record against the live project and refuse to stamp
11
- an incomplete or mismatched pin set; `doctor` compares the live declarations,
12
- resolved versions, lockfile, and installed owned BOM against the record instead of
13
- the record against itself. Only package-owned suite paths are hashed, so a user's
14
- own skill/command files are neither stamped nor reported as drift.
15
- - **Composition manifest (in progress)**: a `storefront.config.json` manifest becomes
16
- the source of truth for composition (theme, views, features, per-slot intents) and
17
- the structural files are derived from it. This reuses the existing `recipes/` +
18
- `archetypes.json` registry and the CLI rather than the LLM-driven view-edit path,
19
- which is superseded: agents will delegate structural changes to the CLI and edit
20
- only user-owned files. Coordinated with the in-progress `storefront-automation-commands`
21
- and `deterministic-sf-init-cli` changes (shared registry and CLI).
22
- - **Project resolution**: only `create` takes a directory. Every other command resolves
23
- the storefront from the current directory upward (looking for `storefront.config.json`)
24
- and errors without writing when none is found.
25
-
26
- ## 0.4.0
27
-
28
- - **Renamed package**: `@thorprovider/create-storefront` → `@thorprovider/storefront`;
29
- the `bin` is now `storefront` (`npx @thorprovider/storefront create`).
30
- - **Single scaffold command**: `storefront create <dir>` scaffolds the storefront and
31
- installs the OpenCode command suite in the same run. The standalone `install` action
32
- is gone; `storefront update` refreshes, prunes removed files, and migrates the
33
- version record.
34
- - **Interactive wizard**: on a TTY, `create` prompts for name, site name, backend URL,
35
- and preset (Maia preselected). Brand color is decided via `/sf-theme`, not the wizard.
36
- Without a TTY, every required input must be passed as a flag or the command fails
37
- fast before writing anything.
38
- - **Command surface**: `<dir>` is positional; `--dir` is removed; `--name` is a flag or
39
- wizard prompt. Commands are `storefront create|update|doctor <dir>`.
40
- - **Removed `/sf-init`**: the `sf-init` command and `sf-scaffold` skill are gone.
41
- Scaffolding is fully deterministic inside the binary.
42
- - **Decoupled templates**: the scaffold templates moved from the `sf-scaffold` skill
43
- into `assets/templates/` at the package root.
44
- - **Version record**: `.opencode/storefront.json` (replacing `.create-storefront.json`);
45
- `update` migrates existing installs.
46
-
47
- ## 0.3.0
48
-
49
- - **Embedded assets**: each skill now carries the templates, recipes, and scripts it
50
- uses inside its own directory (`assets/`, `scripts/`, `references/`) and addresses
51
- them by relative path. No path marker is needed to locate the package.
52
- - **Versioned install command**: `bin` exposes `create-storefront` with `install`,
53
- `update`, and `doctor`. Installation is an explicit command; there is no
54
- `postinstall`. The installer records `{ version, installedAt }` in
55
- `.opencode/.create-storefront.json` (replacing the `.create-storefront-root` marker).
56
- - **Single source, generated copies**: `recipes/` stays the single source at the
57
- package root; `scripts/sync-assets.mjs` generates the per-skill copies and a
58
- `--check` mode fails on drift. The check runs at build/pretest and before the
59
- installer copies anything into a target project.
60
- - **Positive source-of-truth rule**: the skills state that the workflow uses the assets
61
- inside the skill and that an undecided choice is resolved by asking the user.
62
- - **Named interfaces**: each skill declares the target-project inputs it reads and the
63
- outputs it produces.
64
- - **General self-containment check**: the test fails on any absolute machine path in a
65
- shipped artifact, independent of any name.
66
-
67
- ## 0.2.0
68
-
69
- - Per-view templates: every recipe view (`home`, `product`, `category`, `checkout`,
70
- `user-panel`) ships as a self-contained module under `templates/views/<view>/`.
71
- - Generated storefronts now compose views through a barrel (`lib/<name>/views/index.ts`);
72
- shared files (`catalog.ts`, `registry.tsx`, `runtime.ts`, `spec/index.ts`) derive from
73
- the registered views and are never edited per view.
74
- - `/sf-add-view` copies a view module and registers one barrel entry, substituting only
75
- the imported block identifier for the resolved variant. No hand-authored wiring.
76
- - Optional sections (testimonials, FAQ, statistics, logo cloud, pricing) ship as
77
- fragments under `views/sections/` and are validated against `recipes/sections.json`.
78
- - `sf-scaffold` copies `templates/app/` plus `templates/views/home/` and registers
79
- `home` in the barrel.
80
- - Templates and skills no longer reference any repository-local application.
81
-
82
- ## 0.1.3
83
-
84
- - Previous release.
@@ -1,5 +0,0 @@
1
- {
2
- "module": "@thorprovider/blocks",
3
- "import": "Feature1",
4
- "as": "FeatureBlock"
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "module": "@thorprovider/blocks",
3
- "import": "Feature2",
4
- "as": "FeatureBlock"
5
- }
@@ -1,10 +0,0 @@
1
- Feature: ({ props }) => {
2
- const feature = featurePropsSchema.parse(props)
3
- return (
4
- <FeatureBlock
5
- items={feature.items.map((item) => ({ ...item, icon: resolveIcon(item.icon) }))}
6
- title={feature.title}
7
- description={feature.description}
8
- />
9
- )
10
- },
@@ -1,5 +0,0 @@
1
- {
2
- "module": "@thorprovider/blocks",
3
- "import": "ProductCategory2",
4
- "as": "CategoryCardsBlock"
5
- }
@@ -1,4 +0,0 @@
1
- CategoryCards: {
2
- props: categoryCardsPropsSchema,
3
- description: 'Category grid.',
4
- },
@@ -1,16 +0,0 @@
1
- CategoryCards: ({ props, emit }) => {
2
- const { set } = useStateStore()
3
- const cards = categoryCardsPropsSchema.parse(props)
4
- return (
5
- <CategoryCardsBlock
6
- title={cards.title}
7
- description={cards.description}
8
- categories={cards.categories}
9
- cta={cards.cta}
10
- onBrowse={(category) => {
11
- set('/lastCategory', category.handle ?? String(category.id))
12
- emit('openCategory')
13
- }}
14
- />
15
- )
16
- },
@@ -1,5 +0,0 @@
1
- {
2
- "module": "@thorprovider/blocks",
3
- "import": "StorefrontHero1",
4
- "as": "StorefrontHeroBlock"
5
- }
@@ -1,4 +0,0 @@
1
- StorefrontHero: {
2
- props: storefrontHeroPropsSchema,
3
- description: 'Landing hero.',
4
- },
@@ -1,5 +0,0 @@
1
- 'home.hero': {
2
- type: 'StorefrontHero',
3
- props: heroProps,
4
- on: { addToCart: { action: 'addToCart' }, openProduct: { action: 'openProduct' } },
5
- },