Skip to content

Commit 6b53ab3

Browse files
authored
Merge pull request #29 from GizzZmo/copilot/fix-28
Validate and update GitHub Copilot instructions with comprehensive testing and fixes
2 parents 0d3e11f + 2519fac commit 6b53ab3

3 files changed

Lines changed: 36 additions & 6 deletions

File tree

.github/copilot-instructions.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Master Prompt Editor is a React/TypeScript monorepo implementing an AI Orchestra
1212
- **NEVER CANCEL any build command** - All builds must complete fully
1313
- Frontend build: Takes ~2-3 seconds. Set timeout to 120+ seconds minimum
1414
- Full build (all components): Takes ~6-7 seconds. Set timeout to 300+ seconds minimum
15-
- Dependency installation: Takes ~20 seconds. Set timeout to 180+ seconds minimum
15+
- Dependency installation: Takes ~10 seconds. Set timeout to 180+ seconds minimum
1616
- Linting: Takes ~2 seconds. Set timeout to 60+ seconds minimum
1717

1818
### Build Dependencies and Order
@@ -29,7 +29,7 @@ This step is REQUIRED before any server build operations.
2929
npm run install:all
3030
```
3131
- Installs root, server, and client dependencies simultaneously
32-
- Takes approximately 20 seconds
32+
- Takes approximately 10 seconds
3333
- NEVER CANCEL - wait for completion
3434

3535
### Build All Components
@@ -163,12 +163,31 @@ const API_URL = process.env.REACT_APP_API_URL || '/api';
163163
- **Shared types not built**: Run `tsc --build src/types` first
164164
- **Circular dependencies**: Check imports between types and components
165165
- **Missing types**: Ensure all TypeScript files have proper type annotations
166+
- **Missing Vite types**: If you see `Property 'env' does not exist on type 'ImportMeta'`, the `vite-env.d.ts` file may be missing from the project root. This file should contain:
167+
```typescript
168+
/// <reference types="vite/client" />
169+
170+
interface ImportMetaEnv {
171+
readonly VITE_API_URL?: string;
172+
}
173+
174+
interface ImportMeta {
175+
readonly env: ImportMetaEnv;
176+
}
177+
```
178+
- **Missing Toast imports**: Components using `showToast` need to import and use the `useToast` hook:
179+
```typescript
180+
import { useToast } from '../../../context/toastContextHelpers';
181+
const { showToast } = useToast();
182+
```
166183

167184
### Linting Warnings
168-
Current known warnings (acceptable):
169-
- React hooks exhaustive-deps warnings in some components
170-
- Some @typescript-eslint/no-explicit-any warnings in utility files
171-
- These do not prevent builds and can be addressed incrementally
185+
Current known issues (acceptable, do not prevent builds):
186+
- **TypeScript version warning**: Using TypeScript 5.9.2 which is newer than officially supported by @typescript-eslint
187+
- **Explicit any usage**: server/src/middleware/auditLogging.ts has intentional `any` type usage
188+
- **Control character regex**: server/src/middleware/validation.ts uses control character patterns for security filtering
189+
- **React hooks exhaustive-deps**: Some components have missing dependencies in useCallback arrays
190+
- These issues are documented and do not prevent successful builds or deployments
172191

173192
### Runtime Errors
174193
- **Process not defined**: Use `import.meta.env` instead of `process.env` in frontend code

src/pages/PromptEditor/components/PerformanceBenchmark.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface PerformanceBenchmarkProps {
99
}
1010

1111
const PerformanceBenchmark: React.FC<PerformanceBenchmarkProps> = ({ promptId }) => {
12+
const { showToast } = useToast();
1213
const [benchmarkResults, setBenchmarkResults] = useState<BenchmarkResult[]>([]);
1314
const [loadTestResults, setLoadTestResults] = useState<LoadTestResult[]>([]);
1415
const [isRunning, setIsRunning] = useState(false);

vite-env.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference types="vite/client" />
2+
3+
interface ImportMetaEnv {
4+
readonly VITE_API_URL?: string;
5+
// Add other env variables here as needed
6+
}
7+
8+
interface ImportMeta {
9+
readonly env: ImportMetaEnv;
10+
}

0 commit comments

Comments
 (0)