@thorprovider/storefront 0.3.1 → 0.4.0-mvp.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/CHANGELOG.md +23 -0
- package/README.md +248 -99
- package/assets/templates/app/app/[[...slug]]/page.tsx +13 -2
- package/assets/templates/app/app/layout.tsx +18 -4
- package/assets/templates/app/app/robots.ts +13 -0
- package/assets/templates/app/app/sitemap.ts +12 -0
- package/assets/templates/app/lib/__STOREFRONT__/actions.ts +542 -0
- package/assets/templates/app/lib/__STOREFRONT__/cart-state.ts +66 -0
- package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +40 -57
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +608 -0
- package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +165 -0
- package/assets/templates/app/lib/__STOREFRONT__/handlers.ts +5 -36
- package/assets/templates/app/lib/__STOREFRONT__/icon-map.ts +27 -0
- package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +13 -11
- package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +232 -51
- package/assets/templates/app/lib/__STOREFRONT__/runtime.ts +3 -3
- package/assets/templates/app/lib/__STOREFRONT__/schema.ts +121 -0
- package/assets/templates/app/lib/__STOREFRONT__/session.core.ts +470 -0
- package/assets/templates/app/lib/__STOREFRONT__/session.ts +169 -0
- package/assets/templates/app/lib/__STOREFRONT__/shell/content.ts +96 -0
- package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +34 -0
- package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +100 -11
- package/assets/templates/app/lib/__STOREFRONT__/spec/page-root.ts +5 -1
- package/assets/templates/app/lib/__STOREFRONT__/spec/seo.ts +26 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +257 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.ts +7 -31
- package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +142 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.client.tsx +25 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.tsx +16 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.client.tsx +24 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.tsx +5 -18
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/index.ts +17 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/logoCloud.tsx +26 -14
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/pricing.tsx +36 -18
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.cta.ts +19 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.faq.ts +18 -0
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +35 -14
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +31 -13
- package/assets/templates/app/lib/__STOREFRONT__/views/types.ts +5 -3
- package/assets/templates/features/checkout/handlers.ts +153 -0
- package/assets/templates/features/checkout/state.ts +61 -0
- package/assets/templates/features/customer-auth/handlers.ts +59 -0
- package/assets/templates/features/customer-auth/state.ts +36 -0
- package/assets/templates/features/recommendations/state.ts +11 -0
- package/assets/templates/views/account/content.ts +35 -0
- package/assets/templates/views/account/index.tsx +114 -0
- package/assets/templates/views/account/registry.tsx +378 -0
- package/assets/templates/views/account/schema.ts +52 -0
- package/assets/templates/views/category/assembly/assembly.json +28 -0
- package/assets/templates/views/category/assembly/index.skeleton.tsx +193 -0
- package/assets/templates/views/category/assembly/registry.skeleton.tsx +33 -0
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/catalog.part +5 -0
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/element.part +34 -0
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/registry.part +71 -0
- package/assets/templates/views/category/content.ts +30 -0
- package/assets/templates/views/category/data.ts +12 -0
- package/assets/templates/views/category/index.tsx +230 -0
- package/assets/templates/views/category/props.ts +16 -0
- package/assets/templates/views/category/registry.tsx +103 -0
- package/assets/templates/views/category/schema.ts +78 -0
- package/assets/templates/views/checkout/content.ts +105 -0
- package/assets/templates/views/checkout/data.ts +23 -0
- package/assets/templates/views/checkout/index.tsx +111 -0
- package/assets/templates/views/checkout/props.ts +49 -0
- package/assets/templates/views/checkout/registry.tsx +217 -0
- package/assets/templates/views/checkout/schema.ts +229 -0
- package/assets/templates/views/home/assembly/assembly.json +24 -0
- package/assets/templates/views/home/assembly/index.skeleton.tsx +72 -0
- package/assets/templates/views/home/assembly/registry.skeleton.tsx +25 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/element.part +4 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/registry.part +11 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/element.part +4 -0
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/registry.part +10 -0
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/element.part +5 -0
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/registry.part +16 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/element.part +5 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/registry.part +26 -0
- package/assets/templates/views/home/content.ts +70 -0
- package/assets/templates/views/home/data.ts +15 -0
- package/assets/templates/views/home/index.tsx +38 -84
- package/assets/templates/views/home/props.ts +22 -0
- package/assets/templates/views/home/registry.tsx +38 -22
- package/assets/templates/views/home/schema.ts +93 -0
- package/assets/templates/views/product/content.ts +25 -0
- package/assets/templates/views/product/data.ts +48 -0
- package/assets/templates/views/product/index.tsx +104 -0
- package/assets/templates/views/product/props.ts +20 -0
- package/assets/templates/views/product/registry.tsx +78 -0
- package/assets/templates/views/product/schema.ts +108 -0
- package/assets/templates/views/static/content.ts +99 -0
- package/assets/templates/views/static/index.tsx +60 -0
- package/assets/templates/views/static/registry.tsx +66 -0
- package/assets/templates/views/static/schema.ts +45 -0
- package/{skills/sf-view-gen/assets → assets}/templates/views/user-panel/index.tsx +8 -70
- package/{skills/sf-view-gen/assets → assets}/templates/views/user-panel/registry.tsx +23 -18
- package/assets/templates/views/user-panel/schema.ts +79 -0
- package/bin/storefront.js +1278 -79
- package/commands/sf-add-view.md +44 -13
- package/commands/sf-feature.md +28 -0
- package/commands/sf-theme.md +14 -8
- package/commands/sf-view.md +54 -12
- package/package.json +6 -4
- package/recipes/archetypes.json +28 -1
- package/recipes/catalog.json +361 -0
- package/recipes/catalog.mjs +128 -0
- package/recipes/catalog.schema.json +64 -0
- package/recipes/feature.schema.json +89 -0
- package/recipes/features.json +139 -0
- package/recipes/manifest.schema.json +69 -0
- package/recipes/operations.schema.json +43 -0
- package/recipes/recipe.schema.json +11 -2
- package/recipes/recipes.json +60 -5
- package/recipes/sections.json +24 -5
- package/recipes/validate.mjs +784 -32
- package/scripts/candidate.mjs +236 -0
- package/scripts/composers.mjs +140 -0
- package/scripts/file-classes.mjs +116 -0
- package/scripts/logical-controls.mjs +61 -0
- package/scripts/manifest.mjs +298 -0
- package/scripts/operation-registry.mjs +256 -0
- package/scripts/operations.mjs +720 -0
- package/scripts/ownership-conflict.mjs +356 -0
- package/scripts/pinning.mjs +504 -0
- package/scripts/plan-apply.mjs +843 -0
- package/scripts/preflight.mjs +51 -0
- package/scripts/reconcile.mjs +511 -0
- package/scripts/render-templates.mjs +245 -28
- package/scripts/schema-validate.mjs +132 -0
- package/scripts/section-compat.mjs +300 -0
- package/scripts/section-operations.mjs +508 -0
- package/scripts/sync-assets.mjs +22 -15
- package/scripts/view-assembly.mjs +291 -0
- package/scripts/view-selection.mjs +211 -0
- package/skills/sf-feature/SKILL.md +67 -0
- package/skills/sf-theme-gen/SKILL.md +12 -5
- package/skills/sf-view-gen/SKILL.md +123 -93
- package/skills/sf-view-gen/assets/recipes/archetypes.json +28 -1
- package/skills/sf-view-gen/assets/recipes/catalog.json +361 -0
- package/skills/sf-view-gen/assets/recipes/catalog.schema.json +64 -0
- package/skills/sf-view-gen/assets/recipes/features.json +139 -0
- package/skills/sf-view-gen/assets/recipes/recipes.json +60 -5
- package/skills/sf-view-gen/assets/recipes/sections.json +24 -5
- package/skills/sf-view-gen/assets/templates/views/sections/cta.client.tsx +25 -0
- package/skills/sf-view-gen/assets/templates/views/sections/cta.tsx +16 -0
- package/skills/sf-view-gen/assets/templates/views/sections/faq.client.tsx +13 -9
- package/skills/sf-view-gen/assets/templates/views/sections/faq.tsx +2 -7
- package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.client.tsx +12 -8
- package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.tsx +2 -7
- package/skills/sf-view-gen/assets/templates/views/sections/pricing.client.tsx +14 -10
- package/skills/sf-view-gen/assets/templates/views/sections/pricing.tsx +2 -9
- package/skills/sf-view-gen/assets/templates/views/sections/schema.cta.ts +19 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.faq.ts +18 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.logoCloud.ts +19 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.pricing.ts +26 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.statistics.ts +25 -0
- package/skills/sf-view-gen/assets/templates/views/sections/schema.testimonials.ts +23 -0
- package/skills/sf-view-gen/assets/templates/views/sections/statistics.client.tsx +16 -8
- package/skills/sf-view-gen/assets/templates/views/sections/statistics.tsx +2 -7
- package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +13 -9
- package/skills/sf-view-gen/assets/templates/views/sections/testimonials.tsx +2 -5
- package/skills/sf-view-gen/references/views.md +44 -10
- package/skills/sf-view-gen/scripts/catalog.mjs +128 -0
- package/skills/sf-view-gen/scripts/schema-validate.mjs +132 -0
- package/skills/sf-view-gen/scripts/validate.mjs +784 -32
- package/skills/storefront-workflow/SKILL.md +116 -0
- package/skills/sf-view-gen/assets/templates/views/category/index.tsx +0 -86
- package/skills/sf-view-gen/assets/templates/views/category/registry.tsx +0 -48
- package/skills/sf-view-gen/assets/templates/views/checkout/index.tsx +0 -192
- package/skills/sf-view-gen/assets/templates/views/checkout/registry.tsx +0 -45
- package/skills/sf-view-gen/assets/templates/views/product/index.tsx +0 -122
- package/skills/sf-view-gen/assets/templates/views/product/registry.tsx +0 -49
package/commands/sf-add-view.md
CHANGED
|
@@ -1,26 +1,57 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Add a
|
|
2
|
+
description: "Add a view to a Thor Commerce storefront via the storefront CLI"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Add one view to
|
|
5
|
+
Add one view to the current storefront. The CLI is the structural authority; do
|
|
6
|
+
not copy templates or edit derived files.
|
|
6
7
|
|
|
7
|
-
**Input**: view name, optionally
|
|
8
|
+
**Input**: view name, optionally a description of what it should contain.
|
|
8
9
|
Examples:
|
|
9
10
|
- `/sf-add-view product`
|
|
10
11
|
- `/sf-add-view category specialize in power stations, use a dense grid`
|
|
11
|
-
- `/sf-add-view checkout keep it single-page`
|
|
12
12
|
|
|
13
13
|
**Provided arguments**: $ARGUMENTS
|
|
14
14
|
|
|
15
|
-
Use the `sf-view-gen` skill.
|
|
15
|
+
Use the `sf-view-gen` skill. The agent selects the change and delegates every
|
|
16
|
+
structural write to the CLI; the user states the change in natural language and
|
|
17
|
+
never types a command.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
**Flow:**
|
|
20
|
+
1. `npx @thorprovider/storefront views --json` — confirm the view is supported
|
|
21
|
+
and read its `supportedIntents`, `registeredSlots`, `allowedSections`,
|
|
22
|
+
`maxSections`, and the top-level `sectionTypes`. Held units (`user-panel`,
|
|
23
|
+
recommendations) and the feature-owned `checkout` view are rejected; sections
|
|
24
|
+
are composable (step 4).
|
|
25
|
+
2. Choose an intent per slot by meaning from the user's description.
|
|
26
|
+
3. Delegate the write:
|
|
27
|
+
`npx @thorprovider/storefront view add <name> [--intent slot=intent] [--variant slot=Variant]`
|
|
28
|
+
4. To compose **sections** on the new view, delegate to the CLI's section
|
|
29
|
+
operations (`section.add` / `section.remove` / `section.reorder`) in E1's
|
|
30
|
+
operations envelope `{ "formatVersion": 1, "operations": [ ... ] }`; `plan` is
|
|
31
|
+
read-only and `apply --plan` is the only writer:
|
|
32
|
+
- `section.add` (`view`, `type`, optional `id`, `variant`, `at`) adds an
|
|
33
|
+
editorial instance; `type` must be in the view's `allowedSections`, an
|
|
34
|
+
omitted `id` is auto-minted, and the add is rejected past `maxSections`.
|
|
35
|
+
- `section.remove` (`view`, `id`) removes an editorial instance; a registered
|
|
36
|
+
core slot (`slot:<slot>`) cannot be removed.
|
|
37
|
+
- `section.reorder` (`view`, `order`) requires `order` to be a permutation of
|
|
38
|
+
the view's current entry ids: every current id exactly once and every
|
|
39
|
+
registered slot present.
|
|
18
40
|
|
|
19
|
-
|
|
20
|
-
|
|
41
|
+
```bash
|
|
42
|
+
npx @thorprovider/storefront plan --operations operations.json --out plan.json
|
|
43
|
+
npx @thorprovider/storefront apply --plan plan.json
|
|
44
|
+
```
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
Only `faq` and `cta` are executable editorial types. Held types
|
|
47
|
+
(`testimonials`, `statistics`, `logoCloud`, `pricing`) are not available and
|
|
48
|
+
are refused with the bounded reason the registry reports. These three section
|
|
49
|
+
operations are implemented and supported — there is no proposed or future
|
|
50
|
+
section command.
|
|
51
|
+
5. Report the result. If the CLI exits non-zero, show its message; never
|
|
52
|
+
hand-edit derived files to work around it.
|
|
53
|
+
|
|
54
|
+
**Constraints:**
|
|
55
|
+
- UI only `@thorprovider/blocks`; data only `@thorprovider/adapters` +
|
|
56
|
+
`@thorprovider/runtime/commerce`.
|
|
57
|
+
- No manual template copy, no derived-file edits, no manual barrel edits.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Add or remove a storefront feature bundle (e.g. checkout) via the storefront CLI"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Add or remove a feature bundle in the current storefront. A feature may own
|
|
6
|
+
views (plus its state/handlers/adapter wiring), an owned route, and instance
|
|
7
|
+
mounts into a host view's slot; the CLI writes every derived file.
|
|
8
|
+
|
|
9
|
+
**Input**: `add <name>` or `remove <name>` (e.g. `add checkout`).
|
|
10
|
+
**Provided arguments**: $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
Use the `sf-feature` skill.
|
|
13
|
+
|
|
14
|
+
**Flow:**
|
|
15
|
+
1. `npx @thorprovider/storefront features --json` — confirm the feature is
|
|
16
|
+
supported. Held features are rejected before any write.
|
|
17
|
+
2. Delegate the write:
|
|
18
|
+
`npx @thorprovider/storefront feature add|remove <name>`
|
|
19
|
+
3. Report the result and any preserved user-owned file the CLI names. A
|
|
20
|
+
mount-based feature (e.g. `benefits` at `home.benefits`) leaves the host
|
|
21
|
+
view's customized content in place; the CLI reports its location.
|
|
22
|
+
|
|
23
|
+
**Constraints:**
|
|
24
|
+
- The curated MVP features are `checkout` (owns the `/checkout` route) and
|
|
25
|
+
`benefits` (mounts at `home.benefits`).
|
|
26
|
+
- No derived-file edits; the CLI reconciles state/handlers/adapter wiring.
|
|
27
|
+
- Purchase logic is owned by `single-tenant-commerce-mvp`; this installs
|
|
28
|
+
structural wiring only.
|
package/commands/sf-theme.md
CHANGED
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
description: "Customize storefront theme: OKLCH colors (light/dark), typography, and identity metadata"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Customize the theme and identity of
|
|
5
|
+
Customize the theme and identity of the current storefront. The manifest
|
|
6
|
+
(`storefront.config.json`) is the theme authority; the CLI applies deterministic
|
|
7
|
+
changes.
|
|
6
8
|
|
|
7
9
|
**Input**: optional — the wizard asks what to customize (colors, typography, identity, SEO, Open Graph).
|
|
8
10
|
**Provided arguments**: $ARGUMENTS
|
|
9
11
|
|
|
10
12
|
Use the `sf-theme-gen` skill.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
**
|
|
15
|
-
|
|
14
|
+
**Flow:**
|
|
15
|
+
1. Run from inside the project (no directory argument).
|
|
16
|
+
2. **Mode (light/dark/system)** is manifest state, not a hand edit:
|
|
17
|
+
`npx @thorprovider/storefront theme --mode light|dark|system`
|
|
18
|
+
3. Colors/typography/metadata are user-owned edits in `app/globals.css` and
|
|
19
|
+
`app/layout.tsx`, following the skill's assets.
|
|
20
|
+
4. `npx @thorprovider/storefront sync` and report.
|
|
16
21
|
|
|
17
22
|
**Constraints (do not violate without explicit user authorization):**
|
|
18
|
-
- Colors are CSS variables in OKLCH with complete background/foreground pairs
|
|
19
|
-
|
|
20
|
-
-
|
|
23
|
+
- Colors are CSS variables in OKLCH with complete background/foreground pairs
|
|
24
|
+
(light AND dark); never raw Tailwind color utilities for themed colors.
|
|
25
|
+
- Never hand-edit `app/layout.tsx` for the mode — the CLI rewrites the
|
|
26
|
+
`ThemeProvider` wiring idempotently from the manifest.
|
package/commands/sf-view.md
CHANGED
|
@@ -1,25 +1,67 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Modify
|
|
2
|
+
description: "Modify a storefront view's user-owned content/props/data, or compose its sections, via the storefront CLI"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Modify an existing view in
|
|
5
|
+
Modify an existing view in the current storefront.
|
|
6
6
|
|
|
7
7
|
**Input**: view name followed by the change to make.
|
|
8
8
|
Examples:
|
|
9
|
-
- `/sf-view home add a
|
|
9
|
+
- `/sf-view home add a FAQ section after the hero`
|
|
10
|
+
- `/sf-view home move the CTA above the benefits`
|
|
10
11
|
- `/sf-view category switch to a 4-column grid`
|
|
11
12
|
|
|
12
13
|
**Provided arguments**: $ARGUMENTS
|
|
13
14
|
|
|
14
|
-
Use the `sf-view-gen` skill
|
|
15
|
+
Use the `sf-view-gen` skill. The agent selects the change and delegates every
|
|
16
|
+
structural write to the CLI; the user describes the change in natural language
|
|
17
|
+
and never types a command.
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
**Flow:**
|
|
20
|
+
1. Read the registry through the CLI
|
|
21
|
+
(`npx @thorprovider/storefront views --json`) for the view's
|
|
22
|
+
`registeredSlots`, `allowedSections`, `maxSections`, and the top-level
|
|
23
|
+
`sectionTypes`.
|
|
24
|
+
2. If the change composes **sections**, delegate to the CLI's section
|
|
25
|
+
operations — do not edit derived files. They are carried in E1's operations
|
|
26
|
+
envelope `{ "formatVersion": 1, "operations": [ ... ] }`; `plan` is read-only
|
|
27
|
+
and validates the whole intended state, `apply --plan` is the only writer:
|
|
28
|
+
- `{ "op": "section.add", "view": "home", "type": "faq" }` — optional `id`,
|
|
29
|
+
`variant`, and `at` (0-based insertion index, default append). `type` must
|
|
30
|
+
be in the view's `allowedSections`; omit `id` to auto-mint one; rejected
|
|
31
|
+
when adding would exceed `maxSections`.
|
|
32
|
+
- `{ "op": "section.remove", "view": "home", "id": "home-faq-1" }` — removes
|
|
33
|
+
an editorial instance. A registered core slot (`slot:<slot>`) cannot be
|
|
34
|
+
removed.
|
|
35
|
+
- `{ "op": "section.reorder", "view": "home", "order": ["slot:hero",
|
|
36
|
+
"home-faq-1", "slot:benefits", "slot:categories"] }` — `order` must be a
|
|
37
|
+
permutation of the view's current entry ids: every current id exactly once
|
|
38
|
+
and every registered slot present.
|
|
17
39
|
|
|
18
|
-
|
|
19
|
-
|
|
40
|
+
```bash
|
|
41
|
+
npx @thorprovider/storefront plan --operations operations.json --out plan.json
|
|
42
|
+
npx @thorprovider/storefront apply --plan plan.json
|
|
43
|
+
```
|
|
20
44
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
45
|
+
Only `faq` and `cta` are executable editorial types. Held types
|
|
46
|
+
(`testimonials`, `statistics`, `logoCloud`, `pricing`) are not available and
|
|
47
|
+
are refused with the bounded reason the registry reports; never present a
|
|
48
|
+
held type as available. A removed instance's content is preserved in the
|
|
49
|
+
view's user-owned `content.ts`; re-adding the same `id` rebinds it, while an
|
|
50
|
+
auto-minted id never does. These three section operations are implemented and
|
|
51
|
+
supported — there is no proposed or future section command; the held section
|
|
52
|
+
types are the only not-yet-available part of this surface.
|
|
53
|
+
3. If the change is a different block variant or an added/removed view, delegate
|
|
54
|
+
to the CLI: `npx @thorprovider/storefront view add|remove ...`.
|
|
55
|
+
4. If the change is content/props/data, edit only the **user-owned** files:
|
|
56
|
+
`lib/<name>/views/<view>/content.ts`, `props.ts`, `data.ts`, `schema.ts`, and
|
|
57
|
+
`lib/<name>/mappers.ts`.
|
|
58
|
+
5. Regenerate the derived wrappers around the edit:
|
|
59
|
+
`npx @thorprovider/storefront sync`.
|
|
60
|
+
6. Report the result and the files touched.
|
|
61
|
+
|
|
62
|
+
**Constraints:**
|
|
63
|
+
- Preserve exported names, element ids, and the prop/event contracts the derived
|
|
64
|
+
wrapper imports.
|
|
65
|
+
- Never edit derived files (`index.tsx`, `registry.tsx`, `views/index.ts`,
|
|
66
|
+
`views/registry.ts`, `catalog.ts`, `runtime.ts`, `spec/index.ts`).
|
|
67
|
+
- UI only `@thorprovider/blocks`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-mvp.0",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode command suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/storefront.js",
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=20.9.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"sync-assets": "node ./scripts/sync-assets.mjs",
|
|
21
21
|
"check-assets": "node ./scripts/sync-assets.mjs --check",
|
|
22
22
|
"pretest": "node ./scripts/sync-assets.mjs --check",
|
|
23
|
-
"test": "vitest run --config vitest.config.ts"
|
|
23
|
+
"test": "vitest run --config vitest.config.ts",
|
|
24
|
+
"test:integration": "vitest run --config vitest.config.ts tests/scaffold-integration.test.ts"
|
|
24
25
|
},
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public",
|
|
@@ -39,7 +40,8 @@
|
|
|
39
40
|
"scaffolding"
|
|
40
41
|
],
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@clack/prompts": "^1.8.1"
|
|
43
|
+
"@clack/prompts": "^1.8.1",
|
|
44
|
+
"semver": "^7.7.4"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"vitest": "^3.2.4"
|
package/recipes/archetypes.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Archetype (intent) layer. Maps a slot to named intents so selection is by meaning, not by variant ordinal. Each intent resolves to a variant that MUST be allowed by the recipe for that slot.",
|
|
5
5
|
"slots": {
|
|
6
6
|
"home.hero": {
|
|
7
|
-
"default": "
|
|
7
|
+
"default": "compact",
|
|
8
8
|
"intents": {
|
|
9
9
|
"compact": {
|
|
10
10
|
"variant": "StorefrontHero1",
|
|
@@ -122,6 +122,33 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
+
"account.login": {
|
|
126
|
+
"default": "signIn",
|
|
127
|
+
"intents": {
|
|
128
|
+
"signIn": {
|
|
129
|
+
"variant": "LoginPage1",
|
|
130
|
+
"when": "A full sign-in page with email and password and a link to create an account."
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"account.register": {
|
|
135
|
+
"default": "signUp",
|
|
136
|
+
"intents": {
|
|
137
|
+
"signUp": {
|
|
138
|
+
"variant": "SignUpPage1",
|
|
139
|
+
"when": "A full registration page with name, email, and password and a link to sign in."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"account.orders": {
|
|
144
|
+
"default": "viewOrders",
|
|
145
|
+
"intents": {
|
|
146
|
+
"viewOrders": {
|
|
147
|
+
"variant": "OrderHistory2",
|
|
148
|
+
"when": "A signed-in shopper's order history with per-order totals and detail on demand."
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
125
152
|
"user-panel.shell": {
|
|
126
153
|
"default": "standard",
|
|
127
154
|
"intents": {
|