@react-spa-scaffold/mcp 1.1.0 → 1.1.2

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 (70) hide show
  1. package/README.md +2 -1
  2. package/dist/features/index.d.ts +0 -1
  3. package/dist/features/index.d.ts.map +1 -1
  4. package/dist/features/index.js +0 -1
  5. package/dist/features/index.js.map +1 -1
  6. package/dist/features/registry.d.ts +4 -0
  7. package/dist/features/registry.d.ts.map +1 -1
  8. package/dist/features/registry.js +144 -113
  9. package/dist/features/registry.js.map +1 -1
  10. package/dist/features/types.d.ts +12 -2
  11. package/dist/features/types.d.ts.map +1 -1
  12. package/dist/tools/get-example.d.ts.map +1 -1
  13. package/dist/tools/get-example.js +3 -2
  14. package/dist/tools/get-example.js.map +1 -1
  15. package/dist/tools/get-features.d.ts.map +1 -1
  16. package/dist/tools/get-features.js +2 -1
  17. package/dist/tools/get-features.js.map +1 -1
  18. package/dist/tools/get-scaffold.d.ts.map +1 -1
  19. package/dist/tools/get-scaffold.js +12 -64
  20. package/dist/tools/get-scaffold.js.map +1 -1
  21. package/dist/utils/examples.d.ts.map +1 -1
  22. package/dist/utils/examples.js +40 -4
  23. package/dist/utils/examples.js.map +1 -1
  24. package/dist/utils/scaffold.d.ts +9 -5
  25. package/dist/utils/scaffold.d.ts.map +1 -1
  26. package/dist/utils/scaffold.js +81 -17
  27. package/dist/utils/scaffold.js.map +1 -1
  28. package/package.json +1 -1
  29. package/templates/.github/workflows/ci.yml +35 -63
  30. package/templates/.github/workflows/release.yml +36 -0
  31. package/templates/CLAUDE.md +5 -3
  32. package/templates/docs/ARCHITECTURE.md +0 -1
  33. package/templates/docs/COMPONENT_GUIDELINES.md +1 -1
  34. package/templates/docs/E2E_TESTING.md +22 -7
  35. package/templates/docs/TESTING.md +2 -14
  36. package/templates/docs/WORKFLOW.md +5 -5
  37. package/templates/e2e/performance/home.spec.ts +94 -0
  38. package/templates/e2e/performance/setup.ts +9 -0
  39. package/templates/e2e/tests/home.spec.ts +2 -2
  40. package/templates/gitignore +1 -1
  41. package/templates/package.json +19 -8
  42. package/templates/playwright.config.ts +15 -3
  43. package/templates/src/contexts/performanceContext.test.tsx +51 -0
  44. package/templates/src/contexts/performanceContext.tsx +64 -0
  45. package/templates/src/main.tsx +5 -2
  46. package/templates/src/pages/Home.tsx +38 -33
  47. package/templates/src/test/providers.tsx +5 -1
  48. package/templates/vitest.config.ts +1 -1
  49. package/templates/lighthouse-budget.json +0 -17
  50. package/templates/lighthouserc.json +0 -23
  51. /package/templates/{tests/unit/components → src/components/layout}/Header.test.tsx +0 -0
  52. /package/templates/{tests/unit/components → src/components/shared/ErrorBoundary}/ErrorBoundary.test.tsx +0 -0
  53. /package/templates/{tests/unit/components → src/components/shared/LanguageSwitcher}/LanguageSwitcher.test.tsx +0 -0
  54. /package/templates/{tests/unit/components → src/components/shared/RegisterForm}/RegisterForm.test.tsx +0 -0
  55. /package/templates/{tests/unit/components → src/components/shared/SEO}/SEO.test.tsx +0 -0
  56. /package/templates/{tests/unit/components → src/components/shared/ThemeToggle}/ThemeToggle.test.tsx +0 -0
  57. /package/templates/{tests/unit/components/Loading.test.tsx → src/components/ui/loading.test.tsx} +0 -0
  58. /package/templates/{tests/unit → src}/contexts/mobileContext.test.tsx +0 -0
  59. /package/templates/{tests/unit → src}/hooks/useExampleQuery.test.tsx +0 -0
  60. /package/templates/{tests/unit → src}/hooks/useLanguage.test.tsx +0 -0
  61. /package/templates/{tests/unit → src}/hooks/useMediaQuery.test.ts +0 -0
  62. /package/templates/{tests/unit → src}/hooks/useRegisterForm.test.tsx +0 -0
  63. /package/templates/{tests/unit → src}/hooks/useThemeEffect.test.ts +0 -0
  64. /package/templates/{tests/unit → src}/i18n/detectLanguage.test.ts +0 -0
  65. /package/templates/{tests/unit → src}/i18n/loadCatalog.test.ts +0 -0
  66. /package/templates/{tests/unit → src}/lib/api.test.ts +0 -0
  67. /package/templates/{tests/unit → src}/lib/storage.test.ts +0 -0
  68. /package/templates/{tests/unit → src}/lib/utils.test.ts +0 -0
  69. /package/templates/{tests/unit → src}/lib/validations.test.ts +0 -0
  70. /package/templates/{tests/unit → src}/stores/preferencesStore.test.ts +0 -0
