@salesforce/webapp-template-feature-react-file-upload-experimental 1.55.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.
- package/LICENSE.txt +82 -0
- package/README.md +102 -0
- package/dist/.a4drules/README.md +35 -0
- package/dist/.a4drules/a4d-webapp-generate.md +27 -0
- package/dist/.a4drules/build-validation.md +78 -0
- package/dist/.a4drules/code-quality.md +137 -0
- package/dist/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
- package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
- package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
- package/dist/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
- package/dist/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
- package/dist/.a4drules/graphql.md +409 -0
- package/dist/.a4drules/images.md +13 -0
- package/dist/.a4drules/react.md +387 -0
- package/dist/.a4drules/react_image_processing.md +45 -0
- package/dist/.a4drules/typescript.md +224 -0
- package/dist/.a4drules/ui-layout.md +23 -0
- package/dist/.a4drules/webapp-nav-and-placeholders.md +33 -0
- package/dist/.a4drules/webapp-no-node-e.md +25 -0
- package/dist/.a4drules/webapp-ui-first.md +32 -0
- package/dist/.a4drules/webapp.md +75 -0
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/AGENT.md +75 -0
- package/dist/CHANGELOG.md +803 -0
- package/dist/README.md +18 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/.prettierignore +9 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/.prettierrc +11 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/build/vite.config.d.ts +2 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/build/vite.config.js +93 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/codegen.yml +94 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/e2e/app.spec.ts +17 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/eslint.config.js +141 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/feature-react-file-upload.webapplication-meta.xml +7 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/index.html +13 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/package-lock.json +18396 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/package.json +66 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/playwright.config.ts +24 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/scripts/get-graphql-schema.mjs +68 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/scripts/rewrite-e2e-assets.mjs +23 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/api/fileUpload.ts +154 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/api/graphql-operations-types.ts +116 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/api/utils/accounts.ts +41 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/app.tsx +22 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/appLayout.tsx +9 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/icons/book.svg +3 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/icons/copy.svg +4 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/icons/rocket.svg +3 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/icons/star.svg +3 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/images/codey-1.png +0 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/images/codey-2.png +0 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/images/codey-3.png +0 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/images/vibe-codey.svg +194 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/symbols.svg +1 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/assets/utility.svg +1 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUpload.tsx +83 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadDialog.tsx +79 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadDropZone.tsx +82 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadFileItem.tsx +99 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadIcons.tsx +58 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/alert.tsx +69 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/button.tsx +67 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/card.tsx +92 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/dialog.tsx +143 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/field.tsx +222 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/index.ts +84 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/input.tsx +19 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/label.tsx +19 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/pagination.tsx +112 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/select.tsx +183 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/separator.tsx +26 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/skeleton.tsx +14 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/spinner.tsx +15 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/table.tsx +87 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components/ui/tabs.tsx +78 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/components.json +18 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/hooks/useFileUpload.ts +299 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/hooks/useFileUploadDialog.ts +70 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/index.ts +56 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/lib/utils.ts +6 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/navigationMenu.tsx +80 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/pages/Home.tsx +25 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/pages/NotFound.tsx +18 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/router-utils.tsx +35 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/routes.tsx +22 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/styles/global.css +135 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/types/fileUpload.ts +26 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/utils/fileUploadUtils.ts +44 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/src/utils/labels.ts +21 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/tsconfig.json +36 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/tsconfig.node.json +13 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/vite-env.d.ts +1 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/vite.config.ts +43 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/vitest-env.d.ts +2 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/vitest.config.ts +11 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/vitest.setup.ts +1 -0
- package/dist/force-app/main/default/webapplications/feature-react-file-upload/webapplication.json +7 -0
- package/dist/jest.config.js +6 -0
- package/dist/package.json +38 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +53 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/api/fileUpload.ts +154 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/appLayout.tsx +9 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/assets/symbols.svg +1 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/assets/utility.svg +1 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUpload.tsx +83 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadDialog.tsx +79 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadDropZone.tsx +82 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadFileItem.tsx +99 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/components/FileUploadIcons.tsx +58 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/hooks/useFileUpload.ts +299 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/hooks/useFileUploadDialog.ts +70 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/index.ts +56 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/pages/Home.tsx +25 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/routes.tsx +17 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/types/fileUpload.ts +26 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/utils/fileUploadUtils.ts +44 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/src/utils/labels.ts +21 -0
- package/src/force-app/main/default/webapplications/feature-react-file-upload/vite.config.ts +43 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A4D rule — always update navigation menu and placeholder name/design; never leave default
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Navigation Menu & Placeholder Name/Design (MANDATORY)
|
|
7
|
+
|
|
8
|
+
Agents consistently miss these. **You must not leave them default.**
|
|
9
|
+
|
|
10
|
+
**Navigation belongs in the app layout:** Build the navigation **into** the app layout (e.g. `appLayout.tsx`). The layout component must include the nav—header nav, sidebar, or both—so every page is wrapped by the same shell and nav. Do not omit navigation from the layout or put it only on individual pages.
|
|
11
|
+
|
|
12
|
+
## 1. Navigation menu
|
|
13
|
+
|
|
14
|
+
- **Always edit the navigation menu** in the layout file (typically `src/appLayout.tsx`). Replace default/placeholder nav items and labels with **app-specific** links and names.
|
|
15
|
+
- Do **not** leave template items (e.g. "Home", "About", generic links or placeholder labels). Use real routes and labels that match the app (e.g. "Dashboard", "Products", "Orders" for an e‑commerce app).
|
|
16
|
+
- The navigation is part of the app shell; it lives in **appLayout.tsx** (or the file that `routes.tsx` uses as the layout). Open that file and update every nav link and label.
|
|
17
|
+
|
|
18
|
+
**Check before finishing:** Did I change the nav items and labels in the layout file to match this app? If not, the task is incomplete.
|
|
19
|
+
|
|
20
|
+
## 2. Placeholder name and design
|
|
21
|
+
|
|
22
|
+
- **Replace the placeholder app name** everywhere it appears: header, nav brand/logo area, footer, document `<title>`, and any "Welcome to…" or generic title text. Use the **actual app name** (e.g. the name used in `sf webapp generate -n <AppName>` or the user's requested name).
|
|
23
|
+
- **Replace placeholder design** in the shell: default header/footer styling, generic logo area, and any template branding must be updated to match the app's aesthetic (or at least use the real app name and intentional styling).
|
|
24
|
+
|
|
25
|
+
**Check before finishing:** Is the app name and shell design still the template default anywhere? If yes, update it.
|
|
26
|
+
|
|
27
|
+
## Where to edit
|
|
28
|
+
|
|
29
|
+
- **Layout/nav/branding:** `force-app/main/default/webapplications/<appName>/src/appLayout.tsx` — the app layout must contain the navigation (build it in here).
|
|
30
|
+
- **Document title:** `force-app/main/default/webapplications/<appName>/index.html`
|
|
31
|
+
- **Root page content:** The component rendered at the root route (often `Home` or similar in `routes.tsx`)
|
|
32
|
+
|
|
33
|
+
Completing a web app task includes updating **navigation menu**, **app name in header/nav/footer/title**, and **placeholder design** in the shell—not only the main page content.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A4D rule — no node -e; use replace_in_file / write_to_file only
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# A4D Enforcement: No node -e
|
|
7
|
+
|
|
8
|
+
This project forbids using "node -e" for any operation (file manipulation, string replacement, reading/writing configs, shell automation).
|
|
9
|
+
|
|
10
|
+
Policy:
|
|
11
|
+
- Never use "node -e" one-liners.
|
|
12
|
+
- Use replace_in_file or write_to_file for code/config edits.
|
|
13
|
+
- Use jq/sed/awk cautiously when needed; prefer replace_in_file for deterministic edits.
|
|
14
|
+
- For JSON edits: prefer write_to_file after reading, or replace_in_file with precise diffs.
|
|
15
|
+
- For ESLint/TS config changes: edit files directly via write_to_file or replace_in_file.
|
|
16
|
+
|
|
17
|
+
Rationale:
|
|
18
|
+
- Ensures reproducibility and auditability.
|
|
19
|
+
- Avoids shell escaping bugs and cross-platform inconsistencies.
|
|
20
|
+
- Aligns with project reliability protocol.
|
|
21
|
+
|
|
22
|
+
Violation handling:
|
|
23
|
+
- If any prior step used "node -e", revert and redo using write_to_file or replace_in_file.
|
|
24
|
+
|
|
25
|
+
**Cross-reference:** This rule is also summarized in **webapp.md** (MUST FOLLOW #1). Both apply.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: A4D rule — build UI first, then business logic for web apps
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# A4D Rule: UI First, Then Business Logic (Proceed Immediately After UI)
|
|
7
|
+
|
|
8
|
+
When building or modifying a web application (or any feature within it):
|
|
9
|
+
|
|
10
|
+
1. **Build the UI first**
|
|
11
|
+
- Implement layout, structure, and components (pages, forms, lists, navigation).
|
|
12
|
+
- Apply styling, theming, and design-system usage so the interface is visually complete and navigable.
|
|
13
|
+
- Use placeholder or mock data only where needed to render the UI; do not wire real APIs yet.
|
|
14
|
+
|
|
15
|
+
2. **Proceed to API and business logic immediately after UI completion (same iteration)**
|
|
16
|
+
- As soon as the UI for a feature is visually complete and routable, begin wiring the data layer for that same feature in the same iteration.
|
|
17
|
+
- Add data fetching (GraphQL preferred per LDS rules, then UI API; avoid Apex REST for React), state management, and event handlers.
|
|
18
|
+
- Connect forms and actions to real APIs and backend behavior.
|
|
19
|
+
- Add validation, loading, and user-friendly error states.
|
|
20
|
+
- Keep the build green; fix TypeScript and ESLint issues as you wire logic.
|
|
21
|
+
|
|
22
|
+
3. **Quality gates before marking the feature complete**
|
|
23
|
+
- Run `npm run lint` and ensure 0 errors (warnings acceptable if minor).
|
|
24
|
+
- Run `npm run build` and ensure it passes.
|
|
25
|
+
- Replace any remaining mock data relevant to the feature with real data paths or clearly marked TODOs if blocked.
|
|
26
|
+
|
|
27
|
+
**Rationale:** A visible, stable UI gives a clear target, and immediately wiring the API and business logic in the same iteration ensures end‑to‑end functionality and avoids stale mock UIs. This also aligns with design-system guidance (invoke **webapplications-design-system**) and LDS data access rules.
|
|
28
|
+
|
|
29
|
+
Notes:
|
|
30
|
+
- Within LDS, prefer GraphQL for complex reads and mutations; fall back to standard UI API adapters when appropriate.
|
|
31
|
+
- For React apps, do not implement or call Apex REST. If server-side logic is truly required and cannot be achieved via GraphQL/UI API, surface a limitation explicitly.
|
|
32
|
+
- If a feature's UI spans multiple pages, wire business logic page-by-page as each page's UI stabilizes, rather than deferring all logic to the end.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# MUST FOLLOW
|
|
2
|
+
|
|
3
|
+
0. **Always invoke the `local-expert` MCP** when dealing with web applications: call **`get_expert_knowledge`** with topic **`webapplications-design-system`** (for UI/design), and with **`webapplications`** when generating or structuring the app. Do not skip the design-system expert for any web app UI work.
|
|
4
|
+
1. **No `node -e`.** This project forbids `node -e` for any operation (file edits, config, shell automation). Use `replace_in_file` or `write_to_file` only. See **webapp-no-node-e.md**.
|
|
5
|
+
|
|
6
|
+
# React Development & Stability Rules
|
|
7
|
+
|
|
8
|
+
## Terminal & Execution Strategy
|
|
9
|
+
- **NEVER use `node -e`** for file manipulation, string replacement, or reading files. Forbidden. Use `replace_in_file` or `write_to_file` only.
|
|
10
|
+
- ALWAYS use `replace_in_file` or `write_to_file` for code changes.
|
|
11
|
+
- IF you must parse JSON (like package.json), use `jq` if available. Otherwise, read the file and process it internally.
|
|
12
|
+
- ALWAYS use `npm` or `yarn` commands directly rather than writing custom Node scripts to trigger them.
|
|
13
|
+
|
|
14
|
+
## React & TypeScript Standards
|
|
15
|
+
- Component Architecture: Prefer functional components with hooks.
|
|
16
|
+
- File Naming: Use PascalCase for components (e.g., `Button.tsx`) and camelCase for hooks (e.g., `useAuth.ts`).
|
|
17
|
+
- Imports: Use absolute paths (e.g., `@/components/...`) if the `tsconfig.json` or `vite.config.ts` supports it.
|
|
18
|
+
- State: Default to `useState` for local state; avoid adding global state libraries unless requested.
|
|
19
|
+
|
|
20
|
+
## Reliability Protocol
|
|
21
|
+
- Before running any build or test command, check for the existence of `node_modules`. If missing, prompt to run `npm install`.
|
|
22
|
+
- When searching for code, use `search_files` with regex rather than trying to `grep` or `awk` through the terminal.
|
|
23
|
+
- If a command fails twice, STOP and report the exact error to the user rather than attempting a third "creative" bash one-liner.
|
|
24
|
+
|
|
25
|
+
# General app generation guidance
|
|
26
|
+
|
|
27
|
+
Your goal is to create a functioning app on Salesforce platform. Do not mock UIs, but use tools at your disposal, such as custom objects, graphql API, Apex controllers in order to achieve your goal.
|
|
28
|
+
|
|
29
|
+
**Home page must be populated:** The home page (root route) must never be left as the default template. Always populate it with real content—e.g. landing content, banners, tiles, hero, navigation to main features—tailored to the app or use case. Make it visually pleasing and purposeful. Do not leave placeholder or "Welcome to..." default content.
|
|
30
|
+
|
|
31
|
+
**Replace default boilerplate:** Always replace default scaffold content (e.g. "React App", "Vite + React", default page titles, placeholder headings in index.html or App.tsx) with **project- or app-specific** names and copy. Do not leave generic "React App" or template placeholders in the UI or document title.
|
|
32
|
+
|
|
33
|
+
**Navigation menu and placeholder name/design (critical — often missed):** **Build the navigation into the app layout** (`appLayout.tsx`) so every page shares the same nav. Always edit the **navigation menu** in that layout file: replace default nav items and labels with app-specific links and names; do not leave template "Home"/"About" or placeholder links. Always replace the **placeholder app name** in header, nav brand, footer, and `<title>` with the actual app name, and update **placeholder design** (header/footer/shell) so it's not the template default. See **webapp-nav-and-placeholders.md**.
|
|
34
|
+
|
|
35
|
+
**Frontend aesthetics (avoid AI slop):** Make creative, distinctive frontends that surprise and delight. Use distinctive typography (avoid Inter, Roboto, Arial, Space Grotesk as defaults), cohesive color with sharp accents (use CSS variables; avoid purple-on-white clichés), high-impact motion (e.g. staggered reveals), and atmosphere/depth in backgrounds. Do not converge on generic, cookie-cutter layouts. Follow **webapplications-design-system** expert knowledge for full guidance.
|
|
36
|
+
|
|
37
|
+
# SFDX React Web Application Creation
|
|
38
|
+
|
|
39
|
+
When the user asks to **create a React app** (or a web app, webpplication, etc) in this SFDX project:
|
|
40
|
+
|
|
41
|
+
1. **Generate the app** using the Salesforce CLI:
|
|
42
|
+
\`\`\`bash
|
|
43
|
+
sf webapp generate -n MyWebApp -t reactbasic
|
|
44
|
+
\`\`\`
|
|
45
|
+
Use the app name the user requested instead of \`MyWebApp\` if they specify one.
|
|
46
|
+
|
|
47
|
+
Do not use \`create-react-app\`, Vite, or other generic React scaffolds for this scenario; use \`sf webapp generate\` so the app is SFDX-aware.
|
|
48
|
+
|
|
49
|
+
2. **For B2B/B2C or authenticated/guest apps:** Also create site container metadata and create and configure Digital Experience Sites to host the React web application.
|
|
50
|
+
|
|
51
|
+
When modifying webapp in an SFDX project, use the experts MCP to obtain the latest guidance and design before starting implementation. Never assume or create tools that are not explicitly available
|
|
52
|
+
|
|
53
|
+
3. Repeat iterations until the there are no pending actions left.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# Software development cycle (modified for continuous execution)
|
|
57
|
+
|
|
58
|
+
- Execute tasks continuously until all planned items are complete in the current iteration, without pausing after intermediate checkpoints.
|
|
59
|
+
- Maintain a running checklist and proceed through it sequentially.
|
|
60
|
+
- Quality gates (lint/build) remain required, but failures should be remediated inline and the workflow should continue through all feature tasks in this iteration unless the user directs otherwise.
|
|
61
|
+
|
|
62
|
+
## Attempt Completion Enforcement (Local Project Rule)
|
|
63
|
+
|
|
64
|
+
- Do NOT invoke attempt_completion until ALL checklist items for the current iteration are complete and quality gates pass.
|
|
65
|
+
- Intermediate status updates must use task_progress on tool calls (never attempt_completion) until completion criteria are met.
|
|
66
|
+
- The only exceptions that allow early attempt_completion are:
|
|
67
|
+
- A blocking error that cannot be resolved after reasonable remediation and requires user input
|
|
68
|
+
- The user explicitly instructs to pause or complete early
|
|
69
|
+
|
|
70
|
+
## Stop Conditions
|
|
71
|
+
|
|
72
|
+
Only stop when:
|
|
73
|
+
- All checklist items are completed and quality gates pass, or
|
|
74
|
+
- A blocking error cannot be resolved after reasonable remediation, or
|
|
75
|
+
- The user explicitly asks to pause.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
|
|
2
|
+
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
package.xml
|
|
6
|
+
|
|
7
|
+
# LWC configuration files
|
|
8
|
+
**/jsconfig.json
|
|
9
|
+
**/.eslintrc.json
|
|
10
|
+
|
|
11
|
+
# LWC Jest
|
|
12
|
+
**/__tests__/**
|
|
13
|
+
|
|
14
|
+
node_modules/
|
|
15
|
+
.DS_Store
|
package/dist/.prettierrc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"trailingComma": "none",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"prettier-plugin-apex",
|
|
5
|
+
"@prettier/plugin-xml"
|
|
6
|
+
],
|
|
7
|
+
"overrides": [
|
|
8
|
+
{
|
|
9
|
+
"files": "**/lwc/**/*.html",
|
|
10
|
+
"options": { "parser": "lwc" }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"files": "*.{cmp,page,component}",
|
|
14
|
+
"options": { "parser": "html" }
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
package/dist/AGENT.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Agent guide: SFDX project with React web app
|
|
2
|
+
|
|
3
|
+
This project is a **Salesforce DX (SFDX) project** containing a **React web application**. The structure is generated; the app lives under `force-app/main/default/webapplications/<appName>/`. Use this file when working in this directory.
|
|
4
|
+
|
|
5
|
+
## Project layout
|
|
6
|
+
|
|
7
|
+
- **Project root**: this directory — SFDX project root. Contains `sfdx-project.json`, `force-app/`, and (optionally) LWC/Aura.
|
|
8
|
+
- **React web app**: `force-app/main/default/webapplications/<appName>/`
|
|
9
|
+
- Replace `<appName>` with the actual app folder name (e.g. `base-react-app`, or the name chosen when the app was generated).
|
|
10
|
+
- Entry: `src/App.tsx`
|
|
11
|
+
- Routes: `src/routes.tsx`
|
|
12
|
+
- API/GraphQL: `src/api/` (e.g. `graphql.ts`, `graphql-operations-types.ts`, `utils/`)
|
|
13
|
+
|
|
14
|
+
Path convention: **webapplications** (lowercase).
|
|
15
|
+
|
|
16
|
+
## Two package.json contexts
|
|
17
|
+
|
|
18
|
+
### 1. Project root (this directory)
|
|
19
|
+
|
|
20
|
+
Used for SFDX metadata (LWC, Aura, etc.). Scripts here are for the base SFDX template:
|
|
21
|
+
|
|
22
|
+
| Command | Purpose |
|
|
23
|
+
|---------|---------|
|
|
24
|
+
| `npm run lint` | ESLint for `aura/` and `lwc/` |
|
|
25
|
+
| `npm run test` | LWC Jest (passWithNoTests) |
|
|
26
|
+
| `npm run prettier` | Format supported metadata files |
|
|
27
|
+
| `npm run prettier:verify` | Check Prettier |
|
|
28
|
+
|
|
29
|
+
Root **does not** run the React app. The root `npm run build` is a no-op for the base SFDX project.
|
|
30
|
+
|
|
31
|
+
### 2. React web app (where you do most work)
|
|
32
|
+
|
|
33
|
+
**Always `cd` into the web app directory for dev/build/lint/test:**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd force-app/main/default/webapplications/<appName>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Command | Purpose |
|
|
40
|
+
|---------|---------|
|
|
41
|
+
| `npm run dev` | Start Vite dev server |
|
|
42
|
+
| `npm run build` | TypeScript (`tsc -b`) + Vite build |
|
|
43
|
+
| `npm run lint` | ESLint for the React app |
|
|
44
|
+
| `npm run test` | Vitest |
|
|
45
|
+
| `npm run preview` | Preview production build |
|
|
46
|
+
| `npm run graphql:codegen` | Generate GraphQL types |
|
|
47
|
+
| `npm run graphql:schema` | Fetch GraphQL schema |
|
|
48
|
+
|
|
49
|
+
**Before finishing changes:** run `npm run build` and `npm run lint` from the web app directory; both must succeed.
|
|
50
|
+
|
|
51
|
+
## Agent rules (.a4drules)
|
|
52
|
+
|
|
53
|
+
This project includes **.a4drules/** at the project root. Follow them when generating or editing code.
|
|
54
|
+
|
|
55
|
+
When rules refer to “web app directory” or `force-app/main/default/webapplications/<appName>/`, use the **actual app folder name** for this project.
|
|
56
|
+
|
|
57
|
+
## Deploying
|
|
58
|
+
|
|
59
|
+
From **this project root**:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Build the React app first (replace <appName> with the app folder name)
|
|
63
|
+
cd force-app/main/default/webapplications/<appName> && npm i && npm run build && cd -
|
|
64
|
+
|
|
65
|
+
# Deploy web app only
|
|
66
|
+
sf project deploy start --source-dir force-app/main/default/webapplications --target-org <alias>
|
|
67
|
+
|
|
68
|
+
# Deploy all metadata
|
|
69
|
+
sf project deploy start --source-dir force-app --target-org <alias>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Conventions (quick reference)
|
|
73
|
+
|
|
74
|
+
- **UI**: shadcn/ui + Tailwind. Import from `@/components/ui/...`.
|
|
75
|
+
- **Entry**: Keep `App.tsx` and routes in `src/`; add features as new routes or sections, don’t replace the app shell but you may modify it to match the requested design.
|