@react-spa-scaffold/mcp 2.1.0 → 2.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 (101) hide show
  1. package/README.md +2 -1
  2. package/dist/constants.d.ts +1 -0
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +1 -0
  5. package/dist/constants.js.map +1 -1
  6. package/dist/features/definitions/auth.d.ts +3 -0
  7. package/dist/features/definitions/auth.d.ts.map +1 -0
  8. package/dist/features/definitions/auth.js +17 -0
  9. package/dist/features/definitions/auth.js.map +1 -0
  10. package/dist/features/definitions/core.d.ts.map +1 -1
  11. package/dist/features/definitions/core.js +16 -1
  12. package/dist/features/definitions/core.js.map +1 -1
  13. package/dist/features/definitions/forms.d.ts.map +1 -1
  14. package/dist/features/definitions/forms.js +4 -0
  15. package/dist/features/definitions/forms.js.map +1 -1
  16. package/dist/features/definitions/index.d.ts +1 -0
  17. package/dist/features/definitions/index.d.ts.map +1 -1
  18. package/dist/features/definitions/index.js +1 -0
  19. package/dist/features/definitions/index.js.map +1 -1
  20. package/dist/features/definitions/mobile.d.ts.map +1 -1
  21. package/dist/features/definitions/mobile.js +11 -2
  22. package/dist/features/definitions/mobile.js.map +1 -1
  23. package/dist/features/definitions/observability.js +1 -1
  24. package/dist/features/definitions/observability.js.map +1 -1
  25. package/dist/features/definitions/routing.d.ts.map +1 -1
  26. package/dist/features/definitions/routing.js +2 -1
  27. package/dist/features/definitions/routing.js.map +1 -1
  28. package/dist/features/definitions/state.d.ts.map +1 -1
  29. package/dist/features/definitions/state.js +9 -2
  30. package/dist/features/definitions/state.js.map +1 -1
  31. package/dist/features/definitions/testing.d.ts.map +1 -1
  32. package/dist/features/definitions/testing.js +4 -2
  33. package/dist/features/definitions/testing.js.map +1 -1
  34. package/dist/features/registry.d.ts.map +1 -1
  35. package/dist/features/registry.js +2 -1
  36. package/dist/features/registry.js.map +1 -1
  37. package/dist/features/types.test.js +4 -2
  38. package/dist/features/types.test.js.map +1 -1
  39. package/dist/tools/get-scaffold.d.ts.map +1 -1
  40. package/dist/tools/get-scaffold.js +6 -3
  41. package/dist/tools/get-scaffold.js.map +1 -1
  42. package/dist/tools/get-scaffold.test.js +5 -2
  43. package/dist/tools/get-scaffold.test.js.map +1 -1
  44. package/dist/utils/scaffold/compute.d.ts.map +1 -1
  45. package/dist/utils/scaffold/compute.js +3 -1
  46. package/dist/utils/scaffold/compute.js.map +1 -1
  47. package/dist/utils/scaffold/generators.d.ts.map +1 -1
  48. package/dist/utils/scaffold/generators.js +7 -0
  49. package/dist/utils/scaffold/generators.js.map +1 -1
  50. package/package.json +1 -1
  51. package/templates/.env.example +6 -0
  52. package/templates/.github/workflows/ci.yml +8 -3
  53. package/templates/CLAUDE.md +74 -1
  54. package/templates/docs/ARCHITECTURE.md +13 -12
  55. package/templates/docs/CODING_STANDARDS.md +65 -0
  56. package/templates/docs/E2E_TESTING.md +52 -7
  57. package/templates/e2e/fixtures/index.ts +13 -2
  58. package/templates/package.json +7 -3
  59. package/templates/playwright.config.ts +6 -1
  60. package/templates/src/components/layout/Header.tsx +2 -1
  61. package/templates/src/components/shared/AccountButton/AccountButton.test.tsx +30 -0
  62. package/templates/src/components/shared/AccountButton/AccountButton.tsx +38 -0
  63. package/templates/src/components/shared/AccountButton/index.ts +1 -0
  64. package/templates/src/components/shared/ErrorBoundary/ErrorBoundary.test.tsx +4 -4
  65. package/templates/src/components/shared/ErrorBoundary/ErrorBoundary.tsx +55 -53
  66. package/templates/src/components/shared/ProtectedRoute/ProtectedRoute.test.tsx +43 -0
  67. package/templates/src/components/shared/ProtectedRoute/ProtectedRoute.tsx +35 -0
  68. package/templates/src/components/shared/ProtectedRoute/index.ts +1 -0
  69. package/templates/src/components/shared/index.ts +4 -2
  70. package/templates/src/contexts/clerkContext.tsx +45 -0
  71. package/templates/src/hooks/index.ts +23 -2
  72. package/templates/src/hooks/useCopyFeedback.test.ts +129 -0
  73. package/templates/src/hooks/useCopyFeedback.ts +41 -0
  74. package/templates/src/hooks/useDebouncedCallback.test.ts +164 -0
  75. package/templates/src/hooks/useDebouncedCallback.ts +47 -0
  76. package/templates/src/hooks/useDocumentTitle.test.ts +59 -0
  77. package/templates/src/hooks/useDocumentTitle.ts +31 -0
  78. package/templates/src/hooks/useIOSViewportReset.test.ts +58 -0
  79. package/templates/src/hooks/useIOSViewportReset.ts +18 -0
  80. package/templates/src/hooks/useKeyboardShortcut.test.ts +86 -0
  81. package/templates/src/hooks/useKeyboardShortcuts.ts +44 -0
  82. package/templates/src/hooks/useLocalStorage.test.ts +111 -0
  83. package/templates/src/hooks/useLocalStorage.ts +77 -0
  84. package/templates/src/hooks/useSyncedFormData.test.ts +75 -0
  85. package/templates/src/hooks/useSyncedFormData.ts +21 -0
  86. package/templates/src/hooks/useSyncedState.test.ts +119 -0
  87. package/templates/src/hooks/useSyncedState.ts +30 -0
  88. package/templates/src/index.css +1 -0
  89. package/templates/src/lib/constants.ts +10 -0
  90. package/templates/src/lib/createSelectors.test.ts +136 -0
  91. package/templates/src/lib/createSelectors.ts +31 -0
  92. package/templates/src/lib/index.ts +1 -0
  93. package/templates/src/lib/sentry.ts +55 -0
  94. package/templates/src/lib/storage.ts +6 -2
  95. package/templates/src/main.tsx +18 -8
  96. package/templates/src/stores/preferencesStore.ts +34 -9
  97. package/templates/src/test/clerkMock.tsx +97 -0
  98. package/templates/src/test/index.ts +3 -0
  99. package/templates/src/test/providers.tsx +7 -4
  100. package/templates/src/test-setup.ts +16 -2
  101. package/templates/vitest.config.ts +9 -1
