Headless
Storefront Next
storefront-nextFor cartridges serving Storefront Next without SFRA controllers, forms, storefront ISML rendering, or the legacy Pipeline API.
Architecture detailsCommerce Klaus uses cartridge architectures to apply intentional storefront boundaries consistently across linting and tests. They describe how a cartridge participates in a project; they do not attempt to detect or replace the SFCC runtime architecture.
A cartridge architecture is an explicit project policy label. It tells Commerce Klaus which storefront conventions a cartridge intentionally follows; it is not inferred from the cartridge name or directory structure.
Headless
storefront-nextFor cartridges serving Storefront Next without SFRA controllers, forms, storefront ISML rendering, or the legacy Pipeline API.
Architecture details →Headless
pwaFor cartridges supporting a PWA storefront through APIs and headless integration points rather than SFRA controller conventions.
Architecture details →Reference storefront
sfraFor Storefront Reference Architecture cartridges using controllers, the server module, forms, and storefront rendering.
Architecture details →Legacy controllers
sitegenesis-controllersFor controller-based SiteGenesis cartridges that do not use the SFRA server module or the legacy Pipeline API.
Architecture details →Legacy pipelines
sitegenesis-pipelinesFor pipeline-era SiteGenesis cartridges. This is the only architecture policy that permits access to the legacy Pipeline API.
Architecture details →Classification does not change cartridge precedence
Architecture assignments do not reorder the cartridge path, create dependencies between cartridges, or change what SFCC deploys. They let individual tools apply architecture-specific lint policies or select a focused subset while preserving the existing cartridge-path order.
Assign architecture labels centrally in commerce-klaus.config.ts:
import { defineConfig } from "@commerce-klaus/config"
export default defineConfig({
cartridgePath: ["app_headless", "bc_custom_api", "app_storefront_base", "bm_tools", "modules"],
architectures: {
"storefront-next": ["app_headless", "bc_custom_api"],
sfra: ["app_storefront_base"],
"sitegenesis-controllers": ["bm_tools"],
},
})Each cartridge can have at most one architecture. Commerce Klaus rejects unknown labels and ambiguous assignments instead of relying on configuration order. A cartridge can remain unassigned when it is shared infrastructure or when no architecture-specific policy should apply.
Architecture assignments complement the cartridge path. The path still decides precedence; the assignment decides which policy or selection label applies to each named cartridge.
Use storefront-next for cartridges that support a Storefront Next project without implementing an SFRA storefront layer.
server module, storefront ISML response rendering, or Pipeline API.~/ for local modules and named paths for explicit cross-cartridge dependencies instead of */.Use pwa for cartridges serving a PWA storefront through APIs and headless integration points rather than SFRA controller conventions.
storefront-next.pwa distinct records architectural intent and allows the policies to diverge without renaming project assignments.Use sfra for Storefront Reference Architecture cartridges built around SFRA controllers and middleware.
server module, forms, and storefront ISML rendering remain available.app_storefront_base is present.Use sitegenesis-controllers for controller-based SiteGenesis cartridges that do not use the SFRA server module.
server module and the Pipeline API are rejected.sitegenesis/no-global-require still applies to controller files and keeps route-specific dependencies local to the routes that use them.Use sitegenesis-pipelines for pipeline-era SiteGenesis cartridges whose JavaScript is invoked from pipeline definitions.
dw/system/Pipeline.server module remains unavailable.The architecture presets are overlays composed after the recommended config. They change architecture-specific rules, not the baseline of supported JavaScript syntax and standard-library APIs.
| Architecture | ESLint policy rules |
|---|---|
storefront-next | no-controllers, no-forms, no-storefront-isml-rendering, no-pipeline-api, no-proprietary-module-syntax (*/ only), no-sfra-server, prefer-tilde-require-path |
pwa | no-controllers, no-forms, no-storefront-isml-rendering, no-pipeline-api, no-proprietary-module-syntax (*/ only), no-sfra-server, prefer-tilde-require-path |
sfra | no-pipeline-api |
sitegenesis-controllers | no-pipeline-api, no-sfra-server |
sitegenesis-pipelines | no-sfra-server |
pwa and storefront-next currently enforce the same headless boundaries. They retain separate semantic names so their policies can evolve independently as their platform contracts diverge.
Both headless policies reject */ lookup, require ~/ for modules in the current cartridge, and use named paths for explicit cross-cartridge dependencies. They continue to allow module.superModule.
sitegenesis-pipelines is the only policy that permits access to dw/system/Pipeline. The ESLint preset applies to JavaScript; it does not validate pipeline XML files.
Use createCartridgeArchitectureConfig() to generate cartridge-scoped ESLint overlays from the central assignments. Oxlint exposes the same policies through createOxlintArchitectureOverrides().
vitest-sfcc can filter the effective cartridge path with cartridgeSelection:
sfccVitest({
cartridgeSelection: {
architectures: ["storefront-next"],
cartridges: ["modules"],
},
})Filtering preserves the original cartridge-path order. Unassigned cartridges are excluded by default, so shared infrastructure must be named explicitly or included with includeUnassigned: true. Use separate Vitest projects when test suites require different architecture selections.
Choose the label from the conventions the cartridge intentionally follows, not from its prefix:
storefront-next or pwa for a headless boundary without SFRA controllers.sfra when the cartridge implements SFRA controllers or middleware.sitegenesis-controllers for controller-based SiteGenesis code.sitegenesis-pipelines only when Pipeline API access is part of the architecture.