@salesforce/b2c-dx-mcp 3.2.1 → 3.3.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/bin/run.js +5 -9
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +4 -4
- package/content/guidance/b2c/b2c-ordering/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +2 -2
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +3 -3
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +6 -6
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +31 -21
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +23 -2
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +3 -3
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +1 -1
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +2 -2
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +2 -2
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +1 -1
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +4 -4
- package/content/guidance/index.json +935 -258
- package/content/guidance/mcp/{cip → b2c-mcp-cip}/SKILL.md +10 -8
- package/content/guidance/mcp/{b2c-config → b2c-mcp-config}/SKILL.md +10 -9
- package/content/guidance/mcp/{debugger → b2c-mcp-debugger}/SKILL.md +9 -8
- package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/SKILL.md +81 -10
- package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +49 -25
- package/content/guidance/storefront-next/sfnext-accessibility/SKILL.md +103 -0
- package/content/guidance/storefront-next/sfnext-accessibility/references/checklist.md +64 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/SKILL.md +91 -0
- package/content/guidance/storefront-next/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/content/guidance/storefront-next/sfnext-authentication/SKILL.md +86 -79
- package/content/guidance/storefront-next/sfnext-authentication/references/COOKIES.md +39 -0
- package/content/guidance/storefront-next/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/SKILL.md +67 -0
- package/content/guidance/storefront-next/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/content/guidance/storefront-next/sfnext-components/SKILL.md +98 -136
- package/content/guidance/storefront-next/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/content/guidance/storefront-next/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/content/guidance/storefront-next/sfnext-components/references/STORYBOOK.md +54 -0
- package/content/guidance/storefront-next/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/content/guidance/storefront-next/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/content/guidance/storefront-next/sfnext-configuration/SKILL.md +116 -113
- package/content/guidance/storefront-next/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/content/guidance/storefront-next/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/SKILL.md +100 -150
- package/content/guidance/storefront-next/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/content/guidance/storefront-next/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +83 -97
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +73 -97
- package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/content/guidance/storefront-next/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +96 -131
- package/content/guidance/storefront-next/sfnext-i18n/references/locale-config.md +35 -0
- package/content/guidance/storefront-next/sfnext-overview/SKILL.md +101 -0
- package/content/guidance/storefront-next/sfnext-page-designer/SKILL.md +152 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/content/guidance/storefront-next/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/content/guidance/storefront-next/sfnext-performance/SKILL.md +75 -105
- package/content/guidance/storefront-next/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/content/guidance/storefront-next/sfnext-project-setup/SKILL.md +103 -116
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/content/guidance/storefront-next/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/SKILL.md +70 -0
- package/content/guidance/storefront-next/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/content/guidance/storefront-next/sfnext-revalidation/SKILL.md +121 -0
- package/content/guidance/storefront-next/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/content/guidance/storefront-next/sfnext-routing/SKILL.md +86 -143
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/content/guidance/storefront-next/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/content/guidance/storefront-next/sfnext-scapi/SKILL.md +126 -0
- package/content/guidance/storefront-next/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/SKILL.md +129 -0
- package/content/guidance/storefront-next/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/content/guidance/storefront-next/sfnext-security/references/TURNSTILE.md +43 -0
- package/content/guidance/storefront-next/sfnext-seo/SKILL.md +95 -0
- package/content/guidance/storefront-next/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/content/guidance/storefront-next/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/content/guidance/storefront-next/sfnext-state-management/SKILL.md +80 -89
- package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +105 -138
- package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/content/guidance/storefront-next/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/content/guidance/storefront-next/sfnext-theming/SKILL.md +104 -0
- package/content/guidance/storefront-next/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/dist/commands/mcp.d.ts +8 -2
- package/dist/commands/mcp.js +54 -20
- package/dist/guidance.d.ts +4 -1
- package/dist/guidance.js +23 -5
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +3 -3
- package/dist/server.d.ts +10 -0
- package/dist/server.js +21 -0
- package/dist/skill-references.js +5 -5
- package/dist/tools/cartridges/index.js +1 -0
- package/dist/tools/cip/index.js +6 -3
- package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
- package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
- package/dist/tools/diagnostics/debug-start-session.js +1 -1
- package/dist/tools/scapi/index.d.ts +4 -1
- package/dist/tools/scapi/index.js +4 -2
- package/dist/tools/scapi/scapi-code.d.ts +2 -2
- package/dist/tools/scapi/scapi-code.js +17 -61
- package/dist/utils/types.d.ts +6 -0
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +20 -0
- package/node_modules/@salesforce/b2c-agent-plugins/README.md +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-onboarding/SKILL.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-ordering/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-querying-data/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/SKILL.md +6 -6
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/skills/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +8 -9
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-cip/references/SALES_ANALYSIS.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +31 -21
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-content/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-debug/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +23 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-ecdn/references/ADVANCED.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-metrics/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +3 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-custom/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-site-import-export/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-sites/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-slas/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-checkout-triage/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/SKILL.md +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-order-failure-triage/references/order-evidence.md +2 -2
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-production-triage/SKILL.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/README.md +4 -4
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/SKILL.md +76 -73
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/evals/trigger-evals.json +12 -10
- package/node_modules/@salesforce/b2c-agent-plugins/figma-to-sfnext-pagedesigner/skills/figma-to-sfnext-pagedesigner/references/PAGE-DESIGNER-SFN.md +49 -74
- package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/README.md +43 -22
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +9 -6
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/SKILL.md +103 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-accessibility/references/checklist.md +64 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/SKILL.md +91 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-analytics-consent/references/CUSTOM-ADAPTER.md +49 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/SKILL.md +86 -79
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/COOKIES.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-authentication/references/LOGIN-FLOWS.md +59 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/SKILL.md +67 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-commerce-features/references/FEATURE-PREREQUISITES.md +37 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/SKILL.md +98 -136
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/COMPONENT-AUTHORING.md +118 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/SHAPE-TOKENS.md +51 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/STORYBOOK.md +54 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TOKEN-SYSTEM.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-components/references/TROUBLESHOOTING.md +19 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/SKILL.md +116 -113
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/ENV-VARIABLES.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-configuration/references/MULTI-SITE-URLS.md +137 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/SKILL.md +100 -150
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/ACTIONS.md +53 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/API-CLIENTS.md +34 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADERS.md +73 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/SCAPI-FETCHER.md +23 -77
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/SKILL.md +83 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-deployment/references/MRT-DEPLOYMENT.md +37 -68
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/SKILL.md +73 -97
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/BASE-AUDIT.md +47 -44
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/CLI-AND-INSTALL.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-extensions/references/EXTENSION-EXAMPLES.md +49 -86
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/SKILL.md +59 -114
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +53 -90
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/SKILL.md +96 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-i18n/references/locale-config.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/SKILL.md +101 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-overview/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/SKILL.md +152 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/BUSINESS-MANAGER.md +46 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/COMPONENT-REGISTRY.md +86 -53
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/DECORATOR-PATTERNS.md +119 -131
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/REVIEW-CHECKLIST.md +83 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-page-designer/references/TROUBLESHOOTING.md +35 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/SKILL.md +75 -105
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/PERFORMANCE-REVIEW-CHECKLIST.md +85 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-performance/references/SUSPENSE-AND-STREAMING.md +58 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/SKILL.md +103 -116
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -99
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SCRIPTS.md +47 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/SFNEXT-CLI.md +63 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/SKILL.md +70 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-quality-gates/references/lint-and-budgets.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/SKILL.md +121 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-revalidation/references/POLICIES-AND-TAGS.md +55 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/SKILL.md +86 -143
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/ROUTE-CONVENTIONS.md +51 -51
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-routing/references/URLS-AND-SEO-ROUTES.md +22 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/SKILL.md +126 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi/references/WORKED-EXAMPLE.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/SKILL.md +129 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/COOKIE-DOMAIN.md +39 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-security/references/TURNSTILE.md +43 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/SKILL.md +95 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/MULTI-DOMAIN-BASE-PATH.md +17 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-seo/references/SEO-ROUTES.md +31 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/SKILL.md +80 -89
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-state-management/references/PATTERNS.md +45 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/SKILL.md +105 -138
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/E2E.md +38 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/STORYBOOK-PATTERNS.md +73 -94
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-testing/references/UNIT-AND-ROUTE-TESTS.md +60 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/SKILL.md +104 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/evals/trigger-evals.json +5 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-theming/references/REBRAND-CHECKLIST.md +29 -0
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next-figma/skills/sfnext-create-figma-kit/SKILL.md +3 -3
- package/oclif.manifest.json +21 -4
- package/package.json +3 -3
- package/content/guidance/storefront-next/sfnext-create-component/SKILL.md +0 -195
- package/content/guidance/storefront-next/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-create-vertical/SKILL.md +0 -135
- package/content/guidance/storefront-next/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/content/guidance/storefront-next/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/content/guidance/storefront-next/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/content/guidance/storefront-next/sfnext-custom-apis/SKILL.md +0 -221
- package/content/guidance/storefront-next/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/content/guidance/storefront-next/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/content/guidance/storefront-next/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/content/guidance/storefront-next/sfnext-scapi-management/SKILL.md +0 -203
- package/content/guidance/storefront-next/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/SKILL.md +0 -195
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-component/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/SKILL.md +0 -135
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/COMPONENT-AUTHORING.md +0 -206
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/PROJECT-STRUCTURE.md +0 -43
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TOKEN-SYSTEM.md +0 -130
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-create-vertical/references/TROUBLESHOOTING.md +0 -34
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/SKILL.md +0 -221
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-custom-apis/references/WORKFLOW-EXAMPLES.md +0 -294
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-data-fetching/references/LOADER-PATTERNS.md +0 -102
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-project-setup/references/ENV-VARIABLES.md +0 -82
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/SKILL.md +0 -203
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/evals/trigger-evals.json +0 -12
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/skills/sfnext-scapi-management/references/CLI-COMMANDS.md +0 -122
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-apis.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/custom-properties.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/jobs.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/products.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/promotions.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/saving.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/snippets.md +0 -0
- /package/content/guidance/mcp/{scapi → b2c-mcp-scapi}/references/tokens.md +0 -0
- /package/content/guidance/mcp/{server → b2c-mcp-server}/references/files.md +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Performance self-review checklist
|
|
2
|
+
|
|
3
|
+
Run this on your own diff before you call a change done, especially when it adds a loader, fetcher, Suspense boundary, modal, context or action. For each section, find the relevant lines in the diff, answer the questions, and fix what fails. Related docs in your project: `docs/README-DATA.md`, `docs/README-SUSPENSE.md`, `docs/README-REVALIDATION.md`, `docs/README-PERFORMANCE.md`.
|
|
4
|
+
|
|
5
|
+
Impact of a problem is roughly: traffic of the page x instances of the component on it x cost of one occurrence. A fetch in a product tile on a listing page multiplies by every tile; a layout loader re-run multiplies by every action on every page.
|
|
6
|
+
|
|
7
|
+
## 1. Fetch efficiency
|
|
8
|
+
|
|
9
|
+
Map the fetch topology for each user gesture (load, navigation, add to cart, open modal): which loaders, fetchers and SCAPI calls run, and in what order.
|
|
10
|
+
|
|
11
|
+
- [ ] Overlapping loaders: do two active loaders read the same resource? Move it to the lowest common layout and share via `useRouteLoaderData`.
|
|
12
|
+
- [ ] Dependent data chained across round trips (fetch A, then B using A, then enrichment) belongs in one loader, with independent calls started in parallel first.
|
|
13
|
+
- [ ] Write-in-read: does a GET path create or mutate server state (for example "get or create basket")? Reads called from many places then race or duplicate writes. Separate creation from reads.
|
|
14
|
+
- [ ] Prefetch and consume: if one component prefetches and another consumes the same data, they must share one fetcher key, or the data is fetched twice.
|
|
15
|
+
- [ ] Unstable references in effect dependencies (object or array literals, fresh callbacks) re-fire fetches on every render. Depend on primitives or stable refs.
|
|
16
|
+
- [ ] Fetcher hooks inside list items: N items means N registered fetchers and, when they load on mount, N requests. A `useFetcher` used only on interaction is not amplification; one that loads on mount is. Lift the data into the parent loader or a single batched call (`fetchProductsByIds`).
|
|
17
|
+
- [ ] Payload: only the `expand`/`select` values the UI renders.
|
|
18
|
+
|
|
19
|
+
## 2. Fetcher misuse
|
|
20
|
+
|
|
21
|
+
Is this a fetcher that should be a loader?
|
|
22
|
+
|
|
23
|
+
- [ ] A fetch on mount or render whose inputs are known at request time (route params, search params, cookies, context) belongs in the loader. This includes indirect forms: `useEffect` calls an async function that calls `fetch` or `fetcher.load()`, and fetches inside error fallbacks.
|
|
24
|
+
- [ ] Does the component ignore `loaderData` and re-fetch the same data? Use the loader data.
|
|
25
|
+
- [ ] Legitimate uses: gesture-gated loads (click, hover, open), client-only inputs (geolocation, local selection), re-fetching after a mutation, intent-based prefetch.
|
|
26
|
+
|
|
27
|
+
## 3. Suspense placement
|
|
28
|
+
|
|
29
|
+
- [ ] Every `use(promise)` and `<Await>` has a `<Suspense>` ancestor.
|
|
30
|
+
- [ ] The boundary is as low as possible: it wraps only the subtree that reads the promise, not the page or layout.
|
|
31
|
+
- [ ] The fallback reserves the final size (no layout shift) and is not `null` above the fold without reserved space.
|
|
32
|
+
|
|
33
|
+
## 4. Suspense granularity
|
|
34
|
+
|
|
35
|
+
- [ ] Independent consumers have sibling boundaries, so a slow promise does not hold back a fast one.
|
|
36
|
+
- [ ] One logical unit that must appear together shares one boundary and one promise composed in the loader.
|
|
37
|
+
- [ ] No boundary wrapped around content that is already resolved.
|
|
38
|
+
|
|
39
|
+
## 5. Promise stability
|
|
40
|
+
|
|
41
|
+
A new promise object on each render restarts suspension and flashes the fallback.
|
|
42
|
+
|
|
43
|
+
- [ ] Stable sources only: `loaderData`, `useRouteLoaderData`, `useOutletContext`, props derived from them, `useRef`, `useState` lazy-pinned, module constants.
|
|
44
|
+
- [ ] No `Promise.all/race/allSettled`, `.then/.catch/.finally`, `new Promise`, or async IIFE in render. No `useMemo` around a promise.
|
|
45
|
+
- [ ] Fixes: compose and transform in the loader (`.then` there); split into separate boundaries; pin with `useState(() => ...)` or re-pin with `useRef` keyed on inputs.
|
|
46
|
+
|
|
47
|
+
## 6. Hydration and render stability
|
|
48
|
+
|
|
49
|
+
Render scope should not exceed data-change scope.
|
|
50
|
+
|
|
51
|
+
- [ ] Values read only inside event handlers or callbacks live in `useRef`, or are read at call time (for example `matchMedia` inside the handler), not in state or Context.
|
|
52
|
+
- [ ] Hidden subscribers: components that subscribe to a store but render nothing visible still re-render; return `null` early or move the subscription to the component that renders.
|
|
53
|
+
- [ ] Context values are memoized (`useMemo`/`useCallback`); check every field each consumer reads during render, and split state from updaters.
|
|
54
|
+
- [ ] Subscriptions sit at the consumer, or in a render-nothing manager that writes to a ref/store.
|
|
55
|
+
- [ ] `useSyncExternalStore`: `getServerSnapshot` matches the first client render; `getSnapshot` returns a stable reference when nothing changed.
|
|
56
|
+
|
|
57
|
+
## 7. Revalidation scope
|
|
58
|
+
|
|
59
|
+
After an action, every active loader re-runs by default.
|
|
60
|
+
|
|
61
|
+
- [ ] For each new or changed action and each active loader (matched chain, mounted resource fetchers, open modals and drawers): is there overlap (does the result change what the loader reads) and is the value otherwise unavailable (provider not already updated)? If either is false, gate the loader with `shouldRevalidate`.
|
|
62
|
+
- [ ] Confirm the trigger is a real submission (`Form`, `useSubmit`, `fetcher.submit`). Raw `fetch` or SCAPI client calls trigger nothing.
|
|
63
|
+
- [ ] Modals and drawers count twice: as targets (fetchers they load when open) and as triggers (actions they submit). Unmount them when closed (`useDeferredUnmount`).
|
|
64
|
+
- [ ] A gate must inspect the action path or `actionResult`; checking only that `formAction` is set still re-runs on everything.
|
|
65
|
+
- [ ] Do not gate off a re-run that is the sync mechanism for a provider.
|
|
66
|
+
|
|
67
|
+
See `storefront-next:sfnext-revalidation`.
|
|
68
|
+
|
|
69
|
+
## 8. Client-side transforms
|
|
70
|
+
|
|
71
|
+
- [ ] Shape data in the loader, not during render: lookup maps, chained filter/map passes, deep spreads, slug or URL normalization.
|
|
72
|
+
- [ ] `useMemo` does not fix transforming loader data on every mount; move it to the loader.
|
|
73
|
+
- [ ] Exceptions: values derived from UI state (selected variant, local filter), and work inside event handlers.
|
|
74
|
+
|
|
75
|
+
## 9. Also check
|
|
76
|
+
|
|
77
|
+
- [ ] Images: LCP image has `priority="high"` and is not lazy; `widths` match the layout.
|
|
78
|
+
- [ ] New dependency: check bundle impact with `pnpm bundlesize`; lazy-load heavy, hidden UI.
|
|
79
|
+
- [ ] Third-party scripts: `async` or `defer`, loaded after consent where required.
|
|
80
|
+
- [ ] New preconnect only for origins used on every page.
|
|
81
|
+
- [ ] Added routes export the right `shouldRevalidate`.
|
|
82
|
+
|
|
83
|
+
## Reporting
|
|
84
|
+
|
|
85
|
+
For each finding note where it is (file and line), the rule it breaks, who pays (every shopper, every tile, every action), and the smallest fix. Prefer fixing the highest-multiplier problems first.
|
package/content/guidance/storefront-next/sfnext-performance/references/SUSPENSE-AND-STREAMING.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Suspense and streaming recipes
|
|
2
|
+
|
|
3
|
+
Read `docs/README-SUSPENSE.md` in your project for the full guide.
|
|
4
|
+
|
|
5
|
+
## Placement
|
|
6
|
+
|
|
7
|
+
Every component that calls `use(promise)` or renders `<Await>` must sit under a `<Suspense>`. Place the boundary as low as possible, around only the subtree that reads the promise, so the rest of the page is not held back. A consumer with no boundary above it suspends the nearest ancestor (often the whole route) and blocks the shell.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// Bad: boundary wraps the page; one slow promise hides everything
|
|
11
|
+
<Suspense fallback={<PageSkeleton />}><Page /></Suspense>
|
|
12
|
+
|
|
13
|
+
// Good: boundary wraps only the reader
|
|
14
|
+
<Header />
|
|
15
|
+
<Suspense fallback={<ReviewsSkeleton />}><Reviews promise={loaderData.reviews} /></Suspense>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Granularity
|
|
19
|
+
|
|
20
|
+
- Independent data: sibling boundaries, so each resolves on its own.
|
|
21
|
+
- One logical unit that must appear together: one promise composed in the loader, one boundary.
|
|
22
|
+
- Do not nest a boundary per field of one entity; do not share one boundary across unrelated promises.
|
|
23
|
+
|
|
24
|
+
## Promise stability
|
|
25
|
+
|
|
26
|
+
Stable sources: `loaderData`, `useRouteLoaderData`, `useOutletContext`, props passed from those, `useRef`, `useState` lazy pinned, module-level constants.
|
|
27
|
+
|
|
28
|
+
Unstable (new identity each render): `Promise.all/race/allSettled` in render, `.then`/`.catch`/`.finally` chains in render, `new Promise`, async IIFEs, `useMemo(() => promise)`.
|
|
29
|
+
|
|
30
|
+
Fixes:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// in the loader: compose there
|
|
34
|
+
const summary = Promise.all([a(), b()]).then(([x, y]) => ({ x, y }));
|
|
35
|
+
return { summary };
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
// component-local promise that depends on props: pin it
|
|
40
|
+
const [promise] = useState(() => fetchSomething(id)); // lazy pin, fixed for mount
|
|
41
|
+
// or re-pin only when the key changes
|
|
42
|
+
const ref = useRef<{ key: string; p: Promise<Data> }>();
|
|
43
|
+
if (ref.current?.key !== id) ref.current = { key: id, p: fetchSomething(id) };
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Client-side `fetchSomething` here must be a fetcher-driven or already-started promise; prefer composing in the loader whenever the data is knowable there.
|
|
47
|
+
|
|
48
|
+
## Skeletons
|
|
49
|
+
|
|
50
|
+
Size the skeleton to the final content (same height and grid) to avoid layout shift. For listing grids reuse the product-grid skeleton and `DeferredProductGrid`.
|
|
51
|
+
|
|
52
|
+
## Critical Page Designer regions
|
|
53
|
+
|
|
54
|
+
Page-level LCP region: `await` the page in the loader and render `<Region critical>` (no region fallback element). Component-level data inside keeps its own boundaries.
|
|
55
|
+
|
|
56
|
+
## Errors in streamed data
|
|
57
|
+
|
|
58
|
+
A rejected promise reaches the nearest `errorElement` on `<Await>` or the route `ErrorBoundary`. For optional sections use `errorElement={null}` and log in the loader; for important ones show an inline retry.
|
|
@@ -1,160 +1,147 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sfnext-project-setup
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Create and bootstrap a Storefront Next project, and learn its layout, npm scripts, and first-run workflow.
|
|
5
|
+
Use when creating a new storefront, running `sfnext create-storefront` (`--vertical` starter theme, `--defaults`,
|
|
6
|
+
`--template`, `--output-dir`), choosing between Business Manager Storefront Setup and the CLI, fixing
|
|
7
|
+
`pnpm install` / Node 24 problems, copying `.env.default` to `.env`, asking "what does this folder do" or
|
|
8
|
+
"which pnpm script do I run", or running `b2c sfnext` / `pnpm sfnext` commands for the first time.
|
|
9
|
+
Do not use for config.server.ts or PUBLIC__ env var rules (use `storefront-next:sfnext-configuration`),
|
|
10
|
+
building/pushing to Managed Runtime (use `storefront-next:sfnext-deployment`), or a conceptual tour of the
|
|
11
|
+
architecture (use `storefront-next:sfnext-overview`).
|
|
4
12
|
---
|
|
5
13
|
|
|
6
|
-
# Project Setup
|
|
14
|
+
# Storefront Next Project Setup
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
A Storefront Next project is a server-rendered React 19 / React Router 7 / Vite / Tailwind v4 app that runs on Managed Runtime (MRT). All SCAPI calls run server-side. You own the project code after it is created.
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
**Read the project's own `AGENTS.md` first.** It ships in every project (`CLAUDE.md` is a copy) and is the authority for data-loading, Suspense, state, image, and navigation rules. This skill never overrides it. Detailed guides live in the project's `docs/README-*.md`.
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
## Prerequisites
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
- Node.js >= 24 (`package.json` `engines`; MRT also runs Node 24)
|
|
23
|
+
- pnpm >= 10.28
|
|
24
|
+
- A B2C Commerce instance with a SLAS public client, your organization ID, and the SCAPI short code (unless you only want the bundled demo backend)
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
## Choose how to start
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
MRT projects as routine setup.
|
|
21
|
-
|
|
22
|
-
Use
|
|
23
|
-
or expose its secrets. Guide the user through Business Manager when setup is needed.
|
|
28
|
+
| Path | Use when |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Business Manager **Storefront Setup** (GitHub or local-code workflow) | You want an instance-connected storefront. It creates the SLAS client, the MRT project/environments, initial config, and a first deployment. Reuse those resources; do not create replacement SLAS clients or MRT projects as routine setup. Use the downloaded `env.txt` as `.env`. Guides: [GitHub workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm-github.html), [local-code workflow](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-quick-start-create-bm.html) |
|
|
31
|
+
| `sfnext create-storefront` | You want a fresh local project from a starter theme, with your own extension selection and credentials |
|
|
32
|
+
| Clone / "Use this template" of a published starter repo | You prefer plain git; the project README lists the starter repositories |
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
Never invent tenant/site IDs and never echo secrets from `env.txt`.
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
to the user's instance, follow storefront setup above and use its configuration.
|
|
36
|
+
## Create a project with the CLI
|
|
29
37
|
|
|
30
38
|
```bash
|
|
31
|
-
#
|
|
39
|
+
# Interactive: pick a starter theme, name, extensions, and credentials
|
|
32
40
|
pnpm dlx @salesforce/storefront-next-dev create-storefront
|
|
41
|
+
# or, with the b2c CLI (auto-installs the sfnext plugin on first use)
|
|
42
|
+
b2c sfnext create-storefront
|
|
33
43
|
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
# Navigate into the project
|
|
38
|
-
cd my-storefront
|
|
39
|
-
|
|
40
|
-
# Install dependencies
|
|
41
|
-
pnpm install
|
|
42
|
-
|
|
43
|
-
# Start development server
|
|
44
|
-
pnpm dev
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Project Structure
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
my-storefront/
|
|
51
|
-
├── .env.default # Default environment variables (template)
|
|
52
|
-
├── .env # Local overrides (git-ignored)
|
|
53
|
-
├── config.server.ts # Centralized configuration with defaults
|
|
54
|
-
├── vite.config.ts # Vite build configuration
|
|
55
|
-
├── package.json # Dependencies and scripts
|
|
56
|
-
├── src/
|
|
57
|
-
│ ├── app.css # Global styles and Tailwind theme
|
|
58
|
-
│ ├── root.tsx # Root layout component
|
|
59
|
-
│ ├── routes/ # File-based routes (React Router 7)
|
|
60
|
-
│ │ ├── _app.tsx # App layout (authenticated shell)
|
|
61
|
-
│ │ ├── _app._index.tsx # Home page
|
|
62
|
-
│ │ └── _app.product.$productId.tsx
|
|
63
|
-
│ ├── components/ # Reusable UI components
|
|
64
|
-
│ │ ├── ui/ # shadcn/ui base components (customizable)
|
|
65
|
-
│ │ └── ... # Custom components
|
|
66
|
-
│ ├── config/ # Configuration schema and context
|
|
67
|
-
│ │ └── schema.ts # Config type definitions
|
|
68
|
-
│ ├── lib/ # Utilities and API client setup
|
|
69
|
-
│ │ ├── api-clients.ts # createApiClients() factory
|
|
70
|
-
│ │ ├── utils.ts # cn() utility and helpers
|
|
71
|
-
│ │ └── registry.ts # Page Designer component registry
|
|
72
|
-
│ ├── locales/ # Translation files
|
|
73
|
-
│ │ └── en-US/
|
|
74
|
-
│ │ └── translations.json
|
|
75
|
-
│ ├── middlewares/ # Server middleware
|
|
76
|
-
│ │ ├── auth.server.ts # Authentication middleware
|
|
77
|
-
│ │ └── basket.server.ts # Basket middleware
|
|
78
|
-
│ ├── providers/ # React context providers
|
|
79
|
-
│ ├── hooks/ # Custom React hooks
|
|
80
|
-
│ ├── extensions/ # Extension modules
|
|
81
|
-
│ └── test-utils/ # Shared test utilities
|
|
82
|
-
├── public/ # Static assets
|
|
83
|
-
└── cartridges/ # Page Designer cartridge metadata
|
|
44
|
+
# Non-interactive
|
|
45
|
+
sfnext create-storefront -n my-storefront --vertical cosmetic -o ./projects
|
|
46
|
+
sfnext create-storefront -n my-storefront --defaults
|
|
84
47
|
```
|
|
85
48
|
|
|
86
|
-
|
|
49
|
+
| Flag | Meaning |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `-n, --name` | Project name |
|
|
52
|
+
| `-V, --vertical` | Starter theme: `fashion` (default with `--defaults`), `cosmetic`, `foundations`, `footwear`, `furniture`, `luxury` |
|
|
53
|
+
| `-t, --template` | Template repo URL or local path (overrides `--vertical`) |
|
|
54
|
+
| `-b, --template-branch` | Branch or tag to clone |
|
|
55
|
+
| `-d, --defaults` | Accept all defaults, no prompts (CI) |
|
|
56
|
+
| `-o, --output-dir` | Where to create the project |
|
|
87
57
|
|
|
88
|
-
|
|
58
|
+
What it does: shallow-clones the chosen starter, removes `.git`, asks which **extensions** to keep (and trims the rest; manage them later with `sfnext extensions ...`, see `storefront-next:sfnext-extensions`), prompts for the values in `config-meta.json` (SLAS client ID, organization ID, short code), and writes `.env` from `.env.default`.
|
|
89
59
|
|
|
90
|
-
|
|
91
|
-
For local CLI exploration, copy `.env.default` to `.env`:
|
|
60
|
+
Then:
|
|
92
61
|
|
|
93
62
|
```bash
|
|
94
|
-
|
|
63
|
+
cd my-storefront
|
|
64
|
+
pnpm install
|
|
65
|
+
pnpm dev # http://localhost:5173
|
|
95
66
|
```
|
|
96
67
|
|
|
97
|
-
|
|
68
|
+
## First run
|
|
98
69
|
|
|
99
|
-
|
|
100
|
-
request to provision new credentials. See Salesforce's [Environment Variables](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html)
|
|
101
|
-
for public/server-only visibility and supported paths.
|
|
70
|
+
`.env.default` ships with a public demo backend so `cp .env.default .env && pnpm dev` boots. **Only `.env` is read**; `.env.default` is never loaded. Replace the three required values with your own before pointing at real data:
|
|
102
71
|
|
|
103
72
|
```bash
|
|
104
|
-
PUBLIC__app__commerce__api__clientId
|
|
105
|
-
PUBLIC__app__commerce__api__organizationId
|
|
106
|
-
|
|
107
|
-
PUBLIC__app__commerce__api__shortCode=your-short-code
|
|
108
|
-
PUBLIC__app__defaultSiteId=your-site-id
|
|
109
|
-
PUBLIC__app__commerce__sites='[{"id":"your-site-id","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"}],"supportedCurrencies":["USD"]}]'
|
|
73
|
+
PUBLIC__app__commerce__api__clientId=...
|
|
74
|
+
PUBLIC__app__commerce__api__organizationId=...
|
|
75
|
+
PUBLIC__app__commerce__api__shortCode=...
|
|
110
76
|
```
|
|
111
77
|
|
|
112
|
-
|
|
78
|
+
Restart the dev server after editing `.env`. Dev fails fast if the short code is missing. Everything else has defaults in `config.server.ts`; see `storefront-next:sfnext-configuration`. If the project should target your own site, also set `PUBLIC__app__defaultSiteId` and `PUBLIC__app__commerce__sites` (JSON array) as described there.
|
|
113
79
|
|
|
114
|
-
|
|
80
|
+
Before shipping, run through the pre-launch gate in `storefront-next:sfnext-deployment` (demo analytics IDs, staging image host, demo credentials).
|
|
115
81
|
|
|
116
|
-
|
|
117
|
-
# Start development server with hot reload
|
|
118
|
-
pnpm dev
|
|
82
|
+
## Project layout (short form)
|
|
119
83
|
|
|
120
|
-
|
|
121
|
-
|
|
84
|
+
```
|
|
85
|
+
my-storefront/
|
|
86
|
+
├── AGENTS.md / CLAUDE.md # Rules for coding agents -- read first
|
|
87
|
+
├── config.server.ts # All app config defaults (metadata / runtime / app)
|
|
88
|
+
├── config-meta.json # Values create-storefront prompts for
|
|
89
|
+
├── .env.default, .env # Required credentials; only .env is loaded
|
|
90
|
+
├── package.json # Scripts + storefrontNext version stamp
|
|
91
|
+
├── react-router.config.ts, vite.config.ts, vite-plugins/
|
|
92
|
+
├── src/
|
|
93
|
+
│ ├── routes/ # Flat file routes (_app.*, _checkout.*, _empty.*, action.*, resource.*)
|
|
94
|
+
│ ├── components/ (ui/ = primitives), hooks/, providers/, lib/, middlewares/
|
|
95
|
+
│ ├── extensions/ # Optional feature modules + config.json registry
|
|
96
|
+
│ ├── theme/ # index.css entry, tokens/, overrides/
|
|
97
|
+
│ ├── locales/ # <lang-REGION>/translations.json
|
|
98
|
+
│ ├── scapi/ # Generated + custom SCAPI clients
|
|
99
|
+
│ ├── targets/ # UI target (extension point) system
|
|
100
|
+
│ └── types/config.ts # AppConfig type
|
|
101
|
+
├── cartridges/app_storefrontnext_base # Page Designer metadata cartridge
|
|
102
|
+
├── docs/ # README-*.md guides, COMPATIBILITY.md, migrations/
|
|
103
|
+
├── instructions/ # Extension install/uninstall guides (.mdc)
|
|
104
|
+
├── e2e/ # Playwright suite (own package)
|
|
105
|
+
└── public/
|
|
106
|
+
```
|
|
122
107
|
|
|
123
|
-
|
|
124
|
-
pnpm test
|
|
108
|
+
See [PROJECT-STRUCTURE.md](references/PROJECT-STRUCTURE.md) for route families, key files, and where to go for each concern.
|
|
125
109
|
|
|
126
|
-
|
|
127
|
-
pnpm storybook
|
|
110
|
+
## Scripts and CLI
|
|
128
111
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
112
|
+
Run `pnpm <script>`. The most used: `dev`, `build`, `start` (preview the production build on :3000), `typecheck`, `lint`, `test`, `push`, `cartridge:generate|validate|deploy`, `config:inspect`, `config:push-env`, `bundlesize`, `storybook`. Full table in [SCRIPTS.md](references/SCRIPTS.md). The project's `package.json` `scripts` is the source of truth; grep it instead of guessing.
|
|
113
|
+
|
|
114
|
+
The `sfnext` binary (from `@salesforce/storefront-next-dev`, already a project dependency) is also reachable as `pnpm sfnext <cmd>` or `b2c sfnext <cmd>` (the b2c CLI prefers the project-local copy when run inside the project). Command reference: [SFNEXT-CLI.md](references/SFNEXT-CLI.md). The template also exposes `pnpm b2c` for the b2c CLI.
|
|
132
115
|
|
|
133
|
-
##
|
|
116
|
+
## Conventions worth knowing up front
|
|
134
117
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
- Application code is TypeScript/TSX only (`node scripts/check-typescript-only.js` flags stray `.js`). Linting is OxLint (`pnpm lint`, zero warnings), formatting is Biome (`pnpm format`).
|
|
119
|
+
- Imports use the `@/` alias to `src/`. Server-only modules are suffixed `.server.ts`.
|
|
120
|
+
- Use the site-aware `Link`/`NavLink` from `@/components/link` and `useNavigate` from `@/hooks/use-navigate`, not the React Router originals.
|
|
121
|
+
- Server `loader`/`action` only; no `clientLoader`/`clientAction`. Await only critical data; return non-critical data as promises (`storefront-next:sfnext-data-fetching`).
|
|
122
|
+
- Version compatibility between your project and the SDK: `package.json#storefrontNext` and `docs/COMPATIBILITY.md`.
|
|
140
123
|
|
|
141
124
|
## Troubleshooting
|
|
142
125
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
126
|
+
| Symptom | Cause / fix |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| `pnpm install` fails or engine warning | Node < 24 or pnpm < 10.28; upgrade both |
|
|
129
|
+
| Dev server exits immediately about short code | `PUBLIC__app__commerce__api__shortCode` missing in `.env` (not `.env.default`) |
|
|
130
|
+
| SCAPI 401/403 | Client ID / organization ID / short code do not match the same org, or the SLAS client lacks scopes; run `sfnext setup-base-cartridge --slas-client-id <id>` only if the base cartridge scopes are the issue |
|
|
131
|
+
| `.env` change ignored | Restart `pnpm dev`; check with `pnpm config:inspect` |
|
|
132
|
+
| Unknown `sfnext` command via `b2c` | First use installs the plugin; run inside the project so the local copy is used |
|
|
149
133
|
|
|
150
|
-
##
|
|
134
|
+
## Finding more
|
|
151
135
|
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
154
|
-
- `storefront-next:sfnext-data-fetching` - Server-side data loading patterns
|
|
155
|
-
- `storefront-next:sfnext-deployment` - Building and deploying to MRT
|
|
136
|
+
- Project `AGENTS.md` doc index and `docs/README-*.md`
|
|
137
|
+
- `b2c docs search "<topic>" --category sfnext` (or MCP `docs_search`) for the published Storefront Next guides
|
|
156
138
|
|
|
157
|
-
##
|
|
139
|
+
## Related Skills
|
|
158
140
|
|
|
159
|
-
-
|
|
160
|
-
-
|
|
141
|
+
- `storefront-next:sfnext-overview` - Architecture and concept tour
|
|
142
|
+
- `storefront-next:sfnext-configuration` - config.server.ts, PUBLIC__ env vars, multi-site URLs
|
|
143
|
+
- `storefront-next:sfnext-deployment` - Build, push to MRT, cartridge deploy, pre-launch gate
|
|
144
|
+
- `storefront-next:sfnext-routing` - File routes and site-aware links
|
|
145
|
+
- `storefront-next:sfnext-extensions` - Install, remove, and create extensions
|
|
146
|
+
- `storefront-next:sfnext-theming` - Rebranding `src/theme/`
|
|
147
|
+
- `b2c-cli:b2c-mrt` - Generic MRT project/environment management
|
package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md
CHANGED
|
@@ -1,99 +1,61 @@
|
|
|
1
|
-
# Project Structure
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
| `
|
|
11
|
-
| `
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| `
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### `src/locales/`
|
|
63
|
-
|
|
64
|
-
Translation files organized by locale:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
src/locales/
|
|
68
|
-
├── en-US/translations.json
|
|
69
|
-
├── de-DE/translations.json
|
|
70
|
-
└── fr-FR/translations.json
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### `src/middlewares/`
|
|
74
|
-
|
|
75
|
-
Server middleware:
|
|
76
|
-
|
|
77
|
-
- `auth.server.ts` — SLAS authentication, token management, `getAuth(context)`
|
|
78
|
-
- `basket.server.ts` — Basket middleware and request-context basket resource helpers
|
|
79
|
-
|
|
80
|
-
### `src/extensions/`
|
|
81
|
-
|
|
82
|
-
Extension modules with their own routes, components, translations, and providers. Extensions typically include `target-config.json` (for `targetId` component/provider insertion) and are registered in `src/extensions/config.json`.
|
|
83
|
-
|
|
84
|
-
### `src/test-utils/`
|
|
85
|
-
|
|
86
|
-
Shared test utilities:
|
|
87
|
-
|
|
88
|
-
- `config.ts` — Mock configuration for tests
|
|
89
|
-
- `context-provider-utils.ts` — Context provider helpers
|
|
90
|
-
- `context-provider.tsx` — Test wrapper providers
|
|
91
|
-
|
|
92
|
-
## Build Output
|
|
93
|
-
|
|
94
|
-
- `build/` — Production build output (server and client bundles)
|
|
95
|
-
- `coverage/` — Test coverage reports
|
|
96
|
-
|
|
97
|
-
## Cartridges
|
|
98
|
-
|
|
99
|
-
- `cartridges/` — Page Designer cartridge with experience metadata (component/page JSON definitions generated by MCP tools)
|
|
1
|
+
# Project Structure
|
|
2
|
+
|
|
3
|
+
A short map of a Storefront Next project. The project's `AGENTS.md` ("Project Structure") is authoritative and kept current; use `ls` on the project rather than trusting any long listing, including this one.
|
|
4
|
+
|
|
5
|
+
## Top level
|
|
6
|
+
|
|
7
|
+
| Path | Purpose |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `AGENTS.md`, `CLAUDE.md` | Rules and doc index for coding agents |
|
|
10
|
+
| `config.server.ts` | Typed defaults for the whole app (`metadata`, `runtime`, `app`). Edited by you; overridden per environment with `PUBLIC__` env vars |
|
|
11
|
+
| `config-meta.json`, `config-metadata/` | Values `sfnext create-storefront` prompts for; config metadata |
|
|
12
|
+
| `.env.default` / `.env` | Required credentials and MRT target. Only `.env` is read |
|
|
13
|
+
| `package.json` | Scripts, dependencies, and `storefrontNext` (`templateRelease`, `templateVersion`, `minSdkVersion`) |
|
|
14
|
+
| `react-router.config.ts`, `vite.config.ts`, `vite-plugins/` | Framework and build config; plugins for bundle size, env validation, hybrid proxy, server-only-config guard |
|
|
15
|
+
| `components.json` | shadcn config (CSS entry is `src/theme/index.css`) |
|
|
16
|
+
| `cartridges/app_storefrontnext_base/` | Base cartridge; Page Designer metadata is generated into it |
|
|
17
|
+
| `docs/` | `README-*.md` guides, `COMPATIBILITY.md`, `migrations/` upgrade guides |
|
|
18
|
+
| `instructions/` | Install/uninstall instructions for extensions (`.mdc`) |
|
|
19
|
+
| `e2e/` | Playwright end-to-end and accessibility suite (its own package) |
|
|
20
|
+
| `scripts/` | Helper scripts behind `lint:a11y`, `lint:css`, `bundlesize:compare`, `storybook:test`, `extensions:list`, ... |
|
|
21
|
+
| `.storybook/`, `.github/`, `.devcontainer/`, `.claude/skills/sync-shadcn` | Storybook, CI workflows, dev container, in-project skill for syncing shadcn primitives |
|
|
22
|
+
| `public/` | Static assets (fonts, images, robots.txt, favicon) |
|
|
23
|
+
|
|
24
|
+
## `src/`
|
|
25
|
+
|
|
26
|
+
| Path | Notes |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `routes/` | Flat file routes. Families: `_app.*` (storefront shell), `_checkout.*`, `_empty.*` (login, signup, maintenance; minimal chrome), `action.*` (server mutations), `resource.*` (resource routes). Products and categories are splats: `_app.p.$.tsx`, `_app.c.$.tsx`. Orders use `$orderNo`. See `storefront-next:sfnext-routing` |
|
|
29
|
+
| `routes.ts`, `route-paths.ts` | Route registration and typed path helpers (`routeHref`) |
|
|
30
|
+
| `root.tsx`, `entry.client.tsx`, `entry.server.tsx`, `app-wrapper.tsx` | App shell and entry points. `root.tsx` imports `src/theme/index.css` |
|
|
31
|
+
| `components/` | Feature components; `components/ui/` holds UI primitives you own; `components/link` is the site-aware `Link`/`NavLink` |
|
|
32
|
+
| `hooks/` | Includes `use-navigate` and `use-current-site-and-locale-ref` |
|
|
33
|
+
| `providers/` | React context providers |
|
|
34
|
+
| `lib/` | Domain folders (`auth/`, `cart/`, `checkout/`, `product/`, `order/`, ...), `api-clients.server.ts` (`createApiClients(context)`), `url.server.ts` (`buildUrlFromContext`), `page-designer/` (registry, loader), `decorators/`, `revalidation/` |
|
|
35
|
+
| `middlewares/` | Server middlewares (`app-config`, `site-context`, `i18next`, `auth`, `basket`, `security-headers`, `logging`, ...). Ordering is in `src/server/middleware-registry.ts` |
|
|
36
|
+
| `scapi/` | Generated and custom SCAPI clients (`@/scapi` barrel); see `storefront-next:sfnext-scapi` |
|
|
37
|
+
| `extensions/` | Optional feature modules; `config.json` is the extension registry; per-extension `config.ts` / `server-config.ts` feed app config |
|
|
38
|
+
| `targets/` | UI target (extension point) system |
|
|
39
|
+
| `theme/` | `index.css` entry, `base.css`, `tailwind.css`, `tokens/`, `overrides/`, `animations.css`; see `storefront-next:sfnext-theming` |
|
|
40
|
+
| `locales/` | One folder per language-region (`en-US`, `de-DE`, ...) with `translations.json`; see `storefront-next:sfnext-i18n` |
|
|
41
|
+
| `types/config.ts` | `AppConfig` / `Config` types and the `getConfig` / `useConfig` type augmentation |
|
|
42
|
+
| `analytics/`, `design-system/`, `test-utils/` | Tracking components, design-system docs stories, shared test helpers (`@/test-utils/config`, `context-provider`, `request-helpers`, ...) |
|
|
43
|
+
|
|
44
|
+
## Where to look for each concern
|
|
45
|
+
|
|
46
|
+
| Concern | Start here |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| Data loading, Suspense, state, images | `AGENTS.md` "Performance & Data Rules", `docs/README-DATA.md`, `README-SUSPENSE.md`, `README-STATE.md` |
|
|
49
|
+
| All config options | `docs/README-CONFIG.md` (required/optional tables), `docs/README-CONFIG-OPTIONS.md` |
|
|
50
|
+
| Multi-site, locale URLs, SEO routes | `docs/README-MULTI-SITE.md` |
|
|
51
|
+
| Auth and cookies | `docs/README-AUTH.md` |
|
|
52
|
+
| Page Designer | `docs/README-PAGE-DESIGNER.md` |
|
|
53
|
+
| Upgrading | `docs/COMPATIBILITY.md`, `docs/migrations/` |
|
|
54
|
+
|
|
55
|
+
## Page Designer metadata
|
|
56
|
+
|
|
57
|
+
Component metadata is generated from decorators by `pnpm cartridge:generate` (also run by `pnpm build`) into `cartridges/app_storefrontnext_base/`, validated with `pnpm cartridge:validate`, and deployed to the B2C instance with `pnpm cartridge:deploy` (not part of `pnpm push`). See `storefront-next:sfnext-deployment` and `storefront-next:sfnext-page-designer`.
|
|
58
|
+
|
|
59
|
+
## Adding UI primitives
|
|
60
|
+
|
|
61
|
+
The project ships an in-project `sync-shadcn` skill (`.claude/skills/sync-shadcn`) and `scripts/upgrade-shadcn.js` for pulling updated shadcn primitives into `src/components/ui/` without losing local changes. Prefer that over a raw `npx shadcn add`.
|