@appdirect/sfb-toolkit 5.0.8 → 6.0.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/.eslintrc +35 -35
- package/CHANGELOG.md +32 -0
- package/Dockerfile +2 -1
- package/agent/.cursor/rules/sfb-storefront.mdc +17 -0
- package/agent/.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md +130 -0
- package/agent/.cursor/skills/sfb-custom-components/SKILL.md +43 -0
- package/agent/.cursor/skills/sfb-localization-settings/SKILL.md +29 -0
- package/agent/.cursor/skills/sfb-theme-customize/SKILL.md +25 -0
- package/agent/.cursor/skills/sfb-toolkit-commands/SKILL.md +35 -0
- package/agent/AGENTS.md +160 -0
- package/agent/CLAUDE.md +19 -0
- package/bin/index.js +82 -100
- package/coverage/clover.xml +1921 -335
- package/coverage/coverage-final.json +41 -20
- package/coverage/lcov-report/{controllers/controllers-utils → config}/index.html +19 -19
- package/coverage/lcov-report/config/index.js.html +124 -0
- package/coverage/lcov-report/index.html +108 -78
- package/coverage/lcov-report/{constants → src/constants}/customUserAttributesMock.js.html +12 -12
- package/coverage/lcov-report/{constants → src/constants}/index.html +10 -10
- package/coverage/lcov-report/{constants → src/constants}/pageUrls.js.html +14 -14
- package/coverage/lcov-report/{constants → src/constants}/userMock.js.html +13 -13
- package/coverage/lcov-report/{controllers → src/controllers}/controllers-utils/assetsUtils.js.html +20 -20
- package/coverage/lcov-report/src/controllers/controllers-utils/index.html +131 -0
- package/coverage/lcov-report/src/controllers/controllers-utils/locale.js.html +115 -0
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/bootstrap-data-filter.js.html +15 -15
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/call-to-actions-filter.js.html +22 -22
- package/coverage/lcov-report/{controllers → src/controllers}/data-filters/index.html +37 -22
- package/coverage/lcov-report/src/controllers/data-filters/media-url-filter.js.html +394 -0
- package/coverage/lcov-report/{controllers → src/controllers}/index.html +27 -27
- package/coverage/lcov-report/{controllers → src/controllers}/index.js.html +159 -126
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/ResultItem.js.html +43 -43
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/SearchBar.js.html +22 -22
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/index.html +28 -28
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/base/item.js.html +28 -28
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/container.js.html +31 -31
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/data-view.js.html +29 -29
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/header-view.js.html +35 -38
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/index.html +45 -45
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/components/search.js.html +54 -54
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/index.html +22 -22
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/pageUrl.js.html +17 -17
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/roleType.js.html +14 -14
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/constants/searchType.js.html +17 -17
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/utils/debounce.js.html +15 -15
- package/coverage/lcov-report/{front-end-utils → src/front-end-utils}/src/utils/index.html +20 -20
- package/coverage/lcov-report/{middlewares → src/middlewares}/config.js.html +11 -11
- package/coverage/lcov-report/{middlewares → src/middlewares}/index.html +10 -10
- package/coverage/lcov-report/{tools → src/routes}/index.html +30 -30
- package/coverage/lcov-report/src/routes/media-proxy.js.html +613 -0
- package/coverage/lcov-report/src/tools/compile-styles.js.html +1018 -0
- package/coverage/lcov-report/src/tools/custom-components-export-compat-loader.js.html +745 -0
- package/coverage/lcov-report/src/tools/index.html +371 -0
- package/coverage/lcov-report/src/tools/prompt-questions.js.html +1117 -0
- package/coverage/lcov-report/{tools → src/tools}/proxy-fetch.js.html +15 -15
- package/coverage/lcov-report/src/tools/resolve-components-react.js.html +457 -0
- package/coverage/lcov-report/src/tools/sass-legacy-compat.js.html +1192 -0
- package/coverage/lcov-report/src/tools/toolkit-cli-argv.js.html +226 -0
- package/coverage/lcov-report/src/tools/toolkit-common-fun.js.html +1192 -0
- package/coverage/lcov-report/src/tools/toolkit-common-vars-namespace.js.html +403 -0
- package/coverage/lcov-report/src/tools/toolkit-common-vars.js.html +283 -0
- package/coverage/lcov-report/src/tools/toolkit-components-fun.js.html +1237 -0
- package/coverage/lcov-report/src/tools/toolkit-components-vars.js.html +232 -0
- package/coverage/lcov-report/src/tools/toolkit-install-agent-guidance.js.html +439 -0
- package/coverage/lcov-report/src/tools/toolkit-live-reload.js.html +688 -0
- package/coverage/lcov-report/src/tools/toolkit-path.js.html +184 -0
- package/coverage/lcov-report/src/tools/toolkit-spawn.js.html +199 -0
- package/coverage/lcov-report/src/tools/toolkit-v6-theme-risk.js.html +1039 -0
- package/coverage/lcov-report/src/tools/toolkit-zip-utils.js.html +190 -0
- package/coverage/lcov.info +3356 -727
- package/index.js +40 -20
- package/npm-shrinkwrap.json +19445 -35435
- package/package.json +50 -41
- package/readme.md +23 -1
- package/rspack-components.config.cjs +81 -0
- package/rspack-components.config.prod.cjs +71 -0
- package/rspack.config.cjs +25 -0
- package/rspack.shared.cjs +164 -0
- package/src/controllers/controllers-utils/locale.js +10 -0
- package/src/controllers/data-filters/media-url-filter.js +103 -0
- package/src/controllers/index.js +15 -4
- package/src/front-end-utils/dist/toolbar.bundle.js +1 -2
- package/src/front-end-utils/src/components/header-view.js +0 -1
- package/src/routes/cors.js +29 -0
- package/src/routes/index.js +2 -0
- package/src/routes/media-proxy.js +176 -0
- package/src/tools/compile-styles.js +311 -0
- package/src/tools/compiler-components-prod.js +32 -21
- package/src/tools/compiler-css.js +7 -7
- package/src/tools/custom-components-export-compat-loader.js +220 -0
- package/src/tools/resolve-components-react.js +124 -0
- package/src/tools/sass-legacy-compat.js +369 -0
- package/src/tools/toolkit-checkout.js +3 -6
- package/src/tools/toolkit-cli-argv.js +47 -0
- package/src/tools/toolkit-common-fun.js +66 -18
- package/src/tools/toolkit-common-utils.js +5 -3
- package/src/tools/toolkit-common-vars.js +4 -3
- package/src/tools/toolkit-components-copy.js +6 -4
- package/src/tools/toolkit-components-fun.js +6 -4
- package/src/tools/toolkit-config-setup.js +2 -1
- package/src/tools/toolkit-create.js +5 -7
- package/src/tools/toolkit-import.js +5 -6
- package/src/tools/toolkit-install-agent-guidance-cli.js +24 -0
- package/src/tools/toolkit-install-agent-guidance.js +118 -0
- package/src/tools/toolkit-install.js +8 -8
- package/src/tools/toolkit-live-reload.js +201 -0
- package/src/tools/toolkit-package.js +25 -7
- package/src/tools/toolkit-path.js +33 -0
- package/src/tools/toolkit-setup-e2e.js +2 -1
- package/src/tools/toolkit-setup.js +5 -1
- package/src/tools/toolkit-spawn.js +38 -0
- package/src/tools/toolkit-start.js +98 -54
- package/src/tools/toolkit-storybook.js +38 -19
- package/src/tools/toolkit-update.js +5 -3
- package/src/tools/toolkit-v6-theme-risk.js +318 -0
- package/themes-param.json +1 -0
- package/src/front-end-utils/dist/toolbar.bundle.js.LICENSE.txt +0 -52
- package/src/tools/gulp-tasks.js +0 -80
- package/webpack-components.config.cjs +0 -123
- package/webpack-components.config.prod.cjs +0 -113
- package/webpack.config.cjs +0 -25
package/.eslintrc
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"env": {
|
|
14
|
-
"es6": true,
|
|
15
|
-
"browser": true
|
|
16
|
-
},
|
|
17
|
-
"plugins": [
|
|
18
|
-
"prettier"
|
|
19
|
-
],
|
|
20
|
-
"parser": "babel-eslint",
|
|
21
|
-
"rules": {
|
|
22
|
-
"prettier/prettier": 2,
|
|
23
|
-
"strict": [
|
|
24
|
-
2,
|
|
25
|
-
"global"
|
|
26
|
-
],
|
|
27
|
-
"max-len": 0,
|
|
28
|
-
"no-nested-ternary": 0,
|
|
29
|
-
"no-underscore-dangle": 0,
|
|
30
|
-
"global-require": 0,
|
|
31
|
-
"react/prefer-stateless-function": 0,
|
|
32
|
-
"react/jsx-filename-extension": 0,
|
|
33
|
-
"no-invalid-regexp": 0,
|
|
34
|
-
"no-console": 0,
|
|
35
|
-
"import/no-unresolved": 0
|
|
2
|
+
"extends": [
|
|
3
|
+
"airbnb",
|
|
4
|
+
"prettier"
|
|
5
|
+
],
|
|
6
|
+
"parserOptions": {
|
|
7
|
+
"ecmaVersion": "latest",
|
|
8
|
+
"sourceType": "module",
|
|
9
|
+
"ecmaFeatures": {
|
|
10
|
+
"jsx": true
|
|
36
11
|
}
|
|
12
|
+
},
|
|
13
|
+
"env": {
|
|
14
|
+
"es6": true,
|
|
15
|
+
"browser": true,
|
|
16
|
+
"jest": true,
|
|
17
|
+
"node": true
|
|
18
|
+
},
|
|
19
|
+
"plugins": [
|
|
20
|
+
"prettier"
|
|
21
|
+
],
|
|
22
|
+
"rules": {
|
|
23
|
+
"prettier/prettier": 2,
|
|
24
|
+
"strict": [
|
|
25
|
+
2,
|
|
26
|
+
"global"
|
|
27
|
+
],
|
|
28
|
+
"max-len": 0,
|
|
29
|
+
"no-nested-ternary": 0,
|
|
30
|
+
"no-underscore-dangle": 0,
|
|
31
|
+
"global-require": 0,
|
|
32
|
+
"react/prefer-stateless-function": 0,
|
|
33
|
+
"react/jsx-filename-extension": 0,
|
|
34
|
+
"no-invalid-regexp": 0,
|
|
35
|
+
"no-console": 0,
|
|
36
|
+
"import/no-unresolved": 0
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 6.0.0
|
|
4
|
+
|
|
5
|
+
### Upgrade notice
|
|
6
|
+
|
|
7
|
+
Version 6 replaces the **entire** local tooling stack used to build themes (bundler + Sass compiler), not just dependencies. Requires Node >=22.12.0.
|
|
8
|
+
|
|
9
|
+
### AI agent guidance
|
|
10
|
+
|
|
11
|
+
`sfb-toolkit setup` installs self-contained workspace `AGENTS.md` / `CLAUDE.md` plus Cursor (`.cursor/`) and Claude Code (`.claude/skills/`) playbooks covering toolkit commands, theme DOM/CSS limits, custom-components setup (`sfb-toolkit components` first), localization layers, and `settings.json` / `window.__ADComponents.schema()` contracts. Existing workspaces: `sfb-toolkit install-agent-guidance` (backs up existing `AGENTS.md` / `CLAUDE.md` before overwrite).
|
|
12
|
+
|
|
13
|
+
We thoroughly tested this upgrade and added compatibility for common legacy theme patterns, but every customized theme can differ. Themes built or last verified on toolkit 5.x or earlier **must be thoroughly checked** (pages, custom CSS/Sass, custom components, package zip) before you publish with version 6. New themes on current Plaza + current `@appdirect/sfb-theme-components` do not need this extra review for the toolchain change itself. To stay on or revert to toolkit 5.x: `npm install -g @appdirect/sfb-toolkit@5`.
|
|
14
|
+
|
|
15
|
+
Modernized the toolkit build toolchain so everyday theme work feels faster — especially custom-components compiles and theme HMR.
|
|
16
|
+
|
|
17
|
+
- Replaced the legacy Webpack / gulp Sass stack with a newer bundler and Sass compiler
|
|
18
|
+
- Custom components production compile much faster (local Plaza compare ~12.7s → ~1.4s, about **9×**)
|
|
19
|
+
- Quicker theme CSS rebuilds and custom-components HMR while `sfb-toolkit start` is running
|
|
20
|
+
- End-to-end packaging / CLI flows also faster (about **3×** in local comparison)
|
|
21
|
+
- Requires Node >=22.12.0 (6.x.x)
|
|
22
|
+
- Sass compat for published themes that still rely on libsass/gulp-sass quirks (entry load paths, non-CSS `@import`, top-level `&`, compound `@extend`)
|
|
23
|
+
- Custom-components barrels with conflicting `export *` (theme overrides + library) compile under Rspack the way they did under Webpack; bare side-effect imports from those barrels (e.g. Bootstrap CSS) are preserved when the star export is expanded
|
|
24
|
+
- Component Sass resolves cwd-relative `@import 'themes/<name>/…'` and SCSS-in-`.css` like the old stack
|
|
25
|
+
- Missing ESM exports (e.g. hoisted `react-tooltip`) warn instead of hard-failing with a Rspack overlay, matching Webpack 5
|
|
26
|
+
- Provide `_` (lodash) in the custom-components bundle for themes that call `_.debounce` etc. without importing it
|
|
27
|
+
- Install AI agent guidance (`AGENTS.md`, `CLAUDE.md`, Cursor skills) on `sfb-toolkit setup`, or via `sfb-toolkit install-agent-guidance`
|
|
28
|
+
- Opt-in preview live-reload for app-builder iframes: `sfb-toolkit start --live-reload` or `SFB_TOOLKIT_LIVE_RELOAD=1` (off by default; SSE `/__sfb_live_reload`)
|
|
29
|
+
|
|
30
|
+
## 5.0.x
|
|
31
|
+
|
|
32
|
+
See git tags `v5.0.0`–`v5.0.9` for prior patch releases.
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM node:
|
|
1
|
+
FROM node:24
|
|
2
2
|
|
|
3
3
|
ENV NO_UPDATE_NOTIFIER=true
|
|
4
4
|
ENV SFB_TOOLKIT=/app/bin/index.js
|
|
@@ -22,5 +22,6 @@ WORKDIR /app/Plaza
|
|
|
22
22
|
|
|
23
23
|
RUN $SFB_TOOLKIT use-local-sfb-components
|
|
24
24
|
|
|
25
|
+
ENV HOST=0.0.0.0
|
|
25
26
|
EXPOSE 3555
|
|
26
27
|
ENTRYPOINT ["sh", "/app/commands.sh"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Storefront Builder theme workspace constraints for AI agents
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SFB theme workspace
|
|
7
|
+
|
|
8
|
+
- Follow root `AGENTS.md` (self-contained). Do not depend on external doc URLs for core workflows.
|
|
9
|
+
- Plaza UI is React (`sfb-theme-components` / `customComponents`), not static HTML in page Nunjucks. Inspect the live DOM after `sfb-toolkit start` before writing CSS selectors (or ask the human for a snapshot).
|
|
10
|
+
- Edit theme **SCSS / Sass**. Do not edit generated `.css` files (toolkit overwrites them).
|
|
11
|
+
- Preserve element structure and ABEM classnames; prefer additive styles.
|
|
12
|
+
- If `themes/<active>/customComponents/` is missing, run `sfb-toolkit components` before `components-add` or `components-copy`.
|
|
13
|
+
- For `components-copy`, use `.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md`, then confirm on the theme. Prefer CSS/settings/`components-add`; ask if no catalog match. No interactive no-args copy.
|
|
14
|
+
- Before editing `settings.json`, call `window.__ADComponents.<Name>.schema()` in the browser (or ask the human for the output). Never invent setting keys/types.
|
|
15
|
+
- Prefer `sfb-toolkit package -a` after translation/settings changes.
|
|
16
|
+
- Keep `Component.schema().name`, exports, `<component name>`, and `window.__ADComponents` keys aligned.
|
|
17
|
+
- Localized settings store **keys** (`isLocalized: true`); strings live in `translations/*.yml`.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# `@appdirect/sfb-theme-components` catalog
|
|
2
|
+
|
|
3
|
+
Use **Export** as the `sfb-toolkit components-copy` argument and as `<component name="…">` / `window.__ADComponents` key (unless noted).
|
|
4
|
+
|
|
5
|
+
Prefer theme **SCSS** or **settings.json** (via `schema()`) before forking. Fork only when you must change React structure/behavior.
|
|
6
|
+
|
|
7
|
+
**Not copyable via toolkit:** `PageOrderableContainer` (blacklisted).
|
|
8
|
+
|
|
9
|
+
**Listing copy group:** selecting any of `ProductListing`, `ProductListingControls`, `CategorySidebar` also copies the other two (toolkit behavior).
|
|
10
|
+
|
|
11
|
+
**Header atoms:** high risk — tightly coupled; prefer CSS on Header unless the human names a bar.
|
|
12
|
+
|
|
13
|
+
Editor titles below match Theme Editor labels (`storefront-ipa-uieditor`).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Shell / layout (every page)
|
|
18
|
+
|
|
19
|
+
| Export | Editor title | What it does | Typical placement |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `Header` | Header | Top chrome; composes announcement / home / nav / aux bars | layout / global |
|
|
22
|
+
| `Footer` | Footer | Site footer (links, newsletter, legal) | layout / global |
|
|
23
|
+
| `GlobalAlerts` | Global alerts | Marketplace-wide alert banners | layout |
|
|
24
|
+
| `SecondaryNav` | Secondary navigation | Secondary menu | secondary nav regions |
|
|
25
|
+
| `PageOrderableContainer` | — | Hosts orderable sections from Theme Editor | home (and similar); **do not copy** |
|
|
26
|
+
| `StickyButtonPageScroll` | Page Scroll Button | Floating scroll / CTA button | often home |
|
|
27
|
+
|
|
28
|
+
### Header atoms (fork only if explicitly required)
|
|
29
|
+
|
|
30
|
+
| Export | Editor title | What it does |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `HeaderAnnouncementBar` | Announcement Bar | Promo / message strip above header |
|
|
33
|
+
| `HeaderHomeBar` | Home Bar | Logo, search slot, account / cart actions |
|
|
34
|
+
| `HeaderNavigationBar` | Navigation Bar | Primary nav / hamburger |
|
|
35
|
+
| `HeaderAuxiliaryBar` | Auxiliary Bar | Extra utility row |
|
|
36
|
+
| `HeaderSearchBar` | Search | Search field (used inside header) |
|
|
37
|
+
| `HeaderCategoriesMenu` | Categories | Category mega-menu |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Home / marketing (often orderable on home)
|
|
42
|
+
|
|
43
|
+
| Export | Editor title | What it does | Notes |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| `HeroBanner` | Hero Banner | Large hero with title, CTA, media | orderable: home |
|
|
46
|
+
| `Carousel` | Carousel | Multi-slide hero/carousel | orderable: home |
|
|
47
|
+
| `Slider` | Slider | Product / content slider | orderable: home |
|
|
48
|
+
| `FeaturedProduct` | Featured Product | Spotlight a single product | orderable: home |
|
|
49
|
+
| `ProductGroups` | Product Groups | Tabbed / grouped product collections | orderable: home |
|
|
50
|
+
| `AtomsShowcase` | Atoms showcase | Demo / showcase of UI atoms | rarely customized in production |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Browse / listing
|
|
55
|
+
|
|
56
|
+
| Export | Editor title | What it does | Notes |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| `ProductListing` | Product listing | Product grid/list results | listing page; **copy group** |
|
|
59
|
+
| `ProductListingControls` | Title and sorting | Listing title + sort/filter controls | listing; **copy group** |
|
|
60
|
+
| `CategorySidebar` | Category sidebar | Category tree / filters | listing; **copy group** |
|
|
61
|
+
| `ComparableProducts` | Comparable products | Compare-products UI | compare page |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Product profile
|
|
66
|
+
|
|
67
|
+
| Export | Editor title | What it does | Notes |
|
|
68
|
+
|---|---|---|---|
|
|
69
|
+
| `ProductBanner` | Product banner | Product hero (name, icon, CTA, rating) | profile shell |
|
|
70
|
+
| `ProductTabMenu` | Product page tabs | Section tabs on product pages | orderable: profile |
|
|
71
|
+
| `ProductDescription` | Product description | Overview / rich description + media | orderable: profile |
|
|
72
|
+
| `ProductImageViewer` | Image viewer | Gallery / screenshots | profile |
|
|
73
|
+
| `ProductTopFeatures` | Product top features | Highlighted feature list | orderable: profile |
|
|
74
|
+
| `FeatureDetails` | Product feature details | Detailed features section | profile features |
|
|
75
|
+
| `FeaturedCustomers` | Product featured customers | Customer logos / quotes | orderable: profile |
|
|
76
|
+
| `ProductAdditionalInfo` | Product additional info | Extra info blocks | orderable: profile |
|
|
77
|
+
| `ProductResources` | Product resources | Downloads / docs links | orderable: profile |
|
|
78
|
+
| `ProductPricing` | Product pricing | Editions / pricing table | profile editions |
|
|
79
|
+
| `ProductPlan` | Product plan | Plan selection UI | profile |
|
|
80
|
+
| `ProductConfigurator` | Product configurator | Configure options (v1) | profile configure |
|
|
81
|
+
| `ProductConfiguratorV2` | Product configurator | Configure options (v2) | prefer over v1 when present |
|
|
82
|
+
| `ProductVariants` | Product variants | Variant picker | profile variants |
|
|
83
|
+
| `ProductQuestions` | Product question | Q&A list | orderable: profile |
|
|
84
|
+
| `ProductQuestionForm` | Product question form | Ask a question form | add-question page |
|
|
85
|
+
| `ProductReviews` | Product reviews | Reviews list/adapter | profile reviews |
|
|
86
|
+
| `ProductReviewDetail` | Product review detail | Single review detail | reviews |
|
|
87
|
+
| `ProductReviewForm` | Product review form | Write a review | add-review page |
|
|
88
|
+
| `ProductLeadForm` | Product lead form | Lead / contact form | add-lead page |
|
|
89
|
+
| `ProductSimilarApps` | Product similar apps | Similar products rail | profile footer area |
|
|
90
|
+
| `ProductBundles` | Product bundle viewer | Bundles that include this product | profile / bundle contexts |
|
|
91
|
+
| `VolumeDiscountCard` | — | Volume discount presentation | editions (with pricing) |
|
|
92
|
+
| `GraphQLAdapter` | — | Data adapter helper for GraphQL-backed UI | infrastructure; avoid forking |
|
|
93
|
+
| `DomainApp` | Domain App | Standalone domains purchase UI | domains product section |
|
|
94
|
+
| `ProductAssociatedDomain` | — | Associated domain management | cross-sell / domains |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Bundle page
|
|
99
|
+
|
|
100
|
+
| Export | Editor title | What it does |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `BundleBanner` | Bundle banner | Bundle hero (like ProductBanner for bundles) |
|
|
103
|
+
| `BundleTabsMenu` | Bundle Page Tabs | Tabs on bundle page (`schema().name` may be `BundleTabMenu`) |
|
|
104
|
+
| `ProductBundleViewer` | Product description | Bundle overview / included products narrative |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Help / FAQ
|
|
109
|
+
|
|
110
|
+
| Export | Editor title | What it does | Notes |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| `Faq` | FAQs | FAQ accordion | help page; `schema().name` is `FAQ` — keep export/`<component name>` as `Faq` |
|
|
113
|
+
| `LinkSection` | Link section | Related links block | often with FAQ |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Checkout / confirmation
|
|
118
|
+
|
|
119
|
+
| Export | Editor title | What it does |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `OrderConfirmation` | Order confirmation | Post-purchase confirmation content |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## How to pick a copy target
|
|
126
|
+
|
|
127
|
+
1. Match the UI the human described to a row above (title + “what it does”).
|
|
128
|
+
2. Confirm it appears on the theme page (`content/pages/**` `<component name>`), in `settings.json`, or in `Object.keys(window.__ADComponents)`.
|
|
129
|
+
3. Run `sfb-toolkit components-copy <Export> -r` (or `-c` / `-s`). For listing, one of the three is enough to pull the group.
|
|
130
|
+
4. If nothing matches → **ask the human**; do not invent an export name.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-custom-components
|
|
3
|
+
description: Enable and build storefront custom React components with sfb-toolkit (setup first if customComponents is missing).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Custom components
|
|
7
|
+
|
|
8
|
+
## If `customComponents/` does not exist
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
sfb-toolkit components
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Pins `@appdirect/sfb-theme-components`, creates `customComponents/`, sets `settings-schema.json` `{ "useComponents": true }`, switches `base.html` off CDN bundles.
|
|
15
|
+
|
|
16
|
+
Without this, add/copy/local custom HMR do not apply.
|
|
17
|
+
|
|
18
|
+
## Then
|
|
19
|
+
|
|
20
|
+
| Goal | Command |
|
|
21
|
+
|---|---|
|
|
22
|
+
| New component | `sfb-toolkit components-add` (`-p`, `-o`; else prompts) |
|
|
23
|
+
| Fork library component | `sfb-toolkit components-copy <ExactExportName…> -r\|-c\|-s` |
|
|
24
|
+
| Audit overrides | `sfb-toolkit components-info` |
|
|
25
|
+
| Remove forks | `sfb-toolkit components-delete` |
|
|
26
|
+
|
|
27
|
+
### Which component to copy?
|
|
28
|
+
|
|
29
|
+
Use **[COMPONENT-CATALOG.md](COMPONENT-CATALOG.md)** — every copyable library **Export**, editor title, what it does, and typical page.
|
|
30
|
+
|
|
31
|
+
1. Match the task to a catalog row (title / description / page).
|
|
32
|
+
2. Confirm it exists on this theme (`<component name>`, `settings.json`, or `Object.keys(window.__ADComponents)`).
|
|
33
|
+
3. `sfb-toolkit components-copy <Export> -r|-c|-s` (listing trio copies together; never no-args interactive).
|
|
34
|
+
4. No match → ask the human. Prefer SCSS / settings / `components-add` when a fork is not required.
|
|
35
|
+
|
|
36
|
+
Edit under `themes/<name>/customComponents/`. Verify with `start`.
|
|
37
|
+
|
|
38
|
+
## Contracts
|
|
39
|
+
|
|
40
|
+
- `schema().name` === index export === `<component name>` === `window.__ADComponents` key
|
|
41
|
+
- **Before editing `settings.json`:** `window.__ADComponents.<Name>.schema()` in DevTools — use `form` for field names/types; never invent keys
|
|
42
|
+
- Orderable ids: `Name:orderable:<uuid>` in `settings.json`
|
|
43
|
+
- Overriding atoms/library comps is high risk — retest thoroughly
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-localization-settings
|
|
3
|
+
description: Wire storefront theme translations and settings.json defaults without conflating i18n layers or schema contracts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Localization + settings.json
|
|
7
|
+
|
|
8
|
+
## Three i18n layers
|
|
9
|
+
|
|
10
|
+
1. **Theme YAML** — `translations/<lang>-<COUNTRY>.yml` (e.g. `en-us.yml`). Flat keys like `uieditor.home.….field: text`. `isLocalized: true` settings store the **key**.
|
|
11
|
+
2. **Schema / defaultValue keys** — `uieditor.sfbComponent.*` may appear as settings **values** pointing at UI-editor defaults (not theme YAML). To customize, add a theme YAML key and point settings at it with `isLocalized: true`.
|
|
12
|
+
3. **Nunjucks / page-api** — `{{ t(i18n.custom…) }}`, `i18n.overrides` (CTA by `actionType`).
|
|
13
|
+
|
|
14
|
+
YAML alone does not enable marketplace languages.
|
|
15
|
+
|
|
16
|
+
## settings.json
|
|
17
|
+
|
|
18
|
+
**Required first:**
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
window.__ADComponents.<Name>.schema()
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Use `form` field names + `type` / defaults from that object. Do not invent keys.
|
|
25
|
+
|
|
26
|
+
- Live values: `{ value, type }` under `pages.<page>.components`
|
|
27
|
+
- Map keys must match the HTML `id` / `Name:orderable:<uuid>`
|
|
28
|
+
- `editor-properties.json` = style schema; `design-properties.json` = header/footer defaults
|
|
29
|
+
- Ship with `sfb-toolkit package -a` after edits
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-theme-customize
|
|
3
|
+
description: Apply a CSS/Sass coat of paint to a Plaza storefront theme using browser DOM inspection; avoid inventing HTML or classnames.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Theme CSS customization
|
|
7
|
+
|
|
8
|
+
## Reality
|
|
9
|
+
|
|
10
|
+
- Plaza pages place `<component>` / `PageOrderableContainer`; product UI HTML is **not** in those files.
|
|
11
|
+
- Markup is React on `window.__ADComponents`. Classnames are ABEM-generated.
|
|
12
|
+
- **Open the browser** after `sfb-toolkit start` and copy selectors from DevTools. If you cannot browse, ask the human for a DOM snapshot.
|
|
13
|
+
|
|
14
|
+
## Do
|
|
15
|
+
|
|
16
|
+
1. `sfb-toolkit start` → `http://localhost:<port>/en-US/<page>`
|
|
17
|
+
2. Inspect DOM / classes
|
|
18
|
+
3. Edit theme **SCSS** only (never generated `.css`)
|
|
19
|
+
4. Additive rules; keep structure/classnames
|
|
20
|
+
5. Confirm in browser → `sfb-toolkit package -a` when shipping
|
|
21
|
+
|
|
22
|
+
## Limits
|
|
23
|
+
|
|
24
|
+
- Header/footer platform tags and cart preview: CSS only after DOM inspection
|
|
25
|
+
- New behavior → custom-components skill, not CSS alone
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfb-toolkit-commands
|
|
3
|
+
description: Pick the correct sfb-toolkit CLI command for workspace, preview, package, and custom-components workflows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# sfb-toolkit commands
|
|
7
|
+
|
|
8
|
+
Run from the workspace root (`.sfbconfig` + `themes/`). Full table lives in root `AGENTS.md`.
|
|
9
|
+
|
|
10
|
+
## Project
|
|
11
|
+
|
|
12
|
+
- New workspace: `sfb-toolkit setup [name]` (also installs AI guidance)
|
|
13
|
+
- New theme: `sfb-toolkit create [name]`
|
|
14
|
+
- Import zip: `sfb-toolkit import [zip] [marketplaceUrl] [themeName]`
|
|
15
|
+
- Switch theme: `sfb-toolkit checkout [name]`
|
|
16
|
+
- List / config: `about`, `status`, `update`, `version`
|
|
17
|
+
|
|
18
|
+
## Dev / publish
|
|
19
|
+
|
|
20
|
+
- Preview: `sfb-toolkit start` → `http://localhost:<port>/en-US/home` (`-v` verbose)
|
|
21
|
+
- Zip: `sfb-toolkit package -a` when translations or `settings.json` changed (avoids interactive omit prompts)
|
|
22
|
+
|
|
23
|
+
## Dependencies / agent docs
|
|
24
|
+
|
|
25
|
+
- Theme npm: `sfb-toolkit install [module]`
|
|
26
|
+
- Refresh AI guidance: `sfb-toolkit install-agent-guidance`
|
|
27
|
+
|
|
28
|
+
## Custom components (order matters)
|
|
29
|
+
|
|
30
|
+
1. **Enable once** if no `customComponents/`: `sfb-toolkit components` (may prompt)
|
|
31
|
+
2. New: `sfb-toolkit components-add` (prompts unless name/`-p`/`-o` given)
|
|
32
|
+
3. Fork library: pick **Export** from `sfb-custom-components/COMPONENT-CATALOG.md`, then `sfb-toolkit components-copy <Export…> -r|-c|-s` (no interactive no-args mode)
|
|
33
|
+
4. Audit: `components-info` · Remove forks: `components-delete`
|
|
34
|
+
|
|
35
|
+
`storybook` is deprecated. Prefer non-interactive flags when automating.
|
package/agent/AGENTS.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Storefront Toolkit — AI agent guidance
|
|
2
|
+
|
|
3
|
+
This workspace is an **AppDirect Storefront Builder (SFB) toolkit project**. Themes under `themes/` are previewed with `sfb-toolkit` and published as a zip to Theme Manager.
|
|
4
|
+
|
|
5
|
+
**Toolkit 6.x** (Node ≥22.12, Rspack + sass-embedded). Follow this file and the installed skills — do not rely on external documentation.
|
|
6
|
+
|
|
7
|
+
## Hard rules
|
|
8
|
+
|
|
9
|
+
1. **Do not invent DOM or class names.** Plaza UI markup is mostly React from `@appdirect/sfb-theme-components` / `customComponents`, not static HTML in page files. Inspect the live DOM in the browser after `sfb-toolkit start`. If you cannot open a browser, ask the human for a DOM snapshot / classname before writing CSS.
|
|
10
|
+
2. **Before editing `settings.json`, call `window.__ADComponents.<Name>.schema()` in the browser.** That is the live contract for field names, types, defaults, and `marketplaceData`. Do not guess keys from memory or invent `{ value, type }` shapes. If you cannot open a browser, ask the human to paste the `schema()` output.
|
|
11
|
+
3. **Edit `.scss` / theme Sass, never generated `.css`.** The toolkit overwrites compiled CSS on start/package.
|
|
12
|
+
4. **Use toolkit CLI to scaffold custom components.** Do not hand-roll `customComponents` setup.
|
|
13
|
+
5. **Preserve HTML structure and ABEM classnames** when restyling — public API. Prefer additive CSS.
|
|
14
|
+
6. **If there is no `customComponents/` folder**, run `sfb-toolkit components` before `components-add` / `components-copy`.
|
|
15
|
+
7. **Pick `components-copy` targets from the catalog, not from guesses.** Read `.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md` (export name, editor title, what it does, page). Confirm the export is on the theme (`<component name>`, `settings.json`, or `Object.keys(window.__ADComponents)`). Prefer CSS / `settings.json` / `components-add` when a fork is not required. Pass explicit names + `-r`/`-c`/`-s` — no interactive no-args copy. If nothing in the catalog matches, **ask the human**.
|
|
16
|
+
|
|
17
|
+
## Toolkit commands
|
|
18
|
+
|
|
19
|
+
Run from the **workspace root** (folder with `.sfbconfig`, `config/`, `themes/`).
|
|
20
|
+
|
|
21
|
+
| Command | When to use |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `sfb-toolkit setup [name]` | Create a new workspace + first theme (also installs this guidance) |
|
|
24
|
+
| `sfb-toolkit create [name]` | Add another theme to an existing workspace |
|
|
25
|
+
| `sfb-toolkit import [zip] [marketplaceUrl] [themeName]` | Import a theme zip into `themes/` |
|
|
26
|
+
| `sfb-toolkit checkout [name]` | Switch active theme context |
|
|
27
|
+
| `sfb-toolkit about` | List themes in the workspace |
|
|
28
|
+
| `sfb-toolkit status` | Show current config |
|
|
29
|
+
| `sfb-toolkit update` | Update marketplace URL for the current theme |
|
|
30
|
+
| `sfb-toolkit start` | Local preview (default `http://localhost:3555/en-US/home`, port from `config.port`). Flag: `-v` verbose |
|
|
31
|
+
| `sfb-toolkit package` | Build theme zip for upload. Use **`-a` / `--all`** when translations or `settings.json` changed so prompts cannot omit them |
|
|
32
|
+
| `sfb-toolkit install [module]` | `npm install` into the **active theme** (special path for `@appdirect/sfb-theme-components`) |
|
|
33
|
+
| `sfb-toolkit install-agent-guidance` | Install/refresh this guidance in an existing workspace |
|
|
34
|
+
| `sfb-toolkit components` | **Enable** custom components (required once if none exist). May prompt y/n |
|
|
35
|
+
| `sfb-toolkit components-info` | Report overrides / user-defined custom components |
|
|
36
|
+
| `sfb-toolkit components-copy [components…]` | Fork UI-library components. Interactive if no args; with names you must pass an export flag (`-r` replace / `-c` comment / `-s` skip) |
|
|
37
|
+
| `sfb-toolkit components-add [name]` | Scaffold a **new** custom component. Without args it prompts; flags: `-p <page>`, `-o` orderable |
|
|
38
|
+
| `sfb-toolkit components-delete` | Remove copied UI-library components |
|
|
39
|
+
| `sfb-toolkit version` / `v` | Print toolkit version |
|
|
40
|
+
| `sfb-toolkit storybook` | **Deprecated** — only for themes already configured with Storybook |
|
|
41
|
+
| `sfb-toolkit config-setup [proj] [theme]` | Bootstrap config/folders only (no theme tree copy) |
|
|
42
|
+
|
|
43
|
+
**Non-interactive tip:** prefer passing CLI args/flags. For packaging after i18n or settings edits, use `sfb-toolkit package -a`.
|
|
44
|
+
|
|
45
|
+
Typical loop: `start` → browser verify → edit → `package -a` when ready.
|
|
46
|
+
|
|
47
|
+
Toolkit 6 may print theme-risk banners for older / non-current Plaza stacks; recent Plaza stays quiet.
|
|
48
|
+
|
|
49
|
+
## How themes actually render
|
|
50
|
+
|
|
51
|
+
- Plaza **pages** (`content/pages/**`) mostly place `<component name="…" id="…">` or `<PageOrderableContainer …>`. They are not full product HTML documents.
|
|
52
|
+
- Visible UI comes from React on **`window.__ADComponents`** (CDN by default, or local/custom bundle after `sfb-toolkit components`).
|
|
53
|
+
- Lookup uses the component **name** (id before `:orderable:…`): `window.__ADComponents[name]`.
|
|
54
|
+
- Classnames use ABEM via `createNamespace` (e.g. `faq_title`). **Inspect DevTools** — do not guess.
|
|
55
|
+
- Header/footer platform chrome and cart preview: structure is largely fixed — CSS only after DOM inspection.
|
|
56
|
+
- Classic themes use more Nunjucks HTML; Plaza is component-first.
|
|
57
|
+
|
|
58
|
+
**CSS coat of paint:** theme Sass under `themes/<name>/` targeting classes you observed. Prefer CSS variables / theme color tokens.
|
|
59
|
+
|
|
60
|
+
**Test:** `sfb-toolkit start` → open `http://localhost:<port>/en-US/<page>` → DevTools → adjust SCSS/`settings.json` → confirm → `sfb-toolkit package -a`.
|
|
61
|
+
|
|
62
|
+
## Custom components
|
|
63
|
+
|
|
64
|
+
### If custom components are NOT set up yet
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
sfb-toolkit components
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This installs pinned `@appdirect/sfb-theme-components`, creates `themes/<active>/customComponents/`, writes `settings-schema.json` `{ "useComponents": true }`, and switches `base.html` from CDN bundles to the custom/local bundle.
|
|
71
|
+
|
|
72
|
+
**Not set up** if: no `customComponents/`, or layout still on CDN `sfb-components-bundles`, or missing `useComponents: true`.
|
|
73
|
+
|
|
74
|
+
`components` ≠ `components-add`. Enable first; then add or copy.
|
|
75
|
+
|
|
76
|
+
### After setup
|
|
77
|
+
|
|
78
|
+
1. Prefer **not** forking: theme SCSS, `settings.json` (via `schema()`), or `components-add` for net-new UI.
|
|
79
|
+
2. `sfb-toolkit components-add` — new component (orderable → Theme Editor + `settings.json`; non-orderable → page HTML)
|
|
80
|
+
3. `sfb-toolkit components-copy <ExactExportName…> -r|-c|-s` — choose **Export** from [COMPONENT-CATALOG.md](.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md) (hard rule 7).
|
|
81
|
+
4. Edit under `themes/<name>/customComponents/`
|
|
82
|
+
5. `sfb-toolkit start` to verify
|
|
83
|
+
6. `sfb-toolkit components-info` before publishing
|
|
84
|
+
|
|
85
|
+
Keep aligned: `Component.schema().name` === `customComponents/index.js` export === `<component name="…">` === `window.__ADComponents` key.
|
|
86
|
+
|
|
87
|
+
Overriding library components/atoms is risky. Library upgrades are manual (`sfb-toolkit install @appdirect/sfb-theme-components@…`).
|
|
88
|
+
|
|
89
|
+
### `window.__ADComponents` ↔ `settings.json` (required)
|
|
90
|
+
|
|
91
|
+
Components register on `window.__ADComponents`. The Theme Editor / toolkit expect `settings.json` to match each component’s **schema**, not invent fields.
|
|
92
|
+
|
|
93
|
+
**Mandatory before any `settings.json` edit for a component:**
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
// DevTools console after sfb-toolkit start (page that loads that component)
|
|
97
|
+
Object.keys(window.__ADComponents) // list available names
|
|
98
|
+
window.__ADComponents.ProductBanner.schema() // example — use the real Name
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Use the returned object:
|
|
102
|
+
|
|
103
|
+
| Schema field | How it drives settings.json |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `name` | Must match `<component name>`, export, and `__ADComponents` key |
|
|
106
|
+
| `form.<fieldName>.type` | Becomes settings `type` (`TOGGLE`, `COLORPICKER`, `DROPDOWN`, …) |
|
|
107
|
+
| `form.<fieldName>.defaultValue` | Starting `value` (or a localization key) |
|
|
108
|
+
| `form.<fieldName>` + localized flags | Often `{ value: "<i18n key>", isLocalized: true, type }` |
|
|
109
|
+
| `marketplaceData` | Prop → page-api path (additive-only; do not rename/remove) |
|
|
110
|
+
| `orderableSection` | Where orderables may appear in Theme Editor |
|
|
111
|
+
|
|
112
|
+
**settings.json keys:**
|
|
113
|
+
|
|
114
|
+
- Under `pages.<page>.components`, the map key must equal the HTML `id` attribute, e.g. `"ProductBanner"` or `"ProductDescription:orderable:<uuid>"`.
|
|
115
|
+
- Field entries: `{ "value": …, "type": "<schema form type>" }`.
|
|
116
|
+
- Header/Footer under `pages.global` often nest their own `components` + `orderableComponents`.
|
|
117
|
+
|
|
118
|
+
If `window.__ADComponents.<Name>` is missing, the page bundle did not load that component — fix placement/`customComponents` exports before editing settings.
|
|
119
|
+
|
|
120
|
+
## Localization (three layers — do not mix)
|
|
121
|
+
|
|
122
|
+
1. **Theme instance content** — `themes/<name>/translations/<lang>-<COUNTRY>.yml` (e.g. `en-us.yml`, `fr-ca.yml`). Often flat dotted keys:
|
|
123
|
+
- `uieditor.home.Slider:orderable:<uuid>.buttonLabel: Buy now`
|
|
124
|
+
- Menu titles: `uieditor.menuItem.title.<uuid>: …`
|
|
125
|
+
- Settings with `isLocalized: true` store the **key**, not the string: `{ "value": "uieditor.…", "isLocalized": true, "type": "TEXTAREA" }`
|
|
126
|
+
2. **Schema / defaultValue keys** — `uieditor.sfbComponent.*` / `uieditor.editorProperties.*`. Appear as schema titles **and** sometimes as default `settings.json` values (e.g. `"value": "uieditor.sfbComponent.footer.newsletterTitle.defaultValue"`). Those strings usually live in the localization service / UI-editor bundles, not theme YAML. To customize tenant-visible copy, prefer a **theme translation key** + `isLocalized: true` pointing at your `translations/*.yml` entry.
|
|
127
|
+
3. **Nunjucks / page-api** — templates may use `{{ t(i18n.custom.home.welcome) }}` or page-api `i18n.*`. Overrides: `i18n.overrides` (Data Viewer paths; CTA labels by `actionType` such as BUY).
|
|
128
|
+
|
|
129
|
+
Adding YAML does **not** enable marketplace languages by itself.
|
|
130
|
+
|
|
131
|
+
When changing copy: update the right layer **and** the settings/template reference.
|
|
132
|
+
|
|
133
|
+
## settings.json and style contracts
|
|
134
|
+
|
|
135
|
+
| File | Role |
|
|
136
|
+
|---|---|
|
|
137
|
+
| `settings.json` | Live WYSIWYG **values**: `pages.*.components` (`{ value, type }`), `orderableComponents` (`Name:orderable:uuid`), Header/Footer under `pages.global` (often nested `components` + `orderableComponents`), `globalStyles`, `menus` |
|
|
138
|
+
| `editor-properties.json` | Global style **schema** (not live values) |
|
|
139
|
+
| `design-properties.json` | Header/footer chrome **defaults** |
|
|
140
|
+
|
|
141
|
+
- **Always** discover fields with `window.__ADComponents.<Name>.schema()` first (hard rule 2).
|
|
142
|
+
- Settings for components that are not placed/exported will not appear.
|
|
143
|
+
- After changing settings or translations, package with `sfb-toolkit package -a`.
|
|
144
|
+
|
|
145
|
+
## Useful paths
|
|
146
|
+
|
|
147
|
+
- Active theme: `config/index.js` → `theme`, or `.sfbconfig` → `current`
|
|
148
|
+
- Pages: `themes/<name>/content/pages/`
|
|
149
|
+
- Layout: `themes/<name>/content/layout/base.html`
|
|
150
|
+
- Translations: `themes/<name>/translations/`
|
|
151
|
+
- Custom components: `themes/<name>/customComponents/`
|
|
152
|
+
|
|
153
|
+
## Skills
|
|
154
|
+
|
|
155
|
+
Playbooks are installed for Cursor (`.cursor/skills/`) and Claude Code (`.claude/skills/`):
|
|
156
|
+
|
|
157
|
+
- `sfb-toolkit-commands`
|
|
158
|
+
- `sfb-theme-customize`
|
|
159
|
+
- `sfb-custom-components` (+ `COMPONENT-CATALOG.md` — full library export list)
|
|
160
|
+
- `sfb-localization-settings`
|
package/agent/CLAUDE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Claude Code — Storefront Toolkit workspace
|
|
2
|
+
|
|
3
|
+
@AGENTS.md
|
|
4
|
+
|
|
5
|
+
Follow **AGENTS.md** as the source of truth for this workspace (commands, theme DOM rules, custom components, i18n, settings).
|
|
6
|
+
|
|
7
|
+
## Quick constraints
|
|
8
|
+
|
|
9
|
+
- Inspect the **browser DOM** after `sfb-toolkit start` — do not invent HTML/classnames for Plaza React UI. If you cannot browse, ask the human for a DOM snapshot.
|
|
10
|
+
- Edit **SCSS**, not generated CSS.
|
|
11
|
+
- No `customComponents/` yet → run `sfb-toolkit components` before add/copy.
|
|
12
|
+
- For `components-copy`, use `.cursor/skills/sfb-custom-components/COMPONENT-CATALOG.md`, confirm on theme; ask if no match. Prefer CSS/settings/`components-add`.
|
|
13
|
+
- Before editing `settings.json`, call `window.__ADComponents.<Name>.schema()` in the browser (hard rule). Never invent setting keys.
|
|
14
|
+
- Prefer `sfb-toolkit package -a` after translation/settings changes.
|
|
15
|
+
- Keep `schema().name` / export / `<component name>` / `window.__ADComponents` aligned.
|
|
16
|
+
|
|
17
|
+
## Skills
|
|
18
|
+
|
|
19
|
+
Also under `.claude/skills/` (and `.cursor/skills/`): `sfb-toolkit-commands`, `sfb-theme-customize`, `sfb-custom-components`, `sfb-localization-settings`.
|