refactor: saasMode 분기 제거 — 항상 SaaS(OAuth only)로 동작

Mac/Windows 환경 불일치 해소. BUILD_TIME 상수, CONFIGURE 채널,
개발자 모드 UI 전부 제거. Supabase 설정은 supabase-config.ts SSOT.
This commit is contained in:
yunchan8804 2026-04-13 17:20:55 +09:00
parent feb82abbf7
commit 541f04d02b
12 changed files with 566 additions and 9587 deletions

View file

@ -1,5 +1,5 @@
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin, loadEnv } from 'electron-vite'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
const sharedAlias = {
@ -10,34 +10,14 @@ const sharedAlias = {
const workspaceExclude = ['@d3ro/core', '@d3ro/ui', '@d3ro/i18n']
// SaaS 데스크톱 클라이언트: Supabase 연결 정보를 빌드 타임에 박는다.
// `apps/desktop/.env` (committed shared defaults) + `.env.local` (gitignored, 개인/비공개 키)
// 우선순위는 vite/electron-vite의 dotenv 로드 규칙: .env.local > .env.[mode] > .env
// 환경 변수에 값이 없으면 빈 문자열로 박혀, 런타임에 ConfigService가 fallback(설정 UI 입력)으로 동작.
function loadSupabaseEnv(mode: string): { url: string; anonKey: string } {
const env = loadEnv(mode, process.cwd(), 'D3RO_')
return {
url: env.D3RO_SUPABASE_URL ?? '',
anonKey: env.D3RO_SUPABASE_ANON_KEY ?? ''
}
}
export default defineConfig(({ mode }) => {
const supabase = loadSupabaseEnv(mode)
const supabaseDefine = {
'process.env.D3RO_SUPABASE_URL': JSON.stringify(supabase.url),
'process.env.D3RO_SUPABASE_ANON_KEY': JSON.stringify(supabase.anonKey)
}
return {
export default defineConfig({
main: {
plugins: [
externalizeDepsPlugin({
exclude: ['electron-store', ...workspaceExclude]
})
],
resolve: { alias: sharedAlias },
define: supabaseDefine
resolve: { alias: sharedAlias }
},
preload: {
plugins: [externalizeDepsPlugin({ exclude: workspaceExclude })],
@ -82,5 +62,4 @@ export default defineConfig(({ mode }) => {
resolve: { alias: sharedAlias },
plugins: [react()]
}
}
})