@react-spa-scaffold/mcp 1.1.3 → 1.2.1
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/README.md +19 -15
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +35 -0
- package/dist/constants.js.map +1 -0
- package/dist/features/definitions/api.d.ts +3 -0
- package/dist/features/definitions/api.d.ts.map +1 -0
- package/dist/features/definitions/api.js +20 -0
- package/dist/features/definitions/api.js.map +1 -0
- package/dist/features/definitions/ci.d.ts +3 -0
- package/dist/features/definitions/ci.d.ts.map +1 -0
- package/dist/features/definitions/ci.js +25 -0
- package/dist/features/definitions/ci.js.map +1 -0
- package/dist/features/definitions/core.d.ts +3 -0
- package/dist/features/definitions/core.d.ts.map +1 -0
- package/dist/features/definitions/core.js +76 -0
- package/dist/features/definitions/core.js.map +1 -0
- package/dist/features/definitions/devtools.d.ts +3 -0
- package/dist/features/definitions/devtools.d.ts.map +1 -0
- package/dist/features/definitions/devtools.js +53 -0
- package/dist/features/definitions/devtools.js.map +1 -0
- package/dist/features/definitions/forms.d.ts +3 -0
- package/dist/features/definitions/forms.d.ts.map +1 -0
- package/dist/features/definitions/forms.js +32 -0
- package/dist/features/definitions/forms.js.map +1 -0
- package/dist/features/definitions/i18n.d.ts +3 -0
- package/dist/features/definitions/i18n.d.ts.map +1 -0
- package/dist/features/definitions/i18n.js +50 -0
- package/dist/features/definitions/i18n.js.map +1 -0
- package/dist/features/definitions/index.d.ts +15 -0
- package/dist/features/definitions/index.d.ts.map +1 -0
- package/dist/features/definitions/index.js +15 -0
- package/dist/features/definitions/index.js.map +1 -0
- package/dist/features/definitions/mobile.d.ts +3 -0
- package/dist/features/definitions/mobile.d.ts.map +1 -0
- package/dist/features/definitions/mobile.js +19 -0
- package/dist/features/definitions/mobile.js.map +1 -0
- package/dist/features/definitions/observability.d.ts +3 -0
- package/dist/features/definitions/observability.d.ts.map +1 -0
- package/dist/features/definitions/observability.js +21 -0
- package/dist/features/definitions/observability.js.map +1 -0
- package/dist/features/definitions/performance.d.ts +3 -0
- package/dist/features/definitions/performance.d.ts.map +1 -0
- package/dist/features/definitions/performance.js +28 -0
- package/dist/features/definitions/performance.js.map +1 -0
- package/dist/features/definitions/routing.d.ts +3 -0
- package/dist/features/definitions/routing.d.ts.map +1 -0
- package/dist/features/definitions/routing.js +25 -0
- package/dist/features/definitions/routing.js.map +1 -0
- package/dist/features/definitions/state.d.ts +3 -0
- package/dist/features/definitions/state.d.ts.map +1 -0
- package/dist/features/definitions/state.js +27 -0
- package/dist/features/definitions/state.js.map +1 -0
- package/dist/features/definitions/testing.d.ts +3 -0
- package/dist/features/definitions/testing.d.ts.map +1 -0
- package/dist/features/definitions/testing.js +56 -0
- package/dist/features/definitions/testing.js.map +1 -0
- package/dist/features/definitions/theming.d.ts +3 -0
- package/dist/features/definitions/theming.d.ts.map +1 -0
- package/dist/features/definitions/theming.js +27 -0
- package/dist/features/definitions/theming.js.map +1 -0
- package/dist/features/definitions/ui.d.ts +3 -0
- package/dist/features/definitions/ui.d.ts.map +1 -0
- package/dist/features/definitions/ui.js +44 -0
- package/dist/features/definitions/ui.js.map +1 -0
- package/dist/features/index.d.ts +3 -2
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +2 -1
- package/dist/features/index.js.map +1 -1
- package/dist/features/registry.d.ts +3 -9
- package/dist/features/registry.d.ts.map +1 -1
- package/dist/features/registry.js +3 -554
- package/dist/features/registry.js.map +1 -1
- package/dist/features/types.d.ts +17 -20
- package/dist/features/types.d.ts.map +1 -1
- package/dist/features/types.js +7 -1
- package/dist/features/types.js.map +1 -1
- package/dist/features/types.test.d.ts +5 -0
- package/dist/features/types.test.d.ts.map +1 -0
- package/dist/features/types.test.js +32 -0
- package/dist/features/types.test.js.map +1 -0
- package/dist/resources/docs.d.ts +2 -8
- package/dist/resources/docs.d.ts.map +1 -1
- package/dist/resources/docs.js +27 -49
- package/dist/resources/docs.js.map +1 -1
- package/dist/server.d.ts +2 -7
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +24 -57
- package/dist/server.js.map +1 -1
- package/dist/server.test.d.ts +2 -0
- package/dist/server.test.d.ts.map +1 -0
- package/dist/server.test.js +14 -0
- package/dist/server.test.js.map +1 -0
- package/dist/tools/get-example.d.ts +4 -15
- package/dist/tools/get-example.d.ts.map +1 -1
- package/dist/tools/get-example.js +3 -11
- package/dist/tools/get-example.js.map +1 -1
- package/dist/tools/get-example.test.d.ts +5 -0
- package/dist/tools/get-example.test.d.ts.map +1 -0
- package/dist/tools/get-example.test.js +63 -0
- package/dist/tools/get-example.test.js.map +1 -0
- package/dist/tools/get-features.d.ts +15 -14
- package/dist/tools/get-features.d.ts.map +1 -1
- package/dist/tools/get-features.js +12 -2
- package/dist/tools/get-features.js.map +1 -1
- package/dist/tools/get-features.test.d.ts +5 -0
- package/dist/tools/get-features.test.d.ts.map +1 -0
- package/dist/tools/get-features.test.js +45 -0
- package/dist/tools/get-features.test.js.map +1 -0
- package/dist/tools/get-file.d.ts +23 -0
- package/dist/tools/get-file.d.ts.map +1 -0
- package/dist/tools/get-file.js +53 -0
- package/dist/tools/get-file.js.map +1 -0
- package/dist/tools/get-file.test.d.ts +5 -0
- package/dist/tools/get-file.test.d.ts.map +1 -0
- package/dist/tools/get-file.test.js +63 -0
- package/dist/tools/get-file.test.js.map +1 -0
- package/dist/tools/get-scaffold.d.ts +8 -29
- package/dist/tools/get-scaffold.d.ts.map +1 -1
- package/dist/tools/get-scaffold.js +18 -24
- package/dist/tools/get-scaffold.js.map +1 -1
- package/dist/tools/get-scaffold.test.d.ts +5 -0
- package/dist/tools/get-scaffold.test.d.ts.map +1 -0
- package/dist/tools/get-scaffold.test.js +197 -0
- package/dist/tools/get-scaffold.test.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/registry.d.ts +13 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +47 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +41 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +8 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/utils/cache.d.ts +25 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +61 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/docs.d.ts +1 -3
- package/dist/utils/docs.d.ts.map +1 -1
- package/dist/utils/docs.js +3 -8
- package/dist/utils/docs.js.map +1 -1
- package/dist/utils/docs.test.d.ts +5 -0
- package/dist/utils/docs.test.d.ts.map +1 -0
- package/dist/utils/docs.test.js +37 -0
- package/dist/utils/docs.test.js.map +1 -0
- package/dist/utils/errors.d.ts +8 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +19 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/examples/api-patterns.d.ts +3 -0
- package/dist/utils/examples/api-patterns.d.ts.map +1 -0
- package/dist/utils/examples/api-patterns.js +19 -0
- package/dist/utils/examples/api-patterns.js.map +1 -0
- package/dist/utils/examples/component-patterns.d.ts +3 -0
- package/dist/utils/examples/component-patterns.d.ts.map +1 -0
- package/dist/utils/examples/component-patterns.js +71 -0
- package/dist/utils/examples/component-patterns.js.map +1 -0
- package/dist/utils/examples/context-patterns.d.ts +3 -0
- package/dist/utils/examples/context-patterns.d.ts.map +1 -0
- package/dist/utils/examples/context-patterns.js +32 -0
- package/dist/utils/examples/context-patterns.js.map +1 -0
- package/dist/utils/examples/hook-patterns.d.ts +3 -0
- package/dist/utils/examples/hook-patterns.d.ts.map +1 -0
- package/dist/utils/examples/hook-patterns.js +55 -0
- package/dist/utils/examples/hook-patterns.js.map +1 -0
- package/dist/utils/examples/i18n-patterns.d.ts +3 -0
- package/dist/utils/examples/i18n-patterns.d.ts.map +1 -0
- package/dist/utils/examples/i18n-patterns.js +43 -0
- package/dist/utils/examples/i18n-patterns.js.map +1 -0
- package/dist/utils/examples/index.d.ts +12 -0
- package/dist/utils/examples/index.d.ts.map +1 -0
- package/dist/utils/examples/index.js +65 -0
- package/dist/utils/examples/index.js.map +1 -0
- package/dist/utils/examples/mobile-patterns.d.ts +3 -0
- package/dist/utils/examples/mobile-patterns.d.ts.map +1 -0
- package/dist/utils/examples/mobile-patterns.js +38 -0
- package/dist/utils/examples/mobile-patterns.js.map +1 -0
- package/dist/utils/examples/page-patterns.d.ts +3 -0
- package/dist/utils/examples/page-patterns.d.ts.map +1 -0
- package/dist/utils/examples/page-patterns.js +34 -0
- package/dist/utils/examples/page-patterns.js.map +1 -0
- package/dist/utils/examples/patterns.test.d.ts +6 -0
- package/dist/utils/examples/patterns.test.d.ts.map +1 -0
- package/dist/utils/examples/patterns.test.js +75 -0
- package/dist/utils/examples/patterns.test.js.map +1 -0
- package/dist/utils/examples/store-patterns.d.ts +3 -0
- package/dist/utils/examples/store-patterns.d.ts.map +1 -0
- package/dist/utils/examples/store-patterns.js +40 -0
- package/dist/utils/examples/store-patterns.js.map +1 -0
- package/dist/utils/examples/test-patterns.d.ts +3 -0
- package/dist/utils/examples/test-patterns.d.ts.map +1 -0
- package/dist/utils/examples/test-patterns.js +58 -0
- package/dist/utils/examples/test-patterns.js.map +1 -0
- package/dist/utils/examples/types.d.ts +17 -0
- package/dist/utils/examples/types.d.ts.map +1 -0
- package/dist/utils/examples/types.js +2 -0
- package/dist/utils/examples/types.js.map +1 -0
- package/dist/utils/examples/utility-patterns.d.ts +3 -0
- package/dist/utils/examples/utility-patterns.d.ts.map +1 -0
- package/dist/utils/examples/utility-patterns.js +77 -0
- package/dist/utils/examples/utility-patterns.js.map +1 -0
- package/dist/utils/index.d.ts +5 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/paths.d.ts +13 -23
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +28 -39
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/paths.test.d.ts +2 -0
- package/dist/utils/paths.test.d.ts.map +1 -0
- package/dist/utils/paths.test.js +38 -0
- package/dist/utils/paths.test.js.map +1 -0
- package/dist/utils/scaffold/claude-md/index.d.ts +7 -0
- package/dist/utils/scaffold/claude-md/index.d.ts.map +1 -0
- package/dist/utils/scaffold/claude-md/index.js +23 -0
- package/dist/utils/scaffold/claude-md/index.js.map +1 -0
- package/dist/utils/scaffold/claude-md/sections.d.ts +16 -0
- package/dist/utils/scaffold/claude-md/sections.d.ts.map +1 -0
- package/dist/utils/scaffold/claude-md/sections.js +269 -0
- package/dist/utils/scaffold/claude-md/sections.js.map +1 -0
- package/dist/utils/scaffold/commands.d.ts +7 -0
- package/dist/utils/scaffold/commands.d.ts.map +1 -0
- package/dist/utils/scaffold/commands.js +19 -0
- package/dist/utils/scaffold/commands.js.map +1 -0
- package/dist/utils/scaffold/compute.d.ts +15 -0
- package/dist/utils/scaffold/compute.d.ts.map +1 -0
- package/dist/utils/scaffold/compute.js +63 -0
- package/dist/utils/scaffold/compute.js.map +1 -0
- package/dist/utils/scaffold/dependencies.d.ts +25 -0
- package/dist/utils/scaffold/dependencies.d.ts.map +1 -0
- package/dist/utils/scaffold/dependencies.js +101 -0
- package/dist/utils/scaffold/dependencies.js.map +1 -0
- package/dist/utils/scaffold/file-structure.d.ts +23 -0
- package/dist/utils/scaffold/file-structure.d.ts.map +1 -0
- package/dist/utils/scaffold/file-structure.js +62 -0
- package/dist/utils/scaffold/file-structure.js.map +1 -0
- package/dist/utils/scaffold/generators.d.ts +9 -0
- package/dist/utils/scaffold/generators.d.ts.map +1 -0
- package/dist/utils/scaffold/generators.js +121 -0
- package/dist/utils/scaffold/generators.js.map +1 -0
- package/dist/utils/scaffold/index.d.ts +10 -0
- package/dist/utils/scaffold/index.d.ts.map +1 -0
- package/dist/utils/scaffold/index.js +9 -0
- package/dist/utils/scaffold/index.js.map +1 -0
- package/package.json +2 -2
- package/templates/.github/workflows/release.yml +1 -1
- package/templates/e2e/tests/home.spec.ts +2 -2
- package/templates/e2e/tests/language.spec.ts +7 -3
- package/dist/utils/examples.d.ts +0 -27
- package/dist/utils/examples.d.ts.map +0 -1
- package/dist/utils/examples.js +0 -438
- package/dist/utils/examples.js.map +0 -1
- package/dist/utils/scaffold.d.ts +0 -59
- package/dist/utils/scaffold.d.ts.map +0 -1
- package/dist/utils/scaffold.js +0 -637
- package/dist/utils/scaffold.js.map +0 -1
package/dist/utils/examples.js
DELETED
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code example utilities
|
|
3
|
-
*
|
|
4
|
-
* Maps pattern types to actual files in the react-spa-scaffold repository.
|
|
5
|
-
* When the MCP server runs, it reads these files to provide real,
|
|
6
|
-
* working examples to AI agents.
|
|
7
|
-
*/
|
|
8
|
-
import { readFile } from 'fs/promises';
|
|
9
|
-
import { resolveTemplatePath } from './paths.js';
|
|
10
|
-
/**
|
|
11
|
-
* Pattern to file mapping
|
|
12
|
-
*/
|
|
13
|
-
const PATTERN_MAP = {
|
|
14
|
-
// Component patterns
|
|
15
|
-
'component-ui': {
|
|
16
|
-
file: 'src/components/ui/button.tsx',
|
|
17
|
-
description: 'Shadcn/UI component with CVA variants and forwardRef',
|
|
18
|
-
keyPoints: [
|
|
19
|
-
'Uses forwardRef for ref forwarding',
|
|
20
|
-
'CVA (class-variance-authority) for style variants',
|
|
21
|
-
'cn() utility for class merging',
|
|
22
|
-
'Named export (not default)',
|
|
23
|
-
'Props interface extends HTML attributes + VariantProps',
|
|
24
|
-
'Radix Slot for polymorphic "asChild" prop',
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
'component-shared': {
|
|
28
|
-
file: 'src/components/shared/ThemeToggle/ThemeToggle.tsx',
|
|
29
|
-
description: 'Shared feature component with store integration',
|
|
30
|
-
keyPoints: [
|
|
31
|
-
'Named function export',
|
|
32
|
-
'Located in subdirectory with index.ts barrel',
|
|
33
|
-
'Uses Zustand store with selectors',
|
|
34
|
-
'Integrates with Lingui i18n (t() function)',
|
|
35
|
-
'Composes UI components (Button, icons)',
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
'component-layout': {
|
|
39
|
-
file: 'src/components/layout/Header.tsx',
|
|
40
|
-
description: 'Layout component for page structure',
|
|
41
|
-
keyPoints: [
|
|
42
|
-
'Named function export',
|
|
43
|
-
'Uses Tailwind container pattern',
|
|
44
|
-
'Composes shared components',
|
|
45
|
-
'Trans component for i18n text',
|
|
46
|
-
'No props (stateless layout)',
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
// Hook patterns
|
|
50
|
-
'hook-state': {
|
|
51
|
-
file: 'src/hooks/useMediaQuery.ts',
|
|
52
|
-
description: 'State hook with browser API and cleanup',
|
|
53
|
-
keyPoints: [
|
|
54
|
-
'useRef for persistent MediaQueryList',
|
|
55
|
-
'useState with SSR-safe initialization',
|
|
56
|
-
'useEffect with cleanup function',
|
|
57
|
-
'Exports constants alongside hook (BREAKPOINTS)',
|
|
58
|
-
'Convenience wrapper hooks (useIsMobile, useIsDesktop)',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
'hook-query': {
|
|
62
|
-
file: 'src/hooks/useExampleQuery.ts',
|
|
63
|
-
description: 'TanStack Query hook for data fetching',
|
|
64
|
-
keyPoints: [
|
|
65
|
-
'Separate async fetchFn outside hook',
|
|
66
|
-
'Typed with generics (useQuery<Todo[]>)',
|
|
67
|
-
'Namespaced queryKey array',
|
|
68
|
-
'Uses centralized API client',
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
'hook-form': {
|
|
72
|
-
file: 'src/hooks/useRegisterForm.ts',
|
|
73
|
-
description: 'React Hook Form + Zod validation hook',
|
|
74
|
-
keyPoints: [
|
|
75
|
-
'zodResolver for Zod integration',
|
|
76
|
-
'Type-safe with inferred RegisterFormData',
|
|
77
|
-
'Returns form object + handlers + reset',
|
|
78
|
-
'Extracts commonly used state (isSubmitting, errors)',
|
|
79
|
-
'Uses schema with refine() for cross-field validation',
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
'hook-effect': {
|
|
83
|
-
file: 'src/hooks/useThemeEffect.ts',
|
|
84
|
-
description: 'Effect-only hook with no return value',
|
|
85
|
-
keyPoints: [
|
|
86
|
-
'useEffect with conditional listener',
|
|
87
|
-
'Zustand store subscription',
|
|
88
|
-
'Cleanup function for event listener',
|
|
89
|
-
'DOM manipulation (classList)',
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
'use-language-hook': {
|
|
93
|
-
file: 'src/hooks/useLanguage.ts',
|
|
94
|
-
description: 'Hook for language/locale management',
|
|
95
|
-
keyPoints: [
|
|
96
|
-
'Integrates with Lingui i18n',
|
|
97
|
-
'useCallback for memoized async function',
|
|
98
|
-
'Persists to localStorage',
|
|
99
|
-
'Returns object with state + action',
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
// Mobile patterns
|
|
103
|
-
'mobile-context': {
|
|
104
|
-
file: 'src/contexts/mobileContext.tsx',
|
|
105
|
-
description: 'Mobile viewport detection context with optimized resize handling',
|
|
106
|
-
keyPoints: [
|
|
107
|
-
'MobileProvider tracks viewport width via window.innerWidth',
|
|
108
|
-
'useMobileContext hook returns isMobile, isTablet, isDesktop, width',
|
|
109
|
-
'requestAnimationFrame debouncing for performance',
|
|
110
|
-
'Only re-renders when width actually changes',
|
|
111
|
-
'SSR-safe with BREAKPOINTS.lg fallback',
|
|
112
|
-
'Throws error when used outside provider',
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
'use-media-query': {
|
|
116
|
-
file: 'src/hooks/useMediaQuery.ts',
|
|
117
|
-
description: 'Media query hook with breakpoint constants',
|
|
118
|
-
keyPoints: [
|
|
119
|
-
'BREAKPOINTS: sm (640), md (768), lg (1024), xl (1280)',
|
|
120
|
-
'useMediaQuery(query) for custom media queries',
|
|
121
|
-
'useIsMobile() returns true if width < md breakpoint',
|
|
122
|
-
'useIsDesktop() returns true if width >= lg breakpoint',
|
|
123
|
-
'Uses useRef to persist MediaQueryList object',
|
|
124
|
-
'SSR-safe initialization',
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
'use-touch-sizes': {
|
|
128
|
-
file: 'src/hooks/useTouchSizes.ts',
|
|
129
|
-
description: 'Touch-aware component sizing hook',
|
|
130
|
-
keyPoints: [
|
|
131
|
-
'Returns size variants based on device type (mobile vs desktop)',
|
|
132
|
-
'Integrates with MobileProvider via useMobileContext',
|
|
133
|
-
'Provides: button, buttonSm, iconButton, iconButtonLg, input, select, toggle, textarea',
|
|
134
|
-
'Mobile uses "touch" variants for larger tap targets',
|
|
135
|
-
'Desktop uses "default" or smaller variants',
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
// Store patterns
|
|
139
|
-
'zustand-store': {
|
|
140
|
-
file: 'src/stores/preferencesStore.ts',
|
|
141
|
-
description: 'Zustand store with persistence and devtools',
|
|
142
|
-
keyPoints: [
|
|
143
|
-
'Separate type and interface definitions',
|
|
144
|
-
'Middleware stack: devtools(persist(...))',
|
|
145
|
-
'partialize for selective persistence',
|
|
146
|
-
'Computed getter (getResolvedTheme)',
|
|
147
|
-
'reset() action for initial state',
|
|
148
|
-
'Multi-tab sync function export',
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
// Page patterns
|
|
152
|
-
'page-component': {
|
|
153
|
-
file: 'src/pages/Home.tsx',
|
|
154
|
-
description: 'Page component with i18n and SEO',
|
|
155
|
-
keyPoints: [
|
|
156
|
-
'Named export (PageNamePage convention)',
|
|
157
|
-
'SEO component for page-specific meta tags',
|
|
158
|
-
'Trans component for all user text',
|
|
159
|
-
'Container layout classes',
|
|
160
|
-
'Minimal logic (pages are thin)',
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
'lazy-page': {
|
|
164
|
-
file: 'src/App.tsx',
|
|
165
|
-
description: 'Lazy loading pattern for pages with default SEO',
|
|
166
|
-
keyPoints: [
|
|
167
|
-
'React.lazy() with dynamic import',
|
|
168
|
-
'Transform named to default: .then(m => ({ default: m.PageName }))',
|
|
169
|
-
'Suspense boundary with fallback',
|
|
170
|
-
'Route constants from lib/routes.ts',
|
|
171
|
-
'Default SEO component for site-wide meta tags',
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
// Context patterns
|
|
175
|
-
'context-provider': {
|
|
176
|
-
file: 'src/contexts/mobileContext.tsx',
|
|
177
|
-
description: 'React Context with provider and hook',
|
|
178
|
-
keyPoints: [
|
|
179
|
-
'Separate Context and Provider',
|
|
180
|
-
'useMemo for context value',
|
|
181
|
-
'Custom hook with error if outside provider',
|
|
182
|
-
'useEffect with resize listener',
|
|
183
|
-
'requestAnimationFrame for debouncing',
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
'query-provider': {
|
|
187
|
-
file: 'src/contexts/queryContext.tsx',
|
|
188
|
-
description: 'TanStack Query provider setup',
|
|
189
|
-
keyPoints: [
|
|
190
|
-
'QueryClient with default options',
|
|
191
|
-
'staleTime, gcTime, retry configuration',
|
|
192
|
-
'QueryClientProvider wrapper',
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
// API patterns
|
|
196
|
-
'api-client': {
|
|
197
|
-
file: 'src/lib/api.ts',
|
|
198
|
-
description: 'Typed API client with error handling',
|
|
199
|
-
keyPoints: [
|
|
200
|
-
'Custom ApiClientError class',
|
|
201
|
-
'Generic request function',
|
|
202
|
-
'AbortController for timeout',
|
|
203
|
-
'Error parsing from response JSON',
|
|
204
|
-
'Methods object (get, post, put, patch, delete)',
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
// Test patterns (co-located with source files)
|
|
208
|
-
'test-component': {
|
|
209
|
-
file: 'src/components/layout/Header.test.tsx',
|
|
210
|
-
description: 'Component test with Testing Library',
|
|
211
|
-
keyPoints: [
|
|
212
|
-
'Import from vitest (describe, it, expect)',
|
|
213
|
-
'Custom render from @/test',
|
|
214
|
-
'screen queries (getByRole, getByText)',
|
|
215
|
-
'Semantic role assertions',
|
|
216
|
-
'Co-located with component source file',
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
'test-hook': {
|
|
220
|
-
file: 'src/hooks/useMediaQuery.test.ts',
|
|
221
|
-
description: 'Hook test with renderHook',
|
|
222
|
-
keyPoints: [
|
|
223
|
-
'renderHook from Testing Library',
|
|
224
|
-
'mockMatchMedia utility',
|
|
225
|
-
'beforeEach for setup',
|
|
226
|
-
'it.each for parameterized tests',
|
|
227
|
-
'act() for state updates',
|
|
228
|
-
'Co-located with hook source file',
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
'test-store': {
|
|
232
|
-
file: 'src/stores/preferencesStore.test.ts',
|
|
233
|
-
description: 'Zustand store test',
|
|
234
|
-
keyPoints: [
|
|
235
|
-
'Direct store access: useStore.getState()',
|
|
236
|
-
'act() wrapper for state changes',
|
|
237
|
-
'Reset state in beforeEach',
|
|
238
|
-
'Test actions and computed values',
|
|
239
|
-
'Co-located with store source file',
|
|
240
|
-
],
|
|
241
|
-
},
|
|
242
|
-
'msw-handler': {
|
|
243
|
-
file: 'src/mocks/handlers/todos.ts',
|
|
244
|
-
description: 'MSW request handler',
|
|
245
|
-
keyPoints: [
|
|
246
|
-
'http.get/post from msw',
|
|
247
|
-
'HttpResponse.json() for responses',
|
|
248
|
-
'URL parameter extraction',
|
|
249
|
-
'delay() for realistic timing',
|
|
250
|
-
'Error responses with status codes',
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
// Validation patterns
|
|
254
|
-
'zod-schema': {
|
|
255
|
-
file: 'src/lib/validations.ts',
|
|
256
|
-
description: 'Zod validation schemas with type inference',
|
|
257
|
-
keyPoints: [
|
|
258
|
-
'z.object() for form schemas',
|
|
259
|
-
'Chained validations (min, max, email, regex)',
|
|
260
|
-
'Custom error messages',
|
|
261
|
-
'Type inference with z.infer<>',
|
|
262
|
-
'refine() for cross-field validation (password confirmation)',
|
|
263
|
-
],
|
|
264
|
-
},
|
|
265
|
-
// i18n patterns
|
|
266
|
-
'i18n-index': {
|
|
267
|
-
file: 'src/i18n/index.ts',
|
|
268
|
-
description: 'i18n barrel export with initialization functions',
|
|
269
|
-
keyPoints: [
|
|
270
|
-
'Re-exports i18n instance from @lingui/core',
|
|
271
|
-
'initI18n() async function for app initialization',
|
|
272
|
-
'getLocale() returns current active locale',
|
|
273
|
-
'Re-exports config, detectLanguage, and dynamicActivate',
|
|
274
|
-
],
|
|
275
|
-
},
|
|
276
|
-
'trans-component': {
|
|
277
|
-
file: 'src/components/layout/Header.tsx',
|
|
278
|
-
description: 'Trans component usage for JSX text',
|
|
279
|
-
keyPoints: [
|
|
280
|
-
'Import from @lingui/react/macro',
|
|
281
|
-
'comment prop is REQUIRED (ESLint enforced)',
|
|
282
|
-
'Wraps user-visible text',
|
|
283
|
-
'Can contain JSX children',
|
|
284
|
-
],
|
|
285
|
-
},
|
|
286
|
-
't-function': {
|
|
287
|
-
file: 'src/components/shared/ThemeToggle/ThemeToggle.tsx',
|
|
288
|
-
description: 't() function for programmatic text',
|
|
289
|
-
keyPoints: [
|
|
290
|
-
'useLingui() hook for t function',
|
|
291
|
-
'Object syntax: t({ message, comment })',
|
|
292
|
-
'comment is REQUIRED',
|
|
293
|
-
'Use for dynamic text, attributes',
|
|
294
|
-
],
|
|
295
|
-
},
|
|
296
|
-
'language-switcher': {
|
|
297
|
-
file: 'src/components/shared/LanguageSwitcher/LanguageSwitcher.tsx',
|
|
298
|
-
description: 'Language selection component',
|
|
299
|
-
keyPoints: [
|
|
300
|
-
'useLanguage() hook',
|
|
301
|
-
'DropdownMenu for selection',
|
|
302
|
-
'supportedLocales array',
|
|
303
|
-
'changeLanguage async function',
|
|
304
|
-
],
|
|
305
|
-
},
|
|
306
|
-
// Utility patterns
|
|
307
|
-
'storage-utility': {
|
|
308
|
-
file: 'src/lib/storage.ts',
|
|
309
|
-
description: 'Type-safe localStorage utilities',
|
|
310
|
-
keyPoints: [
|
|
311
|
-
'SSR-safe (typeof window check)',
|
|
312
|
-
'JSON serialization',
|
|
313
|
-
'Generic type parameter',
|
|
314
|
-
'Error handling with fallback',
|
|
315
|
-
'clearAppStorage for all prefixed keys',
|
|
316
|
-
],
|
|
317
|
-
},
|
|
318
|
-
// Form error patterns
|
|
319
|
-
'form-error-component': {
|
|
320
|
-
file: 'src/components/ui/form-error.tsx',
|
|
321
|
-
description: 'Form error display components',
|
|
322
|
-
keyPoints: [
|
|
323
|
-
'FieldErrorMessage for single field',
|
|
324
|
-
'FormErrorSummary for all errors',
|
|
325
|
-
'RootFormError for form-level errors',
|
|
326
|
-
'Integrates with react-hook-form types',
|
|
327
|
-
],
|
|
328
|
-
},
|
|
329
|
-
// Form component patterns
|
|
330
|
-
'register-form': {
|
|
331
|
-
file: 'src/components/shared/RegisterForm/RegisterForm.tsx',
|
|
332
|
-
description: 'Complete form component with validation',
|
|
333
|
-
keyPoints: [
|
|
334
|
-
'Uses useRegisterForm custom hook',
|
|
335
|
-
'Inline error display with FieldErrorMessage',
|
|
336
|
-
'form.register() for input binding',
|
|
337
|
-
'Disabled submit during isSubmitting',
|
|
338
|
-
'Lingui Trans for i18n labels',
|
|
339
|
-
'Demonstrates cross-field validation UX',
|
|
340
|
-
],
|
|
341
|
-
},
|
|
342
|
-
// Theme patterns
|
|
343
|
-
'theme-toggle': {
|
|
344
|
-
file: 'src/components/shared/ThemeToggle/ThemeToggle.tsx',
|
|
345
|
-
description: 'Theme toggle with system preference',
|
|
346
|
-
keyPoints: [
|
|
347
|
-
'Three modes: light, dark, system',
|
|
348
|
-
'Zustand store for persistence',
|
|
349
|
-
'getResolvedTheme() for actual value',
|
|
350
|
-
'Icon changes based on resolved theme',
|
|
351
|
-
],
|
|
352
|
-
},
|
|
353
|
-
// SEO patterns
|
|
354
|
-
'seo-component': {
|
|
355
|
-
file: 'src/components/shared/SEO/SEO.tsx',
|
|
356
|
-
description: 'SEO meta tags component (React 19)',
|
|
357
|
-
keyPoints: [
|
|
358
|
-
'React 19 native head hoisting',
|
|
359
|
-
'title, meta, link in JSX',
|
|
360
|
-
'Open Graph tags',
|
|
361
|
-
'Twitter Card tags',
|
|
362
|
-
'Conditional rendering for optional tags',
|
|
363
|
-
],
|
|
364
|
-
},
|
|
365
|
-
// Entry point patterns
|
|
366
|
-
'main-entry': {
|
|
367
|
-
file: 'src/main.tsx',
|
|
368
|
-
description: 'Application entry point with Sentry initialization',
|
|
369
|
-
keyPoints: [
|
|
370
|
-
'Lazy Sentry initialization with requestIdleCallback for web vitals',
|
|
371
|
-
'Global error handlers (window.onerror, onunhandledrejection)',
|
|
372
|
-
'i18n initialization before render',
|
|
373
|
-
'Provider hierarchy: Query → I18n → Router → Mobile → ErrorBoundary',
|
|
374
|
-
'Multi-tab preferences sync with HMR cleanup',
|
|
375
|
-
],
|
|
376
|
-
},
|
|
377
|
-
// Config patterns
|
|
378
|
-
'lib-config': {
|
|
379
|
-
file: 'src/lib/config.ts',
|
|
380
|
-
description: 'Centralized application configuration',
|
|
381
|
-
keyPoints: [
|
|
382
|
-
'APP_CONFIG for app name and URL',
|
|
383
|
-
'SENTRY_CONFIG with enabled flag, DSN, and tracesSampleRate',
|
|
384
|
-
'Environment variables with fallback defaults',
|
|
385
|
-
'as const for type inference',
|
|
386
|
-
],
|
|
387
|
-
},
|
|
388
|
-
};
|
|
389
|
-
/**
|
|
390
|
-
* Get available pattern types
|
|
391
|
-
*/
|
|
392
|
-
export function getAvailablePatterns() {
|
|
393
|
-
return Object.keys(PATTERN_MAP).sort();
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Get code example for a pattern
|
|
397
|
-
*/
|
|
398
|
-
export async function getCodeExample(pattern) {
|
|
399
|
-
const mapping = PATTERN_MAP[pattern];
|
|
400
|
-
if (!mapping) {
|
|
401
|
-
return null;
|
|
402
|
-
}
|
|
403
|
-
const fullPath = resolveTemplatePath(mapping.file);
|
|
404
|
-
try {
|
|
405
|
-
const code = await readFile(fullPath, 'utf-8');
|
|
406
|
-
return {
|
|
407
|
-
pattern,
|
|
408
|
-
description: mapping.description,
|
|
409
|
-
filePath: mapping.file,
|
|
410
|
-
code,
|
|
411
|
-
keyPoints: mapping.keyPoints,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
catch {
|
|
415
|
-
// File might not exist if running outside react-spa-scaffold
|
|
416
|
-
return {
|
|
417
|
-
pattern,
|
|
418
|
-
description: mapping.description,
|
|
419
|
-
filePath: mapping.file,
|
|
420
|
-
code: `// File not found: ${mapping.file}\n// Run MCP server from within react-spa-scaffold repository`,
|
|
421
|
-
keyPoints: mapping.keyPoints,
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Get all examples for a feature's patterns
|
|
427
|
-
*/
|
|
428
|
-
export async function getFeatureExamples(patterns) {
|
|
429
|
-
const examples = [];
|
|
430
|
-
for (const pattern of patterns) {
|
|
431
|
-
const example = await getCodeExample(pattern);
|
|
432
|
-
if (example) {
|
|
433
|
-
examples.push(example);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
return examples;
|
|
437
|
-
}
|
|
438
|
-
//# sourceMappingURL=examples.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"examples.js","sourceRoot":"","sources":["../../src/utils/examples.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAUjD;;GAEG;AACH,MAAM,WAAW,GAOb;IACF,qBAAqB;IACrB,cAAc,EAAE;QACd,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,sDAAsD;QACnE,SAAS,EAAE;YACT,oCAAoC;YACpC,mDAAmD;YACnD,gCAAgC;YAChC,4BAA4B;YAC5B,wDAAwD;YACxD,2CAA2C;SAC5C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,OAAO;YACP,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;QAC7D,OAAO;YACL,OAAO;YACP,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,IAAI,EAAE,sBAAsB,OAAO,CAAC,IAAI,+DAA+D;YACvG,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,QAAkB;IACzD,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,OAAO,EAAE,CAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/utils/scaffold.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { ScaffoldResult } from '../features/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve selected features (always includes core)
|
|
4
|
-
*
|
|
5
|
-
* Features are mostly independent, with one exception:
|
|
6
|
-
* - theming requires state feature (for Zustand persistence)
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolveFeatureDependencies(selectedFeatures: string[]): string[];
|
|
9
|
-
/**
|
|
10
|
-
* Merge dependencies from multiple features
|
|
11
|
-
*
|
|
12
|
-
* Resolves package versions from the source package.json at runtime.
|
|
13
|
-
* This ensures scaffolded projects always use up-to-date dependency versions.
|
|
14
|
-
*/
|
|
15
|
-
export declare function mergeDependencies(featureIds: string[]): Promise<{
|
|
16
|
-
dependencies: Record<string, string>;
|
|
17
|
-
devDependencies: Record<string, string>;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Merge scripts from multiple features
|
|
21
|
-
*/
|
|
22
|
-
export declare function mergeScripts(featureIds: string[]): Record<string, string>;
|
|
23
|
-
/**
|
|
24
|
-
* Compute file structure for selected features
|
|
25
|
-
*
|
|
26
|
-
* When the 'testing' feature is selected, testFiles from all selected features
|
|
27
|
-
* are also included. This ensures scaffolded projects get tests that match
|
|
28
|
-
* their source files.
|
|
29
|
-
*/
|
|
30
|
-
export declare function computeFileStructure(featureIds: string[]): string[];
|
|
31
|
-
/**
|
|
32
|
-
* Get config files needed for selected features
|
|
33
|
-
*/
|
|
34
|
-
export declare function getConfigFiles(featureIds: string[]): string[];
|
|
35
|
-
/**
|
|
36
|
-
* Generate setup commands based on selected features
|
|
37
|
-
*/
|
|
38
|
-
export declare function getSetupCommands(featureIds: string[]): string[];
|
|
39
|
-
/**
|
|
40
|
-
* Generate CLAUDE.md content based on selected features
|
|
41
|
-
*/
|
|
42
|
-
export declare function generateClaudeMd(featureIds: string[], projectName: string, scripts: Record<string, string>): string;
|
|
43
|
-
/**
|
|
44
|
-
* Generate vite-env.d.ts content based on selected features
|
|
45
|
-
*/
|
|
46
|
-
export declare function generateViteEnvDts(featureIds: string[]): string;
|
|
47
|
-
/**
|
|
48
|
-
* Generate env.ts content based on selected features
|
|
49
|
-
*/
|
|
50
|
-
export declare function generateEnvTs(featureIds: string[]): string;
|
|
51
|
-
/**
|
|
52
|
-
* Generate routes.ts content based on selected features
|
|
53
|
-
*/
|
|
54
|
-
export declare function generateRoutesTs(_featureIds: string[]): string;
|
|
55
|
-
/**
|
|
56
|
-
* Compute complete scaffold for selected features
|
|
57
|
-
*/
|
|
58
|
-
export declare function computeScaffold(selectedFeatures: string[], projectName?: string): Promise<ScaffoldResult>;
|
|
59
|
-
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@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