@@ -1,7 +1,20 @@
1
1
  import '@testing-library/jest-dom/vitest';
2
- import { afterAll, afterEach, beforeAll } from 'vitest';
2
+ import { afterAll, afterEach, beforeAll, vi } from 'vitest';
3
3
 
4
4
  import { server } from '@/mocks/node';
5
+ import { resetClerkMocks } from '@/test/clerkMock';
6
+
7
+ // =============================================================================
8
+ // Module Mocks
9
+ // =============================================================================
10
+
11
+ // Mock @clerk/react-router for testing
12
+ vi.mock('@clerk/react-router', async () => import('@/test/clerkMock'));
13
+
14
+ // Mock @clerk/themes for testing
15
+ vi.mock('@clerk/themes', () => ({
16
+ shadcn: { baseTheme: 'shadcn' },
17
+ }));
5
18
 
6
19
  // =============================================================================
7
20
  // MSW Server Setup
@@ -14,9 +27,10 @@ beforeAll(() => {
14
27
  });
15
28
  });
16
29
 
17
- // Reset handlers after each test to ensure test isolation
30
+ // Reset handlers and mocks after each test to ensure test isolation
18
31
  afterEach(() => {
19
32
  server.resetHandlers();
33
+ resetClerkMocks();
20
34
  });
21
35
 
22
36
  // Close MSW server after all tests complete
@@ -21,7 +21,15 @@ export default defineConfig({
21
21
  coverage: {
22
22
  provider: 'v8',
23
23
  reporter: ['text', 'json', 'html', 'lcov'],
24
- exclude: ['**/*.test.{ts,tsx}', '**/index.ts', 'src/types/**', 'src/components/ui/**', 'src/mocks/**'],
24
+ exclude: [
25
+ '**/*.test.{ts,tsx}',
26
+ '**/index.ts',
27
+ 'src/types/**',
28
+ 'src/components/ui/**',
29
+ 'src/mocks/**',
30
+ 'src/test/**', // Test utilities and mocks
31
+ 'src/lib/sentry.ts', // Production-only, lazily loaded
32
+ ],
25
33
  thresholds: {
26
34
  lines: 80,
27
35
  functions: 80,