Add ENV type checking.

This commit is contained in:
Patrick Fic
2025-03-25 20:10:01 -07:00
parent c7aa51f202
commit 2f712e24c9
4 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,2 @@
KEY=123 # not available
MAIN_VITE_KEY=123 # only main process available
PRELOAD_VITE_KEY=123 # only preload scripts available
RENDERER_VITE_KEY=123 # only renderers available
VITE_KEY=123 # all available
VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDomain":"imex-prod.firebaseapp.com","databaseURL":"https://imex-prod.firebaseio.com","projectId":"imex-prod","storageBucket":"imex-prod.appspot.com","messagingSenderId":"253497221485","appId":"1:253497221485:web:3c81c483b94db84b227a64","measurementId":"G-NTWBKG2L0M"}
VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql

10
src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/// <reference types="vite/client" />
export interface ImportMetaEnv {
readonly VITE_FIREBASE_CONFIG: string;
readonly VITE_GRAPHQL_ENDPOINT: string;
}
export interface ImportMeta {
readonly env: ImportMetaEnv;
}

View File

@@ -12,6 +12,6 @@
"compilerOptions": {
"resolveJsonModule": true,
"composite": true,
"types": ["electron-vite/node"]
"types": ["electron-vite/node", "vite/client"]
}
}

View File

@@ -12,6 +12,7 @@
"composite": true,
"jsx": "react-jsx",
"baseUrl": ".",
"types": ["vite/client"],
"paths": {
"@renderer/*": ["src/renderer/src/*"]
}