spine-framework 0.3.81 → 0.3.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -174,13 +174,14 @@ export function registerInitCommands(program: Command) {
|
|
|
174
174
|
const envTemplate = [
|
|
175
175
|
'# Supabase credentials',
|
|
176
176
|
'# Get these from: Supabase Dashboard → Your Project → Settings → API',
|
|
177
|
-
'
|
|
177
|
+
'# Replace the values below — do not leave them blank or as placeholders',
|
|
178
|
+
'SUPABASE_URL=',
|
|
178
179
|
'SUPABASE_ANON_KEY=',
|
|
179
180
|
'SUPABASE_SERVICE_ROLE_KEY=',
|
|
180
181
|
'SUPABASE_DB_PASSWORD=',
|
|
181
182
|
'',
|
|
182
|
-
'# Vite (browser-safe)',
|
|
183
|
-
'VITE_SUPABASE_URL=
|
|
183
|
+
'# Vite (browser-safe) — copy from above',
|
|
184
|
+
'VITE_SUPABASE_URL=',
|
|
184
185
|
'VITE_SUPABASE_ANON_KEY=',
|
|
185
186
|
'VITE_DB_SCHEMA=public',
|
|
186
187
|
'VITE_APP_NAME=Spine',
|
|
@@ -20,9 +20,21 @@ import WebSocket from 'ws'
|
|
|
20
20
|
// ─── ENVIRONMENT RESOLUTION ──────────────────────────────────────────────────
|
|
21
21
|
|
|
22
22
|
const _env = (globalThis as any).process?.env || {}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
|
|
24
|
+
// Use a known-valid placeholder URL so that createClient() doesn't throw at
|
|
25
|
+
// module load time when env vars haven't been set yet (e.g. during CLI init).
|
|
26
|
+
// All real requests validate credentials before hitting the DB.
|
|
27
|
+
const PLACEHOLDER_URL = 'https://placeholder.supabase.co'
|
|
28
|
+
const PLACEHOLDER_KEY = 'placeholder'
|
|
29
|
+
|
|
30
|
+
function isValidUrl(url: string): boolean {
|
|
31
|
+
try { new URL(url); return true } catch { return false }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const rawUrl = _env.SUPABASE_URL || ''
|
|
35
|
+
const supabaseUrl: string = rawUrl && isValidUrl(rawUrl) ? rawUrl : PLACEHOLDER_URL
|
|
36
|
+
const supabaseServiceKey: string = _env.SUPABASE_SERVICE_ROLE_KEY || PLACEHOLDER_KEY
|
|
37
|
+
const supabaseAnonKey: string = _env.SUPABASE_ANON_KEY || PLACEHOLDER_KEY
|
|
26
38
|
const dbSchema: string = _env.DB_SCHEMA || 'public'
|
|
27
39
|
|
|
28
40
|
// ─── CLIENTS ─────────────────────────────────────────────────────────────────
|