@salesforce/b2c-cli 2.3.0 → 2.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/dev.js +8 -8
- package/bin/run.js +5 -7
- package/content/guidance/b2c/b2c-business-manager-extensions/SKILL.md +361 -0
- package/content/guidance/b2c/b2c-business-manager-extensions/references/EXTENSIONS-XML.md +458 -0
- package/content/guidance/b2c/b2c-controllers/SKILL.md +301 -0
- package/content/guidance/b2c/b2c-controllers/references/CLASSIC-PATTERNS.md +335 -0
- package/content/guidance/b2c/b2c-controllers/references/SFRA-PATTERNS.md +400 -0
- package/content/guidance/b2c/b2c-custom-api-development/SKILL.md +281 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/CONTRACT.md +142 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/IMPLEMENTATION.md +153 -0
- package/content/guidance/b2c/b2c-custom-api-development/references/TESTING.md +118 -0
- package/content/guidance/b2c/b2c-custom-caches/SKILL.md +279 -0
- package/content/guidance/b2c/b2c-custom-job-steps/SKILL.md +520 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/CHUNK-ORIENTED.md +377 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/JOBS-XML.md +212 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/STEPTYPES-JSON.md +373 -0
- package/content/guidance/b2c/b2c-custom-job-steps/references/TASK-ORIENTED.md +344 -0
- package/content/guidance/b2c/b2c-custom-objects/SKILL.md +327 -0
- package/content/guidance/b2c/b2c-custom-objects/references/OCAPI-SEARCH.md +298 -0
- package/content/guidance/b2c/b2c-forms/SKILL.md +242 -0
- package/content/guidance/b2c/b2c-forms/references/FORM-XML.md +409 -0
- package/content/guidance/b2c/b2c-hooks/SKILL.md +500 -0
- package/content/guidance/b2c/b2c-hooks/references/OCAPI-SCAPI-HOOKS.md +403 -0
- package/content/guidance/b2c/b2c-hooks/references/ORDER-HOOK-LIFECYCLE.md +169 -0
- package/content/guidance/b2c/b2c-hooks/references/SYSTEM-HOOKS.md +433 -0
- package/content/guidance/b2c/b2c-isml/SKILL.md +320 -0
- package/content/guidance/b2c/b2c-isml/references/EXPRESSIONS.md +366 -0
- package/content/guidance/b2c/b2c-isml/references/TAGS.md +443 -0
- package/content/guidance/b2c/b2c-localization/SKILL.md +344 -0
- package/content/guidance/b2c/b2c-localization/references/PATTERNS.md +407 -0
- package/content/guidance/b2c/b2c-logging/SKILL.md +352 -0
- package/content/guidance/b2c/b2c-logging/references/LOG-FILES.md +282 -0
- package/content/guidance/b2c/b2c-metadata/SKILL.md +406 -0
- package/content/guidance/b2c/b2c-metadata/references/SYSTEM-OBJECTS.md +320 -0
- package/content/guidance/b2c/b2c-metadata/references/XML-EXAMPLES.md +366 -0
- package/content/guidance/b2c/b2c-onboarding/SKILL.md +154 -0
- package/content/guidance/b2c/b2c-ordering/SKILL.md +391 -0
- package/content/guidance/b2c/b2c-page-designer/SKILL.md +410 -0
- package/content/guidance/b2c/b2c-page-designer/references/ATTRIBUTE-TYPES.md +436 -0
- package/content/guidance/b2c/b2c-page-designer/references/META-DEFINITIONS.md +340 -0
- package/content/guidance/b2c/b2c-querying-data/SKILL.md +289 -0
- package/content/guidance/b2c/b2c-querying-data/references/PERFORMANCE-APIS.md +74 -0
- package/content/guidance/b2c/b2c-scapi-admin/SKILL.md +53 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/CLIENT-EXAMPLES.md +440 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/INTEGRATION-PATTERNS.md +518 -0
- package/content/guidance/b2c/b2c-scapi-admin/references/OAUTH-SCOPES.md +337 -0
- package/content/guidance/b2c/b2c-scapi-shopper/SKILL.md +56 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CHECKOUT-FLOW.md +466 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/CLIENT-EXAMPLES.md +351 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/COMMON-PATTERNS.md +390 -0
- package/content/guidance/b2c/b2c-scapi-shopper/references/SCOPES.md +290 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/SKILL.md +420 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/PASSKEYS.md +126 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/SESSION-BRIDGE.md +267 -0
- package/content/guidance/b2c/b2c-slas-auth-patterns/references/TOKEN-LIFECYCLE.md +367 -0
- package/content/guidance/b2c/b2c-webservices/SKILL.md +318 -0
- package/content/guidance/b2c/b2c-webservices/references/FTP-SERVICES.md +524 -0
- package/content/guidance/b2c/b2c-webservices/references/HTTP-SERVICES.md +578 -0
- package/content/guidance/b2c/b2c-webservices/references/SERVICES-XML.md +351 -0
- package/content/guidance/b2c/b2c-webservices/references/SOAP-SERVICES.md +587 -0
- package/content/guidance/b2c-cli/b2c-am/SKILL.md +277 -0
- package/content/guidance/b2c-cli/b2c-bm-users-roles/SKILL.md +210 -0
- package/content/guidance/b2c-cli/b2c-cap/SKILL.md +131 -0
- package/content/guidance/b2c-cli/b2c-cip/SKILL.md +116 -0
- package/content/guidance/b2c-cli/b2c-cip/references/KNOWN_TABLES.md +105 -0
- package/content/guidance/b2c-cli/b2c-cip/references/SALES_ANALYSIS.md +50 -0
- package/content/guidance/b2c-cli/b2c-cip/references/STARTER_QUERIES.md +147 -0
- package/content/guidance/b2c-cli/b2c-code/SKILL.md +146 -0
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +462 -0
- package/content/guidance/b2c-cli/b2c-content/SKILL.md +176 -0
- package/content/guidance/b2c-cli/b2c-debug/SKILL.md +138 -0
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +301 -0
- package/content/guidance/b2c-cli/b2c-ecdn/SKILL.md +135 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/ADVANCED.md +97 -0
- package/content/guidance/b2c-cli/b2c-ecdn/references/SECURITY.md +75 -0
- package/content/guidance/b2c-cli/b2c-import-set-migrations/SKILL.md +265 -0
- package/content/guidance/b2c-cli/b2c-job/SKILL.md +64 -0
- package/content/guidance/b2c-cli/b2c-job/references/EXPORT.md +121 -0
- package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +55 -0
- package/content/guidance/b2c-cli/b2c-job/references/RUN-AND-MONITOR.md +119 -0
- package/content/guidance/b2c-cli/b2c-logs/SKILL.md +249 -0
- package/content/guidance/b2c-cli/b2c-metrics/SKILL.md +315 -0
- package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +207 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/BUNDLE-COMMANDS.md +203 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +218 -0
- package/content/guidance/b2c-cli/b2c-mrt/references/PROJECT-COMMANDS.md +154 -0
- package/content/guidance/b2c-cli/b2c-sandbox/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-scapi-custom/SKILL.md +126 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +66 -0
- package/content/guidance/b2c-cli/b2c-scapi-schemas/references/CLI-EXAMPLES.md +108 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/SKILL.md +57 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/IMPORT-OPTIONS.md +118 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/METADATA-XML.md +381 -0
- package/content/guidance/b2c-cli/b2c-site-import-export/references/WORKFLOWS.md +182 -0
- package/content/guidance/b2c-cli/b2c-sites/SKILL.md +112 -0
- package/content/guidance/b2c-cli/b2c-slas/SKILL.md +182 -0
- package/content/guidance/b2c-cli/b2c-webdav/SKILL.md +186 -0
- package/content/guidance/b2c-ops/b2c-checkout-triage/SKILL.md +68 -0
- package/content/guidance/b2c-ops/b2c-job-health/SKILL.md +75 -0
- package/content/guidance/b2c-ops/b2c-job-health/references/job-logs.md +21 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/SKILL.md +66 -0
- package/content/guidance/b2c-ops/b2c-order-failure-triage/references/order-evidence.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/SKILL.md +87 -0
- package/content/guidance/b2c-ops/b2c-production-triage/references/escalation.md +57 -0
- package/content/guidance/index.json +1949 -0
- 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 +127 -0
- 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 +153 -0
- 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 +163 -0
- 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 +140 -0
- 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 +39 -0
- package/content/guidance/storefront-next/sfnext-deployment/SKILL.md +127 -0
- package/content/guidance/storefront-next/sfnext-deployment/references/MRT-DEPLOYMENT.md +59 -0
- package/content/guidance/storefront-next/sfnext-extensions/SKILL.md +118 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/ACTION-HOOKS.md +57 -0
- package/content/guidance/storefront-next/sfnext-extensions/references/BASE-AUDIT.md +68 -0
- 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 +79 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/SKILL.md +93 -0
- package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md +86 -0
- package/content/guidance/storefront-next/sfnext-i18n/SKILL.md +152 -0
- 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 +202 -0
- 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 +111 -0
- package/content/guidance/storefront-next/sfnext-page-designer/references/DECORATOR-PATTERNS.md +168 -0
- 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 +102 -0
- 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 +147 -0
- package/content/guidance/storefront-next/sfnext-project-setup/references/PROJECT-STRUCTURE.md +61 -0
- 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 +123 -0
- package/content/guidance/storefront-next/sfnext-routing/references/ROUTE-CONVENTIONS.md +65 -0
- 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 +114 -0
- package/content/guidance/storefront-next/sfnext-state-management/references/PATTERNS.md +45 -0
- package/content/guidance/storefront-next/sfnext-testing/SKILL.md +151 -0
- package/content/guidance/storefront-next/sfnext-testing/references/E2E.md +38 -0
- package/content/guidance/storefront-next/sfnext-testing/references/STORYBOOK-PATTERNS.md +97 -0
- 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/cap/install.d.ts +1 -0
- package/dist/commands/cap/list.d.ts +1 -0
- package/dist/commands/cap/pull.d.ts +1 -0
- package/dist/commands/cap/tasks.d.ts +1 -0
- package/dist/commands/cap/uninstall.d.ts +1 -0
- package/dist/commands/cip/describe.d.ts +1 -0
- package/dist/commands/cip/query.d.ts +1 -0
- package/dist/commands/cip/report/bot-traffic-share.d.ts +1 -0
- package/dist/commands/cip/report/checkout-funnel-dropoff.d.ts +1 -0
- package/dist/commands/cip/report/controller-error-rate-trend.d.ts +1 -0
- package/dist/commands/cip/report/controller-health-scorecard.d.ts +1 -0
- package/dist/commands/cip/report/customer-registration-trends.d.ts +1 -0
- package/dist/commands/cip/report/discount-depth-breakdown.d.ts +1 -0
- package/dist/commands/cip/report/inventory-stockout-by-location.d.ts +1 -0
- package/dist/commands/cip/report/new-vs-returning-buyer-revenue.d.ts +1 -0
- package/dist/commands/cip/report/ocapi-client-usage.d.ts +1 -0
- package/dist/commands/cip/report/ocapi-requests.d.ts +1 -0
- package/dist/commands/cip/report/payment-method-performance.d.ts +1 -0
- package/dist/commands/cip/report/product-co-purchase-analysis.d.ts +1 -0
- package/dist/commands/cip/report/promotion-discount-analysis.d.ts +1 -0
- package/dist/commands/cip/report/promotion-roi-leaderboard.d.ts +1 -0
- package/dist/commands/cip/report/recommender-effectiveness.d.ts +1 -0
- package/dist/commands/cip/report/remote-include-performance.d.ts +1 -0
- package/dist/commands/cip/report/revenue-by-channel.d.ts +1 -0
- package/dist/commands/cip/report/sales-analytics.d.ts +1 -0
- package/dist/commands/cip/report/sales-summary.d.ts +1 -0
- package/dist/commands/cip/report/scapi-cache-hit-ratio.d.ts +1 -0
- package/dist/commands/cip/report/scapi-error-rate-by-status.d.ts +1 -0
- package/dist/commands/cip/report/scapi-latency-distribution.d.ts +1 -0
- package/dist/commands/cip/report/scapi-traffic-latency.d.ts +1 -0
- package/dist/commands/cip/report/search-query-performance.d.ts +1 -0
- package/dist/commands/cip/report/top-referrers.d.ts +1 -0
- package/dist/commands/cip/report/top-selling-products.d.ts +1 -0
- package/dist/commands/cip/report/zero-result-searches.d.ts +1 -0
- package/dist/commands/cip/tables.d.ts +1 -0
- package/dist/commands/code/activate.d.ts +1 -0
- package/dist/commands/code/delete.d.ts +1 -0
- package/dist/commands/code/deploy.d.ts +1 -0
- package/dist/commands/code/download.d.ts +1 -0
- package/dist/commands/code/watch.d.ts +1 -0
- package/dist/commands/commands/search.d.ts +35 -0
- package/dist/commands/commands/search.js +85 -0
- package/dist/commands/commands/search.js.map +1 -0
- package/dist/commands/content/export.d.ts +1 -0
- package/dist/commands/content/list.d.ts +1 -0
- package/dist/commands/content/validate.d.ts +1 -0
- package/dist/commands/debug/cli.d.ts +1 -0
- package/dist/commands/debug/index.d.ts +1 -0
- package/dist/commands/docs/cache.d.ts +1 -0
- package/dist/commands/docs/download.d.ts +1 -0
- package/dist/commands/docs/read.d.ts +1 -0
- package/dist/commands/docs/schema.d.ts +1 -0
- package/dist/commands/docs/search.d.ts +1 -0
- package/dist/commands/docs/skill.d.ts +41 -0
- package/dist/commands/docs/skill.js +183 -0
- package/dist/commands/docs/skill.js.map +1 -0
- package/dist/commands/ecdn/cache/purge.d.ts +1 -0
- package/dist/commands/ecdn/certificates/add.d.ts +1 -0
- package/dist/commands/ecdn/certificates/delete.d.ts +1 -0
- package/dist/commands/ecdn/certificates/list.d.ts +1 -0
- package/dist/commands/ecdn/certificates/update.d.ts +1 -0
- package/dist/commands/ecdn/certificates/validate.d.ts +1 -0
- package/dist/commands/ecdn/cipher-suites/get.d.ts +1 -0
- package/dist/commands/ecdn/cipher-suites/update.d.ts +1 -0
- package/dist/commands/ecdn/firewall/create.d.ts +1 -0
- package/dist/commands/ecdn/firewall/delete.d.ts +1 -0
- package/dist/commands/ecdn/firewall/get.d.ts +1 -0
- package/dist/commands/ecdn/firewall/list.d.ts +1 -0
- package/dist/commands/ecdn/firewall/reorder.d.ts +1 -0
- package/dist/commands/ecdn/firewall/update.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/create.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/delete.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/get.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/list.d.ts +1 -0
- package/dist/commands/ecdn/logpush/jobs/update.d.ts +1 -0
- package/dist/commands/ecdn/logpush/ownership.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/create.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/delete.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/get.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/delete.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/rules/update.d.ts +1 -0
- package/dist/commands/ecdn/mrt-rules/update.d.ts +1 -0
- package/dist/commands/ecdn/mtls/create.d.ts +1 -0
- package/dist/commands/ecdn/mtls/delete.d.ts +1 -0
- package/dist/commands/ecdn/mtls/get.d.ts +1 -0
- package/dist/commands/ecdn/mtls/issue.d.ts +1 -0
- package/dist/commands/ecdn/mtls/list.d.ts +1 -0
- package/dist/commands/ecdn/mtls/setup.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/delete.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/get.d.ts +1 -0
- package/dist/commands/ecdn/origin-headers/set.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/create.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/delete.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/notifications/list.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/create.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/delete.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/get.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/list.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/policies/update.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/scripts/get.d.ts +1 -0
- package/dist/commands/ecdn/page-shield/scripts/list.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/create.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/delete.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/get.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/list.d.ts +1 -0
- package/dist/commands/ecdn/rate-limit/update.d.ts +1 -0
- package/dist/commands/ecdn/security/get.d.ts +1 -0
- package/dist/commands/ecdn/security/update.d.ts +1 -0
- package/dist/commands/ecdn/speed/get.d.ts +1 -0
- package/dist/commands/ecdn/speed/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/groups/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/groups/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/managed-rules/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/managed-rules/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/migrate.d.ts +1 -0
- package/dist/commands/ecdn/waf/owasp/get.d.ts +1 -0
- package/dist/commands/ecdn/waf/owasp/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/get.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/rules/update.d.ts +1 -0
- package/dist/commands/ecdn/waf/rulesets/list.d.ts +1 -0
- package/dist/commands/ecdn/waf/rulesets/update.d.ts +1 -0
- package/dist/commands/ecdn/zones/create.d.ts +1 -0
- package/dist/commands/ecdn/zones/list.d.ts +1 -0
- package/dist/commands/job/execution/delete.d.ts +1 -0
- package/dist/commands/job/export.d.ts +1 -0
- package/dist/commands/job/import-set.d.ts +1 -0
- package/dist/commands/job/import.d.ts +1 -0
- package/dist/commands/job/log.d.ts +1 -0
- package/dist/commands/job/run.d.ts +1 -0
- package/dist/commands/job/search.d.ts +1 -0
- package/dist/commands/job/wait.d.ts +1 -0
- package/dist/commands/logs/get.d.ts +1 -0
- package/dist/commands/logs/list.d.ts +1 -0
- package/dist/commands/logs/tail.d.ts +1 -0
- package/dist/commands/metrics/controller.d.ts +1 -0
- package/dist/commands/metrics/ecdn.d.ts +1 -0
- package/dist/commands/metrics/mrt.d.ts +1 -0
- package/dist/commands/metrics/ocapi.d.ts +1 -0
- package/dist/commands/metrics/overall.d.ts +1 -0
- package/dist/commands/metrics/sales.d.ts +1 -0
- package/dist/commands/metrics/scapi-hooks.d.ts +1 -0
- package/dist/commands/metrics/scapi.d.ts +1 -0
- package/dist/commands/metrics/third-party.d.ts +1 -0
- package/dist/commands/mrt/bundle/delete.d.ts +1 -0
- package/dist/commands/mrt/bundle/deploy.d.ts +1 -0
- package/dist/commands/mrt/bundle/download.d.ts +1 -0
- package/dist/commands/mrt/bundle/history.d.ts +1 -0
- package/dist/commands/mrt/bundle/list.d.ts +1 -0
- package/dist/commands/mrt/bundle/save.d.ts +1 -0
- package/dist/commands/mrt/bundle/upload-v2.d.ts +1 -0
- package/dist/commands/mrt/env/access-control/list.d.ts +1 -0
- package/dist/commands/mrt/env/b2c.d.ts +1 -0
- package/dist/commands/mrt/env/clone.d.ts +1 -0
- package/dist/commands/mrt/env/create.d.ts +1 -0
- package/dist/commands/mrt/env/delete.d.ts +1 -0
- package/dist/commands/mrt/env/get.d.ts +1 -0
- package/dist/commands/mrt/env/invalidate.d.ts +1 -0
- package/dist/commands/mrt/env/list.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/clone.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/create.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/delete.d.ts +1 -0
- package/dist/commands/mrt/env/redirect/list.d.ts +1 -0
- package/dist/commands/mrt/env/update.d.ts +1 -0
- package/dist/commands/mrt/env/var/delete.d.ts +1 -0
- package/dist/commands/mrt/env/var/list.d.ts +1 -0
- package/dist/commands/mrt/env/var/push.d.ts +1 -0
- package/dist/commands/mrt/env/var/set.d.ts +1 -0
- package/dist/commands/mrt/org/b2c.d.ts +1 -0
- package/dist/commands/mrt/org/cert/create.d.ts +1 -0
- package/dist/commands/mrt/org/cert/delete.d.ts +1 -0
- package/dist/commands/mrt/org/cert/get.d.ts +1 -0
- package/dist/commands/mrt/org/cert/list.d.ts +1 -0
- package/dist/commands/mrt/org/cert/restart-validation.d.ts +1 -0
- package/dist/commands/mrt/org/list.d.ts +1 -0
- package/dist/commands/mrt/org/member/add.d.ts +1 -0
- package/dist/commands/mrt/org/member/get.d.ts +1 -0
- package/dist/commands/mrt/org/member/list.d.ts +1 -0
- package/dist/commands/mrt/org/member/remove.d.ts +1 -0
- package/dist/commands/mrt/org/member/update.d.ts +1 -0
- package/dist/commands/mrt/project/create.d.ts +1 -0
- package/dist/commands/mrt/project/delete.d.ts +1 -0
- package/dist/commands/mrt/project/get.d.ts +1 -0
- package/dist/commands/mrt/project/list.d.ts +1 -0
- package/dist/commands/mrt/project/member/add.d.ts +1 -0
- package/dist/commands/mrt/project/member/get.d.ts +1 -0
- package/dist/commands/mrt/project/member/list.d.ts +1 -0
- package/dist/commands/mrt/project/member/remove.d.ts +1 -0
- package/dist/commands/mrt/project/member/update.d.ts +1 -0
- package/dist/commands/mrt/project/notification/delete.d.ts +1 -0
- package/dist/commands/mrt/project/notification/get.d.ts +1 -0
- package/dist/commands/mrt/project/update.d.ts +1 -0
- package/dist/commands/mrt/save-credentials.d.ts +1 -0
- package/dist/commands/mrt/tail-logs.d.ts +1 -0
- package/dist/commands/mrt/user/api-key.d.ts +1 -0
- package/dist/commands/mrt/user/email-prefs.d.ts +1 -0
- package/dist/commands/mrt/user/profile.d.ts +1 -0
- package/dist/commands/scaffold/init.js +2 -1
- package/dist/commands/scaffold/init.js.map +1 -1
- package/dist/commands/scapi/custom/status.d.ts +1 -0
- package/dist/commands/scapi/schemas/get.d.ts +1 -0
- package/dist/commands/scapi/schemas/list.d.ts +1 -0
- package/dist/commands/setup/ide/tsserver-plugin.d.ts +1 -0
- package/dist/commands/setup/ide/vscode-types.d.ts +1 -0
- package/dist/commands/setup/index.js +4 -3
- package/dist/commands/setup/index.js.map +1 -1
- package/dist/commands/setup/inspect.d.ts +1 -0
- package/dist/commands/setup/inspect.js +17 -2
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/commands/setup/instance/create.d.ts +1 -0
- package/dist/commands/setup/instance/list.d.ts +1 -0
- package/dist/commands/setup/instance/remove.d.ts +1 -0
- package/dist/commands/setup/instance/set-active.d.ts +1 -0
- package/dist/commands/setup/openshell.d.ts +1 -0
- package/dist/commands/setup/skills.d.ts +1 -0
- package/dist/commands/slas/client/create.d.ts +1 -0
- package/dist/commands/slas/client/delete.d.ts +1 -0
- package/dist/commands/slas/client/get.d.ts +1 -0
- package/dist/commands/slas/client/list.d.ts +1 -0
- package/dist/commands/slas/client/open.d.ts +1 -0
- package/dist/commands/slas/client/update.d.ts +1 -0
- package/dist/commands/slas/token.d.ts +1 -0
- package/dist/commands/slas/token.js +2 -1
- package/dist/commands/slas/token.js.map +1 -1
- package/dist/commands/webdav/get.d.ts +1 -0
- package/dist/commands/webdav/mkdir.d.ts +2 -0
- package/dist/commands/webdav/mkdir.js +5 -3
- package/dist/commands/webdav/mkdir.js.map +1 -1
- package/dist/commands/webdav/put.d.ts +2 -0
- package/dist/commands/webdav/put.js +5 -3
- package/dist/commands/webdav/put.js.map +1 -1
- package/dist/commands/webdav/rm.d.ts +1 -0
- package/dist/help.d.ts +25 -0
- package/dist/help.js +96 -0
- package/dist/help.js.map +1 -0
- package/dist/lib/scaffold/generate-helper.js +3 -2
- package/dist/lib/scaffold/generate-helper.js.map +1 -1
- package/dist/lib/skills.d.ts +19 -0
- package/dist/lib/skills.js +75 -0
- package/dist/lib/skills.js.map +1 -0
- package/dist/utils/cip/command.d.ts +1 -0
- package/dist/utils/ecdn/zone-command.d.ts +1 -0
- package/dist/utils/slas/client.d.ts +1 -0
- package/oclif.manifest.json +10994 -7653
- package/package.json +11 -5
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Extension Examples
|
|
2
|
+
|
|
3
|
+
Read the shipped extensions in `src/extensions/` before writing your own; these three cover the common shapes. Confirm paths in your project, since extensions evolve.
|
|
4
|
+
|
|
5
|
+
## Simplest: BNPL (one slot, one API module)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/extensions/bnpl/
|
|
9
|
+
├── target-config.json
|
|
10
|
+
├── components/ # includes components/target/bnpl-target.tsx
|
|
11
|
+
├── context/ # bnpl-context
|
|
12
|
+
├── lib/api/bnpl.server.ts # mock provider calls; replace bodies for a real provider
|
|
13
|
+
├── locales/
|
|
14
|
+
└── README.md
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"components": [
|
|
20
|
+
{ "targetId": "sfcc.pdp.bnpl.message", "path": "extensions/bnpl/components/target/bnpl-target.tsx", "order": 0 }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The target component is a thin default-exported adapter: it reads a context (`useBnpl()`), returns `null` when there is nothing to show, and wraps streamed promises in `Suspense`/`Await`. Keep slot components small and null-safe, because the slot renders wherever the base places it.
|
|
26
|
+
|
|
27
|
+
## Several slots: Ratings and Reviews
|
|
28
|
+
|
|
29
|
+
Three entries in one `target-config.json` fill three different places:
|
|
30
|
+
|
|
31
|
+
| targetId | Component |
|
|
32
|
+
|----------|-----------|
|
|
33
|
+
| `sfcc.pdp.reviews.section` | `components/target/reviews-section-target.tsx` |
|
|
34
|
+
| `sfcc.pdp.reviews.rating` | `components/target/reviews-summary-target.tsx` |
|
|
35
|
+
| `sfcc.account.orderDetail.lineReview` | `components/target/order-line-review-target.tsx` |
|
|
36
|
+
|
|
37
|
+
It also has `context/`, `providers/`, `routes/`, `lib/` and `locales/`. Pattern: one target adapter per slot, shared logic in context and `lib`.
|
|
38
|
+
|
|
39
|
+
## Routes, provider, middleware: Store Locator
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
src/extensions/store-locator/
|
|
43
|
+
├── target-config.json # sfcc.header.before.cart -> components/header/store-locator-badge.tsx
|
|
44
|
+
├── components/ context/ hooks/ stores/ locales/ tests/
|
|
45
|
+
├── middlewares/ # wired into base files via SFDC_EXT_ markers
|
|
46
|
+
├── providers/store-locator.tsx # mounted in root.tsx via @sfdc-extension-block markers
|
|
47
|
+
└── routes/
|
|
48
|
+
├── _app.store-locator.tsx # page inside the app layout
|
|
49
|
+
├── action.set-selected-store.ts # action route
|
|
50
|
+
└── resource.stores.ts # resource (JSON) route
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This extension needs edits outside its folder (for example `root.tsx` and other base components), which is why it uses `SFDC_EXT_STORE_LOCATOR` markers; see [CLI and Install](CLI-AND-INSTALL.md). Route file names follow flat-route conventions: `_app.` prefix for routes in the app layout, `action.` and `resource.` for non-UI routes.
|
|
54
|
+
|
|
55
|
+
## Wrapper slot
|
|
56
|
+
|
|
57
|
+
A slot that has children keeps the base content and lets the extension decorate it (for example `sfcc.emailSignUp.consent.marketing`). The component receives `children`:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import type { ReactNode } from 'react';
|
|
61
|
+
|
|
62
|
+
export default function ConsentWrapper({ children }: { children?: ReactNode }) {
|
|
63
|
+
return <div className="rounded border p-2">{children}</div>;
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use `pnpm extensions:list` to see which slots are wrappers in your project.
|
|
68
|
+
|
|
69
|
+
## Server hook: fraud check
|
|
70
|
+
|
|
71
|
+
See [Action Hooks](ACTION-HOOKS.md) for a `sfcc.checkout.fraud.beforePlace` handler and the blocking rules.
|
|
72
|
+
|
|
73
|
+
## Checklist for a new extension
|
|
74
|
+
|
|
75
|
+
1. Run the [Base Audit](BASE-AUDIT.md) gate.
|
|
76
|
+
2. `sfnext extensions create -n "Name" -d "..."`.
|
|
77
|
+
3. Add components, then `target-config.json` entries with `sfcc.` target ids from `pnpm extensions:list`.
|
|
78
|
+
4. Add `locales/<lang>/translations.json` and use the `ext<PascalName>` namespace.
|
|
79
|
+
5. Run `pnpm dev`, check the slot in the browser, then `pnpm typecheck && pnpm lint`.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfnext-hybrid-storefronts
|
|
3
|
+
description: >-
|
|
4
|
+
Run Storefront Next alongside an existing SFRA or SiteGenesis storefront for a gradual migration. Use for hybrid mode, PUBLIC__app__hybrid__enabled, legacyRoutes (exact, :param, * wildcard, { pattern, suffix }), HYBRID_PROXY_ENABLED, SFCC_ORIGIN, HYBRID_ROUTING_RULES, vite-plugins/hybrid-proxy.ts, the dwsid session bridge, sharing login/cart between SFRA and Storefront Next, eCDN routing rules, cookie domain for hybrid, "[Hybrid Proxy] SFCC returned a redirect to 404", blank proxied pages, or lost sessions when crossing storefronts. Do not use for the cookie-domain settings themselves beyond the hybrid checklist (use `storefront-next:sfnext-security`), auth code (use `storefront-next:sfnext-authentication`), or MRT deployment (use `storefront-next:sfnext-deployment`).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Hybrid Storefronts
|
|
8
|
+
|
|
9
|
+
A hybrid storefront serves some pages from Storefront Next (on Managed Runtime) and the rest from SFRA/SiteGenesis on the B2C instance, under one hostname.
|
|
10
|
+
|
|
11
|
+
- **Production:** Cloudflare eCDN routes by URL pattern (see `b2c-cli:b2c-ecdn`). The dev proxy is never used.
|
|
12
|
+
- **Local development:** a Vite dev-server plugin proxies non-Storefront-Next paths to your sandbox so both appear at `http://localhost:5173`. It only runs under `pnpm dev` and is a no-op in production builds. Full guide: `docs/README-HYBRID-PROXY.md` in your project.
|
|
13
|
+
|
|
14
|
+
## Two sets of configuration
|
|
15
|
+
|
|
16
|
+
| Set | Variables | Where it applies |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| App config | `PUBLIC__app__hybrid__enabled`, `PUBLIC__app__hybrid__legacyRoutes` | **Every** environment (local, staging, production) |
|
|
19
|
+
| Dev proxy | `HYBRID_PROXY_ENABLED`, `SFCC_ORIGIN`, `HYBRID_ROUTING_RULES`, `HYBRID_PROXY_LOCALE`, `PUBLIC__app__defaultSiteId` | `pnpm dev` only |
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
PUBLIC__app__hybrid__enabled=true
|
|
23
|
+
PUBLIC__app__hybrid__legacyRoutes='["/cart", "/checkout", "/product/:id", "/categoryLv1/*"]'
|
|
24
|
+
|
|
25
|
+
HYBRID_PROXY_ENABLED=true
|
|
26
|
+
SFCC_ORIGIN=https://zzrf-001.dx.commercecloud.salesforce.com # your sandbox hostname, not the SCAPI host
|
|
27
|
+
HYBRID_PROXY_LOCALE=en-GB # optional; falls back to i18n fallbackLng
|
|
28
|
+
HYBRID_ROUTING_RULES='(http.request.uri.path matches "^/$" or http.request.uri.path matches "^/login.*" or http.request.uri.path matches "^/logout.*" or http.request.uri.path matches "^/signup.*" or http.request.uri.path matches "^/reset-password.*" or http.request.uri.path matches "^/account.*" or http.request.uri.path matches "^/social-callback.*" or http.request.uri.path matches "^/product.*" or http.request.uri.path matches "^/category.*" or http.request.uri.path matches "^/search.*" or http.request.uri.path matches "^/resource.*" or http.request.uri.path matches "^/action/.*")'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`HYBRID_ROUTING_RULES` lists what **Storefront Next owns** (same Cloudflare `http.request.uri.path matches "<regex>"` clauses, joined by `or`, as your eCDN rules). Anything not matching is proxied to SFRA. `^/resource.*` and `^/action/.*` are always required. Include every auth route you migrated (`/login`, `/logout`, `/signup`, `/reset-password`, `/social-callback`) or login breaks. `legacyRoutes` is the inverse: what SFRA owns, so a `<Link>` to it forces a full page load instead of a React Router 404. Keep both in sync with the production eCDN rules.
|
|
32
|
+
|
|
33
|
+
## legacyRoutes patterns
|
|
34
|
+
|
|
35
|
+
Each entry is a string or `{ pattern, suffix }`.
|
|
36
|
+
|
|
37
|
+
| Form | Example | Matches |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| Exact | `/cart` | `/cart` only |
|
|
40
|
+
| Named param | `/product/:id` | one segment |
|
|
41
|
+
| Wildcard | `/categoryLv1/*` | anything under the prefix (`/categoryLv1/shoes/running`), **not** the bare `/categoryLv1` (list it separately); `*` may appear mid-pattern |
|
|
42
|
+
| Catch-all | `*` | every path |
|
|
43
|
+
| With suffix | `{ "pattern": "/product/:id", "suffix": ".html" }` | redirect appends `.html` (SFCC SEO URLs) |
|
|
44
|
+
|
|
45
|
+
The matching middleware is `src/middlewares/legacy-routes.client.ts` (helpers in `legacy-routes.ts`). The eCDN regex `^/categoryLv1.*` matches the bare path while `/categoryLv1/*` does not; use `^/categoryLv1(/.*)?$` on the eCDN side to align them.
|
|
46
|
+
|
|
47
|
+
## Session bridge
|
|
48
|
+
|
|
49
|
+
There is no token exchange and no client-side sync. The bridge is the `dwsid` cookie (plus `dw_dnt` for tracking consent):
|
|
50
|
+
|
|
51
|
+
1. Storefront Next's auth middleware extracts `dwsid` from the SLAS response and persists it.
|
|
52
|
+
2. `dwsid` and `dw_dnt` are **not** site-namespaced, so SFRA reads and writes them directly. Other `cc-*` cookies are namespaced per site and are Storefront Next's own.
|
|
53
|
+
3. The browser sends them on every request; the next full request to either side sees the shared session.
|
|
54
|
+
|
|
55
|
+
For this to work across subdomains, cookie domain must be configured on **both** sides and agree: `app.cookies.domain` (or `commerce.sites[].cookies.domain`, or `PUBLIC__app__cookies__domain=.example.com`) in Storefront Next, and Business Manager > Merchant Tools > Site Preferences > **Hybrid Auth Settings** cookie-domain level `2` (level `0` is host-only; level `1` is rejected). Details and verification checklist: `storefront-next:sfnext-security` and `docs/README-COOKIE-DOMAIN.md`. Cookie inventory: `storefront-next:sfnext-authentication`.
|
|
56
|
+
|
|
57
|
+
## Edit the proxy where customers edit it
|
|
58
|
+
|
|
59
|
+
The plugin is wired in `vite-plugins/hybrid-proxy.ts` (called from `vite.config.ts`, development mode only). Edit there, not in `vite.config.ts`. It reads `url.prefix` and the site/locale alias catalog from `config.server.ts` automatically.
|
|
60
|
+
|
|
61
|
+
- **Path rewriting:** `/cart` becomes `/s/<siteId>/<locale>/cart`, `/` becomes `/s/<siteId>`. With `url.prefix` of `/:localeId` or `/:siteId/:localeId` the proxy reuses the site/locale already in the path (`/uk/cart` becomes `/s/<siteId>/uk/cart`), and only treats a segment as site/locale if it is a known id or alias.
|
|
62
|
+
- **Escape hatches (last resort):** `rewritePath(pathname)` returns an SFRA path or `null` to fall through; `routeMatcher(pathname, rules)` replaces the matcher. Keep `shouldRouteToNext` as the fallback so dev stays aligned with eCDN.
|
|
63
|
+
- Target origin priority: `SFCC_ORIGIN`, then `SCAPI_PROXY_HOST`, then the SCAPI host from `shortCode`.
|
|
64
|
+
|
|
65
|
+
## Automatic behaviors
|
|
66
|
+
|
|
67
|
+
- Rewrites `Domain=.salesforce.com` cookies to `localhost`, rewrites SFCC URLs in HTML/JSON bodies, decompresses gzip/brotli/deflate before rewriting, and injects a `document.cookie` interceptor into proxied HTML (localhost workaround only, not used in production).
|
|
68
|
+
- Never proxies Vite internals, `*.data`, `/mobify/*` and static asset extensions; always proxies `/on/demandware.static/*` and `/on/demandware.store/*`.
|
|
69
|
+
- SFRA `plugin_redirect` answering `200` with a `Location` header is converted to a `302`.
|
|
70
|
+
|
|
71
|
+
## Troubleshooting
|
|
72
|
+
|
|
73
|
+
| Symptom | Cause | Fix |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| Logged out after visiting a Storefront Next page; log says `[Hybrid Proxy] SFCC returned a redirect to 404` | A migrated route is missing from `HYBRID_ROUTING_RULES`; SFCC 404s and clears cookies (proxy strips those `Set-Cookie`s) | Add the path pattern |
|
|
76
|
+
| React Router 404 or error boundary when clicking a legacy link | Path missing from `legacyRoutes` | Add it (mind `*` vs bare parent) |
|
|
77
|
+
| Session lost crossing storefronts | Cookie domain mismatch, or BM Hybrid Auth level differs | Align both sides; check for duplicate cookies |
|
|
78
|
+
| Blank proxied page | Upstream `200` + `Location` (fixed in dev), or unsupported compression | Fix the SFRA cartridge or add an eCDN rule for production |
|
|
79
|
+
| Works locally, wrong backend in production | `HYBRID_ROUTING_RULES` drifted from eCDN rules | Sync them |
|
|
80
|
+
| Wrong locale in the SFRA path | `url.prefix` or `HYBRID_PROXY_LOCALE` mismatch | Check `url.prefix`; set `HYBRID_PROXY_LOCALE` to the site's default locale |
|
|
81
|
+
| Proxy does nothing | `HYBRID_PROXY_ENABLED` not `true`, or not in dev mode | Check `.env` and `pnpm dev` |
|
|
82
|
+
|
|
83
|
+
Env-var reference, path transformation and custom matcher: [references/HYBRID-PROXY-CONFIG.md](references/HYBRID-PROXY-CONFIG.md).
|
|
84
|
+
|
|
85
|
+
## Related Skills
|
|
86
|
+
|
|
87
|
+
- `storefront-next:sfnext-authentication` - cookies and SLAS sessions
|
|
88
|
+
- `storefront-next:sfnext-security` - cookie domain, CSP
|
|
89
|
+
- `storefront-next:sfnext-deployment` - MRT deployment
|
|
90
|
+
- `storefront-next:sfnext-configuration` - `config.server.ts` and `PUBLIC__` overrides
|
|
91
|
+
- `storefront-next:sfnext-routing` - site/locale URL prefixes
|
|
92
|
+
- `b2c-cli:b2c-ecdn` - production routing rules
|
|
93
|
+
- `b2c-cli:b2c-mrt` - Managed Runtime environments
|
package/content/guidance/storefront-next/sfnext-hybrid-storefronts/references/HYBRID-PROXY-CONFIG.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Hybrid Proxy Configuration Reference
|
|
2
|
+
|
|
3
|
+
Authoritative guide in your project: `docs/README-HYBRID-PROXY.md`. Plugin wiring: `vite-plugins/hybrid-proxy.ts`.
|
|
4
|
+
|
|
5
|
+
## Environment variables
|
|
6
|
+
|
|
7
|
+
| Variable | Scope | Purpose |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `PUBLIC__app__hybrid__enabled` | all environments | Activates the client-side legacy-routes middleware. Default `false`. |
|
|
10
|
+
| `PUBLIC__app__hybrid__legacyRoutes` | all environments | JSON array of SFRA-owned routes (strings or `{ pattern, suffix }`). |
|
|
11
|
+
| `HYBRID_PROXY_ENABLED` | dev only | `true` turns the proxy on. |
|
|
12
|
+
| `SFCC_ORIGIN` | dev only | Full HTTPS URL of the SFRA sandbox. Highest priority target. |
|
|
13
|
+
| `SCAPI_PROXY_HOST` | dev only | Secondary target-origin override. |
|
|
14
|
+
| `HYBRID_ROUTING_RULES` | dev only | Cloudflare-style expression of paths Storefront Next owns. |
|
|
15
|
+
| `HYBRID_PROXY_LOCALE` | dev only, optional | Fallback locale for the SFRA path; else `PUBLIC__app__i18n__fallbackLng`, else `default`. |
|
|
16
|
+
| `PUBLIC__app__defaultSiteId` | dev | Site id used in `/s/<siteId>/...`. |
|
|
17
|
+
|
|
18
|
+
`hybrid` defaults to `{ enabled: false, legacyRoutes: [] }` in `config.server.ts`.
|
|
19
|
+
|
|
20
|
+
## Routing rule format
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
(http.request.uri.path matches "^/$" or http.request.uri.path matches "^/category.*")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Only `http.request.uri.path matches "<regex>"` clauses joined by `or` are parsed. Always include `^/resource.*` and `^/action/.*`. `.data` requests are excluded automatically.
|
|
27
|
+
|
|
28
|
+
| Pattern | Route |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `^/$` | Home |
|
|
31
|
+
| `^/login.*`, `^/logout.*`, `^/signup.*`, `^/reset-password.*` | Auth pages |
|
|
32
|
+
| `^/account.*` | Account |
|
|
33
|
+
| `^/product.*`, `^/category.*`, `^/search.*` | Catalog |
|
|
34
|
+
| `^/social-callback.*` | Social login callback |
|
|
35
|
+
|
|
36
|
+
## Path transformation
|
|
37
|
+
|
|
38
|
+
| Browser URL | Proxied to |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `/` | `/s/<siteId>` |
|
|
41
|
+
| `/cart` | `/s/<siteId>/<locale>/cart` |
|
|
42
|
+
| `/on/demandware.static/...`, `/s/...` | unchanged |
|
|
43
|
+
|
|
44
|
+
With `url.prefix` set in `config.server.ts`:
|
|
45
|
+
|
|
46
|
+
| `url.prefix` | URL | Proxied to |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `/:localeId` | `/uk/cart` | `/s/<siteId>/uk/cart` |
|
|
49
|
+
| `/:localeId` | `/cart` | `/s/<siteId>/<fallback locale>/cart` (`cart` is not a known locale) |
|
|
50
|
+
| `/:siteId/:localeId` | `/global/en-GB/cart` | `/s/global/en-GB/cart` |
|
|
51
|
+
|
|
52
|
+
Query strings are preserved.
|
|
53
|
+
|
|
54
|
+
## Cookie layers (local dev)
|
|
55
|
+
|
|
56
|
+
1. Set-Cookie headers from SFCC: `Domain=.salesforce.com` rewritten to `localhost`.
|
|
57
|
+
2. Storefront Next's own cookies are written to `localhost` directly.
|
|
58
|
+
3. Injected `document.cookie` patch in proxied HTML so SFRA client-side cookie writes get the same treatment (SFRA omits `Secure` on `http://localhost`). Localhost-only; no production equivalent.
|
|
59
|
+
|
|
60
|
+
## Custom matcher (last resort)
|
|
61
|
+
|
|
62
|
+
Edit `vite-plugins/hybrid-proxy.ts`:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { hybridProxyPlugin, shouldRouteToNext } from '@salesforce/storefront-next-dev';
|
|
66
|
+
|
|
67
|
+
hybridProxyPlugin({
|
|
68
|
+
// ...existing options...
|
|
69
|
+
routeMatcher: (pathname, rules) => {
|
|
70
|
+
if (pathname === '/my-custom-page') return true; // Storefront Next
|
|
71
|
+
if (pathname === '/legacy-only') return false; // SFRA
|
|
72
|
+
return shouldRouteToNext(pathname, rules); // default eCDN-style matching
|
|
73
|
+
},
|
|
74
|
+
// rewritePath: (pathname) => myRewrite(pathname) ?? null, // non-standard URL models only
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If the matcher throws, the request falls through to React Router. Overriding the matcher means local routing no longer matches eCDN behavior; avoid unless necessary.
|
|
79
|
+
|
|
80
|
+
## Gotchas
|
|
81
|
+
|
|
82
|
+
- Rules out of sync with eCDN: local behavior differs from production.
|
|
83
|
+
- A proxied path that does not exist on SFRA returns whatever SFCC returns.
|
|
84
|
+
- `HYBRID_PROXY_LOCALE` must be a locale SFRA accepts in `/s/<site>/<locale>/`; match the site's `defaultLocale`.
|
|
85
|
+
- Unsupported compression formats skip body rewriting and leak SFCC URLs.
|
|
86
|
+
- Production: do not rely on the plugin; configure eCDN routing (`b2c-cli:b2c-ecdn`) and the same cookie domain on both sides.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfnext-i18n
|
|
3
|
+
description: >-
|
|
4
|
+
Translate and localize a Storefront Next storefront with i18next: useTranslation in components, getTranslation in loaders/actions/utilities, translations.json namespaces, pluralization and interpolation, Zod validation-message factories, adding a new language or locale, extension translations, and locale/currency switching. Use when adding or editing strings, "add a Brazilian Portuguese locale", supportedLngs / fallbackLng / supportedLocales, src/locales, locales:aggregate-extensions, LocaleSwitcher, mockI18nContext, hydration mismatch on translated text, or missing-key problems. Do not use for site/locale URL prefix routing (use `storefront-next:sfnext-routing`), site and currency configuration keys (use `storefront-next:sfnext-configuration`), or extension scaffolding (use `storefront-next:sfnext-extensions`).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Storefront Next Internationalization
|
|
8
|
+
|
|
9
|
+
Storefront Next uses `i18next` with a server instance (all languages loaded) and a browser instance (loads the active language as a static JS chunk). The infrastructure comes from `@salesforce/storefront-next-runtime/i18n`; your project owns the translations in `src/locales/`. The full guide ships in your project as `docs/README-I18N.md`. Caution: its locale-detection and `set-locale` passages are outdated; trust the code and this skill.
|
|
10
|
+
|
|
11
|
+
## Which API to use
|
|
12
|
+
|
|
13
|
+
| Where | API |
|
|
14
|
+
|-------|-----|
|
|
15
|
+
| React components | `useTranslation` from `react-i18next` |
|
|
16
|
+
| Loaders, actions, middleware, utilities, tests | `getTranslation` from `@salesforce/storefront-next-runtime/i18n` |
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { useTranslation } from 'react-i18next';
|
|
20
|
+
|
|
21
|
+
export function AddToCart({ count }: { count: number }) {
|
|
22
|
+
const { t } = useTranslation('product'); // namespace = top-level key in translations.json
|
|
23
|
+
return <button>{t('addToCart', { count })}</button>;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import type { LoaderFunctionArgs } from 'react-router';
|
|
29
|
+
import { getTranslation } from '@salesforce/storefront-next-runtime/i18n';
|
|
30
|
+
|
|
31
|
+
export function loader({ context }: LoaderFunctionArgs) {
|
|
32
|
+
const { t } = getTranslation(context); // server: pass the router context
|
|
33
|
+
return { title: t('product:title') };
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- Without a namespace argument, prefix keys: `useTranslation()` then `t('product:title')` works. You lose key autocomplete, not correctness.
|
|
38
|
+
- Client-only non-component code may call `getTranslation()` with no argument.
|
|
39
|
+
- Other exports from the same module: `getLocale`, `mockI18nContext` (tests), `createI18nMiddleware`.
|
|
40
|
+
|
|
41
|
+
## File layout
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
src/locales/
|
|
45
|
+
├── index.ts # barrel: explicit import of every locale
|
|
46
|
+
├── types.ts # DeepPartial<T>
|
|
47
|
+
└── en-US/
|
|
48
|
+
├── index.ts # merges translations.json + aggregated extension strings
|
|
49
|
+
└── translations.json # ONE file; each top-level key is a namespace
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The project ships 17 locale directories (`ls src/locales`). Each `translations.json` is a single file whose top-level keys (`product`, `cart`, `checkout`, `routeError`, ...) are namespaces. There is no separate per-namespace file.
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"product": {
|
|
57
|
+
"addToCart": "Add to cart",
|
|
58
|
+
"greeting": "Hello, {{name}}!",
|
|
59
|
+
"itemCount_one": "{{count}} item",
|
|
60
|
+
"itemCount_other": "{{count}} items"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Interpolation uses `{{var}}`.
|
|
66
|
+
- Plurals use i18next suffix keys (`_one`, `_other`, plus `_zero`, `_few`, ... where a language needs them), as in the shipped files. Call `t('itemCount', { count })` with the base key. Do not use nested `{ one, other }` objects.
|
|
67
|
+
- `t()` key types come from the `en-GB` resources (`src/middlewares/i18next.server.ts`). Non-English locales are typed `satisfies DeepPartial<typeof enUS>`, so they may omit keys (i18next falls back to `fallbackLng`) but keys they include must match the English shape.
|
|
68
|
+
|
|
69
|
+
To customize copy, edit `translations.json` directly.
|
|
70
|
+
|
|
71
|
+
## Add a new locale (checklist)
|
|
72
|
+
|
|
73
|
+
Keep these in sync or the locale silently never appears:
|
|
74
|
+
|
|
75
|
+
1. Create `src/locales/pt-BR/index.ts` and `translations.json`. Copy an existing locale (for example `de-DE`, which carries the `DeepPartial` typing) and translate.
|
|
76
|
+
2. Import and register it in the barrel `src/locales/index.ts` (both the import and the exported object).
|
|
77
|
+
3. Add the id to `i18n.supportedLngs` in `config.server.ts` (and check `fallbackLng`).
|
|
78
|
+
4. Add `{ id: 'pt-BR', preferredCurrency: 'BRL' }` to the site's `supportedLocales`, and make sure that currency is in the site's `supportedCurrencies`. The shape is `commerce.sites[]`; see `storefront-next:sfnext-configuration`.
|
|
79
|
+
5. Add extension translations for the new locale (`src/extensions/<ext>/locales/pt-BR/translations.json`) if the extensions you use ship translations.
|
|
80
|
+
6. Run `pnpm locales:aggregate-extensions` (also run automatically by `pnpm dev` and `pnpm build`).
|
|
81
|
+
7. Verify: `pnpm dev`, then open the site under the new locale prefix and switch via the locale switcher.
|
|
82
|
+
|
|
83
|
+
Details and currency rules: [references/locale-config.md](references/locale-config.md).
|
|
84
|
+
|
|
85
|
+
## How the active locale is chosen
|
|
86
|
+
|
|
87
|
+
The locale is resolved from the site context, driven by the URL prefix (default `/:siteId/:localeId`, from `config.url.prefix`). `siteContextMiddleware` runs before `i18nextMiddleware` (see the middleware array in `src/root.tsx`). It is not read from a `lng` cookie or `Accept-Language`.
|
|
88
|
+
|
|
89
|
+
`src/components/locale-switcher` changes locale by navigating to the same page under the rebuilt prefix (`buildUrl`, `resolvePrefix`, `stripPathPrefix` from `@salesforce/storefront-next-runtime/site-context`) and posting the choice to persist it. There is no `action.set-locale` route. Render it with `import LocaleSwitcher from '@/components/locale-switcher'`. Currency is switched independently with `src/components/currency-switcher`.
|
|
90
|
+
|
|
91
|
+
## Extension translations
|
|
92
|
+
|
|
93
|
+
Each extension keeps its strings in `src/extensions/<name>/locales/<locale>/translations.json`. Its namespace is `ext` + PascalCase directory name:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
const { t } = useTranslation('extStoreLocator'); // src/extensions/store-locator
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`src/extensions/locales/<locale>/index.ts` is generated by `pnpm locales:aggregate-extensions`. Never edit it, and leave its `// @sfdc-extension-line` marker comments alone.
|
|
100
|
+
|
|
101
|
+
## Validation messages: Zod schema factories
|
|
102
|
+
|
|
103
|
+
Module-level `t()` runs before i18next is initialized. Build the schema from a function:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import { useMemo } from 'react';
|
|
107
|
+
import { z } from 'zod';
|
|
108
|
+
import type { TFunction } from 'i18next';
|
|
109
|
+
import { useTranslation } from 'react-i18next';
|
|
110
|
+
|
|
111
|
+
export const createSchema = (t: TFunction) =>
|
|
112
|
+
z.object({ email: z.string().email(t('validation:emailInvalid')) });
|
|
113
|
+
|
|
114
|
+
function MyForm() {
|
|
115
|
+
const { t } = useTranslation();
|
|
116
|
+
const schema = useMemo(() => createSchema(t as unknown as TFunction), [t]);
|
|
117
|
+
// useForm({ resolver: zodResolver(schema) })
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`createCustomerProfileFormSchema` in `src/components/customer-profile-form/index.tsx` is a working example.
|
|
122
|
+
|
|
123
|
+
## Testing translations
|
|
124
|
+
|
|
125
|
+
`vitest.setup.ts` initializes i18next with all locales (language `en-GB`), so components using `useTranslation` render real English text. For loaders/actions, `createTestContext({ locale })` from `@/lib/test-utils` wires `mockI18nContext` for you; call it directly when building a context by hand. Assert on text with `getTranslation()` or literal English. Locale completeness tests (for example `src/locales/*.locale-completeness.test.ts`) are a good pattern for feature-specific keys. See `storefront-next:sfnext-testing`.
|
|
126
|
+
|
|
127
|
+
## Pitfalls
|
|
128
|
+
|
|
129
|
+
| Pitfall | Fix |
|
|
130
|
+
|---------|-----|
|
|
131
|
+
| Importing `getTranslation` from `@/lib/i18next` | It lives in `@salesforce/storefront-next-runtime/i18n`. |
|
|
132
|
+
| Importing `@salesforce/storefront-next-runtime/i18n/client` from a `*.server.ts` file | Browser-only; it fails to bundle and lint blocks it. |
|
|
133
|
+
| Statically importing `@/locales` in `root.tsx` or the error boundary | Pulls every language into the client bundle; `src/locales/locale-imports.test.ts` guards this. The root loader passes `errorTranslations` (the `routeError` bundle) instead. |
|
|
134
|
+
| New locale not showing up | Check all of: `src/locales/index.ts`, `supportedLngs`, site `supportedLocales`. |
|
|
135
|
+
| `t()` at module scope | Use a factory or call inside the component/function. |
|
|
136
|
+
| Hydration mismatch on translated text | `src/i18n-client-init.ts` gates hydration with `whenI18nReady()`; do not bypass it. |
|
|
137
|
+
| Same key name in two namespaces | Use `t('ns:key')` to disambiguate. |
|
|
138
|
+
| "Click here" style link text | `jsx-a11y/anchor-ambiguous-text` cannot see translated strings; review link copy in JSON (see `storefront-next:sfnext-accessibility`). |
|
|
139
|
+
|
|
140
|
+
## Finding more
|
|
141
|
+
|
|
142
|
+
- `docs/README-I18N.md` (architecture, currency flow, using a different i18n library) and the doc index in `AGENTS.md`.
|
|
143
|
+
- `b2c docs search "i18n"` (or the MCP `docs_search` tool) for the Storefront Next docs corpus.
|
|
144
|
+
|
|
145
|
+
## Related Skills
|
|
146
|
+
|
|
147
|
+
- `storefront-next:sfnext-configuration` - `i18n`, `supportedLocales`, `supportedCurrencies` config
|
|
148
|
+
- `storefront-next:sfnext-routing` - site/locale URL prefix and site-aware links
|
|
149
|
+
- `storefront-next:sfnext-extensions` - extension structure and `ext*` namespaces
|
|
150
|
+
- `storefront-next:sfnext-components` - using translations in UI components
|
|
151
|
+
- `storefront-next:sfnext-testing` - unit and story tests
|
|
152
|
+
- `storefront-next:sfnext-accessibility` - translated link and label text
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Locale and currency configuration
|
|
2
|
+
|
|
3
|
+
Locale support is declared in several places that must agree. All keys below live in `config.server.ts`; see `storefront-next:sfnext-configuration` and `docs/README-CONFIG-OPTIONS.md` for the full option reference.
|
|
4
|
+
|
|
5
|
+
## Must stay in sync
|
|
6
|
+
|
|
7
|
+
| Place | What |
|
|
8
|
+
|-------|------|
|
|
9
|
+
| `i18n.supportedLngs` / `i18n.fallbackLng` | Languages the app serves; `src/middlewares/i18next.server.ts` reads them |
|
|
10
|
+
| `commerce.sites[].supportedLocales` | `{ id, preferredCurrency }` per locale, per site |
|
|
11
|
+
| `commerce.sites[].supportedCurrencies` | Currencies a shopper may pick; each `preferredCurrency` must be listed |
|
|
12
|
+
| `src/locales/<id>/` + `src/locales/index.ts` | Translation files and barrel registration |
|
|
13
|
+
|
|
14
|
+
Rules of thumb:
|
|
15
|
+
|
|
16
|
+
- Every id in `supportedLngs` needs a directory in `src/locales/` and an entry in the barrel.
|
|
17
|
+
- Every id in `supportedLngs` should appear in at least one site's `supportedLocales`; the locale switcher only lists languages that are in both `supportedLngs` and the current site's `supportedLocales`.
|
|
18
|
+
- Different sites can expose different subsets of locales.
|
|
19
|
+
- Env overrides use the `PUBLIC__` double-underscore convention described in `docs/README-CONFIG.md`.
|
|
20
|
+
|
|
21
|
+
## Currency
|
|
22
|
+
|
|
23
|
+
Locale and currency switch independently. Priority: shopper's manual choice (cookie) over the locale's `preferredCurrency` over the site default currency. The UI is `src/components/currency-switcher`.
|
|
24
|
+
|
|
25
|
+
## Typing
|
|
26
|
+
|
|
27
|
+
`src/middlewares/i18next.server.ts` augments i18next `CustomTypeOptions` with the `en-GB` resources so `t('ns:key')` is type-checked. `src/locales/types.ts` exports `DeepPartial`; non-English locales use `satisfies ResourceLanguage satisfies DeepPartial<typeof enUS>`. Run `pnpm typecheck` after adding keys: a key present in a translated locale but missing in English, or with a different nested shape, fails the type check.
|
|
28
|
+
|
|
29
|
+
## Client loading
|
|
30
|
+
|
|
31
|
+
`src/i18n-client-init.ts` calls `initI18next` from `@salesforce/storefront-next-runtime/i18n/client` with a `loadLocale` that dynamically imports `@/locales/<language>/index.ts`, so each language becomes its own chunk. `whenI18nReady()` delays hydration until the active language chunk is loaded (with a timeout safety net). Keep the `import()` template there so Vite can split the chunks.
|
|
32
|
+
|
|
33
|
+
## Using a different i18n library
|
|
34
|
+
|
|
35
|
+
i18next is only the translation layer; locale resolution is independent (site context). `docs/README-I18N.md` ("Using a Different i18n Library") describes what to replace.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sfnext-overview
|
|
3
|
+
description: >-
|
|
4
|
+
Start here for any Salesforce Commerce Storefront Next (sfnext) task: a router that maps what you want to do to the right storefront-next skill, says to read your project's AGENTS.md and docs/README-*.md first, and carries a cheat sheet for the sfnext CLI, the b2c CLI, the b2c-dx-mcp tools, and the docs search fallback. Use when starting work in a Storefront Next project, when unsure which skill applies, when asked "how do I do X in Storefront Next", "what commands exist", or "where is the documentation". Do not use once a specific area is clear; go straight to that skill (for example `storefront-next:sfnext-routing` or `storefront-next:sfnext-seo`).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Storefront Next Overview and Router
|
|
8
|
+
|
|
9
|
+
## Before anything else
|
|
10
|
+
|
|
11
|
+
1. Read `AGENTS.md` at your project root. It is the source of truth for project structure, commands, and conventions; skills never override it.
|
|
12
|
+
2. Check `docs/README-*.md` (one per topic) and `instructions/*.mdc` in the project. Prefer them over memory.
|
|
13
|
+
3. Versions and compatibility: `docs/COMPATIBILITY.md` and `package.json#storefrontNext`.
|
|
14
|
+
4. Requirements: Node >= 24, pnpm >= 10.28.
|
|
15
|
+
|
|
16
|
+
## Which skill for which task
|
|
17
|
+
|
|
18
|
+
| I want to... | Skill |
|
|
19
|
+
|---|---|
|
|
20
|
+
| Create a project, install, run locally, pick a starter theme | `storefront-next:sfnext-project-setup` |
|
|
21
|
+
| Change `config.server.ts`, env overrides, feature flags, multi-site config | `storefront-next:sfnext-configuration` |
|
|
22
|
+
| Build a bundle, push to Managed Runtime, deploy cartridges, env vars | `storefront-next:sfnext-deployment` |
|
|
23
|
+
| Add or change a route, loader, action, URL pattern | `storefront-next:sfnext-routing` |
|
|
24
|
+
| Fetch data, SCAPI calls in loaders, streaming, Suspense | `storefront-next:sfnext-data-fetching` |
|
|
25
|
+
| Control loader revalidation and caching after actions | `storefront-next:sfnext-revalidation` |
|
|
26
|
+
| Client state, contexts, stores | `storefront-next:sfnext-state-management` |
|
|
27
|
+
| Speed, bundle size, Lighthouse, web vitals | `storefront-next:sfnext-performance` |
|
|
28
|
+
| Login, SLAS, guest/registered sessions, passkeys, social login | `storefront-next:sfnext-authentication` |
|
|
29
|
+
| Add or inspect SCAPI endpoints and clients (including custom APIs) | `storefront-next:sfnext-scapi` |
|
|
30
|
+
| Serve some routes from another storefront (hybrid proxy) | `storefront-next:sfnext-hybrid-storefronts` |
|
|
31
|
+
| Build or modify UI components | `storefront-next:sfnext-components` |
|
|
32
|
+
| Design tokens, Tailwind, styling | `storefront-next:sfnext-theming` |
|
|
33
|
+
| Page Designer components and regions | `storefront-next:sfnext-page-designer` |
|
|
34
|
+
| Author or install extensions, UITargets | `storefront-next:sfnext-extensions` |
|
|
35
|
+
| Translations, locales, language switching | `storefront-next:sfnext-i18n` |
|
|
36
|
+
| Unit, component, Storybook and e2e tests | `storefront-next:sfnext-testing` |
|
|
37
|
+
| CSP, security headers, bot protection | `storefront-next:sfnext-security` |
|
|
38
|
+
| Analytics adapters, consent banner, attribution | `storefront-next:sfnext-analytics-consent` |
|
|
39
|
+
| Meta tags, JSON-LD, canonical URLs, seoRoutes | `storefront-next:sfnext-seo` |
|
|
40
|
+
| Shopper Context, order management, guest order lookup, email cartridge, shipped extensions | `storefront-next:sfnext-commerce-features` |
|
|
41
|
+
| Lint, typecheck, pre-merge checks | `storefront-next:sfnext-quality-gates` |
|
|
42
|
+
| Accessibility checks and fixes | `storefront-next:sfnext-accessibility` |
|
|
43
|
+
|
|
44
|
+
Figma-to-Page-Designer work lives in the separate `figma-to-sfnext-pagedesigner` plugin.
|
|
45
|
+
|
|
46
|
+
## sfnext CLI cheat sheet
|
|
47
|
+
|
|
48
|
+
Installed with the project (`@salesforce/storefront-next-dev`). Prefer the `package.json` scripts, which wrap these.
|
|
49
|
+
|
|
50
|
+
| Command | Purpose |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `sfnext create-storefront` | Scaffold a project (`--vertical` picks the starter theme) |
|
|
53
|
+
| `sfnext dev` / `sfnext preview` | Dev server / preview of the built app |
|
|
54
|
+
| `sfnext create-bundle`, `sfnext push` | Build and push a bundle to Managed Runtime |
|
|
55
|
+
| `sfnext prepare-local` | Prepare a local build |
|
|
56
|
+
| `sfnext generate-cartridge`, `validate-cartridge`, `deploy-cartridge` | Cartridge build, check, upload |
|
|
57
|
+
| `sfnext setup-base-cartridge` | Register the SLAS scope for the base cartridge |
|
|
58
|
+
| `sfnext create-instructions` | Generate extension install instructions |
|
|
59
|
+
| `sfnext config inspect`, `config aggregate-extensions` | Show resolved config; merge extension config |
|
|
60
|
+
| `sfnext extensions create|install|list|remove` | Manage extensions |
|
|
61
|
+
| `sfnext scapi add|available|list|remove` | Manage SCAPI client wiring |
|
|
62
|
+
| `sfnext locales aggregate-extensions` | Merge extension locale files |
|
|
63
|
+
|
|
64
|
+
Run `sfnext <command> --help` for flags; check your project's `package.json` scripts for the exact invocations.
|
|
65
|
+
|
|
66
|
+
## b2c CLI cheat sheet
|
|
67
|
+
|
|
68
|
+
Use `b2c` (`npx @salesforce/b2c-cli` if not installed) for platform work around the storefront:
|
|
69
|
+
|
|
70
|
+
| Need | Command family |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Managed Runtime projects, envs, env vars, bundles, logs | `b2c mrt ...` (skill `b2c-cli:b2c-mrt`) |
|
|
73
|
+
| Deploy or watch cartridges on an instance | `b2c code deploy`, `b2c code watch` |
|
|
74
|
+
| SCAPI schemas and custom APIs | `b2c scapi schemas ...`, `b2c scapi custom ...` |
|
|
75
|
+
| SLAS clients | `b2c slas ...` (skill `b2c-cli:b2c-slas`) |
|
|
76
|
+
| Instance and site data, WebDAV, jobs, logs | `b2c sites`, `b2c webdav`, `b2c job`, `b2c logs` |
|
|
77
|
+
| Documentation | `b2c docs search`, `b2c docs read` |
|
|
78
|
+
|
|
79
|
+
## MCP tools (b2c-dx-mcp, STOREFRONTNEXT toolset)
|
|
80
|
+
|
|
81
|
+
`mrt_bundle_push`, `mrt_logs_watch`, `scapi_search`, `scapi_execute`, `scapi_snippet_save`, `scapi_schemas_list`, `scapi_custom_apis_get_status`, plus the docs tools `docs_search`, `docs_read`, `docs_list`, `docs_schema_search`, `docs_schema_read`, `docs_schema_list`. Availability depends on how the MCP server was started; list tools in your client.
|
|
82
|
+
|
|
83
|
+
## Docs search fallback
|
|
84
|
+
|
|
85
|
+
When the project docs and skills do not answer it, search the Storefront Next developer guides:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
b2c docs search "storefront next getting started" --category sfnext
|
|
89
|
+
b2c docs read <id-from-results>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
MCP equivalent: `docs_search` with the storefront category, then `docs_read`. Workspace detection also boosts Storefront Next results automatically in a project. See `b2c-cli:b2c-docs`.
|
|
93
|
+
|
|
94
|
+
## Related Skills
|
|
95
|
+
|
|
96
|
+
- `storefront-next:sfnext-project-setup` - usual next step for new work
|
|
97
|
+
- `storefront-next:sfnext-configuration` - config and env
|
|
98
|
+
- `storefront-next:sfnext-routing` - routes and loaders
|
|
99
|
+
- `storefront-next:sfnext-quality-gates` - checks before you finish
|
|
100
|
+
- `b2c-cli:b2c-docs` - documentation search
|
|
101
|
+
- `b2c-cli:b2c-mrt` - Managed Runtime
|