@salesforce/webapp-template-feature-micro-frontend 1.30.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 (67) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +32 -0
  3. package/dist/.a4drules/build-validation.md +81 -0
  4. package/dist/.a4drules/code-quality.md +150 -0
  5. package/dist/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
  6. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +212 -0
  7. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
  8. package/dist/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
  9. package/dist/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
  10. package/dist/.a4drules/graphql.md +408 -0
  11. package/dist/.a4drules/images.md +13 -0
  12. package/dist/.a4drules/react.md +361 -0
  13. package/dist/.a4drules/react_image_processing.md +45 -0
  14. package/dist/.a4drules/skills/install-feature/SKILL.md +67 -0
  15. package/dist/.a4drules/skills/install-feature/scripts/copy-feature-assets.sh +36 -0
  16. package/dist/.a4drules/typescript.md +224 -0
  17. package/dist/.forceignore +15 -0
  18. package/dist/.husky/pre-commit +4 -0
  19. package/dist/.prettierignore +11 -0
  20. package/dist/.prettierrc +17 -0
  21. package/dist/CHANGELOG.md +383 -0
  22. package/dist/README.md +18 -0
  23. package/dist/config/project-scratch-def.json +13 -0
  24. package/dist/force-app/main/default/webapplications/feature-micro-frontend/.prettierignore +9 -0
  25. package/dist/force-app/main/default/webapplications/feature-micro-frontend/.prettierrc +11 -0
  26. package/dist/force-app/main/default/webapplications/feature-micro-frontend/build/vite.config.d.ts +2 -0
  27. package/dist/force-app/main/default/webapplications/feature-micro-frontend/build/vite.config.js +74 -0
  28. package/dist/force-app/main/default/webapplications/feature-micro-frontend/e2e/app.spec.ts +24 -0
  29. package/dist/force-app/main/default/webapplications/feature-micro-frontend/eslint.config.js +113 -0
  30. package/dist/force-app/main/default/webapplications/feature-micro-frontend/feature-micro-frontend.webapplication-meta.xml +11 -0
  31. package/dist/force-app/main/default/webapplications/feature-micro-frontend/index.html +13 -0
  32. package/dist/force-app/main/default/webapplications/feature-micro-frontend/package-lock.json +7157 -0
  33. package/dist/force-app/main/default/webapplications/feature-micro-frontend/package.json +45 -0
  34. package/dist/force-app/main/default/webapplications/feature-micro-frontend/playwright.config.ts +24 -0
  35. package/dist/force-app/main/default/webapplications/feature-micro-frontend/scripts/rewrite-e2e-assets.mjs +23 -0
  36. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/api/graphql-operations-types.ts +127 -0
  37. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
  38. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/app.tsx +13 -0
  39. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/appLayout.tsx +9 -0
  40. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/icons/book.svg +3 -0
  41. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/icons/copy.svg +4 -0
  42. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/icons/rocket.svg +3 -0
  43. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/icons/star.svg +3 -0
  44. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/images/codey-1.png +0 -0
  45. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/images/codey-2.png +0 -0
  46. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/images/codey-3.png +0 -0
  47. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/assets/images/vibe-codey.svg +194 -0
  48. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/pages/About.tsx +12 -0
  49. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/pages/Home.tsx +12 -0
  50. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/pages/NotFound.tsx +18 -0
  51. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/routes.tsx +28 -0
  52. package/dist/force-app/main/default/webapplications/feature-micro-frontend/src/styles/global.css +13 -0
  53. package/dist/force-app/main/default/webapplications/feature-micro-frontend/tsconfig.json +36 -0
  54. package/dist/force-app/main/default/webapplications/feature-micro-frontend/tsconfig.node.json +13 -0
  55. package/dist/force-app/main/default/webapplications/feature-micro-frontend/vite-env.d.ts +1 -0
  56. package/dist/force-app/main/default/webapplications/feature-micro-frontend/vite.config.ts +83 -0
  57. package/dist/force-app/main/default/webapplications/feature-micro-frontend/vitest-env.d.ts +2 -0
  58. package/dist/force-app/main/default/webapplications/feature-micro-frontend/vitest.config.ts +11 -0
  59. package/dist/force-app/main/default/webapplications/feature-micro-frontend/vitest.setup.ts +1 -0
  60. package/dist/force-app/main/default/webapplications/feature-micro-frontend/webapplication.json +7 -0
  61. package/dist/jest.config.js +6 -0
  62. package/dist/package.json +38 -0
  63. package/dist/scripts/apex/hello.apex +10 -0
  64. package/dist/scripts/soql/account.soql +6 -0
  65. package/dist/sfdx-project.json +12 -0
  66. package/package.json +32 -0
  67. package/skills/micro-frontend/SKILL.md +137 -0
