Skip to content

Commit a07aeb0

Browse files
author
vmarta_sfemu
committed
Sync from monorepo
Template version: 1.0.0-alpha.0 Uses NPM packages @salesforce/storefront-next-* v1.0.0-alpha.0 Synced by: vmarta_sfemu Monorepo SHA: 2cb7b44ae90ec6daa0d7c94e2d573e4158f4d95e Latest change: 2cb7b44ae - Bump up to 1.0.0-alpha.0
1 parent ca7fa0a commit a07aeb0

1,857 files changed

Lines changed: 157589 additions & 147952 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Dev container for the SFCC Storefront retail template.
2+
// Used by GitHub Codespaces and any IDE that supports the dev container spec
3+
// (VS Code Dev Containers, JetBrains Gateway, etc.).
4+
{
5+
"name": "SFCC Storefront Retail Template",
6+
7+
// Pinned Node 24 image. The package.json `engines` field requires Node >=24.
8+
"image": "mcr.microsoft.com/devcontainers/typescript-node:24-bookworm",
9+
10+
// Floor for Codespaces machine size. The monorepo is large enough that
11+
// 2-core/4gb instances make `pnpm install` and Vite cold starts painful.
12+
"hostRequirements": {
13+
"cpus": 4,
14+
"memory": "8gb"
15+
},
16+
17+
"features": {
18+
"ghcr.io/devcontainers/features/github-cli:1": {}
19+
},
20+
21+
// Persist pnpm's content-addressable store across container rebuilds.
22+
// The store is shared by all projects on the host, so subsequent installs
23+
// hard-link from the cache instead of re-downloading from npm.
24+
"mounts": ["source=storefront-next-pnpm-store,target=/home/node/.local/share/pnpm/store,type=volume"],
25+
26+
// One-time setup: activate the pinned pnpm version and ensure the mounted
27+
// pnpm store volume is writable by the non-root `node` user. Corepack ships
28+
// with Node, so no separate pnpm install step is needed.
29+
"onCreateCommand": "sudo corepack enable && corepack prepare pnpm@10.28.0 --activate && sudo chown -R node:node /home/node/.local/share/pnpm",
30+
31+
// Install dependencies here (not in `onCreateCommand`) so Codespaces
32+
// prebuilds cover it and re-run it when `package.json` / `pnpm-lock.yaml`
33+
// change — prebuilt codespaces start with `node_modules` already populated.
34+
//
35+
// `--ignore-scripts` skips all postinstall scripts so pnpm 10's strict
36+
// build-script gate doesn't fail in non-interactive mode (no TTY).
37+
// If a missing postinstall surfaces later (e.g. a native binding error
38+
// during `pnpm dev`/`pnpm test`), run `pnpm rebuild <pkg>` once
39+
// interactively in the codespace terminal to compile that package.
40+
"updateContentCommand": "pnpm install --ignore-scripts",
41+
42+
// Download the VSIX and install it here: `/tmp` is cleared on container
43+
// restart, and the `code` CLI is only on PATH once the editor attaches.
44+
// Then mark port 65535 public so AM can redirect to the codespace's
45+
// app.github.dev URL during browser-based sign-in.
46+
"postAttachCommand": "curl -fL -o /tmp/commerce-vibes.vsix https://github.com/storefront-setup-test/commerce-vibes-public/raw/main/commerce-vibes-0.0.1.vsix && code --install-extension /tmp/commerce-vibes.vsix --force; gh codespace ports visibility 65535:public -c $CODESPACE_NAME 2>/dev/null",
47+
48+
// Export the public Codespaces URL the extension should use as redirect_uri.
49+
// The extension reads SFCC_AM_REDIRECT_URI in place of the hardcoded
50+
// http://127.0.0.1:65535/callback when running in a Codespace.
51+
"postStartCommand": "echo \"export SFCC_AM_REDIRECT_URI=https://${CODESPACE_NAME}-65535.app.github.dev/callback\" > ~/.sfcc_env && grep -q 'source ~/.sfcc_env' ~/.bashrc || echo 'source ~/.sfcc_env 2>/dev/null' >> ~/.bashrc",
52+
53+
// Port 65535 is the AM OAuth loopback port the Commerce Vibes extension
54+
// binds to. In Codespaces it must be forwarded + public so the browser-side
55+
// AM redirect can reach the loopback server inside the container.
56+
"forwardPorts": [5173, 6006, 65535],
57+
"portsAttributes": {
58+
"5173": {
59+
"label": "Dev Server",
60+
"onAutoForward": "openPreview"
61+
},
62+
"6006": {
63+
"label": "Storybook",
64+
"onAutoForward": "silent"
65+
},
66+
"65535": {
67+
"label": "Commerce Vibes AM OAuth Callback",
68+
"onAutoForward": "silent",
69+
"visibility": "public"
70+
}
71+
},
72+
73+
"customizations": {
74+
"vscode": {
75+
"extensions": [
76+
"dbaeumer.vscode-eslint",
77+
"esbenp.prettier-vscode",
78+
"bradlc.vscode-tailwindcss",
79+
"ms-playwright.playwright",
80+
"vitest.explorer"
81+
],
82+
"settings": {
83+
"editor.formatOnSave": true,
84+
"editor.defaultFormatter": "esbenp.prettier-vscode",
85+
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
86+
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
87+
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
88+
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
89+
"eslint.useFlatConfig": true,
90+
"typescript.tsdk": "node_modules/typescript/lib"
91+
}
92+
}
93+
},
94+
95+
"remoteUser": "node"
96+
}

