@salesforce/webapp-template-app-react-template-b2e-experimental 1.88.1 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: webapplications-features
|
|
3
|
+
description: Search, describe, and install pre-built UI features (authentication, shadcn components, navigation, charts, search, GraphQL, Agentforce AI) into Salesforce webapps. Use this when the user wants to add functionality to a webapp, or when determining what salesforce-provided features are available — whether prompted by the user or on your own initiative. Always check for an existing feature before building from scratch.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# webapps-features-experimental CLI — Agent Reference
|
|
7
|
+
|
|
8
|
+
**Always check for an existing feature before building something yourself.** This CLI installs pre-built, tested feature packages into Salesforce webapps. Features range from foundational UI component libraries (shadcn/ui with Button, Card, Input, Table, etc.) to full-stack application capabilities like authentication (login, registration, password flows, session management, and Apex backend classes), global search, navigation menus, data visualization charts, GraphQL integrations, and Agentforce AI conversation UIs. Each feature ships as a complete implementation — including React components, context providers, route guards, and any required Salesforce server-side code — that already handles platform-specific concerns like Salesforce API integration, session management, and SFDX metadata structure. Building these from scratch is error-prone and unnecessary when a feature exists. **If no existing feature is found, ask the user before proceeding with a custom implementation — a relevant feature may exist under a different name or keyword.**
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx @salesforce/webapps-features-experimental <command> [options]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Workflow: Search Project → Search Features → Describe → Install
|
|
15
|
+
|
|
16
|
+
**MANDATORY**: When the user asks to add ANY webapp functionality, follow this entire workflow. Do not skip steps.
|
|
17
|
+
|
|
18
|
+
### 1. Search existing project code
|
|
19
|
+
|
|
20
|
+
Before installing anything, check whether the functionality already exists in the **project source code** (not dependencies).
|
|
21
|
+
|
|
22
|
+
- **Always scope searches to `src/`** to avoid matching files in `node_modules/`, `dist/`, or `build/` output
|
|
23
|
+
- Use Glob with a scoped path: e.g., `src/**/Button.tsx`, `src/**/*auth*.tsx`
|
|
24
|
+
- Use Grep with the `path` parameter set to the `src/` directory, or use `glob: "*.{ts,tsx}"` to restrict file types
|
|
25
|
+
- Check common directories: `src/components/`, `src/lib/`, `src/pages/`, `src/hooks/`
|
|
26
|
+
- **Never** search from the project root without a path or glob filter — this will crawl `node_modules` and produce massive, unhelpful output
|
|
27
|
+
|
|
28
|
+
**If existing code is found** — read the files, present them to the user, and ask if they want to reuse or extend what's there. If yes, use the existing code and stop. If no, proceed to step 2.
|
|
29
|
+
|
|
30
|
+
**If nothing is found** — proceed to step 2.
|
|
31
|
+
|
|
32
|
+
### 2. Search available features
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx @salesforce/webapps-features-experimental list [options]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Options:
|
|
39
|
+
|
|
40
|
+
- `-v, --verbose` — Show full descriptions, packages, and dependencies
|
|
41
|
+
- `--search <query>` — Filter features by keyword (ranked by relevance)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @salesforce/webapps-features-experimental list
|
|
45
|
+
npx @salesforce/webapps-features-experimental list --search "auth"
|
|
46
|
+
npx @salesforce/webapps-features-experimental list --search "button"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**If no matching feature is found** — ask the user before proceeding with a custom implementation. A relevant feature may exist under a different name or keyword.
|
|
50
|
+
|
|
51
|
+
### 3. Describe a feature
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @salesforce/webapps-features-experimental describe <feature>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Shows description, package name, dependencies, components, copy operations, and example files.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx @salesforce/webapps-features-experimental describe authentication
|
|
61
|
+
npx @salesforce/webapps-features-experimental describe shadcn
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. Install a feature
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx @salesforce/webapps-features-experimental install <feature> --webapp-dir <path> [options]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Resolves the feature name to an npm package, installs it and its dependencies (including transitive feature dependencies like `shadcn`), copies source files into your project, and reports any `__example__` files that require manual integration.
|
|
71
|
+
|
|
72
|
+
Options:
|
|
73
|
+
|
|
74
|
+
- `--webapp-dir <path>` (required) — Path to the webapp directory
|
|
75
|
+
- `--sfdx-root <path>` (default: `force-app/main/default`) — SFDX metadata root directory
|
|
76
|
+
- `--dry-run` (default: `false`) — Preview changes without writing files
|
|
77
|
+
- `-v, --verbose` (default: `false`) — Enable verbose logging
|
|
78
|
+
- `-y, --yes` (default: `false`) — Skip all prompts (auto-skip conflicts)
|
|
79
|
+
- `--on-conflict <mode>` (default: `prompt`) — `prompt`, `error`, `skip`, or `overwrite`
|
|
80
|
+
- `--conflict-resolution <file>` — Path to JSON file with per-file resolutions
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Install authentication (also installs shadcn dependency)
|
|
84
|
+
npx @salesforce/webapps-features-experimental install authentication \
|
|
85
|
+
--webapp-dir force-app/main/default/webapplications/mywebapp
|
|
86
|
+
|
|
87
|
+
# Dry run to preview changes
|
|
88
|
+
npx @salesforce/webapps-features-experimental install shadcn \
|
|
89
|
+
--webapp-dir force-app/main/default/webapplications/mywebapp \
|
|
90
|
+
--dry-run
|
|
91
|
+
|
|
92
|
+
# Non-interactive install (skip all file conflicts)
|
|
93
|
+
npx @salesforce/webapps-features-experimental install authentication \
|
|
94
|
+
--webapp-dir force-app/main/default/webapplications/mywebapp \
|
|
95
|
+
--yes
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Conflict Handling
|
|
99
|
+
|
|
100
|
+
Since you are running in a non-interactive environment, you cannot use `--on-conflict prompt` directly. When conflicts are likely (e.g. installing into an existing project), you have two options:
|
|
101
|
+
|
|
102
|
+
**Option A — Let the user resolve conflicts interactively.** Suggest the user run the install command themselves with `--on-conflict prompt` so they can decide per-file.
|
|
103
|
+
|
|
104
|
+
**Option B — Two-pass automated resolution:**
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Pass 1: detect conflicts
|
|
108
|
+
npx @salesforce/webapps-features-experimental install authentication \
|
|
109
|
+
--webapp-dir force-app/main/default/webapplications/mywebapp \
|
|
110
|
+
--on-conflict error
|
|
111
|
+
|
|
112
|
+
# The CLI will exit with an error listing every conflicting file path.
|
|
113
|
+
|
|
114
|
+
# Pass 2: create a resolution file and re-run
|
|
115
|
+
echo '{ "src/styles/global.css": "overwrite", "src/lib/utils.ts": "skip" }' > resolutions.json
|
|
116
|
+
|
|
117
|
+
npx @salesforce/webapps-features-experimental install authentication \
|
|
118
|
+
--webapp-dir force-app/main/default/webapplications/mywebapp \
|
|
119
|
+
--conflict-resolution resolutions.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Resolution values per file: `"skip"` (keep existing) or `"overwrite"` (replace). When unsure how to resolve a conflict, ask the user rather than guessing.
|
|
123
|
+
|
|
124
|
+
## Hint Placeholders in Copy Paths
|
|
125
|
+
|
|
126
|
+
Some copy operations use **hint placeholders** in the `"to"` path — descriptive segments like `<desired-page-with-search-input>` that are NOT resolved by the CLI. These are guidance for the user or LLM to choose an appropriate destination.
|
|
127
|
+
|
|
128
|
+
**How they work:** The file is copied with the literal placeholder name (e.g., `src/pages/<desired-page-with-search-input>.tsx`). After installation, you should:
|
|
129
|
+
|
|
130
|
+
1. Read the copied file to understand its purpose
|
|
131
|
+
2. Rename or relocate it to the intended target (e.g., `src/pages/Home.tsx`)
|
|
132
|
+
3. Or integrate its patterns into an existing file, then delete it
|
|
133
|
+
|
|
134
|
+
**How to identify them:** Hint placeholders use `<descriptive-name>` syntax but are NOT one of the system placeholders (`<sfdxRoot>`, `<webappDir>`, `<webapp>`). They always appear in the middle or end of a path, never as the leading segment.
|
|
135
|
+
|
|
136
|
+
**Example from features.json:**
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"to": "<webappDir>/src/pages/<desired-page-with-search-input>.tsx",
|
|
141
|
+
"description": "Example home page showing GlobalSearchInput integration",
|
|
142
|
+
"integrationTarget": "src/pages/Home.tsx"
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The `integrationTarget` field tells you the suggested destination. Use your judgment — if the user already has a different page where search should go, integrate there instead.
|
|
147
|
+
|
|
148
|
+
**When `integrationTarget` itself is a placeholder:** Some features use a hint placeholder in the `integrationTarget` value (e.g., `"integrationTarget": "src/<path-to-desired-page-with-search-input>.tsx"`). This means there is no single default target — the user must decide which existing file to integrate into. When you encounter this:
|
|
149
|
+
|
|
150
|
+
1. Ask the user which page or file they want to integrate the feature into
|
|
151
|
+
2. Read the `__example__` file to understand the integration pattern
|
|
152
|
+
3. Read the user's chosen target file
|
|
153
|
+
4. Apply the pattern from the example into the target file
|
|
154
|
+
|
|
155
|
+
## Post Installation: Integrating **example** Files
|
|
156
|
+
|
|
157
|
+
Features may include `__example__` files (e.g., `__example__auth-app.tsx`) showing integration patterns.
|
|
158
|
+
|
|
159
|
+
**The describe command shows**:
|
|
160
|
+
|
|
161
|
+
- Which **example** files will be copied
|
|
162
|
+
- Target file to integrate into (e.g., `src/app.tsx`)
|
|
163
|
+
- What the example demonstrates
|
|
164
|
+
|
|
165
|
+
### How to Integrate Example Files (CRITICAL FOR LLMs)
|
|
166
|
+
|
|
167
|
+
⚠️ **ONLY USE Read AND Edit TOOLS - NO BASH COMMANDS** ⚠️
|
|
168
|
+
|
|
169
|
+
**DO NOT DO THIS**:
|
|
170
|
+
|
|
171
|
+
- ❌ `git status` or any git commands
|
|
172
|
+
- ❌ `ls`, `cat`, `sed`, `awk`, or ANY bash file commands
|
|
173
|
+
- ❌ Chaining bash commands to read multiple files
|
|
174
|
+
- ❌ Using bash to check directories or file existence
|
|
175
|
+
|
|
176
|
+
**DO THIS INSTEAD**:
|
|
177
|
+
|
|
178
|
+
- ✅ Use Read tool with `file_path` parameter to read each file
|
|
179
|
+
- ✅ Use Edit tool with `file_path`, `old_string`, `new_string` to modify files
|
|
180
|
+
- ✅ That's it! Just Read and Edit tools.
|
|
181
|
+
|
|
182
|
+
**Integration steps**:
|
|
183
|
+
|
|
184
|
+
1. **Read each example file** (use Read tool)
|
|
185
|
+
- Example: Read tool with `file_path: "force-app/main/default/webapplications/mywebapp/src/__example__auth-app.tsx"`
|
|
186
|
+
- Note the imports and patterns to integrate
|
|
187
|
+
|
|
188
|
+
2. **Read each target file** (use Read tool)
|
|
189
|
+
- Example: Read tool with `file_path: "force-app/main/default/webapplications/mywebapp/src/app.tsx"`
|
|
190
|
+
- Understand where the new code should go
|
|
191
|
+
|
|
192
|
+
3. **Edit each target file** (use Edit tool)
|
|
193
|
+
- Add imports from the example
|
|
194
|
+
- Add or modify code following the example's patterns
|
|
195
|
+
- Preserve existing functionality
|
|
196
|
+
|
|
197
|
+
4. **Delete the example file after successful integration** (use Bash tool)
|
|
198
|
+
- Example: `rm force-app/main/default/webapplications/mywebapp/src/__example__authentication-routes.tsx`
|
|
199
|
+
- Only delete after you have successfully integrated the pattern
|
|
200
|
+
- This keeps the codebase clean and removes temporary example files
|
|
201
|
+
|
|
202
|
+
## Troubleshooting
|
|
203
|
+
|
|
204
|
+
**Directory not found**: Check paths are correct, use absolute or correct relative paths
|
|
205
|
+
|
|
206
|
+
**Feature not found**: Use `npx @salesforce/webapps-features-experimental list` to see available feature names
|
|
207
|
+
|
|
208
|
+
**Conflicts in error mode**: Follow CLI instructions to create resolution file
|
|
209
|
+
|
|
210
|
+
**Need help?**: Run `npx @salesforce/webapps-features-experimental --help` to see all commands and options
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.90.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.89.0...v1.90.0) (2026-03-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Features Skill @W-21452399 ([#248](https://github.com/salesforce-experience-platform-emu/webapps/issues/248)) ([0f4b41b](https://github.com/salesforce-experience-platform-emu/webapps/commit/0f4b41b2887f4b98b48f62b6c133dead8cb5d7e9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.89.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.88.1...v1.89.0) (2026-03-10)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.88.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.88.0...v1.88.1) (2026-03-10)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@salesforce/agentforce-conversation-client": "^1.
|
|
19
|
-
"@salesforce/sdk-data": "^1.
|
|
20
|
-
"@salesforce/webapp-experimental": "^1.
|
|
18
|
+
"@salesforce/agentforce-conversation-client": "^1.90.0",
|
|
19
|
+
"@salesforce/sdk-data": "^1.90.0",
|
|
20
|
+
"@salesforce/webapp-experimental": "^1.90.0",
|
|
21
21
|
"@tailwindcss/vite": "^4.1.17",
|
|
22
22
|
"@tanstack/react-form": "^1.28.4",
|
|
23
23
|
"class-variance-authority": "^0.7.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
42
42
|
"@graphql-tools/utils": "^11.0.0",
|
|
43
43
|
"@playwright/test": "^1.49.0",
|
|
44
|
-
"@salesforce/vite-plugin-webapp-experimental": "^1.
|
|
44
|
+
"@salesforce/vite-plugin-webapp-experimental": "^1.90.0",
|
|
45
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
46
46
|
"@testing-library/react": "^16.1.0",
|
|
47
47
|
"@testing-library/user-event": "^14.5.2",
|
package/dist/package.json
CHANGED