chore: remove Firebase backend code, replaced by Supabase (see 2026-08-08 spec)
Deleted all Firebase-specific files and directories: - Configuration: .firebaserc, firebase.json, firestore.* files, storage.rules - Cloud Functions: functions/ directory (package.json, source, config) - Tests: firebase-tests/, vitest.rules.config.ts - Scripts: scripts/seed.ts - Source: src/lib/firebase.ts and .test.ts - Environment: .env.example Removed dependencies: - firebase (main package) - firebase-admin, firebase-tools (dev) - @firebase/rules-unit-testing (dev) Removed scripts: - test:rules (Firebase emulator tests) - seed (Firestore seed script) Updated package.json via npm install (729 packages removed) Updated .gitignore (removed functions/ entries) Updated vite.config.ts (removed firebase-tests and functions exclusions) All tests, builds, and lints pass cleanly. No Firebase references remain in the codebase (only in historical spec documents in docs/). Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
|
||||
const initializeAppMock = vi.fn(() => ({ name: 'mock-app' }))
|
||||
const getFirestoreMock = vi.fn(() => ({ type: 'mock-firestore' }))
|
||||
const getAuthMock = vi.fn(() => ({ type: 'mock-auth' }))
|
||||
const getStorageMock = vi.fn(() => ({ type: 'mock-storage' }))
|
||||
|
||||
vi.mock('firebase/app', () => ({ initializeApp: initializeAppMock }))
|
||||
vi.mock('firebase/firestore', () => ({ getFirestore: getFirestoreMock }))
|
||||
vi.mock('firebase/auth', () => ({ getAuth: getAuthMock }))
|
||||
vi.mock('firebase/storage', () => ({ getStorage: getStorageMock }))
|
||||
|
||||
describe('firebase client setup', () => {
|
||||
beforeEach(() => {
|
||||
vi.resetModules()
|
||||
initializeAppMock.mockClear()
|
||||
})
|
||||
|
||||
it('initializes the app with config read from Vite env vars and exports db/auth/storage', async () => {
|
||||
vi.stubEnv('VITE_FIREBASE_API_KEY', 'test-api-key')
|
||||
vi.stubEnv('VITE_FIREBASE_AUTH_DOMAIN', 'test.firebaseapp.com')
|
||||
vi.stubEnv('VITE_FIREBASE_PROJECT_ID', 'test-project')
|
||||
vi.stubEnv('VITE_FIREBASE_STORAGE_BUCKET', 'test-project.appspot.com')
|
||||
vi.stubEnv('VITE_FIREBASE_MESSAGING_SENDER_ID', '123')
|
||||
vi.stubEnv('VITE_FIREBASE_APP_ID', 'app-id')
|
||||
|
||||
const { app, db, auth, storage } = await import('./firebase')
|
||||
|
||||
expect(initializeAppMock).toHaveBeenCalledWith({
|
||||
apiKey: 'test-api-key',
|
||||
authDomain: 'test.firebaseapp.com',
|
||||
projectId: 'test-project',
|
||||
storageBucket: 'test-project.appspot.com',
|
||||
messagingSenderId: '123',
|
||||
appId: 'app-id',
|
||||
})
|
||||
expect(app).toEqual({ name: 'mock-app' })
|
||||
expect(db).toEqual({ type: 'mock-firestore' })
|
||||
expect(auth).toEqual({ type: 'mock-auth' })
|
||||
expect(storage).toEqual({ type: 'mock-storage' })
|
||||
})
|
||||
})
|
||||
@@ -1,18 +0,0 @@
|
||||
import { initializeApp } from 'firebase/app'
|
||||
import { getFirestore } from 'firebase/firestore'
|
||||
import { getAuth } from 'firebase/auth'
|
||||
import { getStorage } from 'firebase/storage'
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
|
||||
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
|
||||
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
|
||||
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
|
||||
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
|
||||
appId: import.meta.env.VITE_FIREBASE_APP_ID,
|
||||
}
|
||||
|
||||
export const app = initializeApp(firebaseConfig)
|
||||
export const db = getFirestore(app)
|
||||
export const auth = getAuth(app)
|
||||
export const storage = getStorage(app)
|
||||
Reference in New Issue
Block a user