@salesforce/templates 66.1.1 → 66.2.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.
Files changed (238) hide show
  1. package/lib/generators/projectGenerator.d.ts +6 -0
  2. package/lib/generators/projectGenerator.js +43 -4
  3. package/lib/generators/projectGenerator.js.map +1 -1
  4. package/lib/templates/project/react-b2e/.a4drules/README.md +35 -0
  5. package/lib/templates/project/react-b2e/.a4drules/a4d-webapp-generate.md +27 -0
  6. package/lib/templates/project/react-b2e/.a4drules/build-validation.md +78 -0
  7. package/lib/templates/project/react-b2e/.a4drules/code-quality.md +137 -0
  8. package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
  9. package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
  10. package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
  11. package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
  12. package/lib/templates/project/react-b2e/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
  13. package/lib/templates/project/react-b2e/.a4drules/graphql.md +409 -0
  14. package/lib/templates/project/react-b2e/.a4drules/images.md +13 -0
  15. package/lib/templates/project/react-b2e/.a4drules/react.md +387 -0
  16. package/lib/templates/project/react-b2e/.a4drules/react_image_processing.md +45 -0
  17. package/lib/templates/project/react-b2e/.a4drules/typescript.md +224 -0
  18. package/lib/templates/project/react-b2e/.a4drules/ui-layout.md +23 -0
  19. package/lib/templates/project/react-b2e/.a4drules/webapp-nav-and-placeholders.md +33 -0
  20. package/lib/templates/project/react-b2e/.a4drules/webapp-no-node-e.md +25 -0
  21. package/lib/templates/project/react-b2e/.a4drules/webapp-ui-first.md +32 -0
  22. package/lib/templates/project/react-b2e/.a4drules/webapp.md +75 -0
  23. package/lib/templates/project/react-b2e/.forceignore +15 -0
  24. package/lib/templates/project/react-b2e/.husky/pre-commit +4 -0
  25. package/lib/templates/project/react-b2e/.prettierignore +11 -0
  26. package/lib/templates/project/react-b2e/.prettierrc +17 -0
  27. package/lib/templates/project/react-b2e/AGENT.md +75 -0
  28. package/lib/templates/project/react-b2e/CHANGELOG.md +696 -0
  29. package/lib/templates/project/react-b2e/README.md +18 -0
  30. package/lib/templates/project/react-b2e/config/project-scratch-def.json +13 -0
  31. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.graphqlrc.yml +2 -0
  32. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.prettierignore +9 -0
  33. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.prettierrc +11 -0
  34. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/appreacttemplateb2e.webapplication-meta.xml +7 -0
  35. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.d.ts +2 -0
  36. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.js +93 -0
  37. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/codegen.yml +94 -0
  38. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/e2e/app.spec.ts +17 -0
  39. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/eslint.config.js +141 -0
  40. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/index.html +13 -0
  41. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/package-lock.json +14392 -0
  42. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/package.json +58 -0
  43. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/playwright.config.ts +24 -0
  44. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/scripts/get-graphql-schema.mjs +68 -0
  45. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/scripts/rewrite-e2e-assets.mjs +23 -0
  46. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/graphql-operations-types.ts +116 -0
  47. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/accounts.ts +33 -0
  48. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
  49. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/app.tsx +22 -0
  50. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/appLayout.tsx +19 -0
  51. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/book.svg +3 -0
  52. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/copy.svg +4 -0
  53. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/rocket.svg +3 -0
  54. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/star.svg +3 -0
  55. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-1.png +0 -0
  56. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-2.png +0 -0
  57. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-3.png +0 -0
  58. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/vibe-codey.svg +194 -0
  59. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/AgentforceConversationClient.tsx +127 -0
  60. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/index.ts +6 -0
  61. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/navigationMenu.tsx +80 -0
  62. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Home.tsx +12 -0
  63. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/NotFound.tsx +18 -0
  64. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/router-utils.tsx +35 -0
  65. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/routes.tsx +22 -0
  66. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/styles/global.css +13 -0
  67. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/types/conversation.ts +21 -0
  68. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/tsconfig.json +36 -0
  69. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/tsconfig.node.json +13 -0
  70. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vite-env.d.ts +1 -0
  71. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vite.config.ts +102 -0
  72. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest-env.d.ts +2 -0
  73. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest.config.ts +11 -0
  74. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest.setup.ts +1 -0
  75. package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/webapplication.json +7 -0
  76. package/lib/templates/project/react-b2e/jest.config.js +6 -0
  77. package/lib/templates/project/react-b2e/package.json +38 -0
  78. package/lib/templates/project/react-b2e/scripts/apex/hello.apex +10 -0
  79. package/lib/templates/project/react-b2e/scripts/soql/account.soql +6 -0
  80. package/lib/templates/project/react-b2e/sfdx-project.json +12 -0
  81. package/lib/templates/project/react-b2x/.a4drules/README.md +35 -0
  82. package/lib/templates/project/react-b2x/.a4drules/a4d-webapp-generate.md +27 -0
  83. package/lib/templates/project/react-b2x/.a4drules/build-validation.md +78 -0
  84. package/lib/templates/project/react-b2x/.a4drules/code-quality.md +137 -0
  85. package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
  86. package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
  87. package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
  88. package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
  89. package/lib/templates/project/react-b2x/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
  90. package/lib/templates/project/react-b2x/.a4drules/graphql.md +409 -0
  91. package/lib/templates/project/react-b2x/.a4drules/images.md +13 -0
  92. package/lib/templates/project/react-b2x/.a4drules/react.md +387 -0
  93. package/lib/templates/project/react-b2x/.a4drules/react_image_processing.md +45 -0
  94. package/lib/templates/project/react-b2x/.a4drules/typescript.md +224 -0
  95. package/lib/templates/project/react-b2x/.a4drules/ui-layout.md +23 -0
  96. package/lib/templates/project/react-b2x/.a4drules/webapp-nav-and-placeholders.md +33 -0
  97. package/lib/templates/project/react-b2x/.a4drules/webapp-no-node-e.md +25 -0
  98. package/lib/templates/project/react-b2x/.a4drules/webapp-ui-first.md +32 -0
  99. package/lib/templates/project/react-b2x/.a4drules/webapp.md +75 -0
  100. package/lib/templates/project/react-b2x/.forceignore +15 -0
  101. package/lib/templates/project/react-b2x/.husky/pre-commit +4 -0
  102. package/lib/templates/project/react-b2x/.prettierignore +11 -0
  103. package/lib/templates/project/react-b2x/.prettierrc +17 -0
  104. package/lib/templates/project/react-b2x/AGENT.md +75 -0
  105. package/lib/templates/project/react-b2x/CHANGELOG.md +696 -0
  106. package/lib/templates/project/react-b2x/README.md +18 -0
  107. package/lib/templates/project/react-b2x/config/project-scratch-def.json +13 -0
  108. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppAuthUtils.cls +68 -0
  109. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppAuthUtils.cls-meta.xml +5 -0
  110. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppChangePassword.cls +77 -0
  111. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppChangePassword.cls-meta.xml +5 -0
  112. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppForgotPassword.cls +71 -0
  113. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppForgotPassword.cls-meta.xml +5 -0
  114. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppLogin.cls +105 -0
  115. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppLogin.cls-meta.xml +5 -0
  116. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppRegistration.cls +162 -0
  117. package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppRegistration.cls-meta.xml +5 -0
  118. package/lib/templates/project/react-b2x/force-app/main/default/digitalExperienceConfigs/appreacttemplateb2x1.digitalExperienceConfig +8 -0
  119. package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/appreacttemplateb2x1.digitalExperience-meta.xml +11 -0
  120. package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/sfdc_cms__site/appreacttemplateb2x1/_meta.json +5 -0
  121. package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/sfdc_cms__site/appreacttemplateb2x1/content.json +10 -0
  122. package/lib/templates/project/react-b2x/force-app/main/default/networks/appreacttemplateb2x.network +60 -0
  123. package/lib/templates/project/react-b2x/force-app/main/default/package.xml +20 -0
  124. package/lib/templates/project/react-b2x/force-app/main/default/sites/appreacttemplateb2x.site +31 -0
  125. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.graphqlrc.yml +2 -0
  126. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.prettierignore +9 -0
  127. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.prettierrc +11 -0
  128. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/appreacttemplateb2x.webapplication-meta.xml +7 -0
  129. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.d.ts +2 -0
  130. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.js +93 -0
  131. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/codegen.yml +94 -0
  132. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/e2e/app.spec.ts +17 -0
  133. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/eslint.config.js +141 -0
  134. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/index.html +13 -0
  135. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/package-lock.json +18408 -0
  136. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/package.json +66 -0
  137. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/playwright.config.ts +24 -0
  138. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/scripts/get-graphql-schema.mjs +68 -0
  139. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/scripts/rewrite-e2e-assets.mjs +23 -0
  140. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/graphql-operations-types.ts +116 -0
  141. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/accounts.ts +33 -0
  142. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
  143. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/app.tsx +13 -0
  144. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/appLayout.tsx +11 -0
  145. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/book.svg +3 -0
  146. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/copy.svg +4 -0
  147. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/rocket.svg +3 -0
  148. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/star.svg +3 -0
  149. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-1.png +0 -0
  150. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-2.png +0 -0
  151. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-3.png +0 -0
  152. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/vibe-codey.svg +194 -0
  153. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/alerts/status-alert.tsx +45 -0
  154. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authHelpers.ts +73 -0
  155. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authenticationConfig.ts +61 -0
  156. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authenticationRouteLayout.tsx +21 -0
  157. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/privateRouteLayout.tsx +36 -0
  158. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/SessionTimeoutValidator.tsx +616 -0
  159. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/sessionTimeService.ts +161 -0
  160. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/sessionTimeoutConfig.ts +77 -0
  161. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/footers/footer-link.tsx +36 -0
  162. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/forms/auth-form.tsx +81 -0
  163. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/forms/submit-button.tsx +49 -0
  164. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-layout.tsx +23 -0
  165. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-skeleton.tsx +38 -0
  166. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/centered-page-layout.tsx +73 -0
  167. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/alert.tsx +69 -0
  168. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/button.tsx +67 -0
  169. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/card.tsx +92 -0
  170. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/dialog.tsx +143 -0
  171. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/field.tsx +222 -0
  172. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/index.ts +72 -0
  173. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/input.tsx +19 -0
  174. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/label.tsx +19 -0
  175. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/pagination.tsx +112 -0
  176. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/select.tsx +183 -0
  177. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/separator.tsx +26 -0
  178. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/skeleton.tsx +14 -0
  179. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/spinner.tsx +15 -0
  180. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/table.tsx +87 -0
  181. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/tabs.tsx +78 -0
  182. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components.json +18 -0
  183. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/context/AuthContext.tsx +95 -0
  184. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/form.tsx +116 -0
  185. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/useCountdownTimer.ts +266 -0
  186. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/useRetryWithBackoff.ts +109 -0
  187. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/layouts/AuthAppLayout.tsx +12 -0
  188. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/data-sdk.ts +21 -0
  189. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/utils.ts +6 -0
  190. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/navigationMenu.tsx +80 -0
  191. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ChangePassword.tsx +107 -0
  192. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ForgotPassword.tsx +73 -0
  193. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Home.tsx +12 -0
  194. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Login.tsx +97 -0
  195. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/NotFound.tsx +18 -0
  196. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Profile.tsx +178 -0
  197. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Register.tsx +138 -0
  198. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ResetPassword.tsx +107 -0
  199. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/router-utils.tsx +35 -0
  200. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/routes.tsx +71 -0
  201. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/styles/global.css +135 -0
  202. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/utils/helpers.ts +121 -0
  203. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/tsconfig.json +36 -0
  204. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/tsconfig.node.json +13 -0
  205. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vite-env.d.ts +1 -0
  206. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vite.config.ts +102 -0
  207. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest-env.d.ts +2 -0
  208. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest.config.ts +11 -0
  209. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest.setup.ts +1 -0
  210. package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/webapplication.json +7 -0
  211. package/lib/templates/project/react-b2x/jest.config.js +6 -0
  212. package/lib/templates/project/react-b2x/package.json +38 -0
  213. package/lib/templates/project/react-b2x/scripts/apex/hello.apex +10 -0
  214. package/lib/templates/project/react-b2x/scripts/soql/account.soql +6 -0
  215. package/lib/templates/project/react-b2x/sfdx-project.json +12 -0
  216. package/lib/templates/webapplication/reactbasic/.graphqlrc.yml +2 -0
  217. package/lib/templates/webapplication/reactbasic/build/vite.config.js +20 -1
  218. package/lib/templates/webapplication/reactbasic/codegen.yml +94 -0
  219. package/lib/templates/webapplication/reactbasic/e2e/app.spec.ts +0 -7
  220. package/lib/templates/webapplication/reactbasic/eslint.config.js +28 -0
  221. package/lib/templates/webapplication/reactbasic/package-lock.json +10090 -2874
  222. package/lib/templates/webapplication/reactbasic/package.json +16 -4
  223. package/lib/templates/webapplication/reactbasic/scripts/get-graphql-schema.mjs +68 -0
  224. package/lib/templates/webapplication/reactbasic/src/api/graphql-operations-types.ts +23 -34
  225. package/lib/templates/webapplication/reactbasic/src/api/utils/accounts.ts +33 -0
  226. package/lib/templates/webapplication/reactbasic/src/app.tsx +10 -1
  227. package/lib/templates/webapplication/reactbasic/src/appLayout.tsx +2 -0
  228. package/lib/templates/webapplication/reactbasic/src/navigationMenu.tsx +80 -0
  229. package/lib/templates/webapplication/reactbasic/src/router-utils.tsx +35 -0
  230. package/lib/templates/webapplication/reactbasic/src/routes.tsx +1 -7
  231. package/lib/templates/webapplication/reactbasic/vite.config.ts +20 -1
  232. package/lib/tsconfig.tsbuildinfo +1 -1
  233. package/lib/utils/types.d.ts +1 -1
  234. package/lib/utils/webappTemplateUtils.d.ts +49 -0
  235. package/lib/utils/webappTemplateUtils.js +210 -0
  236. package/lib/utils/webappTemplateUtils.js.map +1 -0
  237. package/package.json +7 -5
  238. package/lib/templates/webapplication/reactbasic/src/pages/About.tsx +0 -12
