@salesforce/webapp-template-app-react-sample-b2x-experimental 1.36.3

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 (96) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/.a4drules/build-validation.md +81 -0
  3. package/dist/.a4drules/code-quality.md +150 -0
  4. package/dist/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
  5. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
  6. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
  7. package/dist/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
  8. package/dist/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
  9. package/dist/.a4drules/graphql.md +408 -0
  10. package/dist/.a4drules/images.md +13 -0
  11. package/dist/.a4drules/react.md +361 -0
  12. package/dist/.a4drules/react_image_processing.md +45 -0
  13. package/dist/.a4drules/skills/install-feature/SKILL.md +67 -0
  14. package/dist/.a4drules/skills/install-feature/scripts/copy-feature-assets.sh +36 -0
  15. package/dist/.a4drules/typescript.md +224 -0
  16. package/dist/.forceignore +15 -0
  17. package/dist/.husky/pre-commit +4 -0
  18. package/dist/.prettierignore +11 -0
  19. package/dist/.prettierrc +17 -0
  20. package/dist/CHANGELOG.md +533 -0
  21. package/dist/README.md +18 -0
  22. package/dist/config/project-scratch-def.json +13 -0
  23. package/dist/force-app/main/default/digitalExperienceConfigs/appreactsampleb2x1.digitalExperienceConfig +8 -0
  24. package/dist/force-app/main/default/digitalExperiences/site/appreactsampleb2x1/appreactsampleb2x1.digitalExperience-meta.xml +11 -0
  25. package/dist/force-app/main/default/digitalExperiences/site/appreactsampleb2x1/sfdc_cms__site/appreactsampleb2x1/_meta.json +5 -0
  26. package/dist/force-app/main/default/digitalExperiences/site/appreactsampleb2x1/sfdc_cms__site/appreactsampleb2x1/content.json +10 -0
  27. package/dist/force-app/main/default/networks/appreactsampleb2x.network +60 -0
  28. package/dist/force-app/main/default/package.xml +20 -0
  29. package/dist/force-app/main/default/sites/appreactsampleb2x.site +31 -0
  30. package/dist/force-app/main/default/webapplications/appreactsampleb2x/.graphqlrc.yml +2 -0
  31. package/dist/force-app/main/default/webapplications/appreactsampleb2x/.prettierignore +9 -0
  32. package/dist/force-app/main/default/webapplications/appreactsampleb2x/.prettierrc +11 -0
  33. package/dist/force-app/main/default/webapplications/appreactsampleb2x/appreactsampleb2x.webapplication-meta.xml +7 -0
  34. package/dist/force-app/main/default/webapplications/appreactsampleb2x/build/vite.config.d.ts +2 -0
  35. package/dist/force-app/main/default/webapplications/appreactsampleb2x/build/vite.config.js +94 -0
  36. package/dist/force-app/main/default/webapplications/appreactsampleb2x/codegen.yml +12 -0
  37. package/dist/force-app/main/default/webapplications/appreactsampleb2x/e2e/app.spec.ts +24 -0
  38. package/dist/force-app/main/default/webapplications/appreactsampleb2x/eslint.config.js +141 -0
  39. package/dist/force-app/main/default/webapplications/appreactsampleb2x/index.html +13 -0
  40. package/dist/force-app/main/default/webapplications/appreactsampleb2x/package-lock.json +12805 -0
  41. package/dist/force-app/main/default/webapplications/appreactsampleb2x/package.json +57 -0
  42. package/dist/force-app/main/default/webapplications/appreactsampleb2x/playwright.config.ts +24 -0
  43. package/dist/force-app/main/default/webapplications/appreactsampleb2x/scripts/get-graphql-schema.mjs +68 -0
  44. package/dist/force-app/main/default/webapplications/appreactsampleb2x/scripts/rewrite-e2e-assets.mjs +23 -0
  45. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/graphql-operations-types.ts +129 -0
  46. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/utils/accounts.ts +33 -0
  47. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
  48. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/app.tsx +41 -0
  49. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/appLayout.tsx +161 -0
  50. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/icons/book.svg +3 -0
  51. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/icons/copy.svg +4 -0
  52. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/icons/rocket.svg +3 -0
  53. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/icons/star.svg +3 -0
  54. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/images/codey-1.png +0 -0
  55. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/images/codey-2.png +0 -0
  56. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/images/codey-3.png +0 -0
  57. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/assets/images/vibe-codey.svg +194 -0
  58. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/alert.tsx +65 -0
  59. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/button.tsx +54 -0
  60. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/card.tsx +77 -0
  61. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/field.tsx +111 -0
  62. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/index.ts +71 -0
  63. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/input.tsx +19 -0
  64. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/label.tsx +19 -0
  65. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/pagination.tsx +99 -0
  66. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/select.tsx +151 -0
  67. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/skeleton.tsx +7 -0
  68. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/spinner.tsx +26 -0
  69. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/table.tsx +114 -0
  70. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/components/ui/tabs.tsx +115 -0
  71. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/lib/utils.ts +6 -0
  72. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/About.tsx +8 -0
  73. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Application.tsx +101 -0
  74. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Dashboard.tsx +101 -0
  75. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/HelpCenter.tsx +29 -0
  76. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Home.tsx +30 -0
  77. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/Maintenance.tsx +132 -0
  78. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/NotFound.tsx +14 -0
  79. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/PropertyDetails.tsx +68 -0
  80. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/pages/PropertyListings.tsx +84 -0
  81. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/routes.tsx +62 -0
  82. package/dist/force-app/main/default/webapplications/appreactsampleb2x/src/styles/global.css +80 -0
  83. package/dist/force-app/main/default/webapplications/appreactsampleb2x/tsconfig.json +36 -0
  84. package/dist/force-app/main/default/webapplications/appreactsampleb2x/tsconfig.node.json +13 -0
  85. package/dist/force-app/main/default/webapplications/appreactsampleb2x/vite-env.d.ts +1 -0
  86. package/dist/force-app/main/default/webapplications/appreactsampleb2x/vite.config.ts +102 -0
  87. package/dist/force-app/main/default/webapplications/appreactsampleb2x/vitest-env.d.ts +2 -0
  88. package/dist/force-app/main/default/webapplications/appreactsampleb2x/vitest.config.ts +11 -0
  89. package/dist/force-app/main/default/webapplications/appreactsampleb2x/vitest.setup.ts +1 -0
  90. package/dist/force-app/main/default/webapplications/appreactsampleb2x/webapplication.json +7 -0
  91. package/dist/jest.config.js +6 -0
  92. package/dist/package.json +38 -0
  93. package/dist/scripts/apex/hello.apex +10 -0
  94. package/dist/scripts/soql/account.soql +6 -0
  95. package/dist/sfdx-project.json +12 -0
  96. package/package.json +28 -0
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <active>true</active>
4
+ <allowGuestPaymentsApi>false</allowGuestPaymentsApi>
5
+ <allowHomePage>false</allowHomePage>
6
+ <allowStandardAnswersPages>false</allowStandardAnswersPages>
7
+ <allowStandardIdeasPages>false</allowStandardIdeasPages>
8
+ <allowStandardLookups>false</allowStandardLookups>
9
+ <allowStandardPortalPages>true</allowStandardPortalPages>
10
+ <allowStandardSearch>false</allowStandardSearch>
11
+ <authorizationRequiredPage>CommunitiesLogin</authorizationRequiredPage>
12
+ <bandwidthExceededPage>BandwidthExceeded</bandwidthExceededPage>
13
+ <browserXssProtection>true</browserXssProtection>
14
+ <cachePublicVisualforcePagesInProxyServers>true</cachePublicVisualforcePagesInProxyServers>
15
+ <clickjackProtectionLevel>SameOriginOnly</clickjackProtectionLevel>
16
+ <contentSniffingProtection>true</contentSniffingProtection>
17
+ <enableAuraRequests>true</enableAuraRequests>
18
+ <fileNotFoundPage>FileNotFound</fileNotFoundPage>
19
+ <genericErrorPage>Exception</genericErrorPage>
20
+ <inMaintenancePage>InMaintenance</inMaintenancePage>
21
+ <indexPage>CommunitiesLanding</indexPage>
22
+ <masterLabel>appreactsampleb2x</masterLabel>
23
+ <redirectToCustomDomain>false</redirectToCustomDomain>
24
+ <referrerPolicyOriginWhenCrossOrigin>true</referrerPolicyOriginWhenCrossOrigin>
25
+ <selfRegPage>CommunitiesSelfReg</selfRegPage>
26
+ <!-- <serverIsDown>SNA_U2rxy_sf_default_cdn_byo1</serverIsDown> -->
27
+ <!-- <siteAdmin>epic.out.d1d3a2d722c8@orgfarm.salesforce.com</siteAdmin> -->
28
+ <!-- <siteGuestRecordDefaultOwner>epic.out.d1d3a2d722c8@orgfarm.salesforce.com</siteGuestRecordDefaultOwner> -->
29
+ <siteType>ChatterNetwork</siteType>
30
+ <urlPathPrefix>appreactsampleb2xvforcesite</urlPathPrefix>
31
+ </CustomSite>
@@ -0,0 +1,2 @@
1
+ schema: '../../../../../schema.graphql'
2
+ documents: 'src/**/*.{graphql,js,ts,jsx,tsx}'
@@ -0,0 +1,9 @@
1
+ node_modules
2
+ dist
3
+ build
4
+ .vite
5
+ coverage
6
+ *.min.js
7
+ *.min.css
8
+ *.map
9
+ package-lock.json
@@ -0,0 +1,11 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "es5",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "bracketSpacing": true,
9
+ "arrowParens": "avoid",
10
+ "endOfLine": "lf"
11
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <WebApplication xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <masterLabel>appreactsampleb2x</masterLabel>
4
+ <description>A Salesforce web application.</description>
5
+ <isActive>true</isActive>
6
+ <version>1</version>
7
+ </WebApplication>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfigFnObject;
2
+ export default _default;
@@ -0,0 +1,94 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import path from 'path';
4
+ import { resolve } from 'path';
5
+ import tailwindcss from '@tailwindcss/vite';
6
+ import salesforce from '@salesforce/vite-plugin-webapp-experimental';
7
+ import codegen from 'vite-plugin-graphql-codegen';
8
+
9
+ export default defineConfig(function (_a) {
10
+ var mode = _a.mode;
11
+ return {
12
+ // Ensure root base for e2e/static serve; plugin may override when deployed under a path
13
+ base: '/',
14
+ plugins: [
15
+ tailwindcss(),
16
+ react(),
17
+ salesforce(),
18
+ codegen({
19
+ // Path to the codegen config file
20
+ configFilePathOverride: resolve(__dirname, 'codegen.yml'),
21
+ // Run codegen on dev server start
22
+ runOnStart: true,
23
+ // Don't run codegen on build for now
24
+ runOnBuild: false,
25
+ // Enable file watcher during development
26
+ enableWatcher: true,
27
+ // Fail build if codegen errors
28
+ throwOnBuild: true,
29
+ }),
30
+ ],
31
+ // Build configuration for MPA
32
+ build: {
33
+ outDir: resolve(__dirname, 'dist'),
34
+ assetsDir: 'assets',
35
+ sourcemap: false,
36
+ },
37
+ // Resolve aliases (shared between build and test)
38
+ resolve: {
39
+ dedupe: ['react', 'react-dom'],
40
+ alias: {
41
+ '@': path.resolve(__dirname, './src'),
42
+ '@api': path.resolve(__dirname, './src/api'),
43
+ '@components': path.resolve(__dirname, './src/components'),
44
+ '@utils': path.resolve(__dirname, './src/utils'),
45
+ '@styles': path.resolve(__dirname, './src/styles'),
46
+ '@assets': path.resolve(__dirname, './src/assets'),
47
+ },
48
+ },
49
+ // Vitest configuration
50
+ test: {
51
+ // Override root for tests (build uses src/pages as root)
52
+ root: resolve(__dirname),
53
+ // Use jsdom environment for React component testing
54
+ environment: 'jsdom',
55
+ // Setup files to run before each test
56
+ setupFiles: ['./src/test/setup.ts'],
57
+ // Global test patterns
58
+ include: [
59
+ 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
60
+ 'src/**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
61
+ ],
62
+ // Coverage configuration
63
+ coverage: {
64
+ provider: 'v8',
65
+ reporter: ['text', 'html', 'clover', 'json'],
66
+ exclude: [
67
+ 'node_modules/',
68
+ 'src/test/',
69
+ 'src/**/*.d.ts',
70
+ 'src/main.tsx',
71
+ 'src/vite-env.d.ts',
72
+ 'src/components/**/index.ts',
73
+ '**/*.config.ts',
74
+ 'build/',
75
+ 'dist/',
76
+ 'coverage/',
77
+ 'eslint.config.js',
78
+ ],
79
+ thresholds: {
80
+ global: {
81
+ branches: 85,
82
+ functions: 85,
83
+ lines: 85,
84
+ statements: 85,
85
+ },
86
+ },
87
+ },
88
+ // Test timeout
89
+ testTimeout: 10000,
90
+ // Globals for easier testing
91
+ globals: true,
92
+ },
93
+ };
94
+ });
@@ -0,0 +1,12 @@
1
+ schema: '../../../../../schema.graphql'
2
+ documents: 'src/**/*.{graphql,ts,tsx}'
3
+ generates:
4
+ src/api/graphql-operations-types.ts:
5
+ plugins:
6
+ - 'graphql-codegen-typescript-operation-types'
7
+ - 'typescript-operations'
8
+ config:
9
+ onlyOperationTypes: true
10
+ skipTypename: true
11
+ preResolveTypes: true
12
+ overwrite: true
@@ -0,0 +1,24 @@
1
+ import { test, expect } from '@playwright/test';
2
+
3
+ test.describe('base-react-app', () => {
4
+ test('home page loads and shows welcome content', async ({ page }) => {
5
+ await page.goto('/');
6
+ await expect(page.getByRole('heading', { name: 'Home' })).toBeVisible();
7
+ await expect(
8
+ page.getByText('Welcome to your React application.')
9
+ ).toBeVisible();
10
+ });
11
+
12
+ test('about page loads', async ({ page }) => {
13
+ await page.goto('/about');
14
+ await expect(page).toHaveURL(/\/about/);
15
+ await expect(page.getByRole('heading', { name: 'About' })).toBeVisible();
16
+ await expect(page.getByText('This is the about page.')).toBeVisible();
17
+ });
18
+
19
+ test('not found route shows 404', async ({ page }) => {
20
+ await page.goto('/non-existent-route');
21
+ await expect(page.getByRole('heading', { name: '404' })).toBeVisible();
22
+ await expect(page.getByText('Page not found')).toBeVisible();
23
+ });
24
+ });
@@ -0,0 +1,141 @@
1
+ import js from '@eslint/js';
2
+ import tseslint from '@typescript-eslint/eslint-plugin';
3
+ import tsparser from '@typescript-eslint/parser';
4
+ import react from 'eslint-plugin-react';
5
+ import reactHooks from 'eslint-plugin-react-hooks';
6
+ import reactRefresh from 'eslint-plugin-react-refresh';
7
+ import globals from 'globals';
8
+ import graphqlPlugin from '@graphql-eslint/eslint-plugin';
9
+
10
+ export default [
11
+ // Global ignores
12
+ {
13
+ ignores: ['build/**/*', 'dist/**/*', 'coverage/**/*'],
14
+ },
15
+ // Config files and build tools (first to avoid inheritance)
16
+ {
17
+ files: ['*.config.{js,ts}', 'vite.config.ts'],
18
+ languageOptions: {
19
+ parser: tsparser,
20
+ parserOptions: {
21
+ ecmaVersion: 'latest',
22
+ sourceType: 'module',
23
+ },
24
+ globals: {
25
+ ...globals.node,
26
+ __dirname: 'readonly',
27
+ process: 'readonly',
28
+ },
29
+ },
30
+ plugins: {
31
+ '@typescript-eslint': tseslint,
32
+ },
33
+ rules: {
34
+ '@typescript-eslint/no-var-requires': 'off',
35
+ },
36
+ },
37
+ // Main TypeScript/React files
38
+ {
39
+ files: ['**/*.{ts,tsx}'],
40
+ ignores: [
41
+ 'coverage',
42
+ 'dist',
43
+ 'node_modules',
44
+ 'build',
45
+ '*.config.{js,ts}',
46
+ 'vite.config.ts',
47
+ ],
48
+ languageOptions: {
49
+ ecmaVersion: 2020,
50
+ sourceType: 'module',
51
+ parser: tsparser,
52
+ parserOptions: {
53
+ ecmaFeatures: {
54
+ jsx: true,
55
+ },
56
+ ecmaVersion: 'latest',
57
+ sourceType: 'module',
58
+ project: './tsconfig.json',
59
+ },
60
+ globals: {
61
+ ...globals.browser,
62
+ JSX: 'readonly',
63
+ },
64
+ },
65
+ plugins: {
66
+ react,
67
+ 'react-hooks': reactHooks,
68
+ 'react-refresh': reactRefresh,
69
+ '@typescript-eslint': tseslint,
70
+ },
71
+ rules: {
72
+ ...js.configs.recommended.rules,
73
+ ...tseslint.configs.recommended.rules,
74
+ ...react.configs.recommended.rules,
75
+ ...reactHooks.configs.recommended.rules,
76
+ 'react/react-in-jsx-scope': 'off',
77
+ 'react/prop-types': 'off',
78
+ 'react/jsx-no-comment-textnodes': 'off',
79
+ 'react/no-unescaped-entities': 'off',
80
+ '@typescript-eslint/no-unused-vars': [
81
+ 'error',
82
+ { argsIgnorePattern: '^_' },
83
+ ],
84
+ '@typescript-eslint/explicit-function-return-type': 'off',
85
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
86
+ '@typescript-eslint/no-explicit-any': 'off',
87
+ },
88
+ settings: {
89
+ react: {
90
+ version: 'detect',
91
+ },
92
+ },
93
+ },
94
+ // Test files
95
+ {
96
+ files: [
97
+ '**/*.test.{ts,tsx}',
98
+ '**/test/**/*.{ts,tsx}',
99
+ 'src/test/**/*.{ts,tsx}',
100
+ ],
101
+ languageOptions: {
102
+ parser: tsparser,
103
+ globals: {
104
+ ...globals.browser,
105
+ ...globals.node,
106
+ global: 'writable',
107
+ JSX: 'readonly',
108
+ },
109
+ },
110
+ rules: {
111
+ '@typescript-eslint/no-explicit-any': 'off',
112
+ },
113
+ },
114
+ // GraphQL processor - extracts GraphQL from gql template literals in TS/TSX files
115
+ {
116
+ files: ['**/*.{ts,tsx}'],
117
+ processor: graphqlPlugin.processor,
118
+ },
119
+ // GraphQL linting configuration for .graphql files
120
+ {
121
+ files: ['**/*.graphql'],
122
+ languageOptions: {
123
+ parser: graphqlPlugin.parser,
124
+ parserOptions: {
125
+ graphQLConfig: {
126
+ schema: '../../../../../schema.graphql',
127
+ },
128
+ },
129
+ },
130
+ plugins: {
131
+ '@graphql-eslint': graphqlPlugin,
132
+ },
133
+ rules: {
134
+ '@graphql-eslint/no-anonymous-operations': 'error',
135
+ '@graphql-eslint/no-duplicate-fields': 'error',
136
+ '@graphql-eslint/known-fragment-names': 'error',
137
+ '@graphql-eslint/no-undefined-variables': 'error',
138
+ '@graphql-eslint/no-unused-variables': 'error',
139
+ },
140
+ },
141
+ ];
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>ZENLEASE</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"><p style="padding: 1rem; font-family: system-ui">Loading…</p></div>
11
+ <script type="module" src="/src/app.tsx"></script>
12
+ </body>
13
+ </html>