Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sfnext-deployment

БесплатноБез исполняемых скриптовНе проверен

Build and deploy a Storefront Next storefront: `pnpm build`, `pnpm push` / `sfnext push` to Managed Runtime (MRT), MRT credentials (MRT_API_KEY, MRT_PROJECT…

SalesforceCommerceCloudот SalesforceCommerceCloud★ 58 звёзд на GitHub

Об этом скилле

Storefront Next Deployment

A storefront ships as two independent deployments:

Deployment Target Command
App bundle (SSR server + client assets) Managed Runtime pnpm build then pnpm push
Base cartridge (Page Designer metadata, notification Custom API) B2C Commerce instance (WebDAV code version) pnpm cartridge:deploy

If Business Manager Storefront Setup created your project, reuse its MRT project, environments, and SLAS client. Guides: deployment, launch.

Build

pnpm build        # extension locales + config aggregation, cartridge:generate, react-router build -> build/
pnpm start        # preview the production build at http://localhost:3000
pnpm bundlesize   # build with bundle size limits enforced

Run pnpm typecheck, pnpm lint, and pnpm test before pushing. Node 24 is required locally and on MRT (runtime.ssrParameters.ssrFunctionNodeVersion: '24.x').

Push to Managed Runtime

push does not build; it fails if build/ is missing.

pnpm build && pnpm push                              # upload only (not deployed to an env unless a target is set)
pnpm push -- -m "Release 42" -e staging --wait       # deploy to an env and wait
Need Provide
Credentials MRT_API_KEY (or --api-key, --credentials-file, ~/.mobify); MRT_CLOUD_ORIGIN for a non-default MRT origin
Project slug MRT_PROJECT / -p / SFCC_MRT_PROJECT / dw.json mrtProject (set it explicitly; push errors without one)
Target env MRT_TARGET / -e. Required with --wait. Without it the bundle uploads but is not deployed

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.

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.

Environment variables on MRT

.env is not uploaded by push. Set runtime config on the MRT environment:

pnpm config:push-env                                 # b2c mrt env var push: reads .env, shows a diff, asks to confirm
b2c mrt env var push -f .env.staging -p my-project -e staging --yes   # explicit file, skips prompt
b2c mrt env var set PUBLIC__app__defaultSiteId=MySite -p my-project -e staging
pnpm sfnext config inspect --project my-project --environment staging  # see what is applied

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. Rules for what to set: storefront-next:sfnext-configuration.

Cartridge deployment

pnpm cartridge:generate            # Page Designer metadata from decorators (also run by pnpm build)
pnpm cartridge:validate            # validate generated JSON
pnpm cartridge:deploy              # upload cartridges/ to the instance
pnpm cartridge:deploy -- --delete --reload   # wipe old files first, then activate the code version
  • Deployment is not part of pnpm push and is manual by default.
  • 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.
  • Redeploy whenever Page Designer decorators or attribute definitions change; stale components in Business Manager mean the cartridge is behind.
  • 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).

CI/CD

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.

Pre-launch checklist

  1. `pnpm typecheck && pnpm lint && pnpm test
Полный SKILL.md на GitHub

Установить sfnext-deployment в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/trigger-evals.jsonreferences/MRT-DEPLOYMENT.md

FAQ

Что делает скилл sfnext-deployment?

Build and deploy a Storefront Next storefront: `pnpm build`, `pnpm push` / `sfnext push` to Managed Runtime (MRT), MRT credentials (MRT_API_KEY, MRT_PROJECT, MRT_TARGET), syncing env vars with `pnpm config:push-env`, deploying the base cartridge and Page Designer metadata (`pnpm cartridge:generate|validate|deploy`), the shipped GitHub Actions deploy workflow, bundle size checks, the pre-launch checklist, and upgrading a project (template vs SDK compatibility, react-router pin). Use when a push fails or is rejected, a deployed site returns 500 or shows stale Page Designer components, "deploy to staging/production", or before go-live. Do not use for generic MRT project/environment/redirect/member management or log tailing (use `b2c-cli:b2c-mrt`), for config.server.ts and PUBLIC__ variable rules (use `storefront-next:sfnext-configuration`), or for creating the project (use `storefront-next:sfnext-project-setup`).

Как установить скилл sfnext-deployment?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sfnext-deployment запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sfnext-deployment с