@salesforce/b2c-dx-mcp 3.2.0 → 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/execution-registry.js +9 -9
- 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
|
@@ -1,160 +1,163 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sfnext-configuration
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Configure a Storefront Next app: config.server.ts (defineConfig, metadata/runtime/app), AppConfig types in
|
|
5
|
+
src/types/config.ts, PUBLIC__ environment variable overrides, getConfig(context) / useConfig(), extension config
|
|
6
|
+
(app.extension, app.serverExtension), protected paths, server-only secrets, and multi-site settings
|
|
7
|
+
(commerce.sites, url.prefix, seoRoutes, siteAliasMap, cookie domain). Use when editing config.server.ts, adding a
|
|
8
|
+
config value, an env var is ignored or "not applied", `pnpm config:inspect` / `config:push-env`, "Ignoring
|
|
9
|
+
environment variable" warnings, protected config path errors, setting up a second site or locale URLs, or
|
|
10
|
+
going through the pre-launch config checklist.
|
|
11
|
+
Do not use for creating a project or the npm script list (use `storefront-next:sfnext-project-setup`), pushing
|
|
12
|
+
bundles or MRT env management (use `storefront-next:sfnext-deployment` / `b2c-cli:b2c-mrt`), or hybrid
|
|
13
|
+
proxy and cookie-sharing with SFRA (use `storefront-next:sfnext-hybrid-storefronts`).
|
|
4
14
|
---
|
|
5
15
|
|
|
6
|
-
# Configuration
|
|
16
|
+
# Storefront Next Configuration
|
|
7
17
|
|
|
8
|
-
|
|
18
|
+
All app settings live in one typed file, `config.server.ts`. Environment variables override its values per environment; `defineConfig()` deep-merges them at startup. Full references ship in the project: `docs/README-CONFIG.md` (required/optional variable tables) and `docs/README-CONFIG-OPTIONS.md` (every option).
|
|
9
19
|
|
|
10
|
-
##
|
|
20
|
+
## Model
|
|
11
21
|
|
|
12
|
-
|
|
22
|
+
`config.server.ts` default-exports `defineConfig<Config>({ metadata, runtime, app }, { protectedPaths })`, imported from `@salesforce/storefront-next-runtime/config`.
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
| Section | Visible to | Contents |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `app` | Server and browser (`window.__APP_CONFIG__`) | Commerce API, sites, features, URL/SEO routes, images, security, engagement |
|
|
27
|
+
| `runtime` | Server only | MRT settings such as `ssrParameters` (`ssrFunctionNodeVersion`, `envBasePath`), `ssrOnly`, `ssrShared` |
|
|
28
|
+
| `metadata` | Server only | Project name/slug |
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
Because `app` reaches the browser, never put secrets in it.
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
export type Config = {
|
|
20
|
-
app: {
|
|
21
|
-
myFeature: {
|
|
22
|
-
enabled: boolean;
|
|
23
|
-
maxItems: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
```
|
|
32
|
+
## Add a config value
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
1. Add the field to `AppConfig` in `src/types/config.ts` (`Config = BaseConfig<AppConfig>`; the `AppConfigShape` / `ClientFacingAppConfigShape` augmentations in that file give `getConfig` and `useConfig` their types).
|
|
35
|
+
2. Set a default under `app` in `config.server.ts`. **Define the key even if the default is empty (`''`, `[]`)**; env overrides are only accepted for paths that exist here.
|
|
36
|
+
3. Override per environment: `PUBLIC__app__myFeature__enabled=true`.
|
|
37
|
+
4. Run `pnpm typecheck`.
|
|
30
38
|
|
|
31
39
|
```typescript
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
myFeature: {
|
|
35
|
-
enabled: false,
|
|
36
|
-
maxItems: 10,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 3. Override via environment variables
|
|
40
|
+
// src/types/config.ts (inside AppConfig)
|
|
41
|
+
myFeature: { enabled: boolean; maxItems: number };
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
PUBLIC__app__myFeature__maxItems=20
|
|
43
|
+
// config.server.ts (inside app)
|
|
44
|
+
myFeature: { enabled: false, maxItems: 10 },
|
|
47
45
|
```
|
|
48
46
|
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
### In React Components
|
|
47
|
+
## Read config
|
|
52
48
|
|
|
53
49
|
```typescript
|
|
54
|
-
import { useConfig } from '@salesforce/storefront-next-runtime/config';
|
|
50
|
+
import { getConfig, useConfig } from '@salesforce/storefront-next-runtime/config';
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const maxItems = config.myFeature.maxItems;
|
|
61
|
-
// Feature code
|
|
62
|
-
}
|
|
52
|
+
// Loaders, actions, middleware (server): context is REQUIRED
|
|
53
|
+
export function loader({ context }: LoaderFunctionArgs) {
|
|
54
|
+
const config = getConfig(context); // full AppConfig incl. serverExtension
|
|
55
|
+
return { max: config.myFeature.maxItems };
|
|
63
56
|
}
|
|
64
|
-
```
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
// Components
|
|
59
|
+
const config = useConfig(); // client-facing shape (no serverExtension)
|
|
60
|
+
```
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
- `getConfig()` with no argument is for browser-only modules (reads `window.__APP_CONFIG__`); it returns the client-facing shape. Calling it on the server without a context **throws** "Configuration not available".
|
|
63
|
+
- Routes have no `clientLoader` (forbidden by the project rules), so server code always passes `context`.
|
|
64
|
+
- Middleware can read `context.get(appConfigContext)` (exported from the same module).
|
|
65
|
+
- In tests use `mockConfig`, `mockBuildConfig`, `ConfigWrapper`, `createConfigWrapper` from `@/test-utils/config`.
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
const config = getConfig(context); // context is required on server
|
|
67
|
+
## Environment variable rules
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}
|
|
69
|
+
```
|
|
70
|
+
PUBLIC__app__<path>__<to>__<key>=value -> config.app.<path>.<to>.<key>
|
|
78
71
|
```
|
|
79
72
|
|
|
80
|
-
|
|
73
|
+
| Rule | Detail |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `PUBLIC__` prefix | Merged into config and **exposed to the browser**. Client IDs, flags, site lists only |
|
|
76
|
+
| No prefix | Server-only; not part of config. Read with `process.env` in server code |
|
|
77
|
+
| Path must exist | An unknown path is skipped with `[Config Warning] Ignoring environment variable ...` in the server log, so a typo is silent to the user |
|
|
78
|
+
| Parsing | Numbers, `true`/`false` (as strings), JSON arrays/objects; empty value becomes `''` |
|
|
79
|
+
| Precedence | Deeper (more specific) paths win over a JSON blob at a parent path |
|
|
80
|
+
| Case | Path matching is case-insensitive |
|
|
81
|
+
| Depth | Max 10 segments; use a JSON value for deeper structures |
|
|
82
|
+
| Restart | `.env` is read at startup; restart `pnpm dev` |
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
import { getConfig } from '@salesforce/storefront-next-runtime/config';
|
|
84
|
+
### Required variables
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
Only three are required to boot (`.env` locally; MRT environment variables when deployed):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
PUBLIC__app__commerce__api__clientId=...
|
|
90
|
+
PUBLIC__app__commerce__api__organizationId=...
|
|
91
|
+
PUBLIC__app__commerce__api__shortCode=...
|
|
89
92
|
```
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
Do not set `PUBLIC__app__commerce__api__siteId`; that path does not exist and is ignored with a warning. To point at your own site, set `PUBLIC__app__defaultSiteId` and `PUBLIC__app__commerce__sites` (see [MULTI-SITE-URLS.md](references/MULTI-SITE-URLS.md)). Everything else is optional; see [ENV-VARIABLES.md](references/ENV-VARIABLES.md).
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
### Debug "my env var is not applied"
|
|
94
97
|
|
|
95
98
|
```bash
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
#
|
|
99
|
-
# Accessed as config.commerce.api.clientId
|
|
99
|
+
pnpm config:inspect # shows each value and whether it comes from config.server.ts, .env, or MRT
|
|
100
|
+
pnpm sfnext config inspect --project my-project --environment staging # include MRT env values
|
|
101
|
+
pnpm config:push-env # push .env variables to an MRT environment (b2c mrt env var push)
|
|
100
102
|
```
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
| ----------------- | ---------------------------------------------- |
|
|
104
|
-
| `PUBLIC__` prefix | Exposed to browser (client-safe) |
|
|
105
|
-
| No prefix | Server-only (secrets) |
|
|
106
|
-
| `__` separator | Navigate nested paths |
|
|
107
|
-
| Auto-parsing | Numbers, booleans, JSON parsed automatically |
|
|
108
|
-
| Validation | Paths must exist in `config.server.ts` |
|
|
109
|
-
| Depth limit | Maximum 10 levels |
|
|
110
|
-
| MRT limits | Names max 512 chars; total `PUBLIC__` max 32KB |
|
|
104
|
+
The `config:inspect` script echoes a tip after the command, so call `sfnext config inspect` directly when passing flags.
|
|
111
105
|
|
|
112
|
-
|
|
106
|
+
Checklist: `PUBLIC__` with a double underscore, path exists in `config.server.ts`, booleans are the string `true`, dev server restarted, variable set on the right MRT environment, and the path is not protected.
|
|
113
107
|
|
|
114
|
-
|
|
115
|
-
PUBLIC__app__commerce__sites='[
|
|
116
|
-
{
|
|
117
|
-
"id": "RefArchGlobal",
|
|
118
|
-
"defaultLocale": "en-US",
|
|
119
|
-
"defaultCurrency": "USD",
|
|
120
|
-
"supportedLocales": [
|
|
121
|
-
{"id": "en-US", "preferredCurrency": "USD"},
|
|
122
|
-
{"id": "de-DE", "preferredCurrency": "EUR"}
|
|
123
|
-
],
|
|
124
|
-
"supportedCurrencies": ["USD", "EUR"]
|
|
125
|
-
}
|
|
126
|
-
]'
|
|
127
|
-
```
|
|
108
|
+
## Protected paths
|
|
128
109
|
|
|
129
|
-
|
|
130
|
-
const config = getConfig(context);
|
|
131
|
-
const currentSite = config.commerce.sites[0];
|
|
132
|
-
const locale = currentSite.defaultLocale; // "en-US"
|
|
133
|
-
const currency = currentSite.defaultCurrency; // "USD"
|
|
134
|
-
```
|
|
110
|
+
`defineConfig(..., { protectedPaths })` locks paths against env override. Setting a protected path, or a parent of one (e.g. `PUBLIC__app__url`), **throws at startup**. The template protects:
|
|
135
111
|
|
|
136
|
-
|
|
112
|
+
- `app__url__prefix`, `app__url__excludeRoutes`, `app__url__seoRoutes` (compiled into routes at build time; change `config.server.ts` and rebuild/redeploy)
|
|
113
|
+
- `app__engagement__adapters__einstein`, `...__data360`, `...__activeData__enabled`, `...__activeData__eventToggles`
|
|
137
114
|
|
|
138
|
-
|
|
139
|
-
# Client-safe (PUBLIC__ prefix)
|
|
140
|
-
PUBLIC__app__commerce__api__clientId=abc123
|
|
115
|
+
The rest of `app.engagement` is overridable. Check the `protectedConfigPaths` export in your `config.server.ts` for the current list.
|
|
141
116
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
117
|
+
## Secrets
|
|
118
|
+
|
|
119
|
+
Server-only values are plain env vars read via `process.env` in server routes/middleware, never through config:
|
|
120
|
+
|
|
121
|
+
- `COMMERCE_API_SLAS_SECRET`: only for a private SLAS client (`commerce.api.privateKeyEnabled`). A public client needs no secret.
|
|
122
|
+
- `GUEST_ORDER_LOOKUP_COOKIE_SECRET`: required when guest order lookup is enabled.
|
|
123
|
+
- `MARKETING_CLOUD_*`: only for email-mode passwordless/reset with your own Marketing Cloud tenant.
|
|
145
124
|
|
|
146
|
-
|
|
125
|
+
Extension `config.ts` / `server-config.ts` must not read `process.env` (an AST check fails discovery).
|
|
147
126
|
|
|
148
|
-
##
|
|
127
|
+
## Extension config
|
|
149
128
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
129
|
+
Extensions add config without touching core files:
|
|
130
|
+
|
|
131
|
+
- `src/extensions/<name>/config.ts` (default-export an object) is merged into `app.extension.<camelCaseFolder>`; override with `PUBLIC__app__extension__<key>__<setting>`.
|
|
132
|
+
- `src/extensions/<name>/server-config.ts` is merged into `app.serverExtension.<camelCaseFolder>`, available only through `getConfig(context)`; no env override, and the build fails if a client chunk imports it.
|
|
133
|
+
- `pnpm config:aggregate-extensions` regenerates the merged files (run automatically by `dev`, `build`, `typecheck`).
|
|
134
|
+
|
|
135
|
+
## Multi-site and URLs
|
|
136
|
+
|
|
137
|
+
Short version: the current site comes from the request (site-context middleware), not from `commerce.sites[0]`. Use `useSite()` from `@salesforce/storefront-next-runtime/site-context` in components and `context.get(siteContext)` (same module) on the server. URL shape, `seoRoutes`, aliases, MRT Data Store sites, cookie domain, multiple domains, and base path are in [MULTI-SITE-URLS.md](references/MULTI-SITE-URLS.md).
|
|
138
|
+
|
|
139
|
+
## Pre-launch config gate
|
|
140
|
+
|
|
141
|
+
Before going live, review these defaults in `config.server.ts`:
|
|
142
|
+
|
|
143
|
+
1. `app.engagement.adapters` (Einstein, Active Data, Data 360): defaults carry **demo IDs/hosts**. Enable only with your own values, or disable them; also confirm consent categories.
|
|
144
|
+
2. `images.host` defaults to the DIS **staging** host (`edge.disstg...`); use the production DIS host, and add `realmHostMappings` for custom domains.
|
|
145
|
+
3. `.env` / MRT variables point at your own client ID, organization ID, short code, and site(s), not the demo backend.
|
|
146
|
+
4. `commerce.sites`, `defaultSiteId`, and `siteAliasMap` match your Business Manager sites; `url.seoRoutes` has an entry for every active site if enabled.
|
|
147
|
+
5. Cookie domain (`cookies.domain`) matches Business Manager Hybrid Auth level if used.
|
|
148
|
+
6. Security headers / CSP (`app.security.headers`) and Turnstile keys are reviewed (`storefront-next:sfnext-security`).
|
|
155
149
|
|
|
156
150
|
## Related Skills
|
|
157
151
|
|
|
158
|
-
- `storefront-next:sfnext-project-setup` -
|
|
159
|
-
- `storefront-next:sfnext-
|
|
160
|
-
- `storefront-next:sfnext-
|
|
152
|
+
- `storefront-next:sfnext-project-setup` - Create the project, `.env` basics, scripts
|
|
153
|
+
- `storefront-next:sfnext-deployment` - Push bundles and sync MRT env vars
|
|
154
|
+
- `storefront-next:sfnext-routing` - Site-aware links and SEO route behavior
|
|
155
|
+
- `storefront-next:sfnext-i18n` - Locales, translations, locale switching
|
|
156
|
+
- `storefront-next:sfnext-extensions` - Extension authoring
|
|
157
|
+
- `storefront-next:sfnext-hybrid-storefronts` - Hybrid proxy and shared cookies with SFRA
|
|
158
|
+
- `storefront-next:sfnext-security` - Security headers, CSP, Turnstile
|
|
159
|
+
- `b2c-cli:b2c-mrt` - MRT environment variable management
|
|
160
|
+
|
|
161
|
+
## Finding more
|
|
162
|
+
|
|
163
|
+
Project `docs/README-CONFIG.md`, `docs/README-CONFIG-OPTIONS.md`, `docs/README-MULTI-SITE.md`; `b2c docs search "<topic>" --category sfnext`.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
[
|
|
2
|
+
{"query": "How do I add a new setting to config.server.ts and read it in a loader with getConfig?", "should_trigger": true},
|
|
3
|
+
{"query": "Set up a second site with its own locales and URL prefix in Storefront Next", "should_trigger": true},
|
|
4
|
+
{"query": "Push my built bundle to Managed Runtime staging", "should_trigger": false}
|
|
5
|
+
]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Environment Variables
|
|
2
|
+
|
|
3
|
+
Authoritative, current tables ship in the project: `docs/README-CONFIG.md` ("Required vs Optional Variables") and `docs/README-CONFIG-OPTIONS.md`. This file summarizes the categories; check those docs for defaults.
|
|
4
|
+
|
|
5
|
+
## Where variables come from
|
|
6
|
+
|
|
7
|
+
| Source | Used by |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `.env` in the project root | `pnpm dev`, `pnpm start`, and `sfnext` commands (`push`, `config inspect`, ...). `.env.default` is a template only and is never loaded |
|
|
10
|
+
| Managed Runtime environment variables | The deployed storefront. Set in Runtime Admin or with `b2c mrt env var set` / `b2c mrt env var push` (`pnpm config:push-env`) |
|
|
11
|
+
|
|
12
|
+
`.env` is not uploaded by `pnpm push`. See `storefront-next:sfnext-deployment`.
|
|
13
|
+
|
|
14
|
+
## Required to run
|
|
15
|
+
|
|
16
|
+
`PUBLIC__app__commerce__api__clientId`, `PUBLIC__app__commerce__api__organizationId`, `PUBLIC__app__commerce__api__shortCode`.
|
|
17
|
+
|
|
18
|
+
## Required to push to Managed Runtime
|
|
19
|
+
|
|
20
|
+
| Variable | Notes |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `MRT_PROJECT` | MRT project slug (also `--project`, `SFCC_MRT_PROJECT`, or dw.json `mrtProject`). Set it explicitly |
|
|
23
|
+
| `MRT_TARGET` | Target environment (also `--environment`). Optional unless using `--wait` |
|
|
24
|
+
| `MRT_API_KEY` | API key (or `MRT_CREDENTIALS_FILE` / `~/.mobify`). Also `MRT_CLOUD_ORIGIN` for a non-default MRT origin |
|
|
25
|
+
|
|
26
|
+
These are read by the `sfnext` CLI; they are not storefront runtime config.
|
|
27
|
+
|
|
28
|
+
## Common optional `PUBLIC__` overrides
|
|
29
|
+
|
|
30
|
+
| Variable | Effect |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `PUBLIC__app__defaultSiteId` | Default site ID |
|
|
33
|
+
| `PUBLIC__app__commerce__sites` | JSON array of site definitions |
|
|
34
|
+
| `PUBLIC__app__commerce__sitesFromDal` | `false` keeps static `commerce.sites` authoritative instead of MRT Data Store sites |
|
|
35
|
+
| `PUBLIC__app__cookies__domain` | Cookie domain for all storefront cookies |
|
|
36
|
+
| `PUBLIC__app__commerce__api__privateKeyEnabled` | Use a private SLAS client (needs `COMMERCE_API_SLAS_SECRET`) |
|
|
37
|
+
| `PUBLIC__app__commerce__api__proxy`, `...__callback` | SCAPI proxy and OAuth callback paths |
|
|
38
|
+
| `PUBLIC__app__hybrid__enabled` | Hybrid mode |
|
|
39
|
+
| `PUBLIC__app__features__*` | Feature toggles (passwordless login, social login, shopper context, MRT-based Page Designer resolution, ...) |
|
|
40
|
+
| `PUBLIC__app__security__turnstile__*` | Turnstile bot protection |
|
|
41
|
+
| `PUBLIC__app__commerce__shopperAgent` | Shopper Agent widget config (the older `PUBLIC__app__cimulateAgent` is deprecated) |
|
|
42
|
+
| `PUBLIC__app__extension__<key>__<setting>` | Extension config overrides |
|
|
43
|
+
|
|
44
|
+
## Server-only (no prefix)
|
|
45
|
+
|
|
46
|
+
`COMMERCE_API_SLAS_SECRET` (private client only), `GUEST_ORDER_LOOKUP_COOKIE_SECRET`, `MARKETING_CLOUD_CLIENT_ID` / `_CLIENT_SECRET` / `_AUTH_BASE_URL` / `_REST_BASE_URL`, `SFCC_LOG_LEVEL` (`error|warn|info|debug`), and local-dev hybrid proxy variables (`HYBRID_PROXY_ENABLED`, `HYBRID_ROUTING_RULES`, `HYBRID_PROXY_LOCALE`, `SFCC_ORIGIN`; see `storefront-next:sfnext-hybrid-storefronts`).
|
|
47
|
+
|
|
48
|
+
## Gotchas
|
|
49
|
+
|
|
50
|
+
- Unknown `PUBLIC__` paths are ignored with a server-log warning; define the key in `config.server.ts` first (an empty default is enough).
|
|
51
|
+
- Protected paths (`app__url__*`, selected engagement adapter paths) throw if set via env; see SKILL.md.
|
|
52
|
+
- Booleans must be the string `true`/`false`. Objects and arrays are JSON strings.
|
|
53
|
+
- Multi-line JSON is supported in `.env`; on MRT, keep values compact.
|
|
54
|
+
- MRT limits total variable size and name length; see Salesforce's [Environment Variables constraints](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html) for the current numbers rather than relying on a figure here.
|
|
55
|
+
- Vite also loads `.env.<mode>` files by build mode.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Multi-Site, URLs, Domains, Base Path, and Cookie Domain
|
|
2
|
+
|
|
3
|
+
Everything that decides which site/locale a request is for and what URLs look like. Depth ships in the project: `docs/README-MULTI-SITE.md` (URL config, SEO routes, switchers), `docs/README-MULTI-DOMAIN.md`, `docs/README-BASE-PATH.md`, `docs/README-COOKIE-DOMAIN.md`, and `docs/migrations/seo-url-rules/README.md`. Read the relevant one before changing these settings.
|
|
4
|
+
|
|
5
|
+
## Quick decision table
|
|
6
|
+
|
|
7
|
+
| Goal | Setting | Rebuild needed? |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Add a site or locale | `commerce.sites` (or MRT Data Store sites), i18n locale files | No (env) |
|
|
10
|
+
| Change what the site/locale segments look like | `app.siteAliasMap`, `app.localeAliasMap` | No |
|
|
11
|
+
| Change URL shape (`/:siteId/:localeId`) | `app.url.prefix` / `search` / `excludeRoutes` | **Yes**, protected |
|
|
12
|
+
| Custom product/category URL prefixes | `app.url.seoRoutes` | **Yes**, protected |
|
|
13
|
+
| Many domains, one environment | CDN + `X-Forwarded-Host` (automatic), `images.realmHostMappings` | No |
|
|
14
|
+
| One domain, many environments | `runtime.ssrParameters.envBasePath` | Yes, pushed with `pnpm push` |
|
|
15
|
+
| Share cookies across subdomains | `app.cookies.domain` / per-site override + Business Manager | No |
|
|
16
|
+
|
|
17
|
+
## Sites and locales
|
|
18
|
+
|
|
19
|
+
Sites are defined in `config.server.ts` under `app.commerce.sites` and selected with `app.defaultSiteId`. Override from the environment:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
PUBLIC__app__defaultSiteId=MySite
|
|
23
|
+
PUBLIC__app__commerce__sites='[{"id":"MySite","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"},{"id":"de-DE","preferredCurrency":"EUR"}],"supportedCurrencies":["USD","EUR"]}]'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- Each `supportedLocales` entry needs matching translation files under `src/locales/<locale>/` and to be listed in `app.i18n.supportedLngs`, otherwise the locale selector hides it. The currency switcher only shows when the site has more than one supported currency (`storefront-next:sfnext-i18n`).
|
|
27
|
+
- `commerce.sitesFromDal` is **on by default**: live site data from the MRT Data Store replaces the static `commerce.sites` for site/locale/currency resolution. If the Data Store is unavailable, or the default site is missing from it, the static list is used. Opt out with `PUBLIC__app__commerce__sitesFromDal=false`. URL aliases always come from `siteAliasMap` / `localeAliasMap`, never from the Data Store.
|
|
28
|
+
- There is no `siteId` under `commerce.api`; the site is a per-request parameter that `createApiClients(context)` adds to every SCAPI call.
|
|
29
|
+
|
|
30
|
+
### Reading the current site
|
|
31
|
+
|
|
32
|
+
The site is resolved per request by the site-context middleware from the URL, cookie, or header.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Component
|
|
36
|
+
import { useSite } from '@salesforce/storefront-next-runtime/site-context';
|
|
37
|
+
const { site, language, currency } = useSite(); // throws outside SiteProvider (mounted in root.tsx)
|
|
38
|
+
|
|
39
|
+
// Loader / action / middleware
|
|
40
|
+
import { siteContext } from '@salesforce/storefront-next-runtime/site-context';
|
|
41
|
+
const siteId = context.get(siteContext)?.site?.id;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Never use `config.commerce.sites[0]` as "the current site".
|
|
45
|
+
|
|
46
|
+
## URL shape (`app.url`)
|
|
47
|
+
|
|
48
|
+
Default in the template:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
url: {
|
|
52
|
+
prefix: '/:siteId/:localeId',
|
|
53
|
+
excludeRoutes: ['/resource/**', '/action/**'],
|
|
54
|
+
},
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Pages then live at `/global/en-GB/product/...`; bare `/` is redirected to the default site/locale by the home route loader. `prefix` and `search` accept `:siteId` and `:localeId`; alternatives (locale only, site in path with `?lng=`, everything in query params) are in README-MULTI-SITE "URL Config Use Cases".
|
|
58
|
+
|
|
59
|
+
Rules:
|
|
60
|
+
|
|
61
|
+
- `url.prefix`, `url.excludeRoutes`, `url.seoRoutes` are **protected**: compiled into routes at build time. Edit `config.server.ts`, rebuild, redeploy. Setting `PUBLIC__app__url__...` throws.
|
|
62
|
+
- If you change the prefix order or drop site/locale from the path, update `app.siteDetectionConfig` / `app.localeDetectionConfig` (`order`, `lookupFromPathIndex`, `lookupQuerystring`, `lookupHeader`) so detection reads back what `buildUrl` writes. Locale query param key must stay `lng`; the default site query key is `site`.
|
|
63
|
+
- Detection defaults: site order `path, querystring, cookie, header` (header `X-Site-Id`, cookie `site_id`); locale order `path, querystring, cookie, header` (cookie `lng`).
|
|
64
|
+
|
|
65
|
+
### Aliases
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
siteAliasMap: { RefArchGlobal: 'global', RefArch: 'us' }, // app.siteAliasMap
|
|
69
|
+
localeAliasMap: { 'en-US': 'us' }, // app.localeAliasMap
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Optional. Without them raw IDs appear in URLs. Changing an alias changes public URLs; plan redirects.
|
|
73
|
+
|
|
74
|
+
### Building URLs correctly
|
|
75
|
+
|
|
76
|
+
| Where | Use |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| JSX links | `Link` / `NavLink` from `@/components/link` |
|
|
79
|
+
| Imperative navigation | `useNavigate` from `@/hooks/use-navigate` |
|
|
80
|
+
| Loader/action redirects | `redirect(buildUrlFromContext('/login', context))` from `@/lib/url.server` |
|
|
81
|
+
| `<Form action>` | Prefix manually with `buildUrl` from `@salesforce/storefront-next-runtime/site-context` + `useCurrentSiteAndLocaleRef` (`@/hooks/use-current-site-and-locale-ref`); React Router `<Form>` does not prefix |
|
|
82
|
+
| Typed route patterns | `routeHref` from `@/route-paths` |
|
|
83
|
+
|
|
84
|
+
Importing `Link`/`useNavigate` from `react-router` produces unprefixed URLs that 404.
|
|
85
|
+
|
|
86
|
+
### SEO routes (`url.seoRoutes`)
|
|
87
|
+
|
|
88
|
+
Replicate Business Manager product/category URL prefixes into the route table, keyed by Commerce site ID:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
url: {
|
|
92
|
+
prefix: '/:siteId/:localeId',
|
|
93
|
+
excludeRoutes: ['/resource/**', '/action/**'],
|
|
94
|
+
seoRoutes: {
|
|
95
|
+
RefArchGlobal: { product: { prefix: 'p' }, category: { prefix: 'c', mode: 'id-suffix' } },
|
|
96
|
+
RefArch: { product: { prefix: 'product' }, category: { prefix: 'category', mode: 'id-suffix' } },
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- Every active site needs an entry, or the build fails for the omitted ones.
|
|
102
|
+
- Category `mode`: `id-suffix` (deterministic, ID in last segment) or `slug-path` (needs Shopper Products 1.13 and Shopper Search 1.15 on the instance).
|
|
103
|
+
- Prefixes are single static segments; invalid, reserved, duplicate, or colliding prefixes fail the build. The canonical product/category route modules must be leaf routes.
|
|
104
|
+
- Build links with `createProductUrl` / `createCategoryUrl*` and `useSeoUrlContext()` rather than hand-built paths. Mapping from Business Manager is manual and one-directional.
|
|
105
|
+
- Legacy or unmatched URLs can resolve via the Shopper SEO URL mapping fallback (`app.seoFallback.sites`). Read `docs/migrations/seo-url-rules/README.md` before enabling (redirect loops, indexed URLs).
|
|
106
|
+
|
|
107
|
+
## Multiple domains, one environment
|
|
108
|
+
|
|
109
|
+
One MRT environment can serve many domains. The public origin is taken per request from `X-Forwarded-Host` / `X-Forwarded-Proto`, so links, SLAS `redirect_uri`, magic-link emails, canonical/hreflang tags, and JSON-LD use the domain the shopper used. Nothing to configure in the storefront except:
|
|
110
|
+
|
|
111
|
+
- Attach each domain as an external hostname on the MRT environment and add each domain's callback URLs to the SLAS client's redirect list.
|
|
112
|
+
- `EXTERNAL_DOMAIN_NAME` is only a fallback when no forwarded host exists (startup, local dev); leave the default.
|
|
113
|
+
- `images.realmHostMappings` (`[{ hostSuffix, realm }]`) so DIS resolves the realm on custom domains.
|
|
114
|
+
- To map each domain to a different site, have the CDN set `X-Site-Id` per domain and configure `url.prefix: '/:localeId'`, `siteDetectionConfig: { order: ['header','cookie'], lookupHeader: 'X-Site-Id' }`, `localeDetectionConfig: { lookupFromPathIndex: 0 }`. If the edge cannot inject headers, keep the site in the URL path.
|
|
115
|
+
- Keep cookies host-only across unrelated brand domains.
|
|
116
|
+
|
|
117
|
+
## Base path (one domain, many environments)
|
|
118
|
+
|
|
119
|
+
`runtime.ssrParameters.envBasePath: '/storefront-a'` in `config.server.ts` serves one environment under a path segment (single segment, `/` + up to 63 URL-safe chars). The value is sent to MRT during `pnpm push`; the CDN routes by that first segment and MRT does not strip it. Routes, bundle asset URLs, and React Router `basename` adapt automatically, and site/locale path detection skips the base path.
|
|
120
|
+
|
|
121
|
+
Caveats: raw `fetch()` / `sendBeacon()` from client code must prepend `getBasePath()` from `@/lib/utils`; `redirect()` in middleware is not auto-prefixed; `request.url` still includes the base path; fixed Express routes (e.g. health check) are served without it. Locally `pnpm dev` / `pnpm start` read it from `config.server.ts` and redirect unprefixed requests.
|
|
122
|
+
|
|
123
|
+
## Cookie domain
|
|
124
|
+
|
|
125
|
+
Cookies are host-only by default. To share a session across subdomains (or with SFRA in a hybrid setup):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
PUBLIC__app__cookies__domain=.example.com # global default
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Per-site override: `commerce.sites[].cookies.domain` (wins over the global value). The domain applies to every cookie the storefront writes (auth/session and site-context). It must be a parent of the serving host or browsers silently drop the cookies. Do **not** set `app.siteContext.cookieOptions.domain` (ignored).
|
|
132
|
+
|
|
133
|
+
Business Manager must agree: **Merchant Tools > Site Preferences > Hybrid Auth Settings** cookie-domain level `0` (host only) when unset, `2` (first-level parent domain) when set. Level `1` is rejected. A mismatch breaks cross-subdomain sessions or creates duplicate cookies. Verify with `curl -sI https://www.example.com/ | grep -i set-cookie` (same `Domain=` on every cookie, no duplicates). See `storefront-next:sfnext-hybrid-storefronts` for the hybrid side.
|
|
134
|
+
|
|
135
|
+
## Switchers
|
|
136
|
+
|
|
137
|
+
Site, locale, and currency switchers post to `/action/set-site-context` (which sets `site_id`, `lng`, and the currency cookie and redirects). Currency resolution order: cookie, then the locale's `preferredCurrency`, then the site's `defaultCurrency`.
|