@salesforce/ui-bundle-template-app-react-template-b2e 1.117.2

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.
Files changed (133) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +52 -0
  3. package/dist/.forceignore +15 -0
  4. package/dist/.husky/pre-commit +4 -0
  5. package/dist/.prettierignore +11 -0
  6. package/dist/.prettierrc +17 -0
  7. package/dist/AGENT.md +193 -0
  8. package/dist/CHANGELOG.md +2128 -0
  9. package/dist/README.md +52 -0
  10. package/dist/config/project-scratch-def.json +13 -0
  11. package/dist/eslint.config.js +7 -0
  12. package/dist/force-app/main/default/uiBundles/reactinternalapp/.forceignore +15 -0
  13. package/dist/force-app/main/default/uiBundles/reactinternalapp/.graphqlrc.yml +2 -0
  14. package/dist/force-app/main/default/uiBundles/reactinternalapp/.prettierignore +9 -0
  15. package/dist/force-app/main/default/uiBundles/reactinternalapp/.prettierrc +11 -0
  16. package/dist/force-app/main/default/uiBundles/reactinternalapp/CHANGELOG.md +10 -0
  17. package/dist/force-app/main/default/uiBundles/reactinternalapp/README.md +35 -0
  18. package/dist/force-app/main/default/uiBundles/reactinternalapp/codegen.yml +95 -0
  19. package/dist/force-app/main/default/uiBundles/reactinternalapp/components.json +18 -0
  20. package/dist/force-app/main/default/uiBundles/reactinternalapp/e2e/app.spec.ts +17 -0
  21. package/dist/force-app/main/default/uiBundles/reactinternalapp/eslint.config.js +169 -0
  22. package/dist/force-app/main/default/uiBundles/reactinternalapp/index.html +12 -0
  23. package/dist/force-app/main/default/uiBundles/reactinternalapp/package.json +69 -0
  24. package/dist/force-app/main/default/uiBundles/reactinternalapp/playwright.config.ts +24 -0
  25. package/dist/force-app/main/default/uiBundles/reactinternalapp/reactinternalapp.uibundle-meta.xml +7 -0
  26. package/dist/force-app/main/default/uiBundles/reactinternalapp/scripts/get-graphql-schema.mjs +68 -0
  27. package/dist/force-app/main/default/uiBundles/reactinternalapp/scripts/rewrite-e2e-assets.mjs +23 -0
  28. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/account/accountSearchService.ts +46 -0
  29. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/account/query/distinctAccountIndustries.graphql +19 -0
  30. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/account/query/distinctAccountTypes.graphql +19 -0
  31. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/account/query/getAccountDetail.graphql +121 -0
  32. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/account/query/searchAccounts.graphql +51 -0
  33. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/graphql-operations-types.ts +11260 -0
  34. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/api/graphqlClient.ts +25 -0
  35. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/app.tsx +17 -0
  36. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/appLayout.tsx +85 -0
  37. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/icons/book.svg +3 -0
  38. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/icons/copy.svg +4 -0
  39. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/icons/rocket.svg +3 -0
  40. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/icons/star.svg +3 -0
  41. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/images/codey-1.png +0 -0
  42. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/images/codey-2.png +0 -0
  43. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/images/codey-3.png +0 -0
  44. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/assets/images/vibe-codey.svg +194 -0
  45. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/AgentforceConversationClient.tsx +168 -0
  46. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/__inherit_AgentforceConversationClient.tsx +3 -0
  47. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/alerts/status-alert.tsx +49 -0
  48. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/layouts/card-layout.tsx +29 -0
  49. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/alert.tsx +76 -0
  50. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/badge.tsx +48 -0
  51. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/breadcrumb.tsx +109 -0
  52. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/button.tsx +67 -0
  53. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/calendar.tsx +232 -0
  54. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/card.tsx +103 -0
  55. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/checkbox.tsx +32 -0
  56. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/collapsible.tsx +33 -0
  57. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/datePicker.tsx +127 -0
  58. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/dialog.tsx +162 -0
  59. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/field.tsx +237 -0
  60. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/index.ts +84 -0
  61. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/input.tsx +19 -0
  62. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/label.tsx +22 -0
  63. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/pagination.tsx +132 -0
  64. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/popover.tsx +89 -0
  65. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/select.tsx +193 -0
  66. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/separator.tsx +26 -0
  67. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/skeleton.tsx +14 -0
  68. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/sonner.tsx +20 -0
  69. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/spinner.tsx +16 -0
  70. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/table.tsx +114 -0
  71. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/components/ui/tabs.tsx +88 -0
  72. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/api/accountSearchService.ts +46 -0
  73. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +19 -0
  74. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +19 -0
  75. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/api/query/getAccountDetail.graphql +121 -0
  76. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/api/query/searchAccounts.graphql +51 -0
  77. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +357 -0
  78. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/pages/AccountSearch.tsx +312 -0
  79. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/__examples__/pages/Home.tsx +34 -0
  80. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/api/objectSearchService.ts +84 -0
  81. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/ActiveFilters.tsx +89 -0
  82. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/FilterContext.tsx +83 -0
  83. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/ObjectBreadcrumb.tsx +66 -0
  84. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/PaginationControls.tsx +109 -0
  85. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/SearchBar.tsx +41 -0
  86. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/SortControl.tsx +143 -0
  87. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/BooleanFilter.tsx +78 -0
  88. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/DateFilter.tsx +128 -0
  89. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/DateRangeFilter.tsx +70 -0
  90. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/FilterFieldWrapper.tsx +33 -0
  91. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/MultiSelectFilter.tsx +97 -0
  92. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/NumericRangeFilter.tsx +163 -0
  93. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/SearchFilter.tsx +50 -0
  94. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/SelectFilter.tsx +97 -0
  95. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/components/filters/TextFilter.tsx +91 -0
  96. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/hooks/useAsyncData.ts +54 -0
  97. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/hooks/useCachedAsyncData.ts +184 -0
  98. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/hooks/useDebouncedCallback.ts +34 -0
  99. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/hooks/useObjectSearchParams.ts +252 -0
  100. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/utils/debounce.ts +25 -0
  101. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/utils/fieldUtils.ts +29 -0
  102. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/utils/filterUtils.ts +395 -0
  103. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/features/object-search/utils/sortUtils.ts +38 -0
  104. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/index.ts +6 -0
  105. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/lib/utils.ts +6 -0
  106. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/navigationMenu.tsx +80 -0
  107. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/pages/AccountObjectDetailPage.tsx +361 -0
  108. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/pages/AccountSearch.tsx +305 -0
  109. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/pages/Home.tsx +34 -0
  110. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/pages/NotFound.tsx +18 -0
  111. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/router-utils.tsx +35 -0
  112. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/routes.tsx +32 -0
  113. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/styles/global.css +135 -0
  114. package/dist/force-app/main/default/uiBundles/reactinternalapp/src/types/conversation.ts +33 -0
  115. package/dist/force-app/main/default/uiBundles/reactinternalapp/tsconfig.json +42 -0
  116. package/dist/force-app/main/default/uiBundles/reactinternalapp/tsconfig.node.json +13 -0
  117. package/dist/force-app/main/default/uiBundles/reactinternalapp/ui-bundle.json +7 -0
  118. package/dist/force-app/main/default/uiBundles/reactinternalapp/vite-env.d.ts +1 -0
  119. package/dist/force-app/main/default/uiBundles/reactinternalapp/vite.config.ts +106 -0
  120. package/dist/force-app/main/default/uiBundles/reactinternalapp/vitest-env.d.ts +2 -0
  121. package/dist/force-app/main/default/uiBundles/reactinternalapp/vitest.config.ts +11 -0
  122. package/dist/force-app/main/default/uiBundles/reactinternalapp/vitest.setup.ts +1 -0
  123. package/dist/jest.config.js +6 -0
  124. package/dist/package-lock.json +9995 -0
  125. package/dist/package.json +40 -0
  126. package/dist/scripts/apex/hello.apex +10 -0
  127. package/dist/scripts/graphql-search.sh +191 -0
  128. package/dist/scripts/prepare-import-unique-fields.js +122 -0
  129. package/dist/scripts/setup-cli.mjs +563 -0
  130. package/dist/scripts/sf-project-setup.mjs +66 -0
  131. package/dist/scripts/soql/account.soql +6 -0
  132. package/dist/sfdx-project.json +12 -0
  133. package/package.json +40 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,82 @@
