@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.
- package/lib/generators/projectGenerator.d.ts +6 -0
- package/lib/generators/projectGenerator.js +43 -4
- package/lib/generators/projectGenerator.js.map +1 -1
- package/lib/templates/project/react-b2e/.a4drules/README.md +35 -0
- package/lib/templates/project/react-b2e/.a4drules/a4d-webapp-generate.md +27 -0
- package/lib/templates/project/react-b2e/.a4drules/build-validation.md +78 -0
- package/lib/templates/project/react-b2e/.a4drules/code-quality.md +137 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
- package/lib/templates/project/react-b2e/.a4drules/graphql.md +409 -0
- package/lib/templates/project/react-b2e/.a4drules/images.md +13 -0
- package/lib/templates/project/react-b2e/.a4drules/react.md +387 -0
- package/lib/templates/project/react-b2e/.a4drules/react_image_processing.md +45 -0
- package/lib/templates/project/react-b2e/.a4drules/typescript.md +224 -0
- package/lib/templates/project/react-b2e/.a4drules/ui-layout.md +23 -0
- package/lib/templates/project/react-b2e/.a4drules/webapp-nav-and-placeholders.md +33 -0
- package/lib/templates/project/react-b2e/.a4drules/webapp-no-node-e.md +25 -0
- package/lib/templates/project/react-b2e/.a4drules/webapp-ui-first.md +32 -0
- package/lib/templates/project/react-b2e/.a4drules/webapp.md +75 -0
- package/lib/templates/project/react-b2e/.forceignore +15 -0
- package/lib/templates/project/react-b2e/.husky/pre-commit +4 -0
- package/lib/templates/project/react-b2e/.prettierignore +11 -0
- package/lib/templates/project/react-b2e/.prettierrc +17 -0
- package/lib/templates/project/react-b2e/AGENT.md +75 -0
- package/lib/templates/project/react-b2e/CHANGELOG.md +696 -0
- package/lib/templates/project/react-b2e/README.md +18 -0
- package/lib/templates/project/react-b2e/config/project-scratch-def.json +13 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.graphqlrc.yml +2 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.prettierignore +9 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/.prettierrc +11 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/appreacttemplateb2e.webapplication-meta.xml +7 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.d.ts +2 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/build/vite.config.js +93 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/codegen.yml +94 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/e2e/app.spec.ts +17 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/eslint.config.js +141 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/index.html +13 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/package-lock.json +14392 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/package.json +58 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/playwright.config.ts +24 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/scripts/get-graphql-schema.mjs +68 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/scripts/rewrite-e2e-assets.mjs +23 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/graphql-operations-types.ts +116 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/accounts.ts +33 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/app.tsx +22 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/appLayout.tsx +19 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/book.svg +3 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/copy.svg +4 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/rocket.svg +3 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/icons/star.svg +3 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-1.png +0 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-2.png +0 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/codey-3.png +0 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/assets/images/vibe-codey.svg +194 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/components/AgentforceConversationClient.tsx +127 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/index.ts +6 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/navigationMenu.tsx +80 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/Home.tsx +12 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/pages/NotFound.tsx +18 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/router-utils.tsx +35 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/routes.tsx +22 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/styles/global.css +13 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/src/types/conversation.ts +21 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/tsconfig.json +36 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/tsconfig.node.json +13 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vite-env.d.ts +1 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vite.config.ts +102 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest-env.d.ts +2 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest.config.ts +11 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/vitest.setup.ts +1 -0
- package/lib/templates/project/react-b2e/force-app/main/default/webapplications/appreacttemplateb2e/webapplication.json +7 -0
- package/lib/templates/project/react-b2e/jest.config.js +6 -0
- package/lib/templates/project/react-b2e/package.json +38 -0
- package/lib/templates/project/react-b2e/scripts/apex/hello.apex +10 -0
- package/lib/templates/project/react-b2e/scripts/soql/account.soql +6 -0
- package/lib/templates/project/react-b2e/sfdx-project.json +12 -0
- package/lib/templates/project/react-b2x/.a4drules/README.md +35 -0
- package/lib/templates/project/react-b2x/.a4drules/a4d-webapp-generate.md +27 -0
- package/lib/templates/project/react-b2x/.a4drules/build-validation.md +78 -0
- package/lib/templates/project/react-b2x/.a4drules/code-quality.md +137 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
- package/lib/templates/project/react-b2x/.a4drules/graphql.md +409 -0
- package/lib/templates/project/react-b2x/.a4drules/images.md +13 -0
- package/lib/templates/project/react-b2x/.a4drules/react.md +387 -0
- package/lib/templates/project/react-b2x/.a4drules/react_image_processing.md +45 -0
- package/lib/templates/project/react-b2x/.a4drules/typescript.md +224 -0
- package/lib/templates/project/react-b2x/.a4drules/ui-layout.md +23 -0
- package/lib/templates/project/react-b2x/.a4drules/webapp-nav-and-placeholders.md +33 -0
- package/lib/templates/project/react-b2x/.a4drules/webapp-no-node-e.md +25 -0
- package/lib/templates/project/react-b2x/.a4drules/webapp-ui-first.md +32 -0
- package/lib/templates/project/react-b2x/.a4drules/webapp.md +75 -0
- package/lib/templates/project/react-b2x/.forceignore +15 -0
- package/lib/templates/project/react-b2x/.husky/pre-commit +4 -0
- package/lib/templates/project/react-b2x/.prettierignore +11 -0
- package/lib/templates/project/react-b2x/.prettierrc +17 -0
- package/lib/templates/project/react-b2x/AGENT.md +75 -0
- package/lib/templates/project/react-b2x/CHANGELOG.md +696 -0
- package/lib/templates/project/react-b2x/README.md +18 -0
- package/lib/templates/project/react-b2x/config/project-scratch-def.json +13 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppAuthUtils.cls +68 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppAuthUtils.cls-meta.xml +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppChangePassword.cls +77 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppChangePassword.cls-meta.xml +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppForgotPassword.cls +71 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppForgotPassword.cls-meta.xml +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppLogin.cls +105 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppLogin.cls-meta.xml +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppRegistration.cls +162 -0
- package/lib/templates/project/react-b2x/force-app/main/default/classes/WebAppRegistration.cls-meta.xml +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/digitalExperienceConfigs/appreacttemplateb2x1.digitalExperienceConfig +8 -0
- package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/appreacttemplateb2x1.digitalExperience-meta.xml +11 -0
- package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/sfdc_cms__site/appreacttemplateb2x1/_meta.json +5 -0
- package/lib/templates/project/react-b2x/force-app/main/default/digitalExperiences/site/appreacttemplateb2x1/sfdc_cms__site/appreacttemplateb2x1/content.json +10 -0
- package/lib/templates/project/react-b2x/force-app/main/default/networks/appreacttemplateb2x.network +60 -0
- package/lib/templates/project/react-b2x/force-app/main/default/package.xml +20 -0
- package/lib/templates/project/react-b2x/force-app/main/default/sites/appreacttemplateb2x.site +31 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.graphqlrc.yml +2 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.prettierignore +9 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/.prettierrc +11 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/appreacttemplateb2x.webapplication-meta.xml +7 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.d.ts +2 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/build/vite.config.js +93 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/codegen.yml +94 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/e2e/app.spec.ts +17 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/eslint.config.js +141 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/index.html +13 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/package-lock.json +18408 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/package.json +66 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/playwright.config.ts +24 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/scripts/get-graphql-schema.mjs +68 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/scripts/rewrite-e2e-assets.mjs +23 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/graphql-operations-types.ts +116 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/accounts.ts +33 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/app.tsx +13 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/appLayout.tsx +11 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/book.svg +3 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/copy.svg +4 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/rocket.svg +3 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/icons/star.svg +3 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-1.png +0 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-2.png +0 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/codey-3.png +0 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/assets/images/vibe-codey.svg +194 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/alerts/status-alert.tsx +45 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authHelpers.ts +73 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authenticationConfig.ts +61 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/authenticationRouteLayout.tsx +21 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/privateRouteLayout.tsx +36 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/SessionTimeoutValidator.tsx +616 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/sessionTimeService.ts +161 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/auth/sessionTimeout/sessionTimeoutConfig.ts +77 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/footers/footer-link.tsx +36 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/forms/auth-form.tsx +81 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/forms/submit-button.tsx +49 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-layout.tsx +23 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/card-skeleton.tsx +38 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/layout/centered-page-layout.tsx +73 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/alert.tsx +69 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/button.tsx +67 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/card.tsx +92 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/dialog.tsx +143 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/field.tsx +222 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/index.ts +72 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/input.tsx +19 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/label.tsx +19 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/pagination.tsx +112 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/select.tsx +183 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/separator.tsx +26 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/skeleton.tsx +14 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/spinner.tsx +15 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/table.tsx +87 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components/ui/tabs.tsx +78 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/components.json +18 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/context/AuthContext.tsx +95 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/form.tsx +116 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/useCountdownTimer.ts +266 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/hooks/useRetryWithBackoff.ts +109 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/layouts/AuthAppLayout.tsx +12 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/data-sdk.ts +21 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/lib/utils.ts +6 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/navigationMenu.tsx +80 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ChangePassword.tsx +107 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ForgotPassword.tsx +73 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Home.tsx +12 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Login.tsx +97 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/NotFound.tsx +18 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Profile.tsx +178 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/Register.tsx +138 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/pages/ResetPassword.tsx +107 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/router-utils.tsx +35 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/routes.tsx +71 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/styles/global.css +135 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/src/utils/helpers.ts +121 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/tsconfig.json +36 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/tsconfig.node.json +13 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vite-env.d.ts +1 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vite.config.ts +102 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest-env.d.ts +2 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest.config.ts +11 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/vitest.setup.ts +1 -0
- package/lib/templates/project/react-b2x/force-app/main/default/webapplications/appreacttemplateb2x/webapplication.json +7 -0
- package/lib/templates/project/react-b2x/jest.config.js +6 -0
- package/lib/templates/project/react-b2x/package.json +38 -0
- package/lib/templates/project/react-b2x/scripts/apex/hello.apex +10 -0
- package/lib/templates/project/react-b2x/scripts/soql/account.soql +6 -0
- package/lib/templates/project/react-b2x/sfdx-project.json +12 -0
- package/lib/templates/webapplication/reactbasic/.graphqlrc.yml +2 -0
- package/lib/templates/webapplication/reactbasic/build/vite.config.js +20 -1
- package/lib/templates/webapplication/reactbasic/codegen.yml +94 -0
- package/lib/templates/webapplication/reactbasic/e2e/app.spec.ts +0 -7
- package/lib/templates/webapplication/reactbasic/eslint.config.js +28 -0
- package/lib/templates/webapplication/reactbasic/package-lock.json +10090 -2874
- package/lib/templates/webapplication/reactbasic/package.json +16 -4
- package/lib/templates/webapplication/reactbasic/scripts/get-graphql-schema.mjs +68 -0
- package/lib/templates/webapplication/reactbasic/src/api/graphql-operations-types.ts +23 -34
- package/lib/templates/webapplication/reactbasic/src/api/utils/accounts.ts +33 -0
- package/lib/templates/webapplication/reactbasic/src/app.tsx +10 -1
- package/lib/templates/webapplication/reactbasic/src/appLayout.tsx +2 -0
- package/lib/templates/webapplication/reactbasic/src/navigationMenu.tsx +80 -0
- package/lib/templates/webapplication/reactbasic/src/router-utils.tsx +35 -0
- package/lib/templates/webapplication/reactbasic/src/routes.tsx +1 -7
- package/lib/templates/webapplication/reactbasic/vite.config.ts +20 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/types.d.ts +1 -1
- package/lib/utils/webappTemplateUtils.d.ts +49 -0
- package/lib/utils/webappTemplateUtils.js +210 -0
- package/lib/utils/webappTemplateUtils.js.map +1 -0
- package/package.json +7 -5
- package/lib/templates/webapplication/reactbasic/src/pages/About.tsx +0 -12
|
@@ -9,9 +9,12 @@
|
|
|
9
9
|
"build:e2e": "npm run build && node scripts/rewrite-e2e-assets.mjs",
|
|
10
10
|
"lint": "eslint .",
|
|
11
11
|
"preview": "vite preview",
|
|
12
|
-
"test": "vitest"
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"graphql:codegen": "graphql-codegen",
|
|
14
|
+
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
17
|
+
"@salesforce/sdk-data": "^1.11.2",
|
|
15
18
|
"@salesforce/webapp-experimental": "*",
|
|
16
19
|
"@tailwindcss/vite": "^4.1.17",
|
|
17
20
|
"react": "^19.2.0",
|
|
@@ -21,6 +24,12 @@
|
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@eslint/js": "^9.39.1",
|
|
27
|
+
"@graphql-codegen/cli": "^6.1.0",
|
|
28
|
+
"@graphql-codegen/typescript": "^5.0.6",
|
|
29
|
+
"@graphql-codegen/typescript-operations": "^5.0.6",
|
|
30
|
+
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
31
|
+
"@graphql-tools/utils": "^11.0.0",
|
|
32
|
+
"@playwright/test": "^1.49.0",
|
|
24
33
|
"@salesforce/vite-plugin-webapp-experimental": "*",
|
|
25
34
|
"@testing-library/jest-dom": "^6.6.3",
|
|
26
35
|
"@testing-library/react": "^16.1.0",
|
|
@@ -31,15 +40,18 @@
|
|
|
31
40
|
"@vitejs/plugin-react": "^5.1.1",
|
|
32
41
|
"@vitest/ui": "^4.0.17",
|
|
33
42
|
"eslint": "^9.39.1",
|
|
43
|
+
"eslint-plugin-react": "^7.37.2",
|
|
34
44
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
35
45
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
36
46
|
"globals": "^16.5.0",
|
|
47
|
+
"graphql": "^16.11.0",
|
|
48
|
+
"graphql-codegen-typescript-operation-types": "^2.0.2",
|
|
37
49
|
"jsdom": "^25.0.1",
|
|
50
|
+
"serve": "^14.2.5",
|
|
38
51
|
"typescript": "~5.9.3",
|
|
39
52
|
"typescript-eslint": "^8.46.4",
|
|
40
53
|
"vite": "^7.2.4",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"serve": "^14.2.5"
|
|
54
|
+
"vite-plugin-graphql-codegen": "^3.6.3",
|
|
55
|
+
"vitest": "^4.0.17"
|
|
44
56
|
}
|
|
45
57
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Downloads the full GraphQL schema from a connected Salesforce org via introspection.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* npm run graphql:schema
|
|
6
|
+
* node scripts/get-graphql-schema.mjs [output-path]
|
|
7
|
+
*
|
|
8
|
+
* The default output path matches the schema location expected by codegen.yml
|
|
9
|
+
* and .graphqlrc.yml so that codegen and IDE tooling resolve it automatically.
|
|
10
|
+
*/
|
|
11
|
+
import { writeFileSync } from 'node:fs';
|
|
12
|
+
import { resolve } from 'node:path';
|
|
13
|
+
import { getOrgInfo } from '@salesforce/webapp-experimental/app';
|
|
14
|
+
import { buildClientSchema, getIntrospectionQuery, printSchema } from 'graphql';
|
|
15
|
+
import { pruneSchema } from '@graphql-tools/utils';
|
|
16
|
+
|
|
17
|
+
const DEFAULT_SCHEMA_PATH = '../../../../../schema.graphql';
|
|
18
|
+
|
|
19
|
+
async function executeSalesforceGraphQLQuery(query, variables, operationName) {
|
|
20
|
+
const {
|
|
21
|
+
rawInstanceUrl: instanceUrl,
|
|
22
|
+
apiVersion,
|
|
23
|
+
accessToken,
|
|
24
|
+
} = await getOrgInfo();
|
|
25
|
+
|
|
26
|
+
const targetUrl = `${instanceUrl}/services/data/v${apiVersion}/graphql`;
|
|
27
|
+
|
|
28
|
+
console.log(`Executing introspection query against ${targetUrl}`);
|
|
29
|
+
const response = await fetch(targetUrl, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
Authorization: `Bearer ${accessToken}`,
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
'X-Chatter-Entity-Encoding': 'false',
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify({ query, variables, operationName }),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
const errorText = await response.text();
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Salesforce GraphQL request failed: ${response.status} ${response.statusText} - ${errorText}`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return response.json();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const outputPath = resolve(process.argv[2] || DEFAULT_SCHEMA_PATH);
|
|
51
|
+
|
|
52
|
+
const introspectionResult = await executeSalesforceGraphQLQuery(
|
|
53
|
+
getIntrospectionQuery(),
|
|
54
|
+
{},
|
|
55
|
+
'IntrospectionQuery'
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const schema = buildClientSchema(introspectionResult.data);
|
|
59
|
+
const prunedSchema = pruneSchema(schema);
|
|
60
|
+
const sdl = printSchema(prunedSchema);
|
|
61
|
+
|
|
62
|
+
writeFileSync(outputPath, sdl);
|
|
63
|
+
|
|
64
|
+
console.log(`Schema saved to ${outputPath}`);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error('Error:', error.message);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
@@ -25,39 +25,28 @@ export type Scalars = {
|
|
|
25
25
|
Boolean: { input: boolean; output: boolean };
|
|
26
26
|
Int: { input: number; output: number };
|
|
27
27
|
Float: { input: number; output: number };
|
|
28
|
-
Base64: { input:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/** A UTF-16 code unit; a character on Unicode's BMP */
|
|
36
|
-
Char: { input: any; output: any };
|
|
37
|
-
Currency: { input: any; output: any };
|
|
38
|
-
Date: { input: any; output: any };
|
|
39
|
-
DateTime: { input: any; output: any };
|
|
40
|
-
Double: { input: any; output: any };
|
|
41
|
-
Email: { input: any; output: any };
|
|
42
|
-
EncryptedString: { input: any; output: any };
|
|
28
|
+
Base64: { input: string; output: string };
|
|
29
|
+
Currency: { input: number | string; output: number };
|
|
30
|
+
Date: { input: string; output: string };
|
|
31
|
+
DateTime: { input: string; output: string };
|
|
32
|
+
Double: { input: number | string; output: number };
|
|
33
|
+
Email: { input: string; output: string };
|
|
34
|
+
EncryptedString: { input: string; output: string };
|
|
43
35
|
/** Can be set to an ID or a Reference to the result of another mutation operation. */
|
|
44
|
-
IdOrRef: { input:
|
|
45
|
-
|
|
46
|
-
Latitude: { input: any; output: any };
|
|
36
|
+
IdOrRef: { input: string; output: string };
|
|
37
|
+
Latitude: { input: number | string; output: number };
|
|
47
38
|
/** A 64-bit signed integer */
|
|
48
|
-
Long: { input:
|
|
49
|
-
LongTextArea: { input:
|
|
50
|
-
Longitude: { input:
|
|
51
|
-
MultiPicklist: { input:
|
|
52
|
-
Percent: { input:
|
|
53
|
-
PhoneNumber: { input:
|
|
54
|
-
Picklist: { input:
|
|
55
|
-
RichTextArea: { input:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Time: { input: any; output: any };
|
|
60
|
-
Url: { input: any; output: any };
|
|
39
|
+
Long: { input: number; output: number };
|
|
40
|
+
LongTextArea: { input: string; output: string };
|
|
41
|
+
Longitude: { input: number | string; output: number };
|
|
42
|
+
MultiPicklist: { input: string; output: string };
|
|
43
|
+
Percent: { input: number | string; output: number };
|
|
44
|
+
PhoneNumber: { input: string; output: string };
|
|
45
|
+
Picklist: { input: string; output: string };
|
|
46
|
+
RichTextArea: { input: string; output: string };
|
|
47
|
+
TextArea: { input: string; output: string };
|
|
48
|
+
Time: { input: string; output: string };
|
|
49
|
+
Url: { input: string; output: string };
|
|
61
50
|
};
|
|
62
51
|
|
|
63
52
|
export enum DataType {
|
|
@@ -116,9 +105,9 @@ export type GetHighRevenueAccountsQuery = {
|
|
|
116
105
|
node?: {
|
|
117
106
|
Id: string;
|
|
118
107
|
Name?: { value?: string | null } | null;
|
|
119
|
-
AnnualRevenue?: { value?:
|
|
120
|
-
Industry?: { value?:
|
|
121
|
-
Website?: { value?:
|
|
108
|
+
AnnualRevenue?: { value?: number | null } | null;
|
|
109
|
+
Industry?: { value?: string | null } | null;
|
|
110
|
+
Website?: { value?: string | null } | null;
|
|
122
111
|
} | null;
|
|
123
112
|
} | null> | null;
|
|
124
113
|
} | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { executeGraphQL } from '@salesforce/webapp-experimental/api';
|
|
2
|
+
import HIGH_REVENUE_ACCOUNTS_QUERY from './query/highRevenueAccountsQuery.graphql?raw';
|
|
3
|
+
import type {
|
|
4
|
+
GetHighRevenueAccountsQuery,
|
|
5
|
+
GetHighRevenueAccountsQueryVariables,
|
|
6
|
+
} from '../graphql-operations-types';
|
|
7
|
+
|
|
8
|
+
type AccountNode = NonNullable<
|
|
9
|
+
NonNullable<
|
|
10
|
+
NonNullable<
|
|
11
|
+
NonNullable<
|
|
12
|
+
GetHighRevenueAccountsQuery['uiapi']['query']['Account']
|
|
13
|
+
>['edges']
|
|
14
|
+
>[number]
|
|
15
|
+
>['node']
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fetch accounts with annual revenue greater than the specified amount
|
|
20
|
+
*
|
|
21
|
+
* @param minRevenue - Minimum annual revenue threshold (default: 100000)
|
|
22
|
+
* @returns Array of accounts matching the criteria
|
|
23
|
+
*/
|
|
24
|
+
export async function getHighRevenueAccounts(
|
|
25
|
+
variables: GetHighRevenueAccountsQueryVariables
|
|
26
|
+
): Promise<(AccountNode | null | undefined)[]> {
|
|
27
|
+
const response = await executeGraphQL<GetHighRevenueAccountsQuery>(
|
|
28
|
+
HIGH_REVENUE_ACCOUNTS_QUERY,
|
|
29
|
+
variables
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return response.uiapi?.query?.Account?.edges?.map(edge => edge?.node) || [];
|
|
33
|
+
}
|
|
@@ -4,7 +4,16 @@ import { StrictMode } from 'react';
|
|
|
4
4
|
import { createRoot } from 'react-dom/client';
|
|
5
5
|
import './styles/global.css';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// Match Vite base so client-side routes work when deployed under a path (e.g. /lwr/application/ai/c-webapp2/).
|
|
8
|
+
// When served at root (e.g. e2e with static serve), use '/' so routes match.
|
|
9
|
+
const base = (import.meta.env.BASE_URL ?? '/').replace(/\/$/, '') || '/';
|
|
10
|
+
const basename =
|
|
11
|
+
typeof window !== 'undefined' &&
|
|
12
|
+
(window.location.pathname === '/' ||
|
|
13
|
+
!window.location.pathname.startsWith('/lwr/'))
|
|
14
|
+
? '/'
|
|
15
|
+
: base;
|
|
16
|
+
const router = createBrowserRouter(routes, { basename });
|
|
8
17
|
|
|
9
18
|
createRoot(document.getElementById('root')!).render(
|
|
10
19
|
<StrictMode>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Link, useLocation } from 'react-router';
|
|
2
|
+
import { getAllRoutes } from './router-utils';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
export default function NavigationMenu() {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
|
|
9
|
+
const isActive = (path: string) => location.pathname === path;
|
|
10
|
+
|
|
11
|
+
const toggleMenu = () => setIsOpen(!isOpen);
|
|
12
|
+
|
|
13
|
+
const navigationRoutes: { path: string; label: string }[] = getAllRoutes()
|
|
14
|
+
.filter(
|
|
15
|
+
route =>
|
|
16
|
+
route.handle?.showInNavigation === true &&
|
|
17
|
+
route.fullPath !== undefined &&
|
|
18
|
+
route.handle?.label !== undefined
|
|
19
|
+
)
|
|
20
|
+
.map(
|
|
21
|
+
route =>
|
|
22
|
+
({
|
|
23
|
+
path: route.fullPath,
|
|
24
|
+
label: route.handle?.label,
|
|
25
|
+
}) as { path: string; label: string }
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<nav className="bg-white border-b border-gray-200">
|
|
30
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
31
|
+
<div className="flex justify-between items-center h-16">
|
|
32
|
+
<Link to="/" className="text-xl font-semibold text-gray-900">
|
|
33
|
+
React App
|
|
34
|
+
</Link>
|
|
35
|
+
<button
|
|
36
|
+
onClick={toggleMenu}
|
|
37
|
+
className="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
38
|
+
aria-label="Toggle menu"
|
|
39
|
+
>
|
|
40
|
+
<div className="w-6 h-6 flex flex-col justify-center space-y-1.5">
|
|
41
|
+
<span
|
|
42
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
43
|
+
isOpen ? 'rotate-45 translate-y-2' : ''
|
|
44
|
+
}`}
|
|
45
|
+
/>
|
|
46
|
+
<span
|
|
47
|
+
className={`block h-0.5 w-6 bg-current transition-all ${isOpen ? 'opacity-0' : ''}`}
|
|
48
|
+
/>
|
|
49
|
+
<span
|
|
50
|
+
className={`block h-0.5 w-6 bg-current transition-all ${
|
|
51
|
+
isOpen ? '-rotate-45 -translate-y-2' : ''
|
|
52
|
+
}`}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
{isOpen && (
|
|
58
|
+
<div className="pb-4">
|
|
59
|
+
<div className="flex flex-col space-y-2">
|
|
60
|
+
{navigationRoutes.map(item => (
|
|
61
|
+
<Link
|
|
62
|
+
key={item.path}
|
|
63
|
+
to={item.path}
|
|
64
|
+
onClick={() => setIsOpen(false)}
|
|
65
|
+
className={`px-3 py-2 rounded-md text-sm font-medium transition-colors ${
|
|
66
|
+
isActive(item.path)
|
|
67
|
+
? 'bg-blue-100 text-blue-700'
|
|
68
|
+
: 'text-gray-700 hover:bg-gray-100'
|
|
69
|
+
}`}
|
|
70
|
+
>
|
|
71
|
+
{item.label}
|
|
72
|
+
</Link>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
</nav>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RouteObject } from 'react-router';
|
|
2
|
+
import { routes } from './routes';
|
|
3
|
+
|
|
4
|
+
export type RouteWithFullPath = RouteObject & { fullPath: string };
|
|
5
|
+
|
|
6
|
+
const flatMapRoutes = (
|
|
7
|
+
route: RouteObject,
|
|
8
|
+
parentPath: string = ''
|
|
9
|
+
): RouteWithFullPath[] => {
|
|
10
|
+
let fullPath: string;
|
|
11
|
+
|
|
12
|
+
if (route.index) {
|
|
13
|
+
fullPath = parentPath || '/';
|
|
14
|
+
} else if (route.path) {
|
|
15
|
+
if (route.path.startsWith('/')) {
|
|
16
|
+
fullPath = route.path;
|
|
17
|
+
} else {
|
|
18
|
+
fullPath =
|
|
19
|
+
parentPath === '/' ? `/${route.path}` : `${parentPath}/${route.path}`;
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
fullPath = parentPath;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const routeWithPath = { ...route, fullPath };
|
|
26
|
+
|
|
27
|
+
const childRoutes =
|
|
28
|
+
route.children?.flatMap(child => flatMapRoutes(child, fullPath)) || [];
|
|
29
|
+
|
|
30
|
+
return [routeWithPath, ...childRoutes];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const getAllRoutes = (): RouteWithFullPath[] => {
|
|
34
|
+
return routes.flatMap(route => flatMapRoutes(route));
|
|
35
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RouteObject } from 'react-router';
|
|
2
2
|
import AppLayout from '@/appLayout';
|
|
3
|
-
import Home from '
|
|
4
|
-
import About from './pages/About';
|
|
3
|
+
import Home from './pages/Home';
|
|
5
4
|
import NotFound from './pages/NotFound';
|
|
6
5
|
|
|
7
6
|
export const routes: RouteObject[] = [
|
|
@@ -14,11 +13,6 @@ export const routes: RouteObject[] = [
|
|
|
14
13
|
element: <Home />,
|
|
15
14
|
handle: { showInNavigation: true, label: 'Home' },
|
|
16
15
|
},
|
|
17
|
-
{
|
|
18
|
-
path: 'about',
|
|
19
|
-
element: <About />,
|
|
20
|
-
handle: { showInNavigation: true, label: 'About' },
|
|
21
|
-
},
|
|
22
16
|
{
|
|
23
17
|
path: '*',
|
|
24
18
|
element: <NotFound />,
|
|
@@ -4,10 +4,29 @@ import path from 'path';
|
|
|
4
4
|
import { resolve } from 'path';
|
|
5
5
|
import tailwindcss from '@tailwindcss/vite';
|
|
6
6
|
import salesforce from '@salesforce/vite-plugin-webapp-experimental';
|
|
7
|
+
import codegen from 'vite-plugin-graphql-codegen';
|
|
7
8
|
|
|
8
9
|
export default defineConfig(({ mode }) => {
|
|
9
10
|
return {
|
|
10
|
-
|
|
11
|
+
// Ensure root base for e2e/static serve; plugin may override when deployed under a path
|
|
12
|
+
base: '/',
|
|
13
|
+
plugins: [
|
|
14
|
+
tailwindcss(),
|
|
15
|
+
react(),
|
|
16
|
+
salesforce(),
|
|
17
|
+
codegen({
|
|
18
|
+
// Path to the codegen config file
|
|
19
|
+
configFilePathOverride: resolve(__dirname, 'codegen.yml'),
|
|
20
|
+
// Run codegen on dev server start
|
|
21
|
+
runOnStart: true,
|
|
22
|
+
// Don't run codegen on build for now
|
|
23
|
+
runOnBuild: false,
|
|
24
|
+
// Enable file watcher during development
|
|
25
|
+
enableWatcher: true,
|
|
26
|
+
// Fail build if codegen errors
|
|
27
|
+
throwOnBuild: true,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
11
30
|
|
|
12
31
|
// Build configuration for MPA
|
|
13
32
|
build: {
|
package/lib/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/generators/analyticsTemplateGenerator.ts","../src/generators/apexClassGenerator.ts","../src/generators/apexTriggerGenerator.ts","../src/generators/baseGenerator.ts","../src/generators/digitalExperienceSiteGenerator.ts","../src/generators/flexipageGenerator.ts","../src/generators/lightningAppGenerator.ts","../src/generators/lightningComponentGenerator.ts","../src/generators/lightningEventGenerator.ts","../src/generators/lightningInterfaceGenerator.ts","../src/generators/lightningTestGenerator.ts","../src/generators/projectGenerator.ts","../src/generators/staticResourceGenerator.ts","../src/generators/visualforceComponentGenerator.ts","../src/generators/visualforcePageGenerator.ts","../src/generators/webApplicationGenerator.ts","../src/i18n/i18n.ts","../src/i18n/index.ts","../src/i18n/localization.ts","../src/service/gitRepoUtils.ts","../src/service/templateService.ts","../src/utils/constants.ts","../src/utils/createUtil.ts","../src/utils/index.ts","../src/utils/types.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/generators/analyticsTemplateGenerator.ts","../src/generators/apexClassGenerator.ts","../src/generators/apexTriggerGenerator.ts","../src/generators/baseGenerator.ts","../src/generators/digitalExperienceSiteGenerator.ts","../src/generators/flexipageGenerator.ts","../src/generators/lightningAppGenerator.ts","../src/generators/lightningComponentGenerator.ts","../src/generators/lightningEventGenerator.ts","../src/generators/lightningInterfaceGenerator.ts","../src/generators/lightningTestGenerator.ts","../src/generators/projectGenerator.ts","../src/generators/staticResourceGenerator.ts","../src/generators/visualforceComponentGenerator.ts","../src/generators/visualforcePageGenerator.ts","../src/generators/webApplicationGenerator.ts","../src/i18n/i18n.ts","../src/i18n/index.ts","../src/i18n/localization.ts","../src/service/gitRepoUtils.ts","../src/service/templateService.ts","../src/utils/constants.ts","../src/utils/createUtil.ts","../src/utils/index.ts","../src/utils/types.ts","../src/utils/webappTemplateUtils.ts"],"version":"5.9.3"}
|
package/lib/utils/types.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export interface ProjectOptions extends TemplateOptions {
|
|
|
102
102
|
* Note that namespace is a reserved keyword for yeoman generator
|
|
103
103
|
*/
|
|
104
104
|
ns: string;
|
|
105
|
-
template: 'standard' | 'empty' | 'analytics';
|
|
105
|
+
template: 'standard' | 'empty' | 'analytics' | 'react-b2e' | 'react-b2x';
|
|
106
106
|
manifest: boolean;
|
|
107
107
|
loginurl: string;
|
|
108
108
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** File extensions that should be processed as EJS templates */
|
|
2
|
+
export declare const EJS_EXTENSIONS: Set<string>;
|
|
3
|
+
/** Templates that have a full folder under src/templates/project/ (populated at build time from npm) */
|
|
4
|
+
export declare const BUILT_IN_FULL_TEMPLATES: Set<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Default app/site names embedded in each full template; all are renamed to the project name.
|
|
7
|
+
* Order matters: replace longer (suffix) first to avoid partial replacements.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FULL_TEMPLATE_DEFAULT_NAMES: Record<string, {
|
|
10
|
+
base: string;
|
|
11
|
+
withSuffix: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** Directories to skip when walking a full template dir (e.g. node_modules) */
|
|
14
|
+
export declare const FULL_TEMPLATE_SKIP_DIRS: Set<string>;
|
|
15
|
+
/** Heuristic: treat as text if no null byte in the first chunk and decodable as UTF-8 */
|
|
16
|
+
export declare function isLikelyText(filename: string, buffer: Buffer): boolean;
|
|
17
|
+
/** Renders an EJS template file with the given data (stateless, no generator dependency). */
|
|
18
|
+
export declare function renderEjsFile(sourcePath: string, data: Record<string, unknown>): Promise<string>;
|
|
19
|
+
export type GenerateBuiltInFullTemplateOptions = {
|
|
20
|
+
templateDir: string;
|
|
21
|
+
projectDir: string;
|
|
22
|
+
defaultpackagedir: string;
|
|
23
|
+
ns: string;
|
|
24
|
+
loginurl: string;
|
|
25
|
+
apiversion: string;
|
|
26
|
+
/** Renders an EJS template file; use renderEjsFile from this module */
|
|
27
|
+
renderEjs: (filePath: string, data: Record<string, unknown>) => Promise<string>;
|
|
28
|
+
/** Called for each file created (e.g. to push to generator changes) */
|
|
29
|
+
onFileCreated: (destPath: string) => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Generate project files from a built-in full template (e.g. react-b2e, react-b2x).
|
|
33
|
+
* Builds template vars and name replacements and delegates to generateFromProjectTemplateDir.
|
|
34
|
+
*/
|
|
35
|
+
export declare function generateBuiltInFullTemplate(template: string, projectname: string, options: GenerateBuiltInFullTemplateOptions): Promise<void>;
|
|
36
|
+
export type GenerateFromProjectTemplateDirOptions = {
|
|
37
|
+
/** Pairs of [from, to] for renaming template default app/site names to project name */
|
|
38
|
+
nameReplacements?: [string, string][];
|
|
39
|
+
/** Renders an EJS template file with the given data; used for template files */
|
|
40
|
+
renderEjs: (filePath: string, data: Record<string, unknown>) => Promise<string>;
|
|
41
|
+
/** Called for each file/dir created under destDir (for change tracking) */
|
|
42
|
+
onFileCreated: (destPath: string) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Recursively walk a full project template directory (e.g. react-b2e, react-b2x),
|
|
46
|
+
* rendering EJS for text files and copying the rest. Renames template default app/site
|
|
47
|
+
* names (e.g. appreacttemplateb2e) to the project name in paths and file contents.
|
|
48
|
+
*/
|
|
49
|
+
export declare function generateFromProjectTemplateDir(sourceDir: string, destDir: string, templateVars: Record<string, unknown>, options: GenerateFromProjectTemplateDirOptions): Promise<void>;
|