@@ -7,6 +7,7 @@ import './index.css';
7
7
  import { ErrorBoundary } from '@/components/shared';
8
8
  import { Toaster } from '@/components/ui/sonner';
9
9
  import { MobileProvider } from '@/contexts/mobileContext';
10
+ import { PerformanceProviderWrapper } from '@/contexts/performanceContext';
10
11
  import { QueryProvider } from '@/contexts/queryContext';
11
12
  import { i18n, initI18n } from '@/i18n';
12
13
  import { SENTRY_CONFIG } from '@/lib/config';
@@ -75,8 +76,10 @@ initI18n().then(() => {
75
76
  <BrowserRouter>
76
77
  <MobileProvider>
77
78
  <ErrorBoundary>
78
- <App />
79
- <Toaster />
79
+ <PerformanceProviderWrapper>
80
+ <App />
81
+ <Toaster />
82
+ </PerformanceProviderWrapper>
80
83
  </ErrorBoundary>
81
84
  </MobileProvider>
82
85
  </BrowserRouter>
@@ -1,46 +1,51 @@
1
1
  import { Trans, useLingui } from '@lingui/react/macro';
2
+ import { Profiler } from 'react';
2
3
 
3
4
  import { RegisterForm, SEO } from '@/components/shared';
5
+ import { usePerformance } from '@/contexts/performanceContext';
4
6
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
5
7
 
6
8
  export function HomePage() {
7
9
  const { t } = useLingui();
10
+ const { onProfilerRender } = usePerformance();
8
11
 
9
12
  return (
10
- <div className="container mx-auto max-w-lg px-4 py-8">
11
- <SEO
12
- title={t({ message: 'Home', comment: 'Home page title for SEO' })}
13
- description={t({
14
- message: 'Welcome to our modern React application',
15
- comment: 'Home page meta description for SEO',
16
- })}
17
- />
13
+ <Profiler id="home-page" onRender={onProfilerRender}>
14
+ <div className="container mx-auto max-w-lg px-4 py-8">
15
+ <SEO
16
+ title={t({ message: 'Home', comment: 'Home page title for SEO' })}
17
+ description={t({
18
+ message: 'Welcome to our modern React application',
19
+ comment: 'Home page meta description for SEO',
20
+ })}
21
+ />
18
22
 
19
- <div className="mb-8 text-center">
20
- <h1 className="text-3xl font-bold">
21
- <Trans comment="Main heading on the home page">Welcome to My App</Trans>
22
- </h1>
23
- <p className="text-muted-foreground mt-2">
24
- <Trans comment="Instructions for developers on how to start customizing the app">
25
- Get started by editing <code className="bg-muted rounded px-1">src/App.tsx</code>
26
- </Trans>
27
- </p>
28
- </div>
23
+ <div className="mb-8 text-center">
24
+ <h1 className="text-3xl font-bold">
25
+ <Trans comment="Main heading on the home page">Welcome to My App</Trans>
26
+ </h1>
27
+ <p className="text-muted-foreground mt-2">
28
+ <Trans comment="Instructions for developers on how to start customizing the app">
29
+ Get started by editing <code className="bg-muted rounded px-1">src/App.tsx</code>
30
+ </Trans>
31
+ </p>
32
+ </div>
29
33
 
30
- {/* Form validation demo */}
31
- <Card>
32
- <CardHeader>
33
- <CardTitle>
34
- <Trans comment="Register form card title">Registration Form</Trans>
35
- </CardTitle>
36
- <CardDescription>
37
- <Trans comment="Register form card description">React Hook Form + Zod validation demo</Trans>
38
- </CardDescription>
39
- </CardHeader>
40
- <CardContent>
41
- <RegisterForm />
42
- </CardContent>
43
- </Card>
44
- </div>
34
+ {/* Form validation demo */}
35
+ <Card>
36
+ <CardHeader>
37
+ <CardTitle>
38
+ <Trans comment="Register form card title">Registration Form</Trans>
39
+ </CardTitle>
40
+ <CardDescription>
41
+ <Trans comment="Register form card description">React Hook Form + Zod validation demo</Trans>
42
+ </CardDescription>
43
+ </CardHeader>
44
+ <CardContent>
45
+ <RegisterForm />
46
+ </CardContent>
47
+ </Card>
48
+ </div>
49
+ </Profiler>
45
50
  );
46
51
  }
@@ -6,6 +6,7 @@ import { type ReactElement, type ReactNode } from 'react';
6
6
  import { MemoryRouter } from 'react-router';
7
7
 
8
8
  import { MobileProvider } from '@/contexts/mobileContext';
9
+ import { PerformanceProviderWrapper } from '@/contexts/performanceContext';
9
10
 
10
11
  // Setup empty English catalog for tests
11
12
  i18n.loadAndActivate({ locale: 'en', messages: {} });
@@ -36,11 +37,14 @@ interface WrapperProps {
36
37
  function AllProviders({ children }: WrapperProps) {
37
38
  const queryClient = createTestQueryClient();
38
39
 
40
+ // Provider order matches main.tsx: Query > I18n > Router > Mobile > Performance
39
41
  return (
40
42
  <QueryClientProvider client={queryClient}>
41
43
  <I18nProvider i18n={i18n}>
42
44
  <MemoryRouter>
43
- <MobileProvider>{children}</MobileProvider>
45
+ <MobileProvider>
46
+ <PerformanceProviderWrapper>{children}</PerformanceProviderWrapper>
47
+ </MobileProvider>
44
48
  </MemoryRouter>
45
49
  </I18nProvider>
46
50
  </QueryClientProvider>
@@ -15,7 +15,7 @@ export default defineConfig({
15
15
  globals: true,
16
16
  environment: 'jsdom',
17
17
  setupFiles: ['./src/test-setup.ts'],
18
- include: ['src/**/*.test.{ts,tsx}', 'tests/**/*.test.{ts,tsx}'],
18
+ include: ['src/**/*.test.{ts,tsx}'],
19
19
  clearMocks: true,
20
20
  restoreMocks: true,
21
21
  coverage: {
@@ -1,17 +0,0 @@
1
- [
2
- {
3
- "path": "/*",
4
- "resourceSizes": [
5
- { "resourceType": "script", "budget": 500 },
6
- { "resourceType": "stylesheet", "budget": 100 },
7
- { "resourceType": "total", "budget": 1000 }
8
- ],
9
- "resourceCounts": [{ "resourceType": "third-party", "budget": 10 }],
10
- "timings": [
11
- { "metric": "first-contentful-paint", "budget": 2000 },
12
- { "metric": "interactive", "budget": 5000 },
13
- { "metric": "largest-contentful-paint", "budget": 3000 },
14
- { "metric": "cumulative-layout-shift", "budget": 0.1 }
15
- ]
16
- }
17
- ]
@@ -1,23 +0,0 @@
1
- {
2
- "ci": {
3
- "collect": {
4
- "staticDistDir": "./dist",
5
- "numberOfRuns": 3,
6
- "settings": {
7
- "preset": "desktop",
8
- "budgetPath": "./lighthouse-budget.json"
9
- }
10
- },
11
- "assert": {
12
- "assertions": {
13
- "categories:performance": ["warn", { "minScore": 0.9 }],
14
- "categories:accessibility": ["warn", { "minScore": 0.9 }],
15
- "categories:best-practices": ["warn", { "minScore": 0.9 }],
16
- "categories:seo": ["warn", { "minScore": 0.9 }]
17
- }
18
- },
19
- "upload": {
20
- "target": "temporary-public-storage"
21
- }
22
- }
23
- }
File without changes
File without changes