diff --git a/firebase-config/src/index.ts b/firebase-config/src/index.ts deleted file mode 100644 index 6b678f7..0000000 --- a/firebase-config/src/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Import the functions you need from the SDKs you need -import { initializeApp } from "firebase/app"; - -import { getAuth } from "firebase/auth"; -// TODO: Add SDKs for Firebase products that you want to use -// https://firebase.google.com/docs/web/setup#available-libraries - -// Your web app's Firebase configuration -// For Firebase JS SDK v7.20.0 and later, measurementId is optional -const firebaseConfig = { - apiKey: "AIzaSyCs1LOqsbrAjymIcjvbKxPhFQWXlSPiLTs", - authDomain: "adrift-6c1f6.firebaseapp.com", - projectId: "adrift-6c1f6", - storageBucket: "adrift-6c1f6.appspot.com", - messagingSenderId: "175846512414", - appId: "1:175846512414:web:5c6e06d231ab58e9029b0f", - measurementId: "G-L0P2EF6Q72", -}; -console.warn("firebase is initializing"); - -// Initialize Firebase -export const app = initializeApp(firebaseConfig); -export const auth = getAuth(app); -// export const analytics = getAnalytics(app); diff --git a/frontend/package.json b/frontend/package.json index 325c952..af34227 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,7 +22,7 @@ "esbuild": "^0.19.1", "esbuild-plugin-inline-import": "^1.0.1", "firebase": "^10.1.0", - "firebase-config": "workspace:*", + "tracker-list": "workspace:*", "m3-svelte": "^2.0.3", "postcss": "^8.4.27", "postcss-load-config": "^4.0.1", diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index a3b9cf7..ea6a3f0 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -20,7 +20,7 @@ TextField, } from "m3-svelte"; // note: even though we import firebase, due to the tree shaking, it will only run if we use "auth" so if ADRIFT_DEV is set it won't import - import { auth } from "firebase-config"; + // import { auth } from "firebase-config"; import { signInWithEmailAndPassword } from "firebase/auth"; import { getDatabase, onValue, ref, set } from "firebase/database"; import type { Transport } from "protocol"; diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5ec8198..dc06c5e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,7 +3,7 @@ packages: - server - frontend - client - - firebase-config + - tracker-list - corium - Ultraviolet - Dynamic diff --git a/server/package.json b/server/package.json index 5d07ca2..b2e1999 100644 --- a/server/package.json +++ b/server/package.json @@ -15,7 +15,7 @@ "express": "^4.18.2", "express-ws": "^5.0.2", "firebase": "^10.1.0", - "firebase-config": "workspace:*", + "tracker-list": "workspace:*", "ipaddr.js": "^2.1.0", "isomorphic-ws": "^5.0.0", "protocol": "workspace:*", @@ -32,4 +32,4 @@ "@types/ws": "^8.5.5", "nodemon": "^3.0.1" } -} +} \ No newline at end of file diff --git a/server/src/main.ts b/server/src/main.ts index b3b343d..4a2eb9d 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -5,7 +5,7 @@ import expressWs from "express-ws"; import { signInWithEmailAndPassword } from "firebase/auth"; import wrtc from "wrtc"; -import { auth } from "firebase-config"; + import { getDatabase, onValue, ref, set } from "firebase/database"; import { AdriftServer } from "./server"; diff --git a/firebase-config/package.json b/tracker-list/package.json similarity index 71% rename from firebase-config/package.json rename to tracker-list/package.json index 988458c..23220b6 100644 --- a/firebase-config/package.json +++ b/tracker-list/package.json @@ -1,5 +1,5 @@ { - "name": "firebase-config", + "name": "tracker-list", "version": "1.0.0", "description": "", "main": "src/index.ts", @@ -9,7 +9,5 @@ "keywords": [], "author": "", "license": "ISC", - "dependencies": { - "firebase": "^10.1.0" - } -} + "dependencies": {} +} \ No newline at end of file diff --git a/tracker-list/src/index.ts b/tracker-list/src/index.ts new file mode 100644 index 0000000..2926400 --- /dev/null +++ b/tracker-list/src/index.ts @@ -0,0 +1,28 @@ +let trackers: { + [name: string]: { + firebase: { + apiKey: string; + authDomain: string; + projectId: string; + storageBucket: string; + messagingSenderId: string; + appId: string; + measurementId: string; + } + tracker: string; + } +} = { + "us-central-1": { + firebase: { + apiKey: "AIzaSyCs1LOqsbrAjymIcjvbKxPhFQWXlSPiLTs", + authDomain: "adrift-6c1f6.firebaseapp.com", + projectId: "adrift-6c1f6", + storageBucket: "adrift-6c1f6.appspot.com", + messagingSenderId: "175846512414", + appId: "1:175846512414:web:5c6e06d231ab58e9029b0f", + measurementId: "G-L0P2EF6Q72", + }, + tracker: "wss://lb1.mercurywork.shop" + } +}; +export default trackers; diff --git a/firebase-config/tsconfig.json b/tracker-list/tsconfig.json similarity index 100% rename from firebase-config/tsconfig.json rename to tracker-list/tsconfig.json diff --git a/tracker/package.json b/tracker/package.json index bb40c10..0c7ac7e 100644 --- a/tracker/package.json +++ b/tracker/package.json @@ -15,7 +15,7 @@ "express-ws": "^5.0.2", "firebase": "^10.1.0", "firebase-admin": "^11.10.1", - "firebase-config": "workspace:*", + "tracker-list": "workspace:*", "ts-node": "^10.9.1", "typescript": "^5.1.6" },