@commerce-klaus/typescript-sfcc
v1.5.0
Published
TypeScript tooling for Salesforce Commerce Cloud cartridge projects
Maintainers
Readme
@commerce-klaus/typescript-sfcc
TypeScript tooling for Salesforce Commerce Cloud cartridge projects. It provides cartridge-aware editor resolution, command-line type checking, and project-specific generated types while SFCC runtime code remains JavaScript with JSDoc.
Highlights
- Resolves
dw/*,*/,~/, cartridge aliases, andmodule.superModule - Typechecks cartridges with the same behavior as the editor plugin
- Generates types for custom attributes, hooks, Custom APIs, and custom job steps
- Validates hook registrations and statically detectable exports
Install
pnpm add -D @commerce-klaus/typescript-sfcc typescript @salesforce/b2c-cliEnable the editor plugin in a cartridge jsconfig.json or tsconfig.json:
{
"compilerOptions": {
"plugins": [{ "name": "@commerce-klaus/typescript-sfcc" }]
}
}Synchronize types and run the cartridge typecheck:
pnpm exec sfcc-ts-sync-types
pnpm exec sfcc-ts-typecheckDocumentation
See the complete setup, CLI, and generated types reference.
License
MIT
