@react-spa-scaffold/mcp 1.2.1 → 2.0.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 (130) hide show
  1. package/README.md +36 -123
  2. package/dist/features/definitions/api.d.ts.map +1 -1
  3. package/dist/features/definitions/api.js +0 -1
  4. package/dist/features/definitions/api.js.map +1 -1
  5. package/dist/features/definitions/ci.d.ts.map +1 -1
  6. package/dist/features/definitions/ci.js +0 -1
  7. package/dist/features/definitions/ci.js.map +1 -1
  8. package/dist/features/definitions/core.d.ts.map +1 -1
  9. package/dist/features/definitions/core.js +0 -1
  10. package/dist/features/definitions/core.js.map +1 -1
  11. package/dist/features/definitions/devtools.d.ts.map +1 -1
  12. package/dist/features/definitions/devtools.js +0 -1
  13. package/dist/features/definitions/devtools.js.map +1 -1
  14. package/dist/features/definitions/forms.d.ts.map +1 -1
  15. package/dist/features/definitions/forms.js +0 -1
  16. package/dist/features/definitions/forms.js.map +1 -1
  17. package/dist/features/definitions/i18n.d.ts.map +1 -1
  18. package/dist/features/definitions/i18n.js +0 -1
  19. package/dist/features/definitions/i18n.js.map +1 -1
  20. package/dist/features/definitions/mobile.d.ts.map +1 -1
  21. package/dist/features/definitions/mobile.js +0 -1
  22. package/dist/features/definitions/mobile.js.map +1 -1
  23. package/dist/features/definitions/observability.d.ts.map +1 -1
  24. package/dist/features/definitions/observability.js +0 -1
  25. package/dist/features/definitions/observability.js.map +1 -1
  26. package/dist/features/definitions/performance.d.ts.map +1 -1
  27. package/dist/features/definitions/performance.js +0 -1
  28. package/dist/features/definitions/performance.js.map +1 -1
  29. package/dist/features/definitions/routing.d.ts.map +1 -1
  30. package/dist/features/definitions/routing.js +0 -1
  31. package/dist/features/definitions/routing.js.map +1 -1
  32. package/dist/features/definitions/state.d.ts.map +1 -1
  33. package/dist/features/definitions/state.js +0 -1
  34. package/dist/features/definitions/state.js.map +1 -1
  35. package/dist/features/definitions/testing.d.ts.map +1 -1
  36. package/dist/features/definitions/testing.js +0 -3
  37. package/dist/features/definitions/testing.js.map +1 -1
  38. package/dist/features/definitions/theming.d.ts.map +1 -1
  39. package/dist/features/definitions/theming.js +0 -1
  40. package/dist/features/definitions/theming.js.map +1 -1
  41. package/dist/features/definitions/ui.d.ts.map +1 -1
  42. package/dist/features/definitions/ui.js +0 -1
  43. package/dist/features/definitions/ui.js.map +1 -1
  44. package/dist/features/types.d.ts +0 -1
  45. package/dist/features/types.d.ts.map +1 -1
  46. package/dist/server.js +6 -6
  47. package/dist/tools/get-file.d.ts +1 -1
  48. package/dist/tools/get-file.d.ts.map +1 -1
  49. package/dist/tools/get-file.js +12 -8
  50. package/dist/tools/get-file.js.map +1 -1
  51. package/dist/tools/get-scaffold.d.ts +3 -4
  52. package/dist/tools/get-scaffold.d.ts.map +1 -1
  53. package/dist/tools/get-scaffold.js +19 -26
  54. package/dist/tools/get-scaffold.js.map +1 -1
  55. package/dist/tools/get-scaffold.test.js +11 -7
  56. package/dist/tools/get-scaffold.test.js.map +1 -1
  57. package/dist/tools/index.d.ts +1 -1
  58. package/dist/tools/index.d.ts.map +1 -1
  59. package/dist/tools/index.js +1 -1
  60. package/dist/tools/index.js.map +1 -1
  61. package/dist/tools/registry.d.ts.map +1 -1
  62. package/dist/tools/registry.js +0 -8
  63. package/dist/tools/registry.js.map +1 -1
  64. package/dist/utils/index.d.ts +0 -1
  65. package/dist/utils/index.d.ts.map +1 -1
  66. package/dist/utils/index.js +0 -1
  67. package/dist/utils/index.js.map +1 -1
  68. package/dist/utils/scaffold/compute.js +1 -1
  69. package/dist/utils/scaffold/compute.js.map +1 -1
  70. package/package.json +1 -1
  71. package/dist/tools/get-example.d.ts +0 -38
  72. package/dist/tools/get-example.d.ts.map +0 -1
  73. package/dist/tools/get-example.js +0 -83
  74. package/dist/tools/get-example.js.map +0 -1
  75. package/dist/tools/get-example.test.d.ts +0 -5
  76. package/dist/tools/get-example.test.d.ts.map +0 -1
  77. package/dist/tools/get-example.test.js +0 -63
  78. package/dist/tools/get-example.test.js.map +0 -1
  79. package/dist/utils/examples/api-patterns.d.ts +0 -3
  80. package/dist/utils/examples/api-patterns.d.ts.map +0 -1
  81. package/dist/utils/examples/api-patterns.js +0 -19
  82. package/dist/utils/examples/api-patterns.js.map +0 -1
  83. package/dist/utils/examples/component-patterns.d.ts +0 -3
  84. package/dist/utils/examples/component-patterns.d.ts.map +0 -1
  85. package/dist/utils/examples/component-patterns.js +0 -71
  86. package/dist/utils/examples/component-patterns.js.map +0 -1
  87. package/dist/utils/examples/context-patterns.d.ts +0 -3
  88. package/dist/utils/examples/context-patterns.d.ts.map +0 -1
  89. package/dist/utils/examples/context-patterns.js +0 -32
  90. package/dist/utils/examples/context-patterns.js.map +0 -1
  91. package/dist/utils/examples/hook-patterns.d.ts +0 -3
  92. package/dist/utils/examples/hook-patterns.d.ts.map +0 -1
  93. package/dist/utils/examples/hook-patterns.js +0 -55
  94. package/dist/utils/examples/hook-patterns.js.map +0 -1
  95. package/dist/utils/examples/i18n-patterns.d.ts +0 -3
  96. package/dist/utils/examples/i18n-patterns.d.ts.map +0 -1
  97. package/dist/utils/examples/i18n-patterns.js +0 -43
  98. package/dist/utils/examples/i18n-patterns.js.map +0 -1
  99. package/dist/utils/examples/index.d.ts +0 -12
  100. package/dist/utils/examples/index.d.ts.map +0 -1
  101. package/dist/utils/examples/index.js +0 -65
  102. package/dist/utils/examples/index.js.map +0 -1
  103. package/dist/utils/examples/mobile-patterns.d.ts +0 -3
  104. package/dist/utils/examples/mobile-patterns.d.ts.map +0 -1
  105. package/dist/utils/examples/mobile-patterns.js +0 -38
  106. package/dist/utils/examples/mobile-patterns.js.map +0 -1
  107. package/dist/utils/examples/page-patterns.d.ts +0 -3
  108. package/dist/utils/examples/page-patterns.d.ts.map +0 -1
  109. package/dist/utils/examples/page-patterns.js +0 -34
  110. package/dist/utils/examples/page-patterns.js.map +0 -1
  111. package/dist/utils/examples/patterns.test.d.ts +0 -6
  112. package/dist/utils/examples/patterns.test.d.ts.map +0 -1
  113. package/dist/utils/examples/patterns.test.js +0 -75
  114. package/dist/utils/examples/patterns.test.js.map +0 -1
  115. package/dist/utils/examples/store-patterns.d.ts +0 -3
  116. package/dist/utils/examples/store-patterns.d.ts.map +0 -1
  117. package/dist/utils/examples/store-patterns.js +0 -40
  118. package/dist/utils/examples/store-patterns.js.map +0 -1
  119. package/dist/utils/examples/test-patterns.d.ts +0 -3
  120. package/dist/utils/examples/test-patterns.d.ts.map +0 -1
  121. package/dist/utils/examples/test-patterns.js +0 -58
  122. package/dist/utils/examples/test-patterns.js.map +0 -1
  123. package/dist/utils/examples/types.d.ts +0 -17
  124. package/dist/utils/examples/types.d.ts.map +0 -1
  125. package/dist/utils/examples/types.js +0 -2
  126. package/dist/utils/examples/types.js.map +0 -1
  127. package/dist/utils/examples/utility-patterns.d.ts +0 -3
  128. package/dist/utils/examples/utility-patterns.d.ts.map +0 -1
  129. package/dist/utils/examples/utility-patterns.js +0 -77
  130. package/dist/utils/examples/utility-patterns.js.map +0 -1
