@thorprovider/storefront 0.14.0 → 0.15.1
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 +28 -12
- package/assets/templates/app/app/[[...slug]]/page.tsx +6 -0
- package/assets/templates/app/app/layout.tsx +2 -2
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +11 -4
- package/assets/templates/app/lib/__STOREFRONT__/confirmation.core.ts +7 -4
- package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +18 -3
- package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +10 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +8 -0
- package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +84 -18
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.universal-main-menu.ts +3 -1
- package/assets/templates/app/public/images/README.md +43 -0
- package/assets/templates/app/public/images/banners/banner-aurora-deal.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-guia-regalo.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-mesa-decor.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-nuevas-llegadas.webp +0 -0
- package/assets/templates/app/public/images/banners/banner-salon-oferta.webp +0 -0
- package/assets/templates/app/public/images/categories/accessories.webp +0 -0
- package/assets/templates/app/public/images/categories/dresses.webp +0 -0
- package/assets/templates/app/public/images/categories/furniture.webp +0 -0
- package/assets/templates/app/public/images/categories/home.webp +0 -0
- package/assets/templates/app/public/images/categories/jackets.webp +0 -0
- package/assets/templates/app/public/images/editorial/studio.webp +0 -0
- package/assets/templates/app/public/images/products/alpine-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/amber-dress.webp +0 -0
- package/assets/templates/app/public/images/products/atlas-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/atlas-sofa.webp +0 -0
- package/assets/templates/app/public/images/products/aurora-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/boreal-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/camille-dress.webp +0 -0
- package/assets/templates/app/public/images/products/ceramic-table-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/cinder-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/copper-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/cove-bag.webp +0 -0
- package/assets/templates/app/public/images/products/dahlia-dress.webp +0 -0
- package/assets/templates/app/public/images/products/drift-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/dune-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/elara-dress.webp +0 -0
- package/assets/templates/app/public/images/products/ember-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/fable-bag.webp +0 -0
- package/assets/templates/app/public/images/products/fjord-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/floor-cushion.webp +0 -0
- package/assets/templates/app/public/images/products/harbor-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/helios-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/iris-dress.webp +0 -0
- package/assets/templates/app/public/images/products/juniper-bag.webp +0 -0
- package/assets/templates/app/public/images/products/kestrel-bag.webp +0 -0
- package/assets/templates/app/public/images/products/linen-armchair.webp +0 -0
- package/assets/templates/app/public/images/products/lumen-dress.webp +0 -0
- package/assets/templates/app/public/images/products/luna-bag.webp +0 -0
- package/assets/templates/app/public/images/products/marble-coffee-table.webp +0 -0
- package/assets/templates/app/public/images/products/marlowe-bag.webp +0 -0
- package/assets/templates/app/public/images/products/meridian-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/nomad-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/nova-dress.webp +0 -0
- package/assets/templates/app/public/images/products/oak-dining-table.webp +0 -0
- package/assets/templates/app/public/images/products/onyx-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/piper-bag.webp +0 -0
- package/assets/templates/app/public/images/products/quill-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/rosalind-dress.webp +0 -0
- package/assets/templates/app/public/images/products/rune-bag.webp +0 -0
- package/assets/templates/app/public/images/products/side-table.webp +0 -0
- package/assets/templates/app/public/images/products/slate-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/solis-dress.webp +0 -0
- package/assets/templates/app/public/images/products/storage-shelf.webp +0 -0
- package/assets/templates/app/public/images/products/terra-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/tundra-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/vantage-jacket.webp +0 -0
- package/assets/templates/app/public/images/products/vera-dress.webp +0 -0
- package/assets/templates/app/public/images/products/verdant-lamp.webp +0 -0
- package/assets/templates/app/public/images/products/wall-mirror.webp +0 -0
- package/assets/templates/app/public/images/products/wool-rug.webp +0 -0
- package/assets/templates/views/account/address-book-advanced.defaults.ts +1 -1
- package/assets/templates/views/cart/registry.tsx +9 -0
- package/assets/templates/views/checkout/checkout-commerce-hosted.tsx +5 -1
- package/assets/templates/views/home/assembly/assembly.json +0 -1
- package/assets/templates/views/home/assembly/index.skeleton.tsx +3 -7
- package/assets/templates/views/home/assembly/registry.skeleton.tsx +0 -3
- package/assets/templates/views/home/content.ts +34 -80
- package/assets/templates/views/home/data.ts +12 -0
- package/assets/templates/views/home/index.tsx +4 -21
- package/assets/templates/views/home/props.ts +1 -7
- package/assets/templates/views/home/registry.tsx +0 -35
- package/assets/templates/views/home/schema.ts +0 -36
- package/bin/storefront.js +12 -27
- package/package.json +3 -2
- package/recipes/archetypes.json +0 -21
- package/recipes/catalog.json +0 -22
- package/recipes/features.json +0 -2
- package/recipes/recipe.schema.json +5 -0
- package/recipes/recipes.json +19 -16
- package/recipes/validate.mjs +7 -0
- package/scripts/candidate.mjs +3 -3
- package/scripts/default-sections.mjs +1 -0
- package/scripts/env-file.mjs +10 -0
- package/scripts/file-classes.mjs +3 -0
- package/scripts/generate-demo-images.mjs +507 -0
- package/scripts/reconcile.mjs +32 -1
- package/scripts/render-templates.mjs +13 -1
- package/scripts/section-compat.mjs +10 -1
- package/scripts/section-operations.mjs +3 -0
- package/scripts/starter.mjs +25 -1
- package/scripts/theme/starter-theme.mjs +118 -0
- package/skills/sf-view-gen/assets/recipes/archetypes.json +0 -21
- package/skills/sf-view-gen/assets/recipes/catalog.json +0 -22
- package/skills/sf-view-gen/assets/recipes/features.json +0 -2
- package/skills/sf-view-gen/assets/recipes/recipes.json +19 -16
- package/skills/sf-view-gen/assets/templates/views/sections/schema.universal-main-menu.ts +3 -1
- package/skills/sf-view-gen/scripts/validate.mjs +7 -0
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +0 -8
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/element.part +0 -5
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +0 -31
package/bin/storefront.js
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
classifyImportSource,
|
|
41
41
|
} from '../scripts/theme/import-export.mjs'
|
|
42
42
|
import { resolvePreset, makeShadcnRunner } from '../scripts/theme/preset.mjs'
|
|
43
|
+
import { applyStarterTheme } from '../scripts/theme/starter-theme.mjs'
|
|
43
44
|
import { THEME_COLOR_TOKENS, FONT_VARS, DEFAULT_GLOBALS_TOKENS } from '../scripts/theme/tokens.mjs'
|
|
44
45
|
import { NAMED_COLOR_NAMES, parseColor, formatOklch } from '../scripts/theme/color.mjs'
|
|
45
46
|
import {
|
|
@@ -48,7 +49,6 @@ import {
|
|
|
48
49
|
looksLikeStorefront,
|
|
49
50
|
readManifest,
|
|
50
51
|
validateManifest,
|
|
51
|
-
createManifest,
|
|
52
52
|
writeManifest,
|
|
53
53
|
} from '../scripts/manifest.mjs'
|
|
54
54
|
import { reconcile } from '../scripts/reconcile.mjs'
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
scaffoldTempEnv,
|
|
58
58
|
} from '../scripts/scaffold-env.mjs'
|
|
59
59
|
import { preflightManifest } from '../scripts/preflight.mjs'
|
|
60
|
-
import {
|
|
60
|
+
import { initialManifest } from '../scripts/starter.mjs'
|
|
61
61
|
import {
|
|
62
62
|
buildInstallPlan,
|
|
63
63
|
CANDIDATE_TOOLSET,
|
|
@@ -193,7 +193,7 @@ create options:
|
|
|
193
193
|
--mode <mode> light | dark | system (default: system)
|
|
194
194
|
--starter install every curated view and feature (a full store),
|
|
195
195
|
not just the home+cart baseline
|
|
196
|
-
--brand <color> brand color over
|
|
196
|
+
--brand <color> brand color over the starter theme (not prompted by the wizard)
|
|
197
197
|
--packs <dir> directory of local @thorprovider/* .tgz tarballs; installs
|
|
198
198
|
the local candidate via Yarn resolutions (no publish)
|
|
199
199
|
-f, --force overwrite files that already exist
|
|
@@ -806,19 +806,13 @@ function runYarn(yarnSpec, cmdArgs, cwd, env) {
|
|
|
806
806
|
return res.status ?? 1
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
// Apply
|
|
810
|
-
//
|
|
811
|
-
//
|
|
812
|
-
//
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
const error = diagnostics.find((d) => d.severity === 'error')
|
|
817
|
-
if (error) return { error: error.message }
|
|
818
|
-
const planned = planCss(globalsCss, operation)
|
|
819
|
-
const planError = planned.diagnostics.find((d) => d.severity === 'error')
|
|
820
|
-
if (planError) return { error: planError.message }
|
|
821
|
-
return { css: planned.css }
|
|
809
|
+
// Apply the starter marketplace palette and then a named brand color, both
|
|
810
|
+
// through the same theme-plan pipeline the `theme` command uses. The starter is
|
|
811
|
+
// the default every scaffold ships (orange CTA, navy chrome, tight corners); a
|
|
812
|
+
// `--brand` on top of it overrides the primary family, so `create --brand` and
|
|
813
|
+
// `theme --brand` still agree. Returns `{ css }` or `{ error }`.
|
|
814
|
+
function applyCreateTheme(globalsCss, brand) {
|
|
815
|
+
return applyStarterTheme(globalsCss, { brand })
|
|
822
816
|
}
|
|
823
817
|
|
|
824
818
|
async function promptScaffoldInputs(args) {
|
|
@@ -1010,16 +1004,7 @@ async function create(args) {
|
|
|
1010
1004
|
// same preflight as every other write boundary — and it must run before any
|
|
1011
1005
|
// mkdir, external scaffold, or write so rejected input leaves no trace.
|
|
1012
1006
|
const starter = args.starter === true
|
|
1013
|
-
const
|
|
1014
|
-
const manifest = seedDefaultSections(
|
|
1015
|
-
createManifest({
|
|
1016
|
-
name,
|
|
1017
|
-
siteName,
|
|
1018
|
-
mode,
|
|
1019
|
-
views: composition.views,
|
|
1020
|
-
features: composition.features,
|
|
1021
|
-
}),
|
|
1022
|
-
)
|
|
1007
|
+
const manifest = seedDefaultSections(initialManifest({ name, siteName, mode, starter }))
|
|
1023
1008
|
const preflight = preflightManifest(manifest)
|
|
1024
1009
|
if (!preflight.ok) return rejectComposition(preflight.errors)
|
|
1025
1010
|
|
|
@@ -1217,7 +1202,7 @@ async function create(args) {
|
|
|
1217
1202
|
const globalsPath = join(target, 'app', 'globals.css')
|
|
1218
1203
|
if (existsSync(globalsPath)) {
|
|
1219
1204
|
const css = readFileSync(globalsPath, 'utf8')
|
|
1220
|
-
const branded =
|
|
1205
|
+
const branded = applyCreateTheme(css, brand)
|
|
1221
1206
|
if (branded.error) {
|
|
1222
1207
|
console.error(`Unknown brand color: ${branded.error}`)
|
|
1223
1208
|
return 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode skill suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "bin/storefront.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"test": "vitest run --config vitest.config.ts",
|
|
25
25
|
"test:integration": "vitest run --config vitest.config.ts tests/scaffold-integration.test.ts tests/starter-integration.test.ts",
|
|
26
26
|
"test:registry": "RUN_SCAFFOLD_INTEGRATION=1 STOREFRONT_ACCEPTANCE_CLI=registry vitest run --config vitest.config.ts tests/scaffold-integration.test.ts tests/starter-integration.test.ts",
|
|
27
|
-
"test:browser": "node ./tests/support/projection-ownership.browser.mjs"
|
|
27
|
+
"test:browser": "node ./tests/support/projection-ownership.browser.mjs",
|
|
28
|
+
"demo:images": "node scripts/generate-demo-images.mjs"
|
|
28
29
|
},
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public",
|
package/recipes/archetypes.json
CHANGED
|
@@ -41,27 +41,6 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"home.categories": {
|
|
45
|
-
"default": "standard",
|
|
46
|
-
"intents": {
|
|
47
|
-
"standard": {
|
|
48
|
-
"variant": "CategoryGrid",
|
|
49
|
-
"when": "A balanced grid of category cards with image and label (canonical `presentation: 'grid'`)."
|
|
50
|
-
},
|
|
51
|
-
"iconGrid": {
|
|
52
|
-
"variant": "CategoryGrid",
|
|
53
|
-
"when": "A compact icon-based category grid for many small categories (canonical `presentation: 'icons'`)."
|
|
54
|
-
},
|
|
55
|
-
"featured": {
|
|
56
|
-
"variant": "CategoryGrid",
|
|
57
|
-
"when": "Few, large featured category tiles that act as primary navigation (canonical `presentation: 'icons'`)."
|
|
58
|
-
},
|
|
59
|
-
"editorial": {
|
|
60
|
-
"variant": "CategoryGrid",
|
|
61
|
-
"when": "Category tiles presented as a searchable list with subcategory chips (canonical `presentation: 'list'`)."
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
44
|
"product.overview": {
|
|
66
45
|
"default": "standard",
|
|
67
46
|
"intents": {
|
package/recipes/catalog.json
CHANGED
|
@@ -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": {
|
package/recipes/features.json
CHANGED
|
@@ -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" }
|
package/recipes/recipes.json
CHANGED
|
@@ -5,17 +5,15 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "home",
|
|
7
7
|
"mvp": true,
|
|
8
|
-
"description": "Marketplace-style landing page: campaign hero,
|
|
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,9 +37,11 @@
|
|
|
42
37
|
],
|
|
43
38
|
"registeredSlots": [
|
|
44
39
|
"hero",
|
|
45
|
-
"categories",
|
|
46
40
|
"benefits"
|
|
47
41
|
],
|
|
42
|
+
"retiredSlots": [
|
|
43
|
+
"categories"
|
|
44
|
+
],
|
|
48
45
|
"allowedSections": [
|
|
49
46
|
"faq",
|
|
50
47
|
"cta",
|
|
@@ -59,28 +56,34 @@
|
|
|
59
56
|
{
|
|
60
57
|
"type": "products",
|
|
61
58
|
"variant": "ProductSlider",
|
|
62
|
-
"after": "
|
|
59
|
+
"after": "hero"
|
|
63
60
|
},
|
|
64
61
|
{
|
|
65
62
|
"type": "universal-banner",
|
|
66
|
-
"after": "
|
|
63
|
+
"after": "hero"
|
|
67
64
|
},
|
|
68
65
|
{
|
|
69
66
|
"type": "products",
|
|
70
67
|
"variant": "ProductSlider",
|
|
71
|
-
"after": "
|
|
68
|
+
"after": "hero"
|
|
72
69
|
},
|
|
73
70
|
{
|
|
74
71
|
"type": "products",
|
|
75
72
|
"variant": "ProductSlider",
|
|
76
|
-
"after": "
|
|
73
|
+
"after": "hero"
|
|
77
74
|
},
|
|
78
75
|
{
|
|
79
|
-
"type": "
|
|
80
|
-
"
|
|
76
|
+
"type": "products",
|
|
77
|
+
"variant": "ProductGrid",
|
|
78
|
+
"after": "hero"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "products",
|
|
82
|
+
"variant": "ProductShowcase1",
|
|
83
|
+
"after": "hero"
|
|
81
84
|
}
|
|
82
85
|
],
|
|
83
|
-
"maxSections":
|
|
86
|
+
"maxSections": 6
|
|
84
87
|
},
|
|
85
88
|
{
|
|
86
89
|
"name": "product",
|
package/recipes/validate.mjs
CHANGED
|
@@ -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}".`
|
package/scripts/candidate.mjs
CHANGED
|
@@ -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.
|
|
51
|
-
'@thorprovider/adapters': '5.
|
|
52
|
-
'@thorprovider/runtime': '0.
|
|
50
|
+
'@thorprovider/blocks': '4.8.0',
|
|
51
|
+
'@thorprovider/adapters': '5.8.1',
|
|
52
|
+
'@thorprovider/runtime': '0.10.0',
|
|
53
53
|
'@thorprovider/types': '7.8.0',
|
|
54
54
|
}),
|
|
55
55
|
})
|
package/scripts/env-file.mjs
CHANGED
|
@@ -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,15 @@ 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
|
+
'# Shopper locale (BCP-47): governs <html lang> and every money surface',
|
|
33
|
+
'# (cart, cart sheet, checkout summary, order confirmation). Optional —',
|
|
34
|
+
'# unset or blank falls back to es-UY, the scaffold default that matches',
|
|
35
|
+
'# the mock Uruguay region (UYU).',
|
|
36
|
+
'THOR_STORE_LOCALE=es-UY',
|
|
37
|
+
'# Demo imagery base (mock mode only). The starter ships local product,',
|
|
38
|
+
'# category and banner shots under public/images; drop this to fall back to',
|
|
39
|
+
'# the generated SVG placeholders.',
|
|
40
|
+
'THOR_MOCK_ASSETS=/images',
|
|
31
41
|
'# Real backend configuration (required only when THOR_DATA_SOURCE=medusa).',
|
|
32
42
|
'# Run `storefront setup` to write these: it takes the sales channel id (from the',
|
|
33
43
|
'# Medusa admin) and derives the currency from the selected region.',
|
package/scripts/file-classes.mjs
CHANGED
|
@@ -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
|
],
|