@salesforce/b2c-tooling-sdk / discovery / sfraPattern
Variable: sfraPattern ​
constsfraPattern:DetectionPattern
Defined in: packages/b2c-tooling-sdk/src/discovery/patterns/sfra.ts:42
Detection pattern for SFRA projects.
Detects SFRA workspaces by checking for:
- A cartridge named
app_storefront_base- the core SFRA cartridge that serves as the foundation for SFRA-based storefronts. Per Salesforce documentation, this cartridge is essential and should not be renamed. (Primary detection method) - A package.json with
paths.basecontainingapp_storefront_base- used in multi-repo setups with sgmf-scripts where the SFRA base cartridge is external to the project. (Secondary heuristic, less common)
See ​
https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-customizing-sfra.html
Example ​
// Use in custom detection
import { sfraPattern } from '@salesforce/b2c-tooling-sdk/discovery';
const customPatterns = [sfraPattern, ...otherPatterns];
const result = await detectWorkspaceType(workspacePath, { patterns: customPatterns });