@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.
Files changed (179) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +248 -99
  3. package/assets/templates/app/app/[[...slug]]/page.tsx +13 -2
  4. package/assets/templates/app/app/layout.tsx +18 -4
  5. package/assets/templates/app/app/robots.ts +13 -0
  6. package/assets/templates/app/app/sitemap.ts +12 -0
  7. package/assets/templates/app/lib/__STOREFRONT__/actions.ts +542 -0
  8. package/assets/templates/app/lib/__STOREFRONT__/cart-state.ts +66 -0
  9. package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +40 -57
  10. package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +608 -0
  11. package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +165 -0
  12. package/assets/templates/app/lib/__STOREFRONT__/handlers.ts +5 -36
  13. package/assets/templates/app/lib/__STOREFRONT__/icon-map.ts +27 -0
  14. package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +13 -11
  15. package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +232 -51
  16. package/assets/templates/app/lib/__STOREFRONT__/runtime.ts +3 -3
  17. package/assets/templates/app/lib/__STOREFRONT__/schema.ts +121 -0
  18. package/assets/templates/app/lib/__STOREFRONT__/session.core.ts +470 -0
  19. package/assets/templates/app/lib/__STOREFRONT__/session.ts +169 -0
  20. package/assets/templates/app/lib/__STOREFRONT__/shell/content.ts +96 -0
  21. package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +34 -0
  22. package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +100 -11
  23. package/assets/templates/app/lib/__STOREFRONT__/spec/page-root.ts +5 -1
  24. package/assets/templates/app/lib/__STOREFRONT__/spec/seo.ts +26 -0
  25. package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +257 -0
  26. package/assets/templates/app/lib/__STOREFRONT__/state.ts +7 -31
  27. package/assets/templates/app/lib/__STOREFRONT__/store-context.ts +142 -0
  28. package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.client.tsx +25 -0
  29. package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.tsx +16 -0
  30. package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.client.tsx +24 -0
  31. package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.tsx +5 -18
  32. package/assets/templates/app/lib/__STOREFRONT__/views/sections/index.ts +17 -0
  33. package/assets/templates/app/lib/__STOREFRONT__/views/sections/logoCloud.tsx +26 -14
  34. package/assets/templates/app/lib/__STOREFRONT__/views/sections/pricing.tsx +36 -18
  35. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.cta.ts +19 -0
  36. package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.faq.ts +18 -0
  37. package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +35 -14
  38. package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +31 -13
  39. package/assets/templates/app/lib/__STOREFRONT__/views/types.ts +5 -3
  40. package/assets/templates/features/checkout/handlers.ts +153 -0
  41. package/assets/templates/features/checkout/state.ts +61 -0
  42. package/assets/templates/features/customer-auth/handlers.ts +59 -0
  43. package/assets/templates/features/customer-auth/state.ts +36 -0
  44. package/assets/templates/features/recommendations/state.ts +11 -0
  45. package/assets/templates/views/account/content.ts +35 -0
  46. package/assets/templates/views/account/index.tsx +114 -0
  47. package/assets/templates/views/account/registry.tsx +378 -0
  48. package/assets/templates/views/account/schema.ts +52 -0
  49. package/assets/templates/views/category/assembly/assembly.json +28 -0
  50. package/assets/templates/views/category/assembly/index.skeleton.tsx +193 -0
  51. package/assets/templates/views/category/assembly/registry.skeleton.tsx +33 -0
  52. package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/catalog.part +5 -0
  53. package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/element.part +34 -0
  54. package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/registry.part +71 -0
  55. package/assets/templates/views/category/content.ts +30 -0
  56. package/assets/templates/views/category/data.ts +12 -0
  57. package/assets/templates/views/category/index.tsx +230 -0
  58. package/assets/templates/views/category/props.ts +16 -0
  59. package/assets/templates/views/category/registry.tsx +103 -0
  60. package/assets/templates/views/category/schema.ts +78 -0
  61. package/assets/templates/views/checkout/content.ts +105 -0
  62. package/assets/templates/views/checkout/data.ts +23 -0
  63. package/assets/templates/views/checkout/index.tsx +111 -0
  64. package/assets/templates/views/checkout/props.ts +49 -0
  65. package/assets/templates/views/checkout/registry.tsx +217 -0
  66. package/assets/templates/views/checkout/schema.ts +229 -0
  67. package/assets/templates/views/home/assembly/assembly.json +24 -0
  68. package/assets/templates/views/home/assembly/index.skeleton.tsx +72 -0
  69. package/assets/templates/views/home/assembly/registry.skeleton.tsx +25 -0
  70. package/assets/templates/views/home/assembly/slots/benefits/Feature1/binding.json +5 -0
  71. package/assets/templates/views/home/assembly/slots/benefits/Feature1/catalog.part +4 -0
  72. package/assets/templates/views/home/assembly/slots/benefits/Feature1/element.part +4 -0
  73. package/assets/templates/views/home/assembly/slots/benefits/Feature1/registry.part +11 -0
  74. package/assets/templates/views/home/assembly/slots/benefits/Feature2/binding.json +5 -0
  75. package/assets/templates/views/home/assembly/slots/benefits/Feature2/catalog.part +4 -0
  76. package/assets/templates/views/home/assembly/slots/benefits/Feature2/element.part +4 -0
  77. package/assets/templates/views/home/assembly/slots/benefits/Feature2/registry.part +10 -0
  78. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/binding.json +5 -0
  79. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/catalog.part +4 -0
  80. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/element.part +5 -0
  81. package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/registry.part +16 -0
  82. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/binding.json +5 -0
  83. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/catalog.part +4 -0
  84. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/element.part +5 -0
  85. package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/registry.part +26 -0
  86. package/assets/templates/views/home/content.ts +70 -0
  87. package/assets/templates/views/home/data.ts +15 -0
  88. package/assets/templates/views/home/index.tsx +38 -84
  89. package/assets/templates/views/home/props.ts +22 -0
  90. package/assets/templates/views/home/registry.tsx +38 -22
  91. package/assets/templates/views/home/schema.ts +93 -0
  92. package/assets/templates/views/product/content.ts +25 -0
  93. package/assets/templates/views/product/data.ts +48 -0
  94. package/assets/templates/views/product/index.tsx +104 -0
  95. package/assets/templates/views/product/props.ts +20 -0
  96. package/assets/templates/views/product/registry.tsx +78 -0
  97. package/assets/templates/views/product/schema.ts +108 -0
  98. package/assets/templates/views/static/content.ts +99 -0
  99. package/assets/templates/views/static/index.tsx +60 -0
  100. package/assets/templates/views/static/registry.tsx +66 -0
  101. package/assets/templates/views/static/schema.ts +45 -0
  102. package/{skills/sf-view-gen/assets → assets}/templates/views/user-panel/index.tsx +8 -70
  103. package/{skills/sf-view-gen/assets → assets}/templates/views/user-panel/registry.tsx +23 -18
  104. package/assets/templates/views/user-panel/schema.ts +79 -0
  105. package/bin/storefront.js +1278 -79
  106. package/commands/sf-add-view.md +44 -13
  107. package/commands/sf-feature.md +28 -0
  108. package/commands/sf-theme.md +14 -8
  109. package/commands/sf-view.md +54 -12
  110. package/package.json +6 -4
  111. package/recipes/archetypes.json +28 -1
  112. package/recipes/catalog.json +361 -0
  113. package/recipes/catalog.mjs +128 -0
  114. package/recipes/catalog.schema.json +64 -0
  115. package/recipes/feature.schema.json +89 -0
  116. package/recipes/features.json +139 -0
  117. package/recipes/manifest.schema.json +69 -0
  118. package/recipes/operations.schema.json +43 -0
  119. package/recipes/recipe.schema.json +11 -2
  120. package/recipes/recipes.json +60 -5
  121. package/recipes/sections.json +24 -5
  122. package/recipes/validate.mjs +784 -32
  123. package/scripts/candidate.mjs +236 -0
  124. package/scripts/composers.mjs +140 -0
  125. package/scripts/file-classes.mjs +116 -0
  126. package/scripts/logical-controls.mjs +61 -0
  127. package/scripts/manifest.mjs +298 -0
  128. package/scripts/operation-registry.mjs +256 -0
  129. package/scripts/operations.mjs +720 -0
  130. package/scripts/ownership-conflict.mjs +356 -0
  131. package/scripts/pinning.mjs +504 -0
  132. package/scripts/plan-apply.mjs +843 -0
  133. package/scripts/preflight.mjs +51 -0
  134. package/scripts/reconcile.mjs +511 -0
  135. package/scripts/render-templates.mjs +245 -28
  136. package/scripts/schema-validate.mjs +132 -0
  137. package/scripts/section-compat.mjs +300 -0
  138. package/scripts/section-operations.mjs +508 -0
  139. package/scripts/sync-assets.mjs +22 -15
  140. package/scripts/view-assembly.mjs +291 -0
  141. package/scripts/view-selection.mjs +211 -0
  142. package/skills/sf-feature/SKILL.md +67 -0
  143. package/skills/sf-theme-gen/SKILL.md +12 -5
  144. package/skills/sf-view-gen/SKILL.md +123 -93
  145. package/skills/sf-view-gen/assets/recipes/archetypes.json +28 -1
  146. package/skills/sf-view-gen/assets/recipes/catalog.json +361 -0
  147. package/skills/sf-view-gen/assets/recipes/catalog.schema.json +64 -0
  148. package/skills/sf-view-gen/assets/recipes/features.json +139 -0
  149. package/skills/sf-view-gen/assets/recipes/recipes.json +60 -5
  150. package/skills/sf-view-gen/assets/recipes/sections.json +24 -5
  151. package/skills/sf-view-gen/assets/templates/views/sections/cta.client.tsx +25 -0
  152. package/skills/sf-view-gen/assets/templates/views/sections/cta.tsx +16 -0
  153. package/skills/sf-view-gen/assets/templates/views/sections/faq.client.tsx +13 -9
  154. package/skills/sf-view-gen/assets/templates/views/sections/faq.tsx +2 -7
  155. package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.client.tsx +12 -8
  156. package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.tsx +2 -7
  157. package/skills/sf-view-gen/assets/templates/views/sections/pricing.client.tsx +14 -10
  158. package/skills/sf-view-gen/assets/templates/views/sections/pricing.tsx +2 -9
  159. package/skills/sf-view-gen/assets/templates/views/sections/schema.cta.ts +19 -0
  160. package/skills/sf-view-gen/assets/templates/views/sections/schema.faq.ts +18 -0
  161. package/skills/sf-view-gen/assets/templates/views/sections/schema.logoCloud.ts +19 -0
  162. package/skills/sf-view-gen/assets/templates/views/sections/schema.pricing.ts +26 -0
  163. package/skills/sf-view-gen/assets/templates/views/sections/schema.statistics.ts +25 -0
  164. package/skills/sf-view-gen/assets/templates/views/sections/schema.testimonials.ts +23 -0
  165. package/skills/sf-view-gen/assets/templates/views/sections/statistics.client.tsx +16 -8
  166. package/skills/sf-view-gen/assets/templates/views/sections/statistics.tsx +2 -7
  167. package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +13 -9
  168. package/skills/sf-view-gen/assets/templates/views/sections/testimonials.tsx +2 -5
  169. package/skills/sf-view-gen/references/views.md +44 -10
  170. package/skills/sf-view-gen/scripts/catalog.mjs +128 -0
  171. package/skills/sf-view-gen/scripts/schema-validate.mjs +132 -0
  172. package/skills/sf-view-gen/scripts/validate.mjs +784 -32
  173. package/skills/storefront-workflow/SKILL.md +116 -0
  174. package/skills/sf-view-gen/assets/templates/views/category/index.tsx +0 -86
  175. package/skills/sf-view-gen/assets/templates/views/category/registry.tsx +0 -48
  176. package/skills/sf-view-gen/assets/templates/views/checkout/index.tsx +0 -192
  177. package/skills/sf-view-gen/assets/templates/views/checkout/registry.tsx +0 -45
  178. package/skills/sf-view-gen/assets/templates/views/product/index.tsx +0 -122
  179. package/skills/sf-view-gen/assets/templates/views/product/registry.tsx +0 -49
