diff --git a/package.json b/package.json index c2c1ee8..938fe86 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "dependencies": { "bootstrap": "^5.3.2", "classnames": "^2.5.1", - "dotenv": "^16.4.4", "electron-squirrel-startup": "^1.0.0", "electron-store": "^8.1.0", "env-paths": "^3.0.0", diff --git a/src/component/Connection/ConnectionForm.tsx b/src/component/Connection/ConnectionForm.tsx index 7ccf6a9..7db62ca 100644 --- a/src/component/Connection/ConnectionForm.tsx +++ b/src/component/Connection/ConnectionForm.tsx @@ -20,12 +20,10 @@ class ConnectionForm extends PureComponent< this.state = { name: '', save: true, - host: window.env.TIANA__DEBUG_DB_HOST || 'localhost', - port: window.env.TIANA__DEBUG_DB_PORT - ? parseInt(window.env.TIANA__DEBUG_DB_PORT, 10) - : 3306, - user: window.env.TIANA__DEBUG_DB_USER || '', - password: window.env.TIANA__DEBUG_DB_PASSWORD || '', + host: 'localhost', + port: 3306, + user: '', + password: '', }; this.handleInputChange = this.handleInputChange.bind(this); diff --git a/src/main.ts b/src/main.ts index 95f19ff..3c626af 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,8 +6,6 @@ import installExtension, { import connectionStackInstance from './sql'; import { readConfigurationFile, addConnectionToConfig } from './configuration'; -require('dotenv').config({ path: '../.env' }); - // Handle creating/removing shortcuts on Windows when installing/uninstalling. if (require('electron-squirrel-startup')) { app.quit(); diff --git a/src/preload.ts b/src/preload.ts index 7d7d961..93274d4 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -6,18 +6,6 @@ import { ConnectionObject } from './component/Connection'; import { Configuration } from './configuration'; import { contextBridge, ipcRenderer } from 'electron'; -// === environment variables === -type TianaString = string; // maybe `TIANA__${string}` is TS 5 ? -type TianaEnvVariables = Record; - -const fpEnvVariables: TianaEnvVariables = Object.fromEntries( - Object.entries(process.env).filter((entry): entry is [TianaString, string] => - entry[0].startsWith('TIANA__') - ) -); - -contextBridge.exposeInMainWorld('env', fpEnvVariables); - // === Configuration === interface Config { readConfigurationFile(): Promise; @@ -53,7 +41,6 @@ contextBridge.exposeInMainWorld('sql', sql); // Declare window global that have been added declare global { interface Window { - env: TianaEnvVariables; config: Config; sql: Sql; } diff --git a/yarn.lock b/yarn.lock index 1d38faa..30bd047 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1969,11 +1969,6 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" -dotenv@^16.4.4: - version "16.4.4" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.4.tgz#a26e7bb95ebd36272ebb56edb80b826aecf224c1" - integrity sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg== - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"