@@ -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,2 @@
1
+ declare const _default: import("vite").UserConfigFnObject;
2
+ export default _default;
@@ -0,0 +1,74 @@
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
+ export default defineConfig(function (_a) {
8
+ var mode = _a.mode;
9
+ return {
10
+ plugins: [tailwindcss(), react(), salesforce()],
11
+ // Build configuration for MPA
12
+ build: {
13
+ outDir: resolve(__dirname, 'dist'),
14
+ assetsDir: 'assets',
15
+ sourcemap: false,
16
+ },
17
+ // Resolve aliases (shared between build and test)
18
+ resolve: {
19
+ dedupe: ['react', 'react-dom'],
20
+ alias: {
21
+ '@': path.resolve(__dirname, './src'),
22
+ '@api': path.resolve(__dirname, './src/api'),
23
+ '@components': path.resolve(__dirname, './src/components'),
24
+ '@utils': path.resolve(__dirname, './src/utils'),
25
+ '@styles': path.resolve(__dirname, './src/styles'),
26
+ '@assets': path.resolve(__dirname, './src/assets'),
27
+ },
28
+ },
29
+ // Vitest configuration
30
+ test: {
31
+ // Override root for tests (build uses src/pages as root)
32
+ root: resolve(__dirname),
33
+ // Use jsdom environment for React component testing
34
+ environment: 'jsdom',
35
+ // Setup files to run before each test
36
+ setupFiles: ['./src/test/setup.ts'],
37
+ // Global test patterns
38
+ include: [
39
+ 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
40
+ 'src/**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
41
+ ],
42
+ // Coverage configuration
43
+ coverage: {
44
+ provider: 'v8',
45
+ reporter: ['text', 'html', 'clover', 'json'],
46
+ exclude: [
47
+ 'node_modules/',
48
+ 'src/test/',
49
+ 'src/**/*.d.ts',
50
+ 'src/main.tsx',
51
+ 'src/vite-env.d.ts',
52
+ 'src/components/**/index.ts',
53
+ '**/*.config.ts',
54
+ 'build/',
55
+ 'dist/',
56
+ 'coverage/',
57
+ 'eslint.config.js',
58
+ ],
59
+ thresholds: {
60
+ global: {
61
+ branches: 85,
62
+ functions: 85,
63
+ lines: 85,
64
+ statements: 85,
65
+ },
66
+ },
67
+ },
68
+ // Test timeout
69
+ testTimeout: 10000,
70
+ // Globals for easier testing
71
+ globals: true,
72
+ },
73
+ };
74
+ });
@@ -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,113 @@
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
+
9
+ export default [
10
+ // Global ignores
11
+ {
12
+ ignores: ['build/**/*', 'dist/**/*', 'coverage/**/*'],
13
+ },
14
+ // Config files and build tools (first to avoid inheritance)
15
+ {
16
+ files: ['*.config.{js,ts}', 'vite.config.ts'],
17
+ languageOptions: {
18
+ parser: tsparser,
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ },
23
+ globals: {
24
+ ...globals.node,
25
+ __dirname: 'readonly',
26
+ process: 'readonly',
27
+ },
28
+ },
29
+ plugins: {
30
+ '@typescript-eslint': tseslint,
31
+ },
32
+ rules: {
33
+ '@typescript-eslint/no-var-requires': 'off',
34
+ },
35
+ },
36
+ // Main TypeScript/React files
37
+ {
38
+ files: ['**/*.{ts,tsx}'],
39
+ ignores: [
40
+ 'coverage',
41
+ 'dist',
42
+ 'node_modules',
43
+ 'build',
44
+ '*.config.{js,ts}',
45
+ 'vite.config.ts',
46
+ ],
47
+ languageOptions: {
48
+ ecmaVersion: 2020,
49
+ sourceType: 'module',
50
+ parser: tsparser,
51
+ parserOptions: {
52
+ ecmaFeatures: {
53
+ jsx: true,
54
+ },
55
+ ecmaVersion: 'latest',
56
+ sourceType: 'module',
57
+ project: './tsconfig.json',
58
+ },
59
+ globals: {
60
+ ...globals.browser,
61
+ JSX: 'readonly',
62
+ },
63
+ },
64
+ plugins: {
65
+ react,
66
+ 'react-hooks': reactHooks,
67
+ 'react-refresh': reactRefresh,
68
+ '@typescript-eslint': tseslint,
69
+ },
70
+ rules: {
71
+ ...js.configs.recommended.rules,
72
+ ...tseslint.configs.recommended.rules,
73
+ ...react.configs.recommended.rules,
74
+ ...reactHooks.configs.recommended.rules,
75
+ 'react/react-in-jsx-scope': 'off',
76
+ 'react/prop-types': 'off',
77
+ 'react/jsx-no-comment-textnodes': 'off',
78
+ 'react/no-unescaped-entities': 'off',
79
+ '@typescript-eslint/no-unused-vars': [
80
+ 'error',
81
+ { argsIgnorePattern: '^_' },
82
+ ],
83
+ '@typescript-eslint/explicit-function-return-type': 'off',
84
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
85
+ '@typescript-eslint/no-explicit-any': 'off',
86
+ },
87
+ settings: {
88
+ react: {
89
+ version: 'detect',
90
+ },
91
+ },
92
+ },
93
+ // Test files
94
+ {
95
+ files: [
96
+ '**/*.test.{ts,tsx}',
97
+ '**/test/**/*.{ts,tsx}',
98
+ 'src/test/**/*.{ts,tsx}',
99
+ ],
100
+ languageOptions: {
101
+ parser: tsparser,
102
+ globals: {
103
+ ...globals.browser,
104
+ ...globals.node,
105
+ global: 'writable',
106
+ JSX: 'readonly',
107
+ },
108
+ },
109
+ rules: {
110
+ '@typescript-eslint/no-explicit-any': 'off',
111
+ },
112
+ },
113
+ ];
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <WebApplication xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <apiVersion>65.0</apiVersion>
4
+ <masterLabel>feature-micro-frontend</masterLabel>
5
+ <description>A Salesforce Web App to embed as a Micro Frontend.</description>
6
+ <active>true</active>
7
+ <version>1</version>
8
+ <supportedTargets>
9
+ <target>lightningOut</target>
10
+ </supportedTargets>
11
+ </WebApplication>
@@ -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>Welcome to React App</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/app.tsx"></script>
12
+ </body>
13
+ </html>