1
+ Terms of Use
2
+
3
+ Copyright 2026 Salesforce, Inc. All rights reserved.
4
+
5
+ These Terms of Use govern the download, installation, and/or use of this
6
+ software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
7
+ last updated on April 15, 2025, and constitute a legally binding
8
+ agreement between you and Salesforce. If you do not agree to these Terms of
9
+ Use, do not install or use the Software.
10
+
11
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
12
+ copyright license to reproduce, prepare derivative works of, publicly
13
+ display, publicly perform, sublicense, and distribute the Software and
14
+ derivative works subject to these Terms. These Terms shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ Subject to the limited rights expressly granted hereunder, Salesforce
18
+ reserves all rights, title, and interest in and to all intellectual
19
+ property subsisting in the Software. No rights are granted to you hereunder
20
+ other than as expressly set forth herein. Users residing in countries on
21
+ the United States Office of Foreign Assets Control sanction list, or which
22
+ are otherwise subject to a US export embargo, may not use the Software.
23
+
24
+ Implementation of the Software may require development work, for which you
25
+ are responsible. The Software may contain bugs, errors and
26
+ incompatibilities and is made available on an AS IS basis without support,
27
+ updates, or service level commitments.
28
+
29
+ Salesforce reserves the right at any time to modify, suspend, or
30
+ discontinue, the Software (or any part thereof) with or without notice. You
31
+ agree that Salesforce shall not be liable to you or to any third party for
32
+ any modification, suspension, or discontinuance.
33
+
34
+ You agree to defend Salesforce against any claim, demand, suit or
35
+ proceeding made or brought against Salesforce by a third party arising out
36
+ of or accruing from (a) your use of the Software, and (b) any application
37
+ you develop with the Software that infringes any copyright, trademark,
38
+ trade secret, trade dress, patent, or other intellectual property right of
39
+ any person or defames any person or violates their rights of publicity or
40
+ privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
41
+ from any damages, attorney fees, and costs finally awarded against
42
+ Salesforce as a result of, or for any amounts paid by Salesforce under a
43
+ settlement approved by you in writing of, a Claim Against Salesforce,
44
+ provided Salesforce (x) promptly gives you written notice of the Claim
45
+ Against Salesforce, (y) gives you sole control of the defense and
46
+ settlement of the Claim Against Salesforce (except that you may not settle
47
+ any Claim Against Salesforce unless it unconditionally releases Salesforce
48
+ of all liability), and (z) gives you all reasonable assistance, at your
49
+ expense.
50
+
51
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
52
+ SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
+ IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
54
+ INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
55
+ PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
56
+ OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
57
+ CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
58
+ HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
59
+
60
+ These Terms of Use shall be governed exclusively by the internal laws of
61
+ the State of California, without regard to its conflicts of laws
62
+ rules. Each party hereby consents to the exclusive jurisdiction of the
63
+ state and federal courts located in San Francisco County, California to
64
+ adjudicate any dispute arising out of or relating to these Terms of Use and
65
+ the download, installation, and/or use of the Software. Except as expressly
66
+ stated herein, these Terms of Use constitute the entire agreement between
67
+ the parties, and supersede all prior and contemporaneous agreements,
68
+ proposals, or representations, written or oral, concerning their subject
69
+ matter. No modification, amendment, or waiver of any provision of these
70
+ Terms of Use shall be effective unless it is by an update to these Terms of
71
+ Use that Salesforce makes available, or is in writing and signed by the
72
+ party against whom the modification, amendment, or waiver is to be
73
+ asserted.
74
+
75
+ Data Privacy: Salesforce may collect, process, and store device,
76
+ system, and other information related to your use of the Software. This
77
+ information includes, but is not limited to, IP address, user metrics, and
78
+ other data ("Usage Data"). Salesforce may use Usage Data for analytics,
79
+ product development, and marketing purposes. You acknowledge that files
80
+ generated in conjunction with the Software may contain sensitive or
81
+ confidential data, and you are solely responsible for anonymizing and
82
+ protecting such data.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # React Internal App
2
+
3
+ React internal app template — Agentforce conversation client and global search, without a site container.
4
+
5
+ ## In this monorepo
6
+
7
+ This package is a **template app** in the ui-bundle monorepo. It is built by applying feature patches to the base React app; the output is written to `dist/`.
8
+
9
+ ### Build
10
+
11
+ ```bash
12
+ nx run reactinternalapp:build
13
+ ```
14
+
15
+ Produces an SFDX project in `dist/` with the UI Bundle at `dist/force-app/main/default/uiBundles/reactinternalapp/`.
16
+
17
+ ### Dev server
18
+
19
+ ```bash
20
+ nx run reactinternalapp:dev
21
+ ```
22
+
23
+ Starts the Vite dev server from the built output in `dist/`.
24
+
25
+ ### Watch
26
+
27
+ ```bash
28
+ nx run reactinternalapp:watch
29
+ ```
30
+
31
+ Re-applies patches automatically when source files change.
32
+
33
+ ### Test
34
+
35
+ This package has no dedicated test target. To run tests, build first, then run them from the built UI Bundle:
36
+
37
+ ```bash
38
+ nx run reactinternalapp:build
39
+ cd dist/force-app/main/default/uiBundles/reactinternalapp && npm install && npm test
40
+ ```
41
+
42
+ ### Clean
43
+
44
+ ```bash
45
+ npm run clean
46
+ ```
47
+
48
+ Removes the `dist/` directory.
49
+
50
+ ---
51
+
52
+ For standalone run, deploy, and test instructions (e.g. after publishing or extracting `dist/`), see the [UI Bundle README](dist/force-app/main/default/uiBundles/reactinternalapp/README.md).
@@ -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
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm run precommit
@@ -0,0 +1,11 @@
1
+ # List files or directories below to ignore them when running prettier
2
+ # More information: https://prettier.io/docs/en/ignore.html
3
+ #
4
+
5
+ **/staticresources/**
6
+ .localdevserver
7
+ .sfdx
8
+ .sf
9
+ .vscode
10
+
11
+ coverage/
@@ -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,193 @@
1
+ # Agent guide: Salesforce UI Bundle development
2
+
3
+ This project is a **Salesforce DX (SFDX) project** containing a **React UI Bundle**. The UI Bundle is a standalone Vite + React SPA that runs inside the Salesforce platform. Use this file when working in this project.
4
+
5
+ ## Resolving paths
6
+
7
+ Read `sfdx-project.json` at the project root. Take the first `packageDirectories[].path` value and append `/main/default` to get `<sfdx-source>`. The UI Bundle directory is:
8
+
9
+ ```
10
+ <sfdx-source>/uiBundles/<appName>/
11
+ ```
12
+
13
+ Replace `<appName>` with the actual folder name found under `uiBundles/`. The source path is **not** always `force-app` — always resolve it from `sfdx-project.json`.
14
+
15
+ ## Project layout
16
+
17
+ ```
18
+ <project-root>/
19
+ ├── sfdx-project.json
20
+ ├── package.json # SFDX root scripts
21
+ ├── scripts/
22
+ │ ├── setup-cli.mjs # One-command setup (deploy, schema, build)
23
+ │ └── graphql-search.sh # Schema entity lookup
24
+ ├── config/
25
+ │ └── project-scratch-def.json
26
+
27
+ └── <sfdx-source>/
28
+ ├── uiBundles/
29
+ │ └── <appName>/ # ← React UI Bundle (primary workspace)
30
+ │ ├── <appName>.uibundle-meta.xml
31
+ │ ├── ui-bundle.json
32
+ │ ├── index.html
33
+ │ ├── package.json
34
+ │ ├── vite.config.ts / tsconfig.json
35
+ │ ├── vitest.config.ts / playwright.config.ts
36
+ │ ├── codegen.yml / .graphqlrc.yml
37
+ │ └── src/ # All application code lives here
38
+
39
+ ├── classes/ # Apex classes (optional)
40
+ ├── objects/ # Custom objects and fields (optional)
41
+ ├── permissionsets/ # Permission sets (optional)
42
+ ├── cspTrustedSites/ # CSP trusted site definitions (optional)
43
+ ├── layouts/ # Object layouts (optional)
44
+ ├── triggers/ # Apex triggers (optional)
45
+ └── data/ # Sample data for import (optional)
46
+ ```
47
+
48
+ ## Web application source structure
49
+
50
+ All application code lives inside the UI Bundle's `src/` directory:
51
+
52
+ ```
53
+ src/
54
+ ├── app.tsx # Entry point — creates the browser router
55
+ ├── appLayout.tsx # Shell layout (header, navigation, Outlet, footer)
56
+ ├── routes.tsx # Single route registry for the entire app
57
+ ├── navigationMenu.tsx # Navigation component
58
+ ├── router-utils.tsx # Router helpers
59
+ ├── lib/utils.ts # Utility functions (cn, etc.)
60
+ ├── styles/global.css # Tailwind global styles
61
+ ├── api/ # GraphQL operations, clients, data services
62
+ ├── assets/ # Static SVGs, images
63
+ ├── components/
64
+ │ ├── ui/ # Shared primitives (shadcn-style: button, card, input, etc.)
65
+ │ ├── layout/ # Layout components (header, footer, sidebar)
66
+ │ └── <feature>/ # Feature-specific components
67
+ ├── features/ # Feature modules (auth, search, etc.)
68
+ ├── hooks/ # Custom React hooks
69
+ ├── pages/ # Page components (one per route)
70
+ ├── public/ # Static assets served as-is
71
+ └── utils/ # Shared utilities
72
+ ```
73
+
74
+ ### Key files
75
+
76
+ | File | Role |
77
+ |------|------|
78
+ | `app.tsx` | Creates `BrowserRouter`; do not add UI here |
79
+ | `appLayout.tsx` | Source of truth for navigation, header, footer, and page shell |
80
+ | `routes.tsx` | Single route registry; all pages are children of the layout route |
81
+ | `<appName>.uibundle-meta.xml` | Salesforce deploy descriptor (`masterLabel`, `version`, `isActive`) |
82
+ | `ui-bundle.json` | Runtime config (`outputDir`, routing) |
83
+
84
+ ## Two package.json contexts
85
+
86
+ ### 1. Project root
87
+
88
+ Used for SFDX metadata tooling. Scripts here target LWC/Aura, not the React app.
89
+
90
+ | Command | Purpose |
91
+ |---------|---------|
92
+ | `npm run test` | LWC Jest (passWithNoTests) |
93
+ | `npm run prettier` | Format metadata files |
94
+ | `npm run prettier:verify` | Check Prettier |
95
+
96
+ **One-command setup:** `node scripts/setup-cli.mjs --target-org <alias>` runs login, deploy, permset assignment, data import, GraphQL schema/codegen, UI Bundle build, and optionally the dev server. Use `--help` for all flags.
97
+
98
+ ### 2. Web app directory (primary workspace)
99
+
100
+ **Always `cd` into the UI Bundle directory for dev/build/lint/test:**
101
+
102
+ | Command | Purpose |
103
+ |---------|---------|
104
+ | `npm run dev` | Start Vite dev server |
105
+ | `npm run build` | TypeScript check + Vite production build |
106
+ | `npm run lint` | ESLint for the React app |
107
+ | `npm run test` | Vitest unit tests |
108
+ | `npm run preview` | Preview production build |
109
+ | `npm run graphql:codegen` | Generate GraphQL types from schema |
110
+ | `npm run graphql:schema` | Fetch GraphQL schema from org |
111
+
112
+ **Before completing any change:** run `npm run build` and `npm run lint` from the UI Bundle directory. Both must pass with zero errors.
113
+
114
+ ## Development conventions
115
+
116
+ ### UI
117
+
118
+ - **Component library:** shadcn/ui primitives in `src/components/ui/`. Always use these over raw HTML equivalents.
119
+ - **Styling:** Tailwind CSS only. No inline `style={{}}`. Use `cn()` from `@/lib/utils` for conditional classes.
120
+ - **Icons:** Lucide React.
121
+ - **Path alias:** `@/*` maps to `src/*`. Use it for all imports.
122
+ - **TypeScript:** No `any`. Use proper types, generics, or `unknown`.
123
+ - **Components:** Accept `className?: string` prop. Extract shared state to custom hooks in `src/hooks/`.
124
+ - **React apps must not** import Salesforce platform modules (`lightning/*`, `@wire`, LWC APIs).
125
+
126
+ ### Routing
127
+
128
+ - React Router with `createBrowserRouter`. Route definitions live exclusively in `routes.tsx`.
129
+ - All page routes are children of the layout route (which renders `appLayout.tsx`).
130
+ - Default-export one component per page file.
131
+ - The catch-all `path: '*'` route must always be last.
132
+ - Navigation uses absolute paths (`/dashboard`). Non-router imports use dot-relative paths (`./utils`).
133
+ - Navigation visibility is driven by `handle.showInNavigation` on route definitions.
134
+
135
+ ### Layout and navigation
136
+
137
+ - `appLayout.tsx` owns the header, navigation menu, footer, and `<Outlet />`.
138
+ - To modify header or footer, edit `appLayout.tsx` and create components in `src/components/layout/`.
139
+ - To add a page, add a route in `routes.tsx` and create the page component — do not modify `appLayout.tsx` or `app.tsx` for page additions.
140
+
141
+ ### Data access (Salesforce)
142
+
143
+ - **All data access uses the Data SDK** (`@salesforce/sdk-data`) via `createDataSDK()`.
144
+ - **Never** use `fetch()` or `axios` directly for Salesforce data.
145
+ - **GraphQL is preferred** for record operations (`sdk.graphql`). Use `sdk.fetch` only when GraphQL cannot cover the case (UI API REST, Apex REST, Connect REST, Einstein LLM).
146
+ - Use optional chaining: `sdk.graphql?.()`, `sdk.fetch?.()`.
147
+ - Apply the `@optional` directive to all record fields for field-level security resilience.
148
+ - Verify field and object names via `scripts/graphql-search.sh` before writing queries.
149
+ - Use `__SF_API_VERSION__` global for API version in REST calls.
150
+ - **Blocked APIs:** Enterprise REST query endpoint (`/query` with SOQL), `@AuraEnabled` Apex, Chatter API.
151
+
152
+ ### CSP trusted sites
153
+
154
+ Any external domain the app calls (APIs, CDNs, fonts) must have a `.cspTrustedSite-meta.xml` file under `<sfdx-source>/cspTrustedSites/`. Unregistered domains are blocked at runtime. Each subdomain needs its own entry. URLs must be HTTPS with no trailing slash, no path, and no wildcards.
155
+
156
+ ## Deploying
157
+
158
+ **Deployment order matters.** Metadata (objects, permission sets) must be deployed before fetching the GraphQL schema. After any metadata deployment that changes objects, fields, or permissions, re-run schema fetch and codegen.
159
+
160
+ **Recommended sequence:**
161
+
162
+ 1. Authenticate to the target org
163
+ 2. Build the UI Bundle (`npm run build` in the UI Bundle directory)
164
+ 3. Deploy metadata (`sf project deploy start --source-dir <packageDir> --target-org <alias>`)
165
+ 4. Assign permission sets
166
+ 5. Import data (only with user confirmation)
167
+ 6. Fetch GraphQL schema + run codegen (`npm run graphql:schema && npm run graphql:codegen`)
168
+ 7. Rebuild the UI Bundle (schema changes may affect generated types)
169
+
170
+ **Or use the one-command setup:** `node scripts/setup-cli.mjs --target-org <alias>`
171
+
172
+ ```bash
173
+ # Deploy UI Bundle only
174
+ sf project deploy start --source-dir <sfdx-source>/ui-bundles --target-org <alias>
175
+
176
+ # Deploy all metadata
177
+ sf project deploy start --source-dir <packageDir> --target-org <alias>
178
+ ```
179
+
180
+ ## Skills
181
+
182
+ Check for available skills before implementing any of the following:
183
+
184
+ | Area | When to consult |
185
+ |------|----------------|
186
+ | UI generation | Building pages, components, modifying header/footer/layout |
187
+ | Salesforce data access | Reading/writing records, GraphQL queries, REST calls |
188
+ | Metadata and deployment | Scaffolding apps, configuring CSP, deployment sequencing |
189
+ | Feature installation | Before building something from scratch — check if a pre-built feature exists |
190
+ | File upload | Adding file upload with Salesforce ContentVersion |
191
+ | Agentforce conversation | Adding or modifying the Agentforce chat widget |
192
+
193
+ Skills are the authoritative source for detailed patterns, constraints, and code examples in each area. This file provides project-level orientation; skills provide implementation depth.