@@ -2,7 +2,13 @@ import { ProjectOptions } from '../utils/types';
2
2
  import { BaseGenerator } from './baseGenerator';
3
3
  export default class ProjectGenerator extends BaseGenerator<ProjectOptions> {
4
4
  constructor(options: ProjectOptions);
5
+ /**
6
+ * Returns template path for primary; if it doesn't exist, returns fallback path.
7
+ * Used so react-b2e/react-b2x can omit shared files and fall back to standard.
8
+ */
9
+ private templatePathWithFallback;
5
10
  validateOptions(): void;
6
11
  generate(): Promise<void>;
12
+ private registerChange;
7
13
  private _createHuskyConfig;
8
14
  }
@@ -11,7 +11,15 @@ const fs = require("fs");
11
11
  const promises_1 = require("node:fs/promises");
12
12
  const path = require("path");
13
13
  const utils_1 = require("../utils");
14
+ const webappTemplateUtils_1 = require("../utils/webappTemplateUtils");
14
15
  const baseGenerator_1 = require("./baseGenerator");
16
+ const VALID_PROJECT_TEMPLATES = [
17
+ 'standard',
18
+ 'empty',
19
+ 'analytics',
20
+ 'react-b2e',
21
+ 'react-b2x',
22
+ ];
15
23
  const GITIGNORE = 'gitignore';