@@ -1,75 +0,0 @@
1
- /**
2
- * Pattern definition validation tests.
3
- * Ensures all pattern file paths exist and definitions are complete.
4
- */
5
- import { existsSync } from 'fs';
6
- import { describe, it, expect } from 'vitest';
7
- import { resolveTemplatePath } from '../paths.js';
8
- import { getAvailablePatterns, getCodeExample } from './index.js';
9
- // Import all pattern maps to test
10
- import { componentPatterns } from './component-patterns.js';
11
- import { hookPatterns } from './hook-patterns.js';
12
- import { mobilePatterns } from './mobile-patterns.js';
13
- import { storePatterns } from './store-patterns.js';
14
- import { pagePatterns } from './page-patterns.js';
15
- import { contextPatterns } from './context-patterns.js';
16
- import { apiPatterns } from './api-patterns.js';
17
- import { testPatterns } from './test-patterns.js';
18
- import { i18nPatterns } from './i18n-patterns.js';
19
- import { utilityPatterns } from './utility-patterns.js';
20
- const ALL_PATTERNS = {
21
- ...componentPatterns,
22
- ...hookPatterns,
23
- ...mobilePatterns,
24
- ...storePatterns,
25
- ...pagePatterns,
26
- ...contextPatterns,
27
- ...apiPatterns,
28
- ...testPatterns,
29
- ...i18nPatterns,
30
- ...utilityPatterns,
31
- };
32
- describe('pattern definitions', () => {
33
- const patterns = Object.entries(ALL_PATTERNS);
34
- it.each(patterns)('pattern "%s" points to existing file', (_, def) => {
35
- const fullPath = resolveTemplatePath(def.file);
36
- expect(existsSync(fullPath), `File not found: ${def.file}`).toBe(true);
37
- });
38
- it.each(patterns)('pattern "%s" has description', (_, def) => {
39
- expect(def.description).toBeTruthy();
40
- expect(def.description.length).toBeGreaterThan(10);
41
- });
42
- it.each(patterns)('pattern "%s" has keyPoints array', (_, def) => {
43
- expect(Array.isArray(def.keyPoints)).toBe(true);
44
- expect(def.keyPoints.length).toBeGreaterThan(0);
45
- });
46
- });
47
- describe('getAvailablePatterns', () => {
48
- it('returns sorted array of pattern names', () => {
49
- const patterns = getAvailablePatterns();
50
- expect(patterns.length).toBeGreaterThan(0);
51
- expect(patterns).toEqual([...patterns].sort());
52
- });
53
- it('includes all pattern categories', () => {
54
- const patterns = getAvailablePatterns();
55
- expect(patterns).toContain('component-ui');
56
- expect(patterns).toContain('hook-state');
57
- expect(patterns).toContain('zustand-store');
58
- expect(patterns).toContain('test-component');
59
- });
60
- });
61
- describe('getCodeExample', () => {
62
- it('returns null for unknown pattern', async () => {
63
- const result = await getCodeExample('non-existent-pattern');
64
- expect(result).toBeNull();
65
- });
66
- it('returns complete example for valid pattern', async () => {
67
- const result = await getCodeExample('component-ui');
68
- expect(result).not.toBeNull();
69
- expect(result?.pattern).toBe('component-ui');
70
- expect(result?.code).toBeTruthy();
71
- expect(result?.description).toBeTruthy();
72
- expect(result?.keyPoints.length).toBeGreaterThan(0);
73
- });
74
- });
75
- //# sourceMappingURL=patterns.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patterns.test.js","sourceRoot":"","sources":["../../../src/utils/examples/patterns.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MA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CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACzC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAC5C,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAC5D,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,cAAc,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,UAAU,EAAE,CAAC;QACzC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { PatternMap } from './types.js';
2
- export declare const storePatterns: PatternMap;
3
- //# sourceMappingURL=store-patterns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-patterns.d.ts","sourceRoot":"","sources":["../../../src/utils/examples/store-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,aAAa,EAAE,UAsC3B,CAAC"}
@@ -1,40 +0,0 @@
1
- export const storePatterns = {
2
- 'zustand-store': {
3
- file: 'src/stores/preferencesStore.ts',
4
- description: 'Zustand store with persistence and devtools',
5
- keyPoints: [
6
- 'Separate type and interface definitions',
7
- 'Middleware stack: devtools(persist(...))',
8
- 'partialize for selective persistence',
9
- 'Computed getter (getResolvedTheme)',
10
- 'reset() action for initial state',
11
- 'Multi-tab sync function export',
12
- ],
13
- },
14
- 'store-persistence': {
15
- file: 'src/stores/preferencesStore.ts',
16
- description: 'Zustand persist middleware',
17
- keyPoints: [
18
- 'persist() middleware with name key',
19
- 'partialize to select what to persist',
20
- 'Storage key naming convention',
21
- ],
22
- },
23
- 'multi-tab-sync': {
24
- file: 'src/stores/preferencesStore.ts',
25
- description: 'Multi-tab state synchronization',
26
- keyPoints: ['Storage event listener', 'Rehydrate on storage change', 'Cleanup function for HMR'],
27
- },
28
- 'storage-utility': {
29
- file: 'src/lib/storage.ts',
30
- description: 'Type-safe localStorage utilities',
31
- keyPoints: [
32
- 'SSR-safe (typeof window check)',
33
- 'JSON serialization',
34
- 'Generic type parameter',
35
- 'Error handling with fallback',
36
- 'clearAppStorage for all prefixed keys',
37
- ],
38
- },
39
- };
40
- //# sourceMappingURL=store-patterns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-patterns.js","sourceRoot":"","sources":["../../../src/utils/examples/store-patterns.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC,eAAe,EAAE;QACf,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE,6CAA6C;QAC1D,SAAS,EAAE;YACT,yCAAyC;YACzC,0CAA0C;YAC1C,sCAAsC;YACtC,oCAAoC;YACpC,kCAAkC;YAClC,gCAAgC;SACjC;KACF;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE,4BAA4B;QACzC,SAAS,EAAE;YACT,oCAAoC;YACpC,sCAAsC;YACtC,+BAA+B;SAChC;KACF;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,CAAC,wBAAwB,EAAE,6BAA6B,EAAE,0BAA0B,CAAC;KACjG;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,kCAAkC;QAC/C,SAAS,EAAE;YACT,gCAAgC;YAChC,oBAAoB;YACpB,wBAAwB;YACxB,8BAA8B;YAC9B,uCAAuC;SACxC;KACF;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { PatternMap } from './types.js';
2
- export declare const testPatterns: PatternMap;
3
- //# sourceMappingURL=test-patterns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-patterns.d.ts","sourceRoot":"","sources":["../../../src/utils/examples/test-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,YAAY,EAAE,UAwD1B,CAAC"}
@@ -1,58 +0,0 @@
1
- export const testPatterns = {
2
- 'test-component': {
3
- file: 'src/components/layout/Header.test.tsx',
4
- description: 'Component test with Testing Library',
5
- keyPoints: [
6
- 'Import from vitest (describe, it, expect)',
7
- 'Custom render from @/test',
8
- 'screen queries (getByRole, getByText)',
9
- 'Semantic role assertions',
10
- 'Co-located with component source file',
11
- ],
12
- },
13
- 'test-hook': {
14
- file: 'src/hooks/useMediaQuery.test.ts',
15
- description: 'Hook test with renderHook',
16
- keyPoints: [
17
- 'renderHook from Testing Library',
18
- 'mockMatchMedia utility',
19
- 'beforeEach for setup',
20
- 'it.each for parameterized tests',
21
- 'act() for state updates',
22
- 'Co-located with hook source file',
23
- ],
24
- },
25
- 'test-store': {
26
- file: 'src/stores/preferencesStore.test.ts',
27
- description: 'Zustand store test',
28
- keyPoints: [
29
- 'Direct store access: useStore.getState()',
30
- 'act() wrapper for state changes',
31
- 'Reset state in beforeEach',
32
- 'Test actions and computed values',
33
- 'Co-located with store source file',
34
- ],
35
- },
36
- 'test-utility': {
37
- file: 'src/lib/utils.test.ts',
38
- description: 'Utility function test',
39
- keyPoints: ['Simple describe/it/expect pattern', 'Test edge cases', 'No mocking needed'],
40
- },
41
- 'msw-handler': {
42
- file: 'src/mocks/handlers/todos.ts',
43
- description: 'MSW request handler',
44
- keyPoints: [
45
- 'http.get/post from msw',
46
- 'HttpResponse.json() for responses',
47
- 'URL parameter extraction',
48
- 'delay() for realistic timing',
49
- 'Error responses with status codes',
50
- ],
51
- },
52
- 'test-fixture': {
53
- file: 'src/mocks/fixtures/todos.ts',
54
- description: 'Test data fixtures',
55
- keyPoints: ['Typed mock data', 'Realistic test values', 'Reusable across tests'],
56
- },
57
- };
58
- //# sourceMappingURL=test-patterns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-patterns.js","sourceRoot":"","sources":["../../../src/utils/examples/test-patterns.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC,gBAAgB,EAAE;QAChB,IAAI,EAAE,uCAAuC;QAC7C,WAAW,EAAE,qCAAqC;QAClD,SAAS,EAAE;YACT,2CAA2C;YAC3C,2BAA2B;YAC3B,uCAAuC;YACvC,0BAA0B;YAC1B,uCAAuC;SACxC;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,iCAAiC;QACvC,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE;YACT,iCAAiC;YACjC,wBAAwB;YACxB,sBAAsB;YACtB,iCAAiC;YACjC,yBAAyB;YACzB,kCAAkC;SACnC;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,qCAAqC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,SAAS,EAAE;YACT,0CAA0C;YAC1C,iCAAiC;YACjC,2BAA2B;YAC3B,kCAAkC;YAClC,mCAAmC;SACpC;KACF;IACD,cAAc,EAAE;QACd,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,uBAAuB;QACpC,SAAS,EAAE,CAAC,mCAAmC,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;KACzF;IACD,aAAa,EAAE;QACb,IAAI,EAAE,6BAA6B;QACnC,WAAW,EAAE,qBAAqB;QAClC,SAAS,EAAE;YACT,wBAAwB;YACxB,mCAAmC;YACnC,0BAA0B;YAC1B,8BAA8B;YAC9B,mCAAmC;SACpC;KACF;IACD,cAAc,EAAE;QACd,IAAI,EAAE,6BAA6B;QACnC,WAAW,EAAE,oBAAoB;QACjC,SAAS,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,CAAC;KACjF;CACF,CAAC"}
@@ -1,17 +0,0 @@
1
- /** Code example returned by get_example tool. */
2
- export interface CodeExample {
3
- pattern: string;
4
- description: string;
5
- filePath: string;
6
- code: string;
7
- keyPoints: string[];
8
- }
9
- /** Pattern definition mapping. */
10
- export interface PatternDef {
11
- file: string;
12
- description: string;
13
- keyPoints: string[];
14
- }
15
- /** Pattern map type. */
16
- export type PatternMap = Record<string, PatternDef>;
17
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/examples/types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAwB;AACxB,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/examples/types.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type { PatternMap } from './types.js';
2
- export declare const utilityPatterns: PatternMap;
3
- //# sourceMappingURL=utility-patterns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utility-patterns.d.ts","sourceRoot":"","sources":["../../../src/utils/examples/utility-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,eAAe,EAAE,UA2E7B,CAAC"}
@@ -1,77 +0,0 @@
1
- export const utilityPatterns = {
2
- 'zod-schema': {
3
- file: 'src/lib/validations.ts',
4
- description: 'Zod validation schemas with type inference',
5
- keyPoints: [
6
- 'z.object() for form schemas',
7
- 'Chained validations (min, max, email, regex)',
8
- 'Custom error messages',
9
- 'Type inference with z.infer<>',
10
- 'refine() for cross-field validation (password confirmation)',
11
- ],
12
- },
13
- 'form-error-component': {
14
- file: 'src/components/ui/form-error.tsx',
15
- description: 'Form error display components',
16
- keyPoints: [
17
- 'FieldErrorMessage for single field',
18
- 'FormErrorSummary for all errors',
19
- 'RootFormError for form-level errors',
20
- 'Integrates with react-hook-form types',
21
- ],
22
- },
23
- 'register-form': {
24
- file: 'src/components/shared/RegisterForm/RegisterForm.tsx',
25
- description: 'Complete form component with validation',
26
- keyPoints: [
27
- 'Uses useRegisterForm custom hook',
28
- 'Inline error display with FieldErrorMessage',
29
- 'form.register() for input binding',
30
- 'Disabled submit during isSubmitting',
31
- 'Lingui Trans for i18n labels',
32
- 'Demonstrates cross-field validation UX',
33
- ],
34
- },
35
- 'theme-toggle': {
36
- file: 'src/components/shared/ThemeToggle/ThemeToggle.tsx',
37
- description: 'Theme toggle with system preference',
38
- keyPoints: [
39
- 'Three modes: light, dark, system',
40
- 'Zustand store for persistence',
41
- 'getResolvedTheme() for actual value',
42
- 'Icon changes based on resolved theme',
43
- ],
44
- },
45
- 'main-entry': {
46
- file: 'src/main.tsx',
47
- description: 'Application entry point with Sentry initialization',
48
- keyPoints: [
49
- 'Lazy Sentry initialization with requestIdleCallback for web vitals',
50
- 'Global error handlers (window.onerror, onunhandledrejection)',
51
- 'i18n initialization before render',
52
- 'Provider hierarchy: Query → I18n → Router → Mobile → ErrorBoundary',
53
- 'Multi-tab preferences sync with HMR cleanup',
54
- ],
55
- },
56
- 'lib-config': {
57
- file: 'src/lib/config.ts',
58
- description: 'Centralized application configuration',
59
- keyPoints: [
60
- 'APP_CONFIG for app name and URL',
61
- 'SENTRY_CONFIG with enabled flag, DSN, and tracesSampleRate',
62
- 'Environment variables with fallback defaults',
63
- 'as const for type inference',
64
- ],
65
- },
66
- 'profiler-wrapper': {
67
- file: 'src/contexts/performanceContext.tsx',
68
- description: 'React Profiler wrapper component',
69
- keyPoints: ['Wraps children with React.Profiler', 'Captures render timing', 'Only active in development'],
70
- },
71
- 'performance-e2e': {
72
- file: 'e2e/performance/setup.ts',
73
- description: 'Performance E2E test setup',
74
- keyPoints: ['Lighthouse integration', 'Chrome launcher setup', 'Web Vitals assertions'],
75
- },
76
- };
77
- //# sourceMappingURL=utility-patterns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utility-patterns.js","sourceRoot":"","sources":["../../../src/utils/examples/utility-patterns.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,YAAY,EAAE;QACZ,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,4CAA4C;QACzD,SAAS,EAAE;YACT,6BAA6B;YAC7B,8CAA8C;YAC9C,uBAAuB;YACvB,+BAA+B;YAC/B,6DAA6D;SAC9D;KACF;IACD,sBAAsB,EAAE;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