-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.codiumai.toml
174 lines (150 loc) · 4.77 KB
/
.codiumai.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
[tests]
framework = "Vitest"
num_desired_tests = 6
use_mocks = false
language = "typescript"
customTestInstructions = """
- Write tests using TypeScript best practices with TypeScript 5.3.3
- Include proper type annotations for all variables and functions
- Handle NextUI v2.4.8 components and TailwindCSS v3.4.16 classes appropriately
- Consider Stripe integration testing needs (@stripe/react-stripe-js v3.0.0)
- Mock iron-session (v8.0.4) for authentication testing when needed
- Follow React 18.2.0 and Next.js latest testing best practices
- Ensure server-only components are properly mocked
"""
[tests.typescript]
overrideTestRunScript = "npx vitest run TEST_FILEPATH"
overrideImports = """
import { describe, it, expect, vi, beforeEach } from 'vitest'
import type { Mock } from 'vitest'
import { render, screen, fireEvent } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import '@testing-library/jest-dom/vitest'
import { NextUIProvider } from '@nextui-org/react'
import { Elements } from '@stripe/react-stripe-js'
# Mock Next.js features
vi.mock('next/navigation', () => ({
useRouter: vi.fn(),
useSearchParams: vi.fn(),
usePathname: vi.fn(),
}))
vi.mock('server-only', () => ({}))
vi.mock('iron-session', () => ({
getIronSession: vi.fn(),
}))
"""
fileExtension = ".test.tsx"
strictTypeChecking = true
# Add setup for component testing with all providers
testSetup = """
beforeAll(() => {
const Wrapper = ({ children }) => (
<NextUIProvider>
{/* Add Stripe provider if needed */}
{children}
</NextUIProvider>
)
const customRender = (ui, options = {}) =>
render(ui, { wrapper: Wrapper, ...options })
vi.stubGlobal('render', customRender)
})
// Setup userEvent
beforeEach(() => {
vi.clearAllMocks()
})
"""
# Environment setup for testing
envSetup = """
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY = 'test_key'
process.env.STRIPE_SECRET_KEY = 'test_secret_key'
process.env.IRON_SESSION_PASSWORD = 'test_password'
"""
[suggestions]
language = "typescript"
framework = "nextjs"
customSuggestionInstructions = """
# Code Style & Best Practices
- Follow Next.js 13+ App Router patterns and conventions
- Use TypeScript strict mode patterns and type safety
- Implement React Server Components (RSC) patterns where applicable
- Follow React 18 best practices including hooks and concurrent features
# UI/Styling
- Prefer NextUI v2.4.8 component patterns and hooks
- Use TailwindCSS v3.4.16 utility classes with proper organization
- Follow responsive design patterns using Tailwind breakpoints
- Maintain consistent dark/light theme support with NextUI
# Authentication & API
- Implement iron-session best practices for auth management
- Follow Stripe best practices for payment integration
- Use proper error handling for API routes
- Implement proper type safety for API responses
# Performance & Security
- Implement proper loading and error states
- Use proper data fetching patterns (Server Components)
- Follow security best practices for payment handling
- Implement proper form validation patterns
# Component Structure
- Maintain clear component boundaries
- Use proper prop typing with TypeScript
- Implement proper state management patterns
- Follow NextUI composition patterns
"""
[suggestions.patterns]
# NextUI component patterns
nextui = """
- Use semantic NextUI components
- Implement proper NextUI theme configuration
- Use NextUI's built-in hooks for state management
- Follow NextUI's responsive design patterns
"""
# Stripe integration patterns
stripe = """
- Implement proper error handling for Stripe operations
- Use Stripe Elements components correctly
- Follow Stripe security best practices
- Implement proper loading states for payments
"""
# Authentication patterns
auth = """
- Implement proper session management with iron-session
- Use proper type safety for session data
- Follow secure cookie handling practices
- Implement proper authentication flow
"""
# API patterns
api = """
- Use proper error handling
- Implement proper type safety
- Follow RESTful conventions
- Use proper status codes
"""
[suggestions.typescript]
strictNullChecks = true
noImplicitAny = true
strictFunctionTypes = true
strictBindCallApply = true
[suggestions.nextjs]
serverComponents = true
clientComponents = true
metadata = true
routing = true
[dependencies]
# Main Dependencies
"@nextui-org/react" = "^2.4.8"
"@stripe/react-stripe-js" = "^3.0.0"
"@stripe/stripe-js" = "^5.2.0"
"iron-session" = "^8.0.4"
"next" = "latest"
"react" = "^18.2.0"
"react-dom" = "^18.2.0"
"server-only" = "^0.0.1"
"stripe" = "^17.4.0"
"tailwindcss" = "^3.4.16"
# Dev Dependencies
"@testing-library/jest-dom" = "^6.1.4"
"@testing-library/react" = "^14.1.2"
"@testing-library/user-event" = "^14.5.2"
"@vitejs/plugin-react" = "^4.3.4"
"jsdom" = "^23.0.1"
"typescript" = "5.3.3"
"vitest" = "^1.0.4"