.env.default

Lines changed: 20 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -1,228 +1,29 @@
11
# ============================================================================
2-
# Managed Runtime Deployment Configuration
2+
# Storefront Next - Required Configuration
3+
# ============================================================================
4+
# Only the variables below are REQUIRED to run the app or deploy it.
5+
# All other settings have sensible defaults in config.server.ts.
6+
#
7+
# To enable optional features (hybrid proxy, Marketing Cloud, Turnstile,
8+
# multi-site, commerce agent, etc.), see:
9+
# - Get started: README.md
10+
# - Full reference: docs/README-CONFIG.md
11+
# - All config options: docs/README-CONFIG-OPTIONS.md
312
# ============================================================================
413

5-
# Project slug - the unique identifier for your project on Managed Runtime
6-
# If not set, defaults to package.json name
14+
# ----------------------------------------------------------------------------
15+
# Managed Runtime Deployment (used by `pnpm push`)
16+
# These are read by the storefront-next-dev CLI; they are not runtime config.
17+
# ----------------------------------------------------------------------------
718
MRT_PROJECT=my-project-slug
8-
9-
# Deploy target environment (e.g., production, staging, development)
10-
# If not set, deployment will upload without deploying to a specific target
1119
MRT_TARGET=development
1220

13-
# ============================================================================
14-
# Application Configuration
15-
# All PUBLIC__ prefixed variables are automatically merged into config.server.ts
16-
# Use double underscore (__) to target nested config paths
17-
# See docs/README-CONFIG.md for complete documentation
18-
# ============================================================================
19-
20-
# ============================================================================
21-
# Commerce Cloud API Configuration (REQUIRED)
22-
# ============================================================================
21+
# ----------------------------------------------------------------------------
22+
# B2C Commerce API credentials (REQUIRED for the storefront to call SCAPI)
23+
# Pre-filled with the public demo backend (zzrf-001) so that
24+
# `cp .env.default .env && pnpm dev` boots out-of-the-box. Replace these with
25+
# your own credentials before deploying or pointing at a real storefront.
26+
# ----------------------------------------------------------------------------
2327
PUBLIC__app__commerce__api__clientId=c9c45bfd-0ed3-4aa2-9971-40f88962b836
2428
PUBLIC__app__commerce__api__organizationId=f_ecom_zzrf_001
2529
PUBLIC__app__commerce__api__shortCode=kv7kzm78
26-
27-
# Optional API settings
28-
PUBLIC__app__commerce__api__proxy=/mobify/proxy/api
29-
PUBLIC__app__commerce__api__callback=/callback
30-
PUBLIC__app__commerce__api__privateKeyEnabled=false
31-
32-
# ============================================================================
33-
# SLAS Client Secret (Server-only - NEVER use PUBLIC__ prefix for secrets!)
34-
# ============================================================================
35-
# Read directly from process.env in server-side code (loaders/actions/middleware)
36-
# COMMERCE_API_SLAS_SECRET=your-secret-here
37-
38-
# ============================================================================
39-
# Site/Multi sites Configuration (Optional), use when you'd like
40-
# to override the values in config.server.ts
41-
# ============================================================================
42-
# PUBLIC__app__defaultSiteId=RefArchGlobal
43-
44-
# The quote wrapping the array value is needed because it is multi-line.
45-
# If you were to copy it for MRT environment variable, make sure to NOT use any quote:
46-
# - convert the array value to a single line and make sure it's valid
47-
# - do NOT use single/double quote to wrap the array
48-
49-
# This works for both MRT env, and local .env
50-
# PUBLIC__app__commerce__sites=[{"id":"RefArch","defaultLocale":"en-US","defaultCurrency":"USD","supportedLocales":[{"id":"en-US","preferredCurrency":"USD"}],"supportedCurrencies":["USD"]}]
51-
52-
# This only works with local env file
53-
# PUBLIC__app__commerce__sites='[
54-
# {
55-
# "id": "RefArchGlobal",
56-
# "defaultLocale": "en-GB",
57-
# "defaultCurrency": "GBP",
58-
# "supportedLocales": [
59-
# {"id": "en-US", "preferredCurrency": "USD"},
60-
# {"id": "da-DK", "preferredCurrency": "EUR"},
61-
# {"id": "de-DE", "preferredCurrency": "EUR"},
62-
# {"id": "en-GB", "preferredCurrency": "GBP"},
63-
# {"id": "es-MX", "preferredCurrency": "USD"},
64-
# {"id": "fi-FI", "preferredCurrency": "EUR"},
65-
# {"id": "fr-FR", "preferredCurrency": "EUR"},
66-
# {"id": "it-IT", "preferredCurrency": "EUR"},
67-
# {"id": "ja-JP", "preferredCurrency": "JPY"},
68-
# {"id": "ko-KR", "preferredCurrency": "KRW"},
69-
# {"id": "nl-NL", "preferredCurrency": "EUR"},
70-
# {"id": "no-NO", "preferredCurrency": "EUR"},
71-
# {"id": "pl-PL", "preferredCurrency": "EUR"},
72-
# {"id": "pt-BR", "preferredCurrency": "BRL"},
73-
# {"id": "sv-SE", "preferredCurrency": "EUR"},
74-
# {"id": "zh-CN", "preferredCurrency": "CNY"},
75-
# {"id": "zh-TW", "preferredCurrency": "TWD"}
76-
# ],
77-
# "supportedCurrencies": ["EUR", "GBP"]
78-
# }
79-
# ]'
80-
81-
# ============================================================================
82-
# Hybrid Flags
83-
# ============================================================================
84-
PUBLIC__app__hybrid__enabled=false
85-
86-
# ============================================================================
87-
# Hybrid Proxy (Local Development Only)
88-
# ============================================================================
89-
# Enable silent HTTP proxying with cookie rewriting for unified storefront experience
90-
#
91-
# How it works:
92-
# - Vite plugin intercepts requests BEFORE React Router
93-
# - Routes matching HYBRID_ROUTING_RULES → Handled by Storefront Next (React Router)
94-
# - Routes NOT matching → Silently proxied to SFCC with cookie rewriting
95-
# - Path transformation: /cart → /s/{siteId}/{locale}/cart (automatic)
96-
#
97-
# ⚠️ LOCAL DEV ONLY: This only works with `pnpm dev` (Vite dev server)
98-
# ⚠️ MRT/Production: Use Cloudflare eCDN for routing (not this plugin)
99-
#
100-
# ⚠️ REQUIRES: SFCC_ORIGIN and PUBLIC__app__defaultSiteId
101-
#
102-
# Locale for path transformation:
103-
# - Uses HYBRID_PROXY_LOCALE if set (hybrid-specific override)
104-
# - Falls back to PUBLIC__app__i18n__fallbackLng
105-
# - Should match your site's defaultLocale (config.app.commerce.sites[0].defaultLocale)
106-
#
107-
# Example: URL stays localhost:5173/cart (no redirect), but content comes from SFRA
108-
# Cookies rewritten to Domain=localhost for session continuity across Next and SFRA pages
109-
HYBRID_PROXY_ENABLED=false
110-
111-
# Optional: Override locale for SFRA path transformation (defaults to PUBLIC__app__i18n__fallbackLng)
112-
# HYBRID_PROXY_LOCALE=en-GB
113-
114-
# Cloudflare-style routing rules (Cloudflare "matches" expression format)
115-
# Paths matching → Storefront Next | Paths NOT matching → Proxied to SFCC
116-
#
117-
# Example (home, product, category, search, account go to Next):
118-
# HYBRID_ROUTING_RULES='(http.request.uri.path matches "^/$" 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 "^/account.*" or http.request.uri.path matches "^/resource/.*")'
119-
#
120-
# Note: /mobify/*, *.data, and Vite assets are auto-excluded (never proxied)
121-
HYBRID_ROUTING_RULES=
122-
123-
# SFCC origin URL for proxying (REQUIRED when HYBRID_PROXY_ENABLED=true)
124-
# Example: https://zzrf-001.dx.commercecloud.salesforce.com
125-
SFCC_ORIGIN=
126-
127-
# ============================================================================
128-
# Auth Configuration
129-
# ============================================================================
130-
# OTP length for authentication methods with mode set to email (6 or 8)
131-
PUBLIC__app__auth__otpLength=8
132-
133-
# ============================================================================
134-
# Feature Flags
135-
# ============================================================================
136-
137-
# Passwordless Login Configuration
138-
PUBLIC__app__features__passwordlessLogin__enabled=true
139-
# mode - Authentication delivery method for passwordless login.
140-
# 'email' - User receives a one-time passcode (OTP) via email through SLAS email service.
141-
# 'callback' - User receives one-time passcode (OTP) using a custom callback flow.
142-
PUBLIC__app__features__passwordlessLogin__mode=email
143-
# callbackUri - Only needed when mode is 'callback'. Defaults to '/passwordless-login-callback' if not set. Can be an absolute URL or a path.
144-
# PUBLIC__app__features__passwordlessLogin__callbackUri='/passwordless-login-callback'
145-
# landingUri - Path where the magic link redirects the user. Defaults to '/login' if not set.
146-
# PUBLIC__app__features__passwordlessLogin__landingUri='/login'
147-
148-
# Reset Password Configuration
149-
# mode - Delivery method for reset password.
150-
# 'email' - User receives a one-time passcode (OTP) via email through SLAS email service.
151-
# 'callback' - User receives one-time passcode (OTP) using a custom callback flow.
152-
PUBLIC__app__features__resetPassword__mode=email
153-
# callbackUri - Only needed when mode is 'callback'. Defaults to '/reset-password-callback' if not set. Can be an absolute URL or a path.
154-
# PUBLIC__app__features__resetPassword__callbackUri='/reset-password-callback'
155-
# landingUri - Path where users land to create a new password after requesting a reset. Defaults to '/reset-password' if not set.
156-
# PUBLIC__app__features__resetPassword__landingUri='/reset-password'
157-
158-
# MRT-based Page Designer Resolution Configuration
159-
# Enable when using the MRT Data Store to resolve Page Designer pages instead of fetching from SCAPI.
160-
PUBLIC__app__features__mrtBasedPageDesignerResolution=false
161-
162-
# Social Login Configuration
163-
PUBLIC__app__features__socialLogin__enabled=true
164-
PUBLIC__app__features__socialLogin__callbackUri=/social-callback
165-
PUBLIC__app__features__socialLogin__providers=["Apple","Google"]
166-
PUBLIC__app__features__shopperContext__enabled=false
167-
168-
# ============================================================================
169-
# Commerce Agent (Embedded Messaging / Agentforce)
170-
# ============================================================================
171-
# Set PUBLIC__app__commerceAgent__enabled=true and the variables below to enable.
172-
# See src/components/shopper-agent/README.md for setup and environments.
173-
#
174-
# PUBLIC__app__commerceAgent__enabled=false
175-
# PUBLIC__app__commerceAgent__embeddedServiceName=
176-
# PUBLIC__app__commerceAgent__embeddedServiceEndpoint=
177-
# PUBLIC__app__commerceAgent__scriptSourceUrl=
178-
# PUBLIC__app__commerceAgent__scrt2Url=
179-
# PUBLIC__app__commerceAgent__salesforceOrgId=
180-
# PUBLIC__app__commerceAgent__siteId=
181-
# PUBLIC__app__commerceAgent__enableConversationContext=false
182-
# PUBLIC__app__commerceAgent__conversationContext=[]
183-
184-
# ============================================================================
185-
# Turnstile Bot Protection (Local Development)
186-
# ============================================================================
187-
# Turnstile is disabled by default. Uncomment both lines to enable for local testing.
188-
# Cloudflare test key that always passes — for local dev only.
189-
# Production sites must set their own site keys via MRT env vars.
190-
# See e2e/feature-specs/checkout/turnstile-protection.spec.md for setup.
191-
# PUBLIC__security__turnstile__enabled=true
192-
# PUBLIC__security__turnstile__sites={"local-dev":[{"siteKey":"1x00000000000000000000BB","domains":["localhost","127.0.0.1"]}]}
193-
194-
# ============================================================================
195-
# Logging
196-
# ============================================================================
197-
# Log verbosity: error | warn | info | debug
198-
# Defaults to "warn" in production, "info" in development
199-
# Shared with the SDK logger (storefront-next-dev) for unified control
200-
# SFCC_LOG_LEVEL=info
201-
202-
# ============================================================================
203-
# Optional Configuration
204-
# ============================================================================
205-
206-
# Cookie Configuration
207-
# Domain for all application cookies
208-
# If not set, cookies will use browser default (current domain)
209-
# Example: .example.com (allows cookies across subdomains)
210-
# PUBLIC__app__site__cookies__domain=
211-
212-
# Refresh Token Expiry (seconds)
213-
# If not set, uses the expiry time from Commerce Cloud API response
214-
# Guest user (default: ~30 days = 2592000 seconds)
215-
# PUBLIC__app__commerce__api__guestRefreshTokenExpirySeconds=2592000
216-
# Registered user (default: ~90 days = 7776000 seconds)
217-
# PUBLIC__app__commerce__api__registeredRefreshTokenExpirySeconds=7776000
218-
219-
# Google Cloud API Key (for Google Address Autocomplete)
220-
# PUBLIC__app__features__googleCloudAPI__apiKey=
221-
222-
# ============================================================================
223-
# JSON Configuration Example
224-
# ============================================================================
225-
# You can store complex values by encoding JSON into a string.
226-
#
227-
# Example: Override multiple cart configuration values at once
228-
# PUBLIC__app__pages__cart='{"quantityUpdateDebounce":1000,"maxQuantityPerItem":500,"enableSaveForLater":true}'

.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ PUBLIC__app__hybrid__enabled=false
7676
# ============================================================================
7777
# Feature Flags
7878
# ============================================================================
79-
PUBLIC__app__features__passwordlessLogin__enabled=false
8079
PUBLIC__app__features__socialLogin__enabled=true
8180
PUBLIC__app__features__socialLogin__callbackUri=/social-callback
8281
PUBLIC__app__features__socialLogin__providers=["Apple","Google"]

0 commit comments

Comments
 (0)