@salesforce/b2c-dx-mcp 3.2.1 → 3.4.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 +54 -25
- 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/SKILL.md +2 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/SKILL.md +9 -3
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +1 -1
- package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +35 -6
- 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 +6 -2
- 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-edge-traffic-triage/SKILL.md +69 -0
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +13 -8
- 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 +5 -4
- package/content/guidance/index.json +981 -259
- 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/b2c-mcp-scapi/SKILL.md +98 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/authentication.md +34 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/compose-verify.md +25 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/confirmation.md +30 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/discover.md +94 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/jobs.md +72 -0
- package/content/guidance/mcp/b2c-mcp-scapi/references/workflows.md +28 -0
- package/content/guidance/mcp/{server → b2c-mcp-server}/SKILL.md +52 -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/docs/docs-read.js +4 -2
- package/dist/tools/docs/docs-search.js +10 -8
- package/dist/tools/docs/topics.d.ts +5 -0
- package/dist/tools/docs/topics.js +5 -0
- 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 +106 -81
- package/dist/tools/scapi/scapi-schemas-list.js +93 -56
- package/dist/utils/types.d.ts +6 -0
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +32 -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 +54 -25
- 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/SKILL.md +2 -0
- 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/SKILL.md +9 -3
- 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-job/references/RUN-AND-MONITOR.md +35 -6
- 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 +6 -2
- 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 +4 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/README.md +1 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +4 -3
- 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-edge-traffic-triage/SKILL.md +69 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/skills/b2c-job-health/SKILL.md +13 -8
- 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 +5 -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 +4 -4
- package/content/guidance/mcp/scapi/SKILL.md +0 -203
- package/content/guidance/mcp/scapi/references/jobs.md +0 -30
- 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/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,141 +1,127 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sfnext-deployment
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Build and deploy a Storefront Next storefront: `pnpm build`, `pnpm push` / `sfnext push` to Managed Runtime (MRT),
|
|
5
|
+
MRT credentials (MRT_API_KEY, MRT_PROJECT, MRT_TARGET), syncing env vars with `pnpm config:push-env`, deploying
|
|
6
|
+
the base cartridge and Page Designer metadata (`pnpm cartridge:generate|validate|deploy`), the shipped GitHub
|
|
7
|
+
Actions deploy workflow, bundle size checks, the pre-launch checklist, and upgrading a project (template vs SDK
|
|
8
|
+
compatibility, react-router pin). Use when a push fails or is rejected, a deployed site returns 500 or shows
|
|
9
|
+
stale Page Designer components, "deploy to staging/production", or before go-live.
|
|
10
|
+
Do not use for generic MRT project/environment/redirect/member management or log tailing (use `b2c-cli:b2c-mrt`),
|
|
11
|
+
for config.server.ts and PUBLIC__ variable rules (use `storefront-next:sfnext-configuration`), or for creating
|
|
12
|
+
the project (use `storefront-next:sfnext-project-setup`).
|
|
4
13
|
---
|
|
5
14
|
|
|
6
|
-
# Deployment
|
|
15
|
+
# Storefront Next Deployment
|
|
7
16
|
|
|
8
|
-
|
|
17
|
+
A storefront ships as two independent deployments:
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
| Deployment | Target | Command |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| App bundle (SSR server + client assets) | Managed Runtime | `pnpm build` then `pnpm push` |
|
|
22
|
+
| Base cartridge (Page Designer metadata, notification Custom API) | B2C Commerce instance (WebDAV code version) | `pnpm cartridge:deploy` |
|
|
11
23
|
|
|
12
|
-
|
|
24
|
+
If Business Manager Storefront Setup created your project, reuse its MRT project, environments, and SLAS client. Guides: [deployment](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-push-mrt-auto.html), [launch](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-launch-storefront.html).
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
storefront setup. Follow the [deployment guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-push-mrt-auto.html)
|
|
16
|
-
for source deployments and the [launch guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-launch-storefront.html)
|
|
17
|
-
for staging/production rollout. Creating new SLAS clients or MRT resources is not
|
|
18
|
-
a prerequisite to each deployment.
|
|
19
|
-
|
|
20
|
-
## Production Build
|
|
26
|
+
## Build
|
|
21
27
|
|
|
22
28
|
```bash
|
|
23
|
-
#
|
|
24
|
-
pnpm build
|
|
25
|
-
|
|
26
|
-
# The build output goes to build/ directory
|
|
29
|
+
pnpm build # extension locales + config aggregation, cartridge:generate, react-router build -> build/
|
|
30
|
+
pnpm start # preview the production build at http://localhost:3000
|
|
31
|
+
pnpm bundlesize # build with bundle size limits enforced
|
|
27
32
|
```
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- Compiles TypeScript to JavaScript
|
|
32
|
-
- Bundles client and server code separately
|
|
33
|
-
- Optimizes and minifies assets
|
|
34
|
-
- Generates the static Page Designer registry
|
|
34
|
+
Run `pnpm typecheck`, `pnpm lint`, and `pnpm test` before pushing. Node 24 is required locally and on MRT (`runtime.ssrParameters.ssrFunctionNodeVersion: '24.x'`).
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Push to Managed Runtime
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Use the project's `push` script (`sfnext push --project-directory .`). Build first;
|
|
41
|
-
the push command requires existing build output. With the template's pnpm setup:
|
|
38
|
+
`push` does **not** build; it fails if `build/` is missing.
|
|
42
39
|
|
|
43
40
|
```bash
|
|
44
|
-
#
|
|
45
|
-
pnpm
|
|
46
|
-
|
|
47
|
-
# Push with a specific message
|
|
48
|
-
pnpm run push --message "Release v1.2.0"
|
|
49
|
-
|
|
50
|
-
# Push to a specific environment
|
|
51
|
-
pnpm run push --environment staging --wait
|
|
41
|
+
pnpm build && pnpm push # upload only (not deployed to an env unless a target is set)
|
|
42
|
+
pnpm push -- -m "Release 42" -e staging --wait # deploy to an env and wait
|
|
52
43
|
```
|
|
53
44
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
| Need | Provide |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| Credentials | `MRT_API_KEY` (or `--api-key`, `--credentials-file`, `~/.mobify`); `MRT_CLOUD_ORIGIN` for a non-default MRT origin |
|
|
48
|
+
| Project slug | `MRT_PROJECT` / `-p` / `SFCC_MRT_PROJECT` / dw.json `mrtProject` (set it explicitly; push errors without one) |
|
|
49
|
+
| Target env | `MRT_TARGET` / `-e`. Required with `--wait`. Without it the bundle uploads but is not deployed |
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
Put `MRT_PROJECT` and `MRT_TARGET` in `.env` for local pushes. Store `MRT_API_KEY` in your shell or CI secret store, not in committed files. Flags and other commands: `storefront-next:sfnext-project-setup` `references/SFNEXT-CLI.md`. Inspect without deploying: `pnpm sfnext create-bundle -d . -o .bundle`.
|
|
61
52
|
|
|
62
|
-
|
|
53
|
+
Bundle history, rolling back to an earlier bundle, and environment management are generic MRT tasks: `b2c mrt bundle history|list|deploy`, see `b2c-cli:b2c-mrt`. Live logs: MCP `mrt_logs_watch` / `mrt_logs_watch_poll`, or `b2c mrt tail-logs`. MCP `mrt_bundle_push` can also push a bundle.
|
|
63
54
|
|
|
64
|
-
Environment variables
|
|
55
|
+
## Environment variables on MRT
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
2. **CLI flags or `MRT_*` environment variables** — Control push/deploy targets
|
|
68
|
-
3. **`.env` files** — Local development only (not deployed)
|
|
69
|
-
|
|
70
|
-
Use `b2c mrt env var push --file .env.staging --project <project> --environment <environment>`
|
|
71
|
-
to explicitly apply a reviewed file. It shows a diff and prompts; omit local-only
|
|
72
|
-
values and use credentials for the target instance. See [Environment Variables](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html)
|
|
73
|
-
for visibility, naming, and limits. MRT variable management uses the B2C CLI. For live logs, prefer MCP
|
|
74
|
-
`mrt_logs_watch` / `mrt_logs_watch_poll`; CLI alternative: `b2c mrt tail-logs`.
|
|
75
|
-
|
|
76
|
-
### MRT Deployment Variables
|
|
57
|
+
`.env` is **not** uploaded by `push`. Set runtime config on the MRT environment:
|
|
77
58
|
|
|
78
59
|
```bash
|
|
79
|
-
#
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
MRT_TARGET=development
|
|
60
|
+
pnpm config:push-env # b2c mrt env var push: reads .env, shows a diff, asks to confirm
|
|
61
|
+
b2c mrt env var push -f .env.staging -p my-project -e staging --yes # explicit file, skips prompt
|
|
62
|
+
b2c mrt env var set PUBLIC__app__defaultSiteId=MySite -p my-project -e staging
|
|
63
|
+
pnpm sfnext config inspect --project my-project --environment staging # see what is applied
|
|
84
64
|
```
|
|
85
65
|
|
|
86
|
-
|
|
66
|
+
`push` excludes `MRT_`-prefixed keys by default. Review the file first: `PUBLIC__` values are browser-visible, and local-only values should not be pushed. Variable naming and limits: Salesforce's [environment variables guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html). Rules for what to set: `storefront-next:sfnext-configuration`.
|
|
67
|
+
|
|
68
|
+
## Cartridge deployment
|
|
87
69
|
|
|
88
70
|
```bash
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
71
|
+
pnpm cartridge:generate # Page Designer metadata from decorators (also run by pnpm build)
|
|
72
|
+
pnpm cartridge:validate # validate generated JSON
|
|
73
|
+
pnpm cartridge:deploy # upload cartridges/ to the instance
|
|
74
|
+
pnpm cartridge:deploy -- --delete --reload # wipe old files first, then activate the code version
|
|
92
75
|
```
|
|
93
76
|
|
|
94
|
-
|
|
77
|
+
- Deployment is **not** part of `pnpm push` and is manual by default.
|
|
78
|
+
- Needs an instance (`-s/--server` or `SFCC_SERVER`), WebDAV credentials, and either `--code-version` or OAuth credentials to discover the active version (`--reload` also needs OAuth with OCAPI `code_versions` access). Settings resolve from flags, env, or `dw.json`; see `b2c-cli:b2c-code` for the shared auth model.
|
|
79
|
+
- Redeploy whenever Page Designer decorators or attribute definitions change; stale components in Business Manager mean the cartridge is behind.
|
|
80
|
+
- The base cartridge also hosts the notification Custom API used by passwordless login, password reset, OTP, and guest order lookup emails. Once per client, register its SLAS scope with `sfnext setup-base-cartridge --slas-client-id <id>` (`docs/README-EMAIL-CARTRIDGE.md`).
|
|
95
81
|
|
|
96
|
-
|
|
82
|
+
## CI/CD
|
|
97
83
|
|
|
98
|
-
|
|
99
|
-
# Generate cartridge metadata
|
|
100
|
-
pnpm generate:cartridge
|
|
101
|
-
|
|
102
|
-
# Deploy cartridge to B2C instance
|
|
103
|
-
pnpm deploy:cartridge
|
|
84
|
+
The project ships `.github/workflows/deploy.yml`: on push to the `latest` branch (or manual dispatch) it builds, runs `pnpm push --wait` (needs secret `MRT_API_KEY`, variables `MRT_PROJECT`, `MRT_TARGET`), and deploys cartridges with the b2c `code-deploy` action (needs `SFCC_SERVER`, `SFCC_CLIENT_ID`, secret `SFCC_CLIENT_SECRET`). Each job skips cleanly when its configuration is absent. Read the file before changing branch names or environments.
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
pnpm deploy:cartridge:clean
|
|
107
|
-
|
|
108
|
-
# Validate cartridge structure
|
|
109
|
-
pnpm validate:cartridge
|
|
110
|
-
```
|
|
86
|
+
## Pre-launch checklist
|
|
111
87
|
|
|
112
|
-
|
|
88
|
+
1. `pnpm typecheck && pnpm lint && pnpm test` pass; `pnpm bundlesize` within limits.
|
|
89
|
+
2. MRT variables set on the target env: your own client ID, organization ID, short code, site(s); `pnpm config:inspect` shows no unintended demo values.
|
|
90
|
+
3. Demo analytics IDs/hosts in `app.engagement.adapters` replaced or disabled.
|
|
91
|
+
4. `images.host` switched from the DIS staging host to production; `realmHostMappings` for custom domains.
|
|
92
|
+
5. Cartridge deployed and code version activated; SLAS scopes registered; Page Designer pages publish and render.
|
|
93
|
+
6. SLAS redirect URIs include every production domain; cookie domain and Business Manager Hybrid Auth level agree if used (`references/MRT-DEPLOYMENT.md`).
|
|
94
|
+
7. `url.seoRoutes` has an entry per active site if enabled (protected: needs a rebuild).
|
|
95
|
+
8. Security headers/CSP and Turnstile reviewed (`storefront-next:sfnext-security`); robots and sitemap handled (`storefront-next:sfnext-seo`).
|
|
96
|
+
9. Smoke test after deploy: home, PLP, PDP, cart, login, checkout, and a Page Designer page.
|
|
113
97
|
|
|
114
|
-
##
|
|
98
|
+
## Upgrading a project
|
|
115
99
|
|
|
116
|
-
|
|
117
|
-
2. **Check bundle size** — `pnpm bundlesize:test`
|
|
118
|
-
3. **Verify environment variables** — All required vars set in target environment
|
|
119
|
-
4. **Build successfully** — `pnpm build` completes without errors
|
|
120
|
-
5. **Verify SCAPI credentials** — Client ID and org ID match the target environment
|
|
100
|
+
Your project records `storefrontNext.templateRelease`, `templateVersion`, and `minSdkVersion` in `package.json`; `docs/COMPATIBILITY.md` maps template releases to the SDK (`@salesforce/storefront-next-dev` / `-runtime`) versions they need. Follow the step-by-step guides in `docs/migrations/` (for example `react-router-7.18`: pin `react-router` and every `@react-router/*` package to exactly `7.18.2`, and `seo-url-rules`). Upgrade SDK packages, run `pnpm install`, `pnpm typecheck`, and tests, then redeploy.
|
|
121
101
|
|
|
122
102
|
## Troubleshooting
|
|
123
103
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
| Build
|
|
127
|
-
| Push
|
|
128
|
-
|
|
|
129
|
-
|
|
|
104
|
+
| Symptom | Cause / fix |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `Build directory ... does not exist` | Run `pnpm build` before `pnpm push` |
|
|
107
|
+
| Push: project slug required | Set `MRT_PROJECT` (or `-p`) |
|
|
108
|
+
| Push: credentials required / 401 | `MRT_API_KEY` missing or for a different MRT user; check `--credentials-file` |
|
|
109
|
+
| `--wait` error about environment | Add `-e <env>` or `MRT_TARGET` |
|
|
110
|
+
| 500 after deploy | Required `PUBLIC__` variables missing on that MRT environment; `pnpm sfnext config inspect --environment <env>`; tail logs (`b2c-cli:b2c-mrt`) |
|
|
111
|
+
| Env var "not applied" on MRT | Key not in `config.server.ts` (ignored with a warning) or a protected path; see `storefront-next:sfnext-configuration` |
|
|
112
|
+
| Stale Page Designer components | Cartridge not regenerated/deployed or code version not activated |
|
|
113
|
+
| Build fails on client chunk importing server config | `server-config.ts` imported from client code |
|
|
130
114
|
|
|
131
115
|
## Related Skills
|
|
132
116
|
|
|
133
|
-
- `storefront-next:sfnext-project-setup` -
|
|
134
|
-
- `storefront-next:sfnext-configuration` -
|
|
135
|
-
- `storefront-next:sfnext-page-designer` -
|
|
136
|
-
- `storefront-next:sfnext-performance` - Bundle size
|
|
137
|
-
- `
|
|
117
|
+
- `storefront-next:sfnext-project-setup` - Scripts, CLI reference, first run
|
|
118
|
+
- `storefront-next:sfnext-configuration` - Config and env var rules, multi-site/base path/cookie domain
|
|
119
|
+
- `storefront-next:sfnext-page-designer` - Decorators and cartridge metadata
|
|
120
|
+
- `storefront-next:sfnext-performance` - Bundle size and Lighthouse
|
|
121
|
+
- `storefront-next:sfnext-quality-gates` - Pre-push lint/type/test gates
|
|
122
|
+
- `b2c-cli:b2c-mrt` - MRT projects, environments, bundles, env vars, redirects, logs
|
|
123
|
+
- `b2c-cli:b2c-code` - Code version and cartridge deploy with the b2c CLI
|
|
138
124
|
|
|
139
|
-
##
|
|
125
|
+
## Finding more
|
|
140
126
|
|
|
141
|
-
-
|
|
127
|
+
Project `docs/README-BASE-PATH.md`, `README-MULTI-DOMAIN.md`, `README-COOKIE-DOMAIN.md`, `README-EMAIL-CARTRIDGE.md`, `docs/migrations/`; `b2c docs search "<topic>" --category sfnext`.
|
|
@@ -1,90 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Managed Runtime Deployment Reference
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## What MRT provides
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Server-side rendering on Node 24, a CDN in front of the SSR function and static bundle assets, separate environments (for example development, staging, production), and versioned bundles that can be re-deployed. Project, environment, member, redirect, and certificate management is done with `b2c mrt ...` (`b2c-cli:b2c-mrt`) or Runtime Admin.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **CDN** — Global content delivery for static assets
|
|
9
|
-
- **Environment management** — Separate environments for development, staging, production
|
|
10
|
-
- **Bundle management** — Versioned deployments with rollback capability
|
|
7
|
+
## Push flow
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
pnpm run build && pnpm run push
|
|
17
|
-
|
|
18
|
-
# Push with deployment message
|
|
19
|
-
pnpm run push --message "Fix checkout flow"
|
|
20
|
-
|
|
21
|
-
# Push to specific environment
|
|
22
|
-
pnpm run push --environment production --wait
|
|
23
|
-
|
|
24
|
-
# Create a bundle without deploying (inspection/custom pipelines)
|
|
25
|
-
pnpm sfnext create-bundle -d . -o .bundle
|
|
9
|
+
```
|
|
10
|
+
pnpm build -> build/
|
|
11
|
+
pnpm push -> sfnext push: creates a bundle from build/, uploads it to the project
|
|
12
|
+
-> with a target env (MRT_TARGET / -e): deploys it; with --wait: blocks until done
|
|
26
13
|
```
|
|
27
14
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Setting Variables
|
|
31
|
-
|
|
32
|
-
Environment variables are set per-environment through:
|
|
15
|
+
Precedence for project and environment: CLI flag, then `MRT_PROJECT` / `MRT_TARGET`, then `SFCC_MRT_PROJECT` / `SFCC_MRT_ENVIRONMENT`, then `dw.json` (`mrtProject`, `mrtEnvironment`). Credentials: `--api-key` / `MRT_API_KEY`, or `--credentials-file` / `MRT_CREDENTIALS_FILE`, or `~/.mobify`.
|
|
33
16
|
|
|
34
|
-
|
|
35
|
-
2. **`MRT_PROJECT`, `MRT_TARGET`, `MRT_API_KEY`** — Deployment target and credentials for `pnpm sfnext push`; these do not upload application variables from `.env`.
|
|
17
|
+
Send extra flags through pnpm with `--`: `pnpm push -- --wait -e production`.
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
## What push sends to MRT
|
|
38
20
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
not only `PUBLIC__` values. Public configuration paths must exist in `config.server.ts`.
|
|
21
|
+
- The bundle (server build + client assets).
|
|
22
|
+
- SSR parameters from `config.server.ts` `runtime.ssrParameters` (`ssrFunctionNodeVersion`, `envBasePath`) and `runtime.ssrOnly` / `ssrShared`.
|
|
42
23
|
|
|
43
|
-
|
|
24
|
+
It does not send `.env` values or cartridges.
|
|
44
25
|
|
|
45
|
-
|
|
46
|
-
# Commerce API credentials
|
|
47
|
-
PUBLIC__app__commerce__api__clientId=prod-client-id
|
|
48
|
-
PUBLIC__app__commerce__api__organizationId=f_ecom_abcd_001
|
|
49
|
-
PUBLIC__app__commerce__api__siteId=RefArchGlobal
|
|
50
|
-
PUBLIC__app__commerce__api__shortCode=kv7kzm78
|
|
51
|
-
|
|
52
|
-
# Site configuration
|
|
53
|
-
PUBLIC__app__defaultSiteId=RefArchGlobal
|
|
54
|
-
PUBLIC__app__commerce__sites='[{"id":"RefArchGlobal","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"},{"id":"de-DE","preferredCurrency":"EUR"}],"supportedCurrencies":["USD","EUR"]}]'
|
|
55
|
-
|
|
56
|
-
# Server-only secrets (not exposed to client)
|
|
57
|
-
COMMERCE_API_SLAS_SECRET=production-slas-secret
|
|
58
|
-
```
|
|
26
|
+
## Environment variables
|
|
59
27
|
|
|
60
|
-
|
|
28
|
+
Set per environment in Runtime Admin or with the b2c CLI (`pnpm config:push-env`, `b2c mrt env var set|push|list|delete`). Changes to variables apply to that environment; confirm the behavior in Runtime Admin for your project. Server-only secrets (`COMMERCE_API_SLAS_SECRET` for private clients, `GUEST_ORDER_LOOKUP_COOKIE_SECRET`, `MARKETING_CLOUD_*`) go in unprefixed. `PUBLIC__` variables are merged into config and visible in the browser. Limits: see Salesforce's [constraints](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-environment-vars.html#constraints).
|
|
61
29
|
|
|
62
|
-
|
|
30
|
+
Example of per-environment application variables (values are yours):
|
|
63
31
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
32
|
+
```bash
|
|
33
|
+
PUBLIC__app__commerce__api__clientId=<slas-client-id>
|
|
34
|
+
PUBLIC__app__commerce__api__organizationId=f_ecom_<realm>_<instance>
|
|
35
|
+
PUBLIC__app__commerce__api__shortCode=<short-code>
|
|
36
|
+
PUBLIC__app__defaultSiteId=<site-id>
|
|
37
|
+
PUBLIC__app__commerce__sites='[{"id":"<site-id>","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"}],"supportedCurrencies":["USD"]}]'
|
|
68
38
|
```
|
|
69
39
|
|
|
70
|
-
|
|
40
|
+
## Domains, base path, cookies
|
|
71
41
|
|
|
72
|
-
|
|
42
|
+
- Many domains on one environment: register each as an external hostname in Runtime Admin, add SLAS redirect URIs per domain, configure `images.realmHostMappings`. The public origin is resolved per request from `X-Forwarded-Host`.
|
|
43
|
+
- Several storefronts under one domain: give each environment a distinct `runtime.ssrParameters.envBasePath` (`/shop-a`); the CDN routes on the first path segment; the value reaches MRT via `pnpm push`.
|
|
44
|
+
- Shared cookies across subdomains: `app.cookies.domain` plus Business Manager Hybrid Auth cookie-domain level `2`.
|
|
73
45
|
|
|
74
|
-
|
|
46
|
+
Details: `storefront-next:sfnext-configuration` `references/MULTI-SITE-URLS.md`. If the domain is also fronted by eCDN, manage zones and rules with `b2c-cli:b2c-ecdn`.
|
|
75
47
|
|
|
76
|
-
|
|
77
|
-
| ----------- | ------------------------- | --------------------- |
|
|
78
|
-
| Development | Feature testing | From feature branches |
|
|
79
|
-
| Staging | Pre-production validation | From main branch |
|
|
80
|
-
| Production | Live storefront | Manual promotion |
|
|
48
|
+
## Rollback
|
|
81
49
|
|
|
82
|
-
|
|
50
|
+
Each push creates a bundle. To return to an earlier version, list bundles and deploy one to the environment: `b2c mrt bundle history -p <project> -e <env>` and `b2c mrt bundle deploy <bundleId> -p <project> -e <env>`. Cartridge changes roll back separately by activating a previous code version (`b2c-cli:b2c-code`).
|
|
83
51
|
|
|
84
|
-
|
|
52
|
+
## Verifying a deployment
|
|
85
53
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
89
|
-
4.
|
|
90
|
-
5.
|
|
54
|
+
1. Home, category, product, cart, and checkout pages render.
|
|
55
|
+
2. Products and prices load (SCAPI connectivity, correct site).
|
|
56
|
+
3. Login/logout, including social or passwordless if enabled.
|
|
57
|
+
4. A Page Designer page renders and the cartridge/code version is current.
|
|
58
|
+
5. Response headers (CSP) and cookies have the expected `Domain` (`curl -sI`).
|
|
59
|
+
6. Logs show no repeated `[Config Warning]` lines about ignored variables.
|
|
@@ -1,142 +1,118 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sfnext-extensions
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Add or remove modular features in a Storefront Next project with the extension system: src/extensions/<name>/ folders, target-config.json (UITarget components, contextProviders, actionHooks), sfcc.-prefixed UITarget ids, extension routes, per-extension config.ts and locales, SFDC_EXT_ integration markers, the `sfnext extensions create|install|remove|list` commands, and the agent-driven instructions/*.mdc install flow. Use when inserting a component into a UITarget slot (for example sfcc.header.before.cart or sfcc.pdp.bnpl.message), adding a checkout action hook, installing or removing store locator, BOPIS, multiship or a demo extension, listing extension points with pnpm extensions:list, or deciding whether to extend, restyle, or edit the base at all. Do not use for styling or brand changes (use `storefront-next:sfnext-theming`), for new merchant-editable Page Designer blocks (use `storefront-next:sfnext-page-designer`), or for analytics/engagement adapters (use `storefront-next:sfnext-analytics-consent`).
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Extensions
|
|
7
|
+
# Storefront Next Extensions
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
An extension is a self-contained folder under `src/extensions/<name>/` that adds UI, routes, providers, translations, config and server hooks to the storefront without rewriting base files. The base declares named slots (`<UITarget targetId="..." />`); an extension's `target-config.json` says which of its components fill which slot.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Your project ships with several extensions already (store locator, BOPIS, multiship, and demo extensions such as BNPL and ratings and reviews). Look at them before building: they are the reference implementations. See [Extension Examples](references/EXTENSION-EXAMPLES.md).
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
## Decision gate: should this be an extension?
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Run this before writing code; the full walkthrough is in [Base Audit](references/BASE-AUDIT.md).
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
1. Trace the route in `src/routes/` down to the place you want to change. Does the base already render equivalent content there?
|
|
18
|
+
2. Already rendered: restyle it (tokens or a component variant, see `storefront-next:sfnext-theming`) or fill an existing slot; do not add a parallel copy.
|
|
19
|
+
3. Not rendered and a slot exists: write an extension.
|
|
20
|
+
4. Not rendered and no slot fits: edit the base route or component directly (you own the whole project) and, if it is a reusable seam, add a `<UITarget>` there so later extensions can plug in.
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
Discover what already exists:
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
Is the change purely visual (color, font, spacing)?
|
|
28
|
-
└─ YES → Token / CVA change (brand.css or a component variant). No extension needed.
|
|
29
|
-
└─ NO → Is the new structure needed by only one storefront/vertical?
|
|
30
|
-
└─ YES → Extension at a UITarget slot (this skill). Never edit core.
|
|
31
|
-
└─ NO → It's a shared pattern — add a slot/render-prop to the BASE
|
|
32
|
-
component instead, and let each consumer fill it.
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
**Rule of thumb:** extensions *add what is missing*; they never recreate what already exists. When in doubt, prefer a UITarget slot or a token override over a new component.
|
|
36
|
-
|
|
37
|
-
See [Base Audit Reference](references/BASE-AUDIT.md) for worked examples of the gate.
|
|
24
|
+
```bash
|
|
25
|
+
pnpm extensions:list # all UITarget ids and server action hook ids (add --json for tooling)
|
|
26
|
+
sfnext extensions list # installed extensions
|
|
27
|
+
rg "UITarget" src/ # where a slot is rendered
|
|
28
|
+
```
|
|
38
29
|
|
|
39
|
-
##
|
|
30
|
+
## Structure
|
|
40
31
|
|
|
41
32
|
```
|
|
42
33
|
src/extensions/my-extension/
|
|
43
|
-
├── target-config.json
|
|
44
|
-
├── components/
|
|
45
|
-
├── routes/
|
|
46
|
-
├──
|
|
47
|
-
|
|
34
|
+
├── target-config.json # which components/providers/hooks plug in where
|
|
35
|
+
├── components/ # UI, including the components named in target-config.json
|
|
36
|
+
├── routes/ # auto-registered routes (flat-route file naming)
|
|
37
|
+
├── providers/ # context providers (listed in target-config.json)
|
|
38
|
+
├── hooks/ context/ middlewares/ stores/ # as needed
|
|
39
|
+
├── locales/<lang>/translations.json
|
|
40
|
+
├── config.ts # optional client-side defaults
|
|
41
|
+
├── server-config.ts # optional server-only defaults
|
|
42
|
+
└── README.md
|
|
48
43
|
```
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
Create the scaffold with `sfnext extensions create -n "My Extension" -d "What it does"` (adds the folder, a README and an entry in `src/extensions/config.json`). Import across the project with the normal alias: `@/extensions/my-extension/...`. There is no `@extensions` alias.
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
## target-config.json
|
|
53
48
|
|
|
54
49
|
```json
|
|
55
50
|
{
|
|
56
51
|
"components": [
|
|
57
|
-
{
|
|
58
|
-
"targetId": "header.before.cart",
|
|
59
|
-
"path": "extensions/my-extension/components/badge.tsx",
|
|
60
|
-
"order": 0
|
|
61
|
-
}
|
|
52
|
+
{ "targetId": "sfcc.header.before.cart", "path": "extensions/my-extension/components/header/badge.tsx", "order": 0 }
|
|
62
53
|
],
|
|
63
54
|
"contextProviders": [
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
55
|
+
{ "path": "extensions/my-extension/providers/my-provider.tsx", "order": 0 }
|
|
56
|
+
],
|
|
57
|
+
"actionHooks": [
|
|
58
|
+
{ "hookId": "sfcc.checkout.payments.afterSubmitPayment", "handler": "extensions/my-extension/hooks/after-payment.ts", "order": 0 }
|
|
68
59
|
]
|
|
69
60
|
}
|
|
70
61
|
```
|
|
71
62
|
|
|
72
|
-
|
|
63
|
+
- `path` is relative to `src/` and points at a module whose default export is the component (no required props; read context or hooks inside). Multiple components on one slot render in ascending `order`; duplicate orders warn because their order is not deterministic.
|
|
64
|
+
- A slot without children is a replacement slot. A slot that wraps base content (`<UITarget targetId="..."><Base /></UITarget>`) is a wrapper slot: the extension component receives the base content as children.
|
|
65
|
+
- Optional per component: `"enabled": false` to switch it off, and `"hint"` as a label for the dev-mode overlay. A top-level `"devOnly": true` skips the whole file in production builds.
|
|
66
|
+
- Extension components only inject when a `target-config.json` exists in `src/extensions/<name>/`.
|
|
67
|
+
- Every `targetId` must exist as a `<UITarget>` in the source; otherwise the build fails and names the orphan. Ids are namespaced: use the exact `sfcc.`-prefixed ids reported by `pnpm extensions:list` (for example `sfcc.header.before.cart`, `sfcc.pdp.bnpl.message`, `sfcc.pdp.reviews.section`, `sfcc.cart.orderSummary.before`).
|
|
68
|
+
- In `pnpm dev`, UITarget dev mode shows markers so you can see which slots exist and what fills them.
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Extension availability is managed in `src/extensions/config.json`, where each extension is keyed by an `SFDC_EXT_*` marker.
|
|
77
|
-
|
|
78
|
-
## Extension Routes
|
|
79
|
-
|
|
80
|
-
Files in the `routes/` directory auto-register as routes:
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
// src/extensions/my-extension/routes/my-route.tsx
|
|
84
|
-
export function loader() {
|
|
85
|
-
return { message: 'Hello' };
|
|
86
|
-
}
|
|
70
|
+
Server-side hooks (`actionHooks`, checkout steps) have their own semantics: [Action Hooks](references/ACTION-HOOKS.md).
|
|
87
71
|
|
|
88
|
-
|
|
89
|
-
const { message } = useLoaderData();
|
|
90
|
-
return <div>{message}</div>;
|
|
91
|
-
}
|
|
92
|
-
```
|
|
72
|
+
## Routes, translations, config
|
|
93
73
|
|
|
94
|
-
|
|
74
|
+
- **Routes**: any file in `routes/` is merged into the route tree with React Router flat-route naming: `_app.store-locator.tsx` (inside the app layout), `action.set-selected-store.ts` (action), `resource.stores.ts` (resource route). See `src/extensions/store-locator/routes/`.
|
|
75
|
+
- **Translations**: `locales/<lang>/translations.json` is namespaced `ext` + PascalCase folder name (`my-extension` -> `extMyExtension`): `useTranslation('extMyExtension')`. `pnpm dev` and `pnpm build` run `pnpm locales:aggregate-extensions` for you and write `src/extensions/locales/`; that folder is generated, do not edit it.
|
|
76
|
+
- **Client config**: `config.ts` default-exports a plain, JSON-serializable object. It is merged into `config.app.extension.<camelName>` (read with `useConfig()` in components or `getConfig()` on the server) and can be overridden per environment with `PUBLIC__app__extension__<camelName>__<key>`. It is exposed to the browser: never put secrets there.
|
|
77
|
+
- **Server-only config**: `server-config.ts` lands at `config.app.serverExtension.<camelName>`, has no `PUBLIC__` override, is unreachable from client code (the build fails if a client chunk imports it), and is read with `getConfig(context)` in loaders, actions and middleware.
|
|
78
|
+
- `pnpm config:aggregate-extensions` (also run by dev and build) writes `src/extensions/config/`; generated, do not edit. Folder names must be letters, digits and hyphens starting with a letter. See `docs/README-CONFIG.md`.
|
|
95
79
|
|
|
96
|
-
|
|
80
|
+
## Integration markers
|
|
97
81
|
|
|
98
|
-
|
|
99
|
-
src/extensions/my-extension/locales/
|
|
100
|
-
├── en-US/translations.json
|
|
101
|
-
└── it-IT/translations.json
|
|
102
|
-
```
|
|
82
|
+
Extensions that modify base files mark their edits with comments so they can be installed and removed cleanly:
|
|
103
83
|
|
|
104
84
|
```typescript
|
|
105
|
-
|
|
106
|
-
t('welcome');
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Integration Markers
|
|
85
|
+
selectedStoreMiddleware /** @sfdc-extension-line SFDC_EXT_STORE_LOCATOR */,
|
|
110
86
|
|
|
111
|
-
|
|
87
|
+
// @sfdc-extension-block-start SFDC_EXT_STORE_LOCATOR
|
|
88
|
+
import { StoreLocatorProvider } from '@/extensions/store-locator/providers/store-locator';
|
|
89
|
+
// @sfdc-extension-block-end SFDC_EXT_STORE_LOCATOR
|
|
112
90
|
|
|
113
|
-
|
|
114
|
-
// Single line marker
|
|
115
|
-
/** @sfdc-extension-line SFDC_EXT_MY_FEATURE */
|
|
116
|
-
import myFeature from '@extensions/my-feature';
|
|
117
|
-
|
|
118
|
-
// Block marker
|
|
119
|
-
{/* @sfdc-extension-block-start SFDC_EXT_MY_FEATURE */}
|
|
120
|
-
<Link to="/my-feature">My Feature</Link>
|
|
121
|
-
{/* @sfdc-extension-block-end SFDC_EXT_MY_FEATURE */}
|
|
91
|
+
/** @sfdc-extension-file SFDC_EXT_STORE_LOCATOR */ // marks an entire file as belonging to the extension
|
|
122
92
|
```
|
|
123
93
|
|
|
124
|
-
|
|
94
|
+
Use them when the extension needs edits outside its folder (middleware registration, a nav link, a loader) and you want `sfnext extensions remove` to be able to undo them. Each marker name (`SFDC_EXT_*`) is a key in `src/extensions/config.json`. Install, remove and marker details: [CLI and Install](references/CLI-AND-INSTALL.md).
|
|
125
95
|
|
|
126
|
-
##
|
|
96
|
+
## Removing or replacing a demo extension
|
|
127
97
|
|
|
128
|
-
|
|
129
|
-
2. **Use target points** — Insert UI via `target-config.json` rather than editing core files
|
|
130
|
-
3. **Namespace translations** — Auto-namespacing prevents collisions
|
|
131
|
-
4. **Order matters** — Use `order` in `target-config.json` to control rendering order
|
|
98
|
+
BNPL, customer preferences, ratings and reviews, and product content ship with mock fixtures. To integrate a real provider, replace the bodies of their API functions (for example `src/extensions/bnpl/lib/api/bnpl.server.ts`). To drop one, use `sfnext extensions remove -e SFDC_EXT_BNPL`, then run `pnpm locales:aggregate-extensions`. `docs/README-FEATURE-STUBS.md` describes finding stubs with `grep -r "@feature-stub" src/`.
|
|
132
99
|
|
|
133
|
-
##
|
|
100
|
+
## Best practices
|
|
134
101
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
102
|
+
1. Keep the extension self-contained; reach into the base only through slots, hooks and markers.
|
|
103
|
+
2. Prefer a slot over editing a base file; add a slot when you keep editing the same spot.
|
|
104
|
+
3. Use `order` deliberately and give each slot entry a distinct value.
|
|
105
|
+
4. Import via `@/extensions/...` and keep translations in the extension's own namespace.
|
|
106
|
+
5. After adding a slot, extension or locale, run `pnpm dev` once so the aggregation and registries regenerate, and commit nothing from `src/extensions/locales/` or `src/extensions/config/` by hand.
|
|
138
107
|
|
|
139
|
-
##
|
|
108
|
+
## Related Skills
|
|
140
109
|
|
|
141
|
-
-
|
|
142
|
-
-
|
|
110
|
+
- `storefront-next:sfnext-overview` - project map and where things live
|
|
111
|
+
- `storefront-next:sfnext-components` - component conventions used inside extensions
|
|
112
|
+
- `storefront-next:sfnext-routing` - how extension routes join the route tree
|
|
113
|
+
- `storefront-next:sfnext-i18n` - translation namespaces and locale files
|
|
114
|
+
- `storefront-next:sfnext-configuration` - `config.ts` layering and `PUBLIC__` overrides
|
|
115
|
+
- `storefront-next:sfnext-theming` - token and brand changes that do not need an extension
|
|
116
|
+
- `storefront-next:sfnext-commerce-features` - checkout, multiship, BOPIS flows
|
|
117
|
+
- `storefront-next:sfnext-page-designer` - merchant-editable blocks
|
|
118
|
+
- `b2c:b2c-hooks` - B2C platform-side hooks (different from Storefront Next action hooks)
|