📌 Description
src/shared/config/api.ts reads import.meta.env.VITE_API_BASE_URL and VITE_FRONTEND_BASE_URL, but src/vite-env.d.ts does not declare an ImportMetaEnv interface, so these are loosely typed and typos go unnoticed. Add an ImportMetaEnv/ImportMeta augmentation declaring the known VITE_* keys so TypeScript flags misspelled or missing env references at compile time.
💡 Why it matters: Untyped env access lets a typo like VITE_API_BSE_URL compile and fail only at runtime.
🧩 Requirements and context
- Declare
interface ImportMetaEnv with VITE_API_BASE_URL: string and optional VITE_FRONTEND_BASE_URL?: string.
- Augment
ImportMeta with readonly env: ImportMetaEnv.
- Place the declaration in
src/vite-env.d.ts.
- Confirm
api.ts typechecks against the new types.
- Keep the existing
vite/client triple-slash reference.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b chore/typed-vite-env
2. Implement changes
- Write/modify the relevant source:
src/vite-env.d.ts
- Write comprehensive tests: typecheck serves as the gate
- Add documentation: inline comment listing each VITE_ var
- Include TSDoc doc comments where applicable
- Validate security assumptions: only public VITE_ vars declared
3. Test and commit
npm run typecheck && npm test
- Cover edge cases: referencing an undeclared VITE_ key errors
- Include test output and security notes in the PR description.
Example commit message
chore(types): declare typed ImportMetaEnv for VITE_ vars
✅ Acceptance criteria
🔒 Security notes
Only declare non-secret VITE_ variables; never add server-only secrets to the public env type.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
src/shared/config/api.tsreadsimport.meta.env.VITE_API_BASE_URLandVITE_FRONTEND_BASE_URL, butsrc/vite-env.d.tsdoes not declare anImportMetaEnvinterface, so these are loosely typed and typos go unnoticed. Add anImportMetaEnv/ImportMetaaugmentation declaring the knownVITE_*keys so TypeScript flags misspelled or missing env references at compile time.🧩 Requirements and context
interface ImportMetaEnvwithVITE_API_BASE_URL: stringand optionalVITE_FRONTEND_BASE_URL?: string.ImportMetawithreadonly env: ImportMetaEnv.src/vite-env.d.ts.api.tstypechecks against the new types.vite/clienttriple-slash reference.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/vite-env.d.ts3. Test and commit
Example commit message
✅ Acceptance criteria
ImportMetaEnvdeclares known VITE_ keysImportMeta.envtypedapi.tstypechecks🔒 Security notes
Only declare non-secret
VITE_variables; never add server-only secrets to the public env type.📋 Guidelines