@@ -1,26 +1,57 @@
1
1
  ---
2
- description: "Add a single view to an existing Thor Commerce storefront (product, category, checkout, user-panel)"
2
+ description: "Add a view to a Thor Commerce storefront via the storefront CLI"
3
3
  ---
4
4
 
5
- Add one view to an existing Thor Commerce storefront, generated from a recipe.
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 followed by a description of what the view should contain or emphasize.
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
- The skill generates from the assets inside its own directory (`assets/recipes/`, `assets/templates/views/`); when a choice is not resolved there, it asks you.
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
- **Reads (target project):** existence of `package.json`, `lib/<name>/`, `.opencode/`, and the view name + description.
20
- **Writes (target project):** the view module and one barrel entry, all reported.
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
- **Constraints (do not violate without explicit user authorization):**
23
- - Allowed view names: `home`, `product`, `category`, `checkout`, `user-panel`
24
- - Block variants and optional sections MUST come from the skill's own `assets/recipes/` (`recipes.json`, `archetypes.json`, `sections.json`)
25
- - UI components come ONLY from `@thorprovider/blocks`
26
- - Data access goes ONLY through `@thorprovider/adapters` / `@thorprovider/runtime/commerce`
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.
@@ -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 a Thor Commerce storefront.
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
- The skill works from its own directory and the vendored `shadcn-theming` skill beside it; when a choice is not resolved there, it asks you.
13
-
14
- **Reads (target project):** existence of `package.json`, `lib/<name>/`, `.opencode/`, and the wizard answers.
15
- **Writes (target project):** `app/globals.css` and `app/layout.tsx`, all reported.
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 (light AND dark)
19
- - Never use raw Tailwind color utilities for themed colors
20
- - Typography and metadata follow the skill's own assets
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.
@@ -1,25 +1,67 @@
1
1
  ---
2
- description: "Modify an existing storefront view's spec while preserving its structure"
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 a Thor Commerce storefront.
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 statistics band after the hero`
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 (modification workflow).
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
- The skill works from the assets inside its own directory (`assets/recipes/`, `assets/templates/views/`); when a choice is not resolved there, it asks you.
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
- **Reads (target project):** existence of `package.json`, `lib/<name>/`, `.opencode/`, the existing view module, and the change requested.
19
- **Writes (target project):** the edited view module, all reported.
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
- **Constraints (do not violate without explicit user authorization):**
22
- - Allowed view names: `home`, `product`, `category`, `checkout`, `user-panel`
23
- - Preserve element ids, `type`, untouched `props`, `$state` bindings, and `on` wiring
24
- - Only add block variants/sections declared in the skill's own `assets/recipes/`
25
- - UI components come ONLY from `@thorprovider/blocks`
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.1",
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": ">=18.17.0"
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"
@@ -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": "showcase",
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": {