@thorprovider/storefront 0.13.3 → 0.15.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 (108) hide show
  1. package/README.md +19 -8
  2. package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +18 -3
  3. package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.client.tsx +1 -0
  4. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.products.ts +6 -0
  5. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-main-menu.ts +3 -1
  6. package/assets/templates/app/public/images/README.md +43 -0
  7. package/assets/templates/app/public/images/banners/banner-aurora-deal.webp +0 -0
  8. package/assets/templates/app/public/images/banners/banner-guia-regalo.webp +0 -0
  9. package/assets/templates/app/public/images/banners/banner-mesa-decor.webp +0 -0
  10. package/assets/templates/app/public/images/banners/banner-nuevas-llegadas.webp +0 -0
  11. package/assets/templates/app/public/images/banners/banner-salon-oferta.webp +0 -0
  12. package/assets/templates/app/public/images/categories/accessories.webp +0 -0
  13. package/assets/templates/app/public/images/categories/dresses.webp +0 -0
  14. package/assets/templates/app/public/images/categories/furniture.webp +0 -0
  15. package/assets/templates/app/public/images/categories/home.webp +0 -0
  16. package/assets/templates/app/public/images/categories/jackets.webp +0 -0
  17. package/assets/templates/app/public/images/editorial/studio.webp +0 -0
  18. package/assets/templates/app/public/images/products/alpine-jacket.webp +0 -0
  19. package/assets/templates/app/public/images/products/amber-dress.webp +0 -0
  20. package/assets/templates/app/public/images/products/atlas-lamp.webp +0 -0
  21. package/assets/templates/app/public/images/products/atlas-sofa.webp +0 -0
  22. package/assets/templates/app/public/images/products/aurora-jacket.webp +0 -0
  23. package/assets/templates/app/public/images/products/boreal-jacket.webp +0 -0
  24. package/assets/templates/app/public/images/products/camille-dress.webp +0 -0
  25. package/assets/templates/app/public/images/products/ceramic-table-lamp.webp +0 -0
  26. package/assets/templates/app/public/images/products/cinder-jacket.webp +0 -0
  27. package/assets/templates/app/public/images/products/copper-lamp.webp +0 -0
  28. package/assets/templates/app/public/images/products/cove-bag.webp +0 -0
  29. package/assets/templates/app/public/images/products/dahlia-dress.webp +0 -0
  30. package/assets/templates/app/public/images/products/drift-jacket.webp +0 -0
  31. package/assets/templates/app/public/images/products/dune-lamp.webp +0 -0
  32. package/assets/templates/app/public/images/products/elara-dress.webp +0 -0
  33. package/assets/templates/app/public/images/products/ember-jacket.webp +0 -0
  34. package/assets/templates/app/public/images/products/fable-bag.webp +0 -0
  35. package/assets/templates/app/public/images/products/fjord-jacket.webp +0 -0
  36. package/assets/templates/app/public/images/products/floor-cushion.webp +0 -0
  37. package/assets/templates/app/public/images/products/harbor-jacket.webp +0 -0
  38. package/assets/templates/app/public/images/products/helios-lamp.webp +0 -0
  39. package/assets/templates/app/public/images/products/iris-dress.webp +0 -0
  40. package/assets/templates/app/public/images/products/juniper-bag.webp +0 -0
  41. package/assets/templates/app/public/images/products/kestrel-bag.webp +0 -0
  42. package/assets/templates/app/public/images/products/linen-armchair.webp +0 -0
  43. package/assets/templates/app/public/images/products/lumen-dress.webp +0 -0
  44. package/assets/templates/app/public/images/products/luna-bag.webp +0 -0
  45. package/assets/templates/app/public/images/products/marble-coffee-table.webp +0 -0
  46. package/assets/templates/app/public/images/products/marlowe-bag.webp +0 -0
  47. package/assets/templates/app/public/images/products/meridian-jacket.webp +0 -0
  48. package/assets/templates/app/public/images/products/nomad-jacket.webp +0 -0
  49. package/assets/templates/app/public/images/products/nova-dress.webp +0 -0
  50. package/assets/templates/app/public/images/products/oak-dining-table.webp +0 -0
  51. package/assets/templates/app/public/images/products/onyx-lamp.webp +0 -0
  52. package/assets/templates/app/public/images/products/piper-bag.webp +0 -0
  53. package/assets/templates/app/public/images/products/quill-lamp.webp +0 -0
  54. package/assets/templates/app/public/images/products/rosalind-dress.webp +0 -0
  55. package/assets/templates/app/public/images/products/rune-bag.webp +0 -0
  56. package/assets/templates/app/public/images/products/side-table.webp +0 -0
  57. package/assets/templates/app/public/images/products/slate-lamp.webp +0 -0
  58. package/assets/templates/app/public/images/products/solis-dress.webp +0 -0
  59. package/assets/templates/app/public/images/products/storage-shelf.webp +0 -0
  60. package/assets/templates/app/public/images/products/terra-lamp.webp +0 -0
  61. package/assets/templates/app/public/images/products/tundra-jacket.webp +0 -0
  62. package/assets/templates/app/public/images/products/vantage-jacket.webp +0 -0
  63. package/assets/templates/app/public/images/products/vera-dress.webp +0 -0
  64. package/assets/templates/app/public/images/products/verdant-lamp.webp +0 -0
  65. package/assets/templates/app/public/images/products/wall-mirror.webp +0 -0
  66. package/assets/templates/app/public/images/products/wool-rug.webp +0 -0
  67. package/assets/templates/views/account/address-book-advanced.defaults.ts +1 -1
  68. package/assets/templates/views/home/assembly/assembly.json +1 -2
  69. package/assets/templates/views/home/assembly/index.skeleton.tsx +3 -7
  70. package/assets/templates/views/home/assembly/registry.skeleton.tsx +0 -3
  71. package/assets/templates/views/home/content.ts +80 -72
  72. package/assets/templates/views/home/data.ts +25 -3
  73. package/assets/templates/views/home/index.tsx +4 -21
  74. package/assets/templates/views/home/props.ts +1 -7
  75. package/assets/templates/views/home/registry.tsx +0 -35
  76. package/assets/templates/views/home/schema.ts +0 -36
  77. package/bin/storefront.js +12 -27
  78. package/package.json +3 -2
  79. package/recipes/archetypes.json +0 -21
  80. package/recipes/catalog.json +0 -22
  81. package/recipes/features.json +0 -2
  82. package/recipes/recipe.schema.json +5 -0
  83. package/recipes/recipes.json +32 -11
  84. package/recipes/validate.mjs +7 -0
  85. package/scripts/candidate.mjs +3 -3
  86. package/scripts/default-sections.mjs +1 -0
  87. package/scripts/env-file.mjs +5 -0
  88. package/scripts/file-classes.mjs +3 -0
  89. package/scripts/generate-demo-images.mjs +507 -0
  90. package/scripts/reconcile.mjs +32 -1
  91. package/scripts/render-templates.mjs +13 -1
  92. package/scripts/section-compat.mjs +10 -1
  93. package/scripts/section-operations.mjs +3 -0
  94. package/scripts/starter.mjs +25 -1
  95. package/scripts/theme/starter-theme.mjs +118 -0
  96. package/scripts/view-assembly.mjs +26 -5
  97. package/skills/sf-view-gen/assets/recipes/archetypes.json +0 -21
  98. package/skills/sf-view-gen/assets/recipes/catalog.json +0 -22
  99. package/skills/sf-view-gen/assets/recipes/features.json +0 -2
  100. package/skills/sf-view-gen/assets/recipes/recipes.json +32 -11
  101. package/skills/sf-view-gen/assets/templates/views/sections/products.client.tsx +53 -1
  102. package/skills/sf-view-gen/assets/templates/views/sections/schema.products.ts +6 -0
  103. package/skills/sf-view-gen/assets/templates/views/sections/schema.universal-main-menu.ts +3 -1
  104. package/skills/sf-view-gen/scripts/validate.mjs +7 -0
  105. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +0 -5
  106. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +0 -8
  107. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/element.part +0 -5
  108. package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +0 -31
