@salesforce/webapps-features-experimental
v1.112.5
Published
CLI tool for searching and installing UI features into Salesforce webapps
Readme
@salesforce/webapps-features-experimental
CLI tool for installing UI features into Salesforce webapps.
Installation
Using npx (Recommended)
npx @salesforce/webapps-features-experimental <command>Usage
List Available Features
npx @salesforce/webapps-features-experimental listSearch for specific features:
npx @salesforce/webapps-features-experimental list --search "auth"Describe a Feature
Get detailed information about a specific feature:
npx @salesforce/webapps-features-experimental describe authenticationThis shows:
- Full description
- Dependencies (feature and npm packages)
- Files that will be copied
- Integration examples
- Components and capabilities
Install a Feature
npx @salesforce/webapps-features-experimental install <feature-name> --webapp-dir <path>Example:
npx @salesforce/webapps-features-experimental install authentication --webapp-dir mywebappInstallation Options
--webapp-dir <name>- Required. Webapp name, resolves to<sfdx-source>/webapplications/<name>--sfdx-source <path>- Optional. SFDX source directory (default:force-app/main/default)--dry-run- Preview changes without making them--verboseor-v- Show detailed output--yesor-y- Skip conflicts (non-destructive)--on-conflict <mode>- Conflict resolution mode:error,skip,overwrite, orprompt(default)--conflict-resolution <file>- JSON file with per-file conflict resolutions
Handling Conflicts
The recommended workflow for LLMs and automated tools:
First, detect conflicts:
npx @salesforce/webapps-features-experimental install authentication \ --webapp-dir mywebapp \ --on-conflict errorIf conflicts are detected, create a resolution file:
{ "path/to/file1": "overwrite", "path/to/file2": "skip", "path/to/file3": "overwrite" }Rerun with resolution file:
npx @salesforce/webapps-features-experimental install authentication \ --webapp-dir mywebapp \ --conflict-resolution resolution.json
Integration Examples
After installation, the CLI will list any __example__ files that need manual integration:
Example files to integrate:
src/__example__auth-app.tsx → Integrate into: src/app.tsxFor each example file:
- Read the example file to see the integration pattern
- Apply the pattern to your target file
- Delete the example file after integration
Available Features
Run npx @salesforce/webapps-features-experimental list to see all available features.
Common features:
- authentication - Complete auth system with login, registration, password reset
- shadcn - UI component library based on shadcn/ui
- global-search - Salesforce object search
- nav-menu - Navigation menu layout
- charts - Analytics charts with Recharts
- agentforce - AI-powered conversation interface
Local Development
Building
npm run buildRunning locally
npm run dev -- <command>Example:
npm run dev -- list
npm run dev -- install authentication --webapp-dir /path/to/webappGlobal install from local build
npm run build && npm linkThen use webapps-features-experimental <command> directly without npx.
License
SEE LICENSE IN LICENSE.txt
