chore(types): declare typed ImportMetaEnv for VITE_ vars#360
Closed
yunus-dev-codecrafter wants to merge 1 commit into
Closed
chore(types): declare typed ImportMetaEnv for VITE_ vars#360yunus-dev-codecrafter wants to merge 1 commit into
yunus-dev-codecrafter wants to merge 1 commit into
Conversation
Contributor
|
hey @yunus-dev-codecrafter, thanks for jumping in! closing this pr because the author needs to be assigned to the linked issue (#305) before opening a pr. please comment on the issue requesting assignment, wait to be assigned, then re-raise your pr. this keeps work fairly distributed across contributors. hope to see a revised pr from you soon! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #305
chore(types): declare typed
ImportMetaEnvforVITE_varsWhy
src/shared/config/api.tsreadsimport.meta.env.VITE_API_BASE_URLandVITE_FRONTEND_BASE_URL, but there was no typedImportMetaEnvdeclaration. This meant a typo likeVITE_API_BSE_URLwould compile silently and only fail at runtime.What
Added TSDoc-documented
ImportMetaEnvandImportMetaaugmentations tosrc/vite-env.d.ts:Verification
npm run typecheck—api.tsnpm run typecheck—logger.ts(usesimport.meta.env.PROD)ImportMetaEnv)npm run typecheck—vite-env.d.tsVITE_API_BSE_URL)Property 'VITE_API_BSE_URL' does not exist on type 'ImportMetaEnv'npm test0 tests, infrastructure issue — unrelated)Security notes
VITE_*environment variables are declared. Server-only secrets (API keys, auth tokens, etc.) must never be added here — they would be exposed to the client bundle.Migration
No migration needed. The changes are purely additive type declarations. Existing
.envfiles and runtime behavior are unaffected.