@@ -70,28 +70,6 @@
70
70
  }
71
71
  }
72
72
  },
73
- "home.categories": {
74
- "default": "CategoryGrid",
75
- "legacyAliases": {
76
- "ProductCategory": "CategoryGrid"
77
- },
78
- "variants": {
79
- "CategoryGrid": {
80
- "status": "executable",
81
- "block": "CategoryGrid",
82
- "dataShape": "CategoryCard[]",
83
- "events": [
84
- "browse",
85
- "viewAll",
86
- "queryChange"
87
- ],
88
- "state": "controlled",
89
- "requirements": [
90
- "categories"
91
- ]
92
- }
93
- }
94
- },
95
73
  "product.overview": {
96
74
  "default": "ProductOverview",
97
75
  "variants": {
@@ -49,7 +49,6 @@
49
49
  {
50
50
  "name": "customer-profile",
51
51
  "mvp": true,
52
- "starter": false,
53
52
  "status": "gated",
54
53
  "description": "Signed-in profile editor for the account area (name, phone, and email only where the backend supports changing it). Module of customer-auth.",
55
54
  "views": [],
@@ -64,7 +63,6 @@
64
63
  {
65
64
  "name": "customer-addresses",
66
65
  "mvp": true,
67
- "starter": false,
68
66
  "status": "gated",
69
67
  "description": "Signed-in address book for the account area (list, create, edit, delete, default shipping and billing). Module of customer-auth.",
70
68
  "views": [],
@@ -56,6 +56,11 @@
56
56
  "type": "array",
57
57
  "items": { "type": "string" }
58
58
  },
59
+ "retiredSlots": {
60
+ "type": "array",
61
+ "items": { "type": "string" },
62
+ "description": "Slots the view used to register. A manifest entry naming one of them is dropped during normalization instead of rejected."
63
+ },
59
64
  "allowedSections": {
60
65
  "type": "array",
61
66
  "items": { "type": "string" }
@@ -5,17 +5,15 @@
5
5
  {
6
6
  "name": "home",
7
7
  "mvp": true,
8
- "description": "Storefront landing page with hero, benefits, and category highlights",
8
+ "description": "Marketplace-style landing page: campaign hero, four merchandising shelves (three rails, a product grid and a product showcase), a mid-page campaign band, and the trust band",
9
9
  "route": "/",
10
10
  "loader": "home",
11
11
  "requiredDataKeys": [
12
- "heroProducts",
13
- "categories"
12
+ "heroProducts"
14
13
  ],
15
14
  "defaultVariants": {
16
15
  "hero": "UniversalBanner",
17
- "benefits": "cards",
18
- "categories": "CategoryGrid"
16
+ "benefits": "cards"
19
17
  },
20
18
  "allowedVariants": {
21
19
  "hero": [
@@ -26,9 +24,6 @@
26
24
  "cards",
27
25
  "split"
28
26
  ],
29
- "categories": [
30
- "CategoryGrid"
31
- ],
32
27
  "productCard": [
33
28
  "ProductGrid"
34
29
  ]
@@ -42,7 +37,9 @@
42
37
  ],
43
38
  "registeredSlots": [
44
39
  "hero",
45
- "benefits",
40
+ "benefits"
41
+ ],
42
+ "retiredSlots": [
46
43
  "categories"
47
44
  ],
48
45
  "allowedSections": [
@@ -59,10 +56,34 @@
59
56
  {
60
57
  "type": "products",
61
58
  "variant": "ProductSlider",
62
- "after": "benefits"
59
+ "after": "hero"
60
+ },
61
+ {
62
+ "type": "universal-banner",
63
+ "after": "hero"
64
+ },
65
+ {
66
+ "type": "products",
67
+ "variant": "ProductSlider",
68
+ "after": "hero"
69
+ },
70
+ {
71
+ "type": "products",
72
+ "variant": "ProductSlider",
73
+ "after": "hero"
74
+ },
75
+ {
76
+ "type": "products",
77
+ "variant": "ProductGrid",
78
+ "after": "hero"
79
+ },
80
+ {
81
+ "type": "products",
82
+ "variant": "ProductShowcase1",
83
+ "after": "hero"
63
84
  }
64
85
  ],
65
- "maxSections": 4
86
+ "maxSections": 6
66
87
  },
67
88
  {
68
89
  "name": "product",
@@ -861,6 +861,10 @@ export function validateComposition(composition) {
861
861
  const optionalSections = Array.isArray(recipe.optionalSections) ? recipe.optionalSections : []
862
862
  const allowedSections = Array.isArray(recipe.allowedSections) ? recipe.allowedSections : []
863
863
  const registeredSlots = Array.isArray(recipe.registeredSlots) ? recipe.registeredSlots : []
864
+ // A retired slot (for example `categories` on home) may still appear in a
865
+ // manifest written against an earlier registry version: it is dropped by the
866
+ // normalizer, so validating it here must not refuse the whole manifest.
867
+ const retiredSlots = Array.isArray(recipe.retiredSlots) ? recipe.retiredSlots : []
864
868
  const maxSections = typeof recipe.maxSections === 'number' ? recipe.maxSections : null
865
869
  const seenSectionIds = new Set()
866
870
  let editorialCount = 0
@@ -883,6 +887,9 @@ export function validateComposition(composition) {
883
887
  errors.push(
884
888
  `Reserved slot id "${section.id}" in view "${viewName}" must equal "slot:${section.type}".`
885
889
  )
890
+ } else if (!registeredSlots.includes(section.type) && retiredSlots.includes(section.type)) {
891
+ // Retired slot: tolerated here and dropped by the composition
892
+ // normalizer, so it never renders and never blocks a sync.
886
893
  } else if (!registeredSlots.includes(section.type)) {
887
894
  errors.push(
888
895
  `Slot "${section.type}" is not a registered slot of view "${viewName}".`
@@ -47,9 +47,9 @@ export const CANDIDATE_TOOLSET = Object.freeze({
47
47
  '@json-render/next': '0.21.0',
48
48
  }),
49
49
  local: Object.freeze({
50
- '@thorprovider/blocks': '4.5.0',
51
- '@thorprovider/adapters': '5.7.0',
52
- '@thorprovider/runtime': '0.9.0',
50
+ '@thorprovider/blocks': '4.8.0',
51
+ '@thorprovider/adapters': '5.8.0',
52
+ '@thorprovider/runtime': '0.10.0',
53
53
  '@thorprovider/types': '7.8.0',
54
54
  }),
55
55
  })
@@ -33,6 +33,7 @@ export function seedDefaultSections(manifest, { recipes = loadRecipes() } = {})
33
33
  {
34
34
  allowedSections: recipe.allowedSections ?? [],
35
35
  maxSections: recipe.maxSections,
36
+ retiredSlots: recipe.retiredSlots ?? [],
36
37
  },
37
38
  )
38
39
  if (!normalized.ok) {
@@ -17,6 +17,7 @@ export function initialEnvLocal(name, sessionSecret) {
17
17
  'THOR_DATA_SOURCE=mock',
18
18
  `THOR_STORE_ID=${name}`,
19
19
  `THOR_SESSION_SECRET=${sessionSecret}`,
20
+ 'THOR_MOCK_ASSETS=/images',
20
21
  ].join('\n') + '\n'
21
22
  }
22
23
 
@@ -28,6 +29,10 @@ export function envExample(name) {
28
29
  'THOR_DATA_SOURCE=mock',
29
30
  '# Store identity (written by create; required only in real mode).',
30
31
  `THOR_STORE_ID=${name}`,
32
+ '# Demo imagery base (mock mode only). The starter ships local product,',
33
+ '# category and banner shots under public/images; drop this to fall back to',
34
+ '# the generated SVG placeholders.',
35
+ 'THOR_MOCK_ASSETS=/images',
31
36
  '# Real backend configuration (required only when THOR_DATA_SOURCE=medusa).',
32
37
  '# Run `storefront setup` to write these: it takes the sales channel id (from the',
33
38
  '# Medusa admin) and derives the currency from the selected region.',
@@ -36,6 +36,9 @@ const RULES = [
36
36
  'views/*/sections/**',
37
37
  'app/lib/*/mappers.ts',
38
38
  'app/lib/*/icon-map.ts',
39
+ // Demo imagery: local static files the developer replaces in place, so a
40
+ // sync must never overwrite a swapped shot.
41
+ 'app/public/images/**',
39
42
  // The shell brand/newsletter seam is user-owned so its edits survive sync.
40
43
  'app/lib/*/shell/**',
41
44
  ],