16
24
  const HUSKY_FOLDER = '.husky';
17
25
  const huskyhookarray = ['pre-commit'];
@@ -53,11 +61,26 @@ class ProjectGenerator extends baseGenerator_1.BaseGenerator {
53
61
  super(options);
54
62
  this.sourceRootWithPartialPath('project');
55
63
  }
64
+ /**
65
+ * Returns template path for primary; if it doesn't exist, returns fallback path.
66
+ * Used so react-b2e/react-b2x can omit shared files and fall back to standard.
67
+ */
68
+ templatePathWithFallback(primary, fallback) {
69
+ const primaryPath = this.templatePath(primary);
70
+ return fs.existsSync(primaryPath)
71
+ ? primaryPath
72
+ : this.templatePath(fallback);
73
+ }
56
74
  validateOptions() {
57
- utils_1.CreateUtil.checkInputs(this.options.template);
75
+ utils_1.CreateUtil.checkInputs(this.options.projectname);
76
+ if (!VALID_PROJECT_TEMPLATES.includes(this.options.template)) {
77
+ throw new Error(`Invalid project template: ${this.options.template}. Valid options: ${VALID_PROJECT_TEMPLATES.join(', ')}`);
78
+ }
58
79
  }
59
80
  generate() {
60
81
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
+ // Re-apply source root so customTemplatesRootPath (set in run()) is used when provided
83
+ this.sourceRootWithPartialPath('project');
61
84
  const { projectname, template, defaultpackagedir, manifest, ns, loginurl } = this.options;
62
85
  const folderlayout = [
63
86
  this.outputdir,
@@ -70,8 +93,8 @@ class ProjectGenerator extends baseGenerator_1.BaseGenerator {
70
93
  const manifestFile = `${template}/Manifest.xml`;
71
94
  const soqlQueryFile = 'account.soql';
72
95
  const anonApexFile = 'hello.apex';
73
- yield this.render(this.templatePath(scratchDefFile), this.destinationPath(path.join(this.outputdir, projectname, 'config', 'project-scratch-def.json')), { company: (process.env.USER || 'Demo') + ' company' });
74
- yield this.render(this.templatePath(`${template}/README.md`), this.destinationPath(path.join(this.outputdir, projectname, 'README.md')), {});
96
+ yield this.render(this.templatePathWithFallback(scratchDefFile, 'standard/ScratchDef.json'), this.destinationPath(path.join(this.outputdir, projectname, 'config', 'project-scratch-def.json')), { company: (process.env.USER || 'Demo') + ' company' });
97
+ yield this.render(this.templatePathWithFallback(`${template}/README.md`, 'standard/README.md'), this.destinationPath(path.join(this.outputdir, projectname, 'README.md')), {});
75
98
  yield this.render(this.templatePath('sfdx-project.json'), this.destinationPath(path.join(this.outputdir, projectname, 'sfdx-project.json')), {
76
99
  defaultpackagedir,
77
100
  namespace: ns,
@@ -80,7 +103,7 @@ class ProjectGenerator extends baseGenerator_1.BaseGenerator {
80
103
  name: projectname,
81
104
  });
82
105
  if (manifest === true) {
83
- yield this.render(this.templatePath(manifestFile), this.destinationPath(path.join(this.outputdir, projectname, 'manifest', 'package.xml')), { apiversion: this.apiversion });
106
+ yield this.render(this.templatePathWithFallback(manifestFile, 'standard/Manifest.xml'), this.destinationPath(path.join(this.outputdir, projectname, 'manifest', 'package.xml')), { apiversion: this.apiversion });
84
107
  }
85
108
  if (template === 'standard') {
86
109
  yield makeEmptyFolders(folderlayout, standardfolderarray);
@@ -131,8 +154,24 @@ class ProjectGenerator extends baseGenerator_1.BaseGenerator {
131
154
  yield this.render(this.templatePath(file), this.destinationPath(path.join(this.outputdir, projectname, out)), {});
132
155
  }
133
156
  }
157
+ if (webappTemplateUtils_1.BUILT_IN_FULL_TEMPLATES.has(template)) {
158
+ yield (0, webappTemplateUtils_1.generateBuiltInFullTemplate)(template, projectname, {
159
+ templateDir: this.templatePath(template),
160
+ projectDir: path.join(this.outputdir, projectname),
161
+ defaultpackagedir,
162
+ ns,
163
+ loginurl,
164
+ apiversion: this.apiversion,
165
+ renderEjs: webappTemplateUtils_1.renderEjsFile,
166
+ onFileCreated: (destPath) => this.registerChange(destPath),
167
+ });
168
+ }
134
169
  });
135
170
  }
171
+ registerChange(destPath) {
172
+ const relativePath = path.relative(process.cwd(), destPath);
173
+ this.changes.created.push(relativePath);
174
+ }
136
175
  _createHuskyConfig(projectRootDir) {
137
176
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
138
177
  const huskyDirPath = path.join(projectRootDir, HUSKY_FOLDER);
@@ -1 +1 @@
1
- {"version":3,"file":"projectGenerator.js","sourceRoot":"","sources":["../../src/generators/projectGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,+CAA8D;AAC9D,6BAA6B;AAC7B,oCAAsC;AAEtC,mDAAgD;AAEhD,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,mBAAmB,GAAG;IAC1B,cAAc;IACd,MAAM;IACN,SAAS;IACT,eAAe;IACf,YAAY;IACZ,SAAS;IACT,K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AAC,SAAS,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,EACjE,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;KAAA;IAEa,kBAAkB,CAAC,cAAsB;;YACrD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAC7D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjC,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAC7B,CAAC;YACD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;gBAClC,MAAM,IAAI,CAAC,MAAM,CACf,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,EAChD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,EACnD,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF;AAnND,mCAmNC;AAED,SAAe,gBAAgB,CAC7B,eAAyB,EACzB,eAAyB;;QAEzB,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;YACrC,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CAAA"}
1
+ {"version":3,"file":"projectGenerator.js","sourceRoot":"","sources":["../../src/generators/projectGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,+CAA8D;AAC9D,6BAA6B;AAC7B,oCAAsC;AAEtC,sEAIsC;AACtC,mDAAgD;AAEhD,MAAM,uBAAuB,GAAG;IAC9B,UAAU;IACV,OAAO;IACP,WAAW;IACX,WAAW;IACX,WAAW;CACH,CAAC;AAEX,MAAM,SAAS,GAAG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CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CAAA"}
@@ -0,0 +1,35 @@
1
+ # A4D Rules Index
2
+
3
+ Rules in this folder guide the agent for this SFDX project. **Knowledge** (expert content) lives in the **local-expert MCP** repo (e.g. `local-expert-mcp`); rules here reference when to call which expert.
4
+
5
+ ## Always-apply rules (MUST follow)
6
+
7
+ | File | Purpose |
8
+ |------|--------|
9
+ | **webapp.md** | Main web app rules: invoke local-expert MCP (`webapplications-design-system` + `webapplications`), no `node -e`, React/SFDX workflow; **replace default boilerplate**; **populate home page**; **frontend aesthetics**—avoid AI slop, follow design-system expert. |
10
+ | **webapp-no-node-e.md** | No `node -e` for any file/config/shell work; use `replace_in_file` or `write_to_file` only. |
11
+ | **a4d-webapp-generate.md** | Before `sf webapp generate`: call `get_expert_knowledge` with `webapplications-design-system` and `webapplications`; then run CLI. |
12
+ | **webapp-ui-first.md** | Build UI (layout, components, styling) first; then implement business logic (APIs, state, handlers). |
13
+ | **webapp-nav-and-placeholders.md** | **Build navigation into the app layout** (`appLayout.tsx`). Always update nav menu (app-specific items/labels) and placeholder name/design (header/nav/footer/title). Often missed—mandatory. |
14
+
15
+ ## Context-specific rules (by file pattern or topic)
16
+
17
+ | File | Purpose |
18
+ |------|--------|
19
+ | **react.md** | React web app structure, shadcn/Tailwind, data access, security; edit `appLayout.tsx` when changing layout. |
20
+ | **ui-layout.md** | When changing UI/nav/header/footer/sidebar/theme, always update `appLayout.tsx`. |
21
+ | **code-quality.md** | ESLint, Prettier, import order, naming, lint/build before completion; no `node -e`. |
22
+ | **build-validation.md** | `npm run build` must succeed from web app dir before completing. |
23
+ | **typescript.md** | TypeScript strictness, return types, interfaces. |
24
+ | **images.md** | Images: Unsplash default, CSP, alt text, error handling. |
25
+ | **react_image_processing.md** | Image handling (Unsplash, CSP, accessibility) for React components. |
26
+ | **graphql/** | GraphQL tools and knowledge (schemas, LDS guides). |
27
+
28
+ ## Knowledge repository (experts)
29
+
30
+ Expert knowledge is served by the **local-expert MCP** (e.g. at `local-expert-mcp`). The agent must call **`get_expert_knowledge`** with the appropriate topic:
31
+
32
+ - **webapplications-design-system** — Always use for web app UI/design work (design system, typography, color, motion).
33
+ - **webapplications** — Use for app generation and structure; then call sub-topics as needed (e.g. `webapplications-best-practice`, `webapplications-feature-*`).
34
+
35
+ See the MCP repo's **rule-expert-mcp.md** for full topic list and when to call which expert.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: A4D rule — call expert MCP (webapplications + webapplications-design-system) before sf webapp generate
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # A4D Rule: Before `sf webapp generate`
7
+
8
+ Before running **`sf webapp generate`**, you **must**:
9
+
10
+ 1. **Call the expert MCP** (`get_expert_knowledge`) with topic **`webapplications-design-system`** — always invoke this expert for UI/design direction.
11
+ 2. **Call the expert MCP** with topic **`webapplications`** to get generation and structure guidance.
12
+ 3. Follow the instructions from the MCP responses.
13
+ 4. Only after that, run `sf webapp generate` (e.g. `sf webapp generate -n <AppName> -t <template>`).
14
+
15
+ **Webapp name (`-n` / `<AppName>`):** Must be **alphanumerical only**—no spaces, hyphens, underscores, or other special characters. Use only letters (A–Z, a–z) and digits (0–9). If the desired name has spaces or special characters, use a single alphanumeric word (e.g. `CoffeeBoutique` instead of `Coffee Boutique` or `coffee-boutique`).
16
+
17
+ Do not run `sf webapp generate` without having invoked the expert MCP with **`webapplications-design-system`** and **`webapplications`** first.
18
+
19
+ When modifying an existing web app (UI, layout, or new features), **always** call `get_expert_knowledge` with topic **`webapplications-design-system`** before making UI or design changes.
20
+
21
+ **After generating (or when touching a new app):** Replace all default boilerplate content (e.g. "React App", "Vite + React", default document title in `index.html`, placeholder text in the shell) with the actual app name or user-facing copy. Do not leave generic template text in the UI or `<title>`.
22
+
23
+ **Home page content:** Populate the home page (root route) with real, app-specific content (e.g. landing section, banners, tiles, hero, links to features). Never leave the home page as the default template or placeholder.
24
+
25
+ **Navigation menu and placeholder name/design:** After generating or when delivering a web app, **you must** (1) **Edit the navigation menu** in `appLayout.tsx`: replace every default nav item and label with app-specific routes and names; do not leave template "Home"/"About" or placeholder links. (2) **Replace the placeholder app name** in the header, nav brand, footer, and `index.html` `<title>` with the actual app name. (3) **Update placeholder design** in the shell (header/footer/branding) so it is not the template default. See **webapp-nav-and-placeholders.md**. Agents often skip this—do not.
26
+
27
+ Prioritize webapplications generation first, and then generate the metadata.
@@ -0,0 +1,78 @@
1
+ # AI Rule: Build Validation
2
+
3
+ Build validation for successful deployments with minimal friction.
4
+
5
+ ## Targets
6
+ - `force-app/main/default/webapplications/*/**/*`
7
+ - `**/*.{js,ts,jsx,tsx}`
8
+
9
+ ## MANDATORY: Build Success
10
+
11
+ **Before completing any coding session** (from the web app directory `force-app/main/default/webapplications/<appName>/`):
12
+ ```bash
13
+ npm run build # MUST succeed with no errors
14
+ ```
15
+
16
+ ## Quick Quality Checks
17
+ Run from the web app directory (`force-app/main/default/webapplications/<appName>/`):
18
+ ```bash
19
+ npm run lint # ESLint; fix issues before completing
20
+ npm run build # Runs tsc -b && vite build; catches TypeScript and build issues
21
+ ```
22
+
23
+ ## Requirements
24
+
25
+ **Must Pass:**
26
+ - `npm run build` completes successfully
27
+ - No TypeScript compilation errors
28
+ - No critical ESLint errors
29
+
30
+ **Can Be Warnings:**
31
+ - ESLint warnings
32
+ - Minor TypeScript warnings
33
+
34
+ ## Fix Commands (when available in the web app's package.json)
35
+ ```bash
36
+ npm run lint # Run ESLint (always available)
37
+ # If your project adds Prettier/format scripts, use those before completing
38
+ ```
39
+
40
+ ## Workflow
41
+
42
+ **During Development:**
43
+ 1. Write code with AI assistance
44
+ 2. Save frequently (auto-format on save)
45
+ 3. Check periodically: `npm run lint` (optional)
46
+
47
+ **Before Completion:**
48
+ 1. Run `npm run build` from the web app directory
49
+ 2. If it fails: fix TypeScript/ESLint errors (run `npm run lint`), then retry build
50
+
51
+ ## Error Priority
52
+
53
+ **Fix Immediately:**
54
+ - TypeScript compilation errors
55
+ - Import/export errors
56
+ - Syntax errors
57
+
58
+ **Fix When Convenient:**
59
+ - ESLint warnings
60
+ - Unused variables
61
+
62
+ ## Hard Requirements
63
+ - Build must complete without errors
64
+ - No broken imports
65
+ - Basic TypeScript type safety
66
+
67
+ ## Key Commands (web app directory)
68
+ ```bash
69
+ npm run start # Start development server (vite)
70
+ npm run build # TypeScript + Vite build; check deployment readiness
71
+ npm run lint # Run ESLint
72
+ ```
73
+
74
+ ## Troubleshooting Import Errors
75
+ ```bash
76
+ npm install # Check missing dependencies
77
+ # Verify file exists, case sensitivity, export/import match
78
+ ```
@@ -0,0 +1,137 @@
1
+ # AI Rule: Code Quality Standards
2
+
3
+ Enforces ESLint, Prettier, and coding best practices for consistent, maintainable code.
4
+
5
+ **Execution rule:** Do not use `node -e` for any file or config edits. Use `replace_in_file` or `write_to_file` only (see **webapp-no-node-e.md**).
6
+
7
+ ## Targets
8
+ - `force-app/main/default/webapplications/*/**/*`
9
+ - `**/*.{js,ts,jsx,tsx,json,md}`
10
+
11
+ ## MANDATORY Checks
12
+
13
+ **Before completing code** (run from the web app directory `force-app/main/default/webapplications/<appName>/`):
14
+ ```bash
15
+ npm run lint # MUST result in: 0 errors (0 warnings preferred)
16
+ npm run build # MUST succeed (includes TypeScript check)
17
+ ```
18
+
19
+ If your project adds Prettier, use a consistent config (e.g. `.prettierrc` with `semi`, `singleQuote`, `printWidth`, etc.) and run format checks before completing.
20
+
21
+ ## Lint / Fix
22
+
23
+ ```bash
24
+ npm run lint # Run ESLint (always available in the template web app)
25
+ # Use your editor's format-on-save or add npm scripts for Prettier if desired
26
+ ```
27
+
28
+ ## Import Order (MANDATORY)
29
+ ```typescript
30
+ // 1. React ecosystem
31
+ import { useState, useEffect } from 'react';
32
+
33
+ // 2. External libraries (alphabetical)
34
+ import axios from 'axios';
35
+ import clsx from 'clsx';
36
+
37
+ // 3. UI components (alphabetical)
38
+ import { Button } from '@/components/ui/button';
39
+ import { Card } from '@/components/ui/card';
40
+
41
+ // 4. Internal utilities (alphabetical)
42
+ import { useAuth } from '../hooks/useAuth';
43
+ import { formatDate } from '../utils/dateUtils';
44
+
45
+ // 5. Relative imports
46
+ import { ComponentA } from './ComponentA';
47
+
48
+ // 6. Type imports (separate, at end)
49
+ import type { User, ApiResponse } from '../types';
50
+ ```
51
+
52
+ ## Naming Conventions
53
+ ```typescript
54
+ // PascalCase: Components, classes
55
+ const UserProfile = () => {};
56
+ const ApiClient = class {};
57
+
58
+ // camelCase: Variables, functions, properties
59
+ const userName = 'john';
60
+ const fetchUserData = async () => {};
61
+
62
+ // SCREAMING_SNAKE_CASE: Constants
63
+ const API_BASE_URL = 'https://api.example.com';
64
+
65
+ // kebab-case: Files
66
+ // user-profile.tsx, api-client.ts
67
+ ```
68
+
69
+ ## React Component Structure
70
+ ```typescript
71
+ interface ComponentProps {
72
+ // Props interface first
73
+ }
74
+
75
+ const Component: React.FC<ComponentProps> = ({ prop1, prop2 }) => {
76
+ // 1. Hooks
77
+ // 2. Computed values
78
+ // 3. Event handlers
79
+ // 4. JSX return
80
+
81
+ return <div />;
82
+ };
83
+
84
+ export default Component;
85
+ ```
86
+
87
+ ## JSX Standards
88
+ ```typescript
89
+ // Self-closing tags
90
+ <Button onClick={handleClick} />
91
+
92
+ // Conditional rendering
93
+ {isLoading && <Spinner />}
94
+ {error ? <ErrorMessage error={error} /> : <Content />}
95
+
96
+ // Lists with keys
97
+ {items.map(item => <Item key={item.id} data={item} />)}
98
+ ```
99
+
100
+ ## Error Handling
101
+ ```typescript
102
+ // Async functions with try-catch
103
+ const fetchData = async (id: string): Promise<Data> => {
104
+ try {
105
+ const response = await api.get(`/data/${id}`);
106
+ return response.data;
107
+ } catch (error) {
108
+ console.error('Failed to fetch data:', error);
109
+ throw error;
110
+ }
111
+ };
112
+ ```
113
+
114
+ ## Anti-Patterns (FORBIDDEN)
115
+ ```typescript
116
+ // NEVER disable ESLint without justification
117
+ // eslint-disable-next-line
118
+
119
+ // NEVER mutate state directly
120
+ state.items.push(newItem); // Wrong
121
+ setItems(prev => [...prev, newItem]); // Correct
122
+
123
+ // NEVER use magic numbers/strings
124
+ setTimeout(() => {}, 5000); // Wrong
125
+ const DEBOUNCE_DELAY = 5000; // Correct
126
+ ```
127
+
128
+ ## Quality Workflow
129
+
130
+ **Before Committing:**
131
+ 1. `npm run lint` - 0 errors (and 0 warnings when possible)
132
+ 2. `npm run build` - Build must succeed (TypeScript + Vite)
133
+
134
+ ## Zero Tolerance Policy
135
+ - ESLint errors: MUST be 0
136
+ - ESLint warnings: MUST be 0 (fix when convenient)
137
+ - TypeScript errors: MUST be 0 (enforced by `npm run build`)
@@ -0,0 +1,227 @@
1
+ # GraphQL Schema Reference
2
+
3
+ This document provides guidance for AI agents working with the Salesforce GraphQL API schema in this project.
4
+
5
+ ## Schema File Location
6
+
7
+ **The complete GraphQL schema is located at: `@schema.graphql`** (in the project root)
8
+
9
+ > ⚠️ **Important**: The schema file is very large (~265,000+ lines). Do NOT read it entirely. Instead, use targeted searches to find specific types, fields, or operations.
10
+
11
+ If the file is not present, generate it by running:
12
+ ```bash
13
+ npm run graphql:get-schema
14
+ ```
15
+
16
+ ## Required Pre-Flight Check
17
+
18
+ **BEFORE generating any GraphQL query, you MUST:**
19
+
20
+ 1. **Check if schema exists**: Look for `schema.graphql` in the project root
21
+ 2. **If schema is missing**:
22
+ - Run `npm run graphql:get-schema` to download it
23
+ - Wait for the command to complete successfully
24
+ - Then proceed with schema exploration
25
+ 3. **If schema exists**: Proceed with targeted searches as described below
26
+
27
+ > ⚠️ **DO NOT** generate GraphQL queries without first having access to the schema. Standard field assumptions may not match the target org's configuration.
28
+
29
+ ## Schema Structure Overview
30
+
31
+ The schema follows the Salesforce GraphQL Wire Adapter pattern with these main entry points:
32
+
33
+ ### Query Entry Point
34
+ ```graphql
35
+ type Query {
36
+ uiapi: UIAPI!
37
+ }
38
+ ```
39
+
40
+ ### UIAPI Structure
41
+ ```graphql
42
+ type UIAPI {
43
+ query: RecordQuery! # For querying records
44
+ aggregate: RecordQueryAggregate! # For aggregate queries
45
+ objectInfos: [ObjectInfo] # For metadata
46
+ relatedListByName: RelatedListInfo
47
+ }
48
+ ```
49
+
50
+ ### Mutation Entry Point
51
+ ```graphql
52
+ type Mutation {
53
+ uiapi(input: UIAPIMutationsInput): UIAPIMutations!
54
+ }
55
+ ```
56
+
57
+ ## How to Explore the Schema
58
+
59
+ When you need to build a GraphQL query, use these search patterns:
60
+
61
+ ### 1. Find Available Fields for a Record Type
62
+ Search for `type <ObjectName> implements Record` to find all queryable fields:
63
+ ```bash
64
+ # Example: Find Account fields
65
+ grep "^type Account implements Record" schema.graphql -A 50
66
+ ```
67
+
68
+ ### 2. Find Filter Options for a Record Type
69
+ Search for `input <ObjectName>_Filter` to find filterable fields and operators:
70
+ ```bash
71
+ # Example: Find Account filter options
72
+ grep "^input Account_Filter" schema.graphql -A 30
73
+ ```
74
+
75
+ ### 3. Find OrderBy Options
76
+ Search for `input <ObjectName>_OrderBy` for sorting options:
77
+ ```bash
78
+ # Example: Find Account ordering options
79
+ grep "^input Account_OrderBy" schema.graphql -A 20
80
+ ```
81
+
82
+ ### 4. Find Mutation Operations
83
+ Search for operations in `UIAPIMutations`:
84
+ ```bash
85
+ # Example: Find Account mutations
86
+ grep "Account.*Create\|Account.*Update\|Account.*Delete" schema.graphql
87
+ ```
88
+
89
+ ### 5. Find Input Types for Mutations
90
+ Search for `input <ObjectName>CreateInput` or `input <ObjectName>UpdateInput`:
91
+ ```bash
92
+ # Example: Find Account create input
93
+ grep "^input AccountCreateInput" schema.graphql -A 30
94
+ ```
95
+
96
+ ## Common Operator Types
97
+
98
+ ### StringOperators (for text fields)
99
+ ```graphql
100
+ input StringOperators {
101
+ eq: String # equals
102
+ ne: String # not equals
103
+ like: String # pattern matching (use % as wildcard)
104
+ lt: String # less than
105
+ gt: String # greater than
106
+ lte: String # less than or equal
107
+ gte: String # greater than or equal
108
+ in: [String] # in list
109
+ nin: [String] # not in list
110
+ }
111
+ ```
112
+
113
+ ### OrderByClause
114
+ ```graphql
115
+ input OrderByClause {
116
+ order: ResultOrder # ASC or DESC
117
+ nulls: NullOrder # FIRST or LAST
118
+ }
119
+ ```
120
+
121
+ ## Query Pattern Examples
122
+
123
+ ### Basic Query Structure
124
+ All record queries follow this pattern:
125
+ ```graphql
126
+ query {
127
+ uiapi {
128
+ query {
129
+ <ObjectName>(
130
+ first: Int # pagination limit
131
+ after: String # pagination cursor
132
+ where: <Object>_Filter
133
+ orderBy: <Object>_OrderBy
134
+ ) {
135
+ edges {
136
+ node {
137
+ Id
138
+ <Field> { value }
139
+ # ... more fields
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ ### Example: Query Accounts with Filter
149
+ ```graphql
150
+ query GetHighRevenueAccounts($minRevenue: Currency) {
151
+ uiapi {
152
+ query {
153
+ Account(
154
+ where: { AnnualRevenue: { gt: $minRevenue } }
155
+ orderBy: { AnnualRevenue: { order: DESC } }
156
+ first: 50
157
+ ) {
158
+ edges {
159
+ node {
160
+ Id
161
+ Name { value }
162
+ AnnualRevenue { value }
163
+ Industry { value }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ ### Mutation Pattern
173
+ ```graphql
174
+ mutation CreateAccount($input: AccountCreateInput!) {
175
+ uiapi(input: { AccountCreate: { input: $input } }) {
176
+ AccountCreate {
177
+ Record {
178
+ Id
179
+ Name { value }
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ ## Field Value Wrappers
187
+
188
+ Salesforce GraphQL returns field values wrapped in typed objects:
189
+
190
+ | Wrapper Type | Access Pattern |
191
+ |-------------|----------------|
192
+ | `StringValue` | `FieldName { value }` |
193
+ | `IntValue` | `FieldName { value }` |
194
+ | `BooleanValue` | `FieldName { value }` |
195
+ | `DateTimeValue` | `FieldName { value displayValue }` |
196
+ | `PicklistValue` | `FieldName { value displayValue }` |
197
+ | `CurrencyValue` | `FieldName { value displayValue }` |
198
+
199
+ ## Agent Workflow for Building Queries
200
+
201
+ **Pre-requisites (MANDATORY):**
202
+ - [ ] Verified `schema.graphql` exists in project root
203
+ - [ ] If missing, ran `npm run graphql:get-schema` and waited for completion
204
+ - [ ] Confirmed connection to correct Salesforce org (if downloading fresh schema)
205
+
206
+ **Workflow Steps:**
207
+
208
+ 1. **Identify the target object** (e.g., Account, Contact, Opportunity)
209
+ 2. **Search the schema** for the object type to discover available fields
210
+ 3. **Search for filter input** (`<Object>_Filter`) to understand filtering options
211
+ 4. **Search for orderBy input** (`<Object>_OrderBy`) for sorting capabilities
212
+ 5. **Build the query** following the patterns above
213
+ 6. **Validate field names** match exactly as defined in the schema (case-sensitive)
214
+
215
+ ## Tips for Agents
216
+
217
+ - **Always verify field names** by searching the schema before generating queries
218
+ - **Use grep/search** to explore the schema efficiently—never read the entire file
219
+ - **Check relationships** by looking for `parentRelationship` and `childRelationship` comments in type definitions
220
+ - **Look for Connection types** (e.g., `AccountConnection`) to understand pagination structure
221
+ - **Custom objects** end with `__c` (e.g., `CustomObject__c`)
222
+ - **Custom fields** also end with `__c` (e.g., `Custom_Field__c`)
223
+
224
+ ## Related Documentation
225
+
226
+ - For generating mutations and queries, see `lds-generate-graphql-mutationquery.md`
227
+ - For GraphQL best practices, see `lds-guide-graphql.md`