commit e42c5cf3d5f4b29163a6028bde7681a9c4f2b9f7
parent 851e7d76434a287154eda29b96087c50b51842df
Author: triesap <tyson@radroots.org>
Date: Thu, 11 Jun 2026 14:39:24 -0700
env: align web libraries with RADROOTS_WEB names
- replace library Vite env keys with RADROOTS_WEB-prefixed names
- update library env examples to match the web runtime surface
- make geop_is_valid a TypeScript predicate for app consumers
- keep the shared web library build compatible with the app check lane
Diffstat:
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/apps-lib-market/.env.example b/apps-lib-market/.env.example
@@ -1 +1 @@
-VITE_PUBLIC_RADROOTS_MARKET_RELAY_INDEXES_URL=
+RADROOTS_WEB_MARKET_RELAY_INDEXES_URL=
diff --git a/apps-lib-pwa/src/lib/utils/_env.ts b/apps-lib-pwa/src/lib/utils/_env.ts
@@ -1,8 +1,8 @@
-const KEYVAL_NAME = import.meta.env.VITE_PUBLIC_KEYVAL_NAME;
-if (!KEYVAL_NAME || typeof KEYVAL_NAME !== 'string') throw new Error('Missing env var: VITE_PUBLIC_KEYVAL_NAME');
+const KEYVAL_NAME = import.meta.env.RADROOTS_WEB_KEYVAL_NAME;
+if (!KEYVAL_NAME || typeof KEYVAL_NAME !== 'string') throw new Error('Missing env var: RADROOTS_WEB_KEYVAL_NAME');
-const RADROOTS_RELAY = import.meta.env.VITE_PUBLIC_RADROOTS_RELAY;
-if (!RADROOTS_RELAY || typeof RADROOTS_RELAY !== 'string') throw new Error('Missing env var: VITE_PUBLIC_RADROOTS_RELAY');
+const RADROOTS_RELAY = import.meta.env.RADROOTS_WEB_RELAY_URL;
+if (!RADROOTS_RELAY || typeof RADROOTS_RELAY !== 'string') throw new Error('Missing env var: RADROOTS_WEB_RELAY_URL');
const PROD = import.meta.env.MODE === 'production';
diff --git a/apps-lib/.env.example b/apps-lib/.env.example
@@ -1,3 +1,3 @@
-VITE_PUBLIC_KEYVAL_NAME=
-VITE_PUBLIC_NOSTR_CLIENT=
-VITE_PUBLIC_RADROOTS_RELAY=
+RADROOTS_WEB_KEYVAL_NAME=
+RADROOTS_WEB_NOSTR_CLIENT=
+RADROOTS_WEB_RELAY_URL=
diff --git a/apps-lib/src/lib/utils/_env.ts b/apps-lib/src/lib/utils/_env.ts
@@ -1,11 +1,11 @@
-const KEYVAL_NAME = import.meta.env.VITE_PUBLIC_KEYVAL_NAME;
-if (!KEYVAL_NAME || typeof KEYVAL_NAME !== 'string') throw new Error('Missing env var: VITE_PUBLIC_KEYVAL_NAME');
+const KEYVAL_NAME = import.meta.env.RADROOTS_WEB_KEYVAL_NAME;
+if (!KEYVAL_NAME || typeof KEYVAL_NAME !== 'string') throw new Error('Missing env var: RADROOTS_WEB_KEYVAL_NAME');
-const NOSTR_CLIENT = import.meta.env.VITE_PUBLIC_NOSTR_CLIENT;
-if (!NOSTR_CLIENT || typeof NOSTR_CLIENT !== 'string') throw new Error('Missing env var: VITE_PUBLIC_NOSTR_CLIENT');
+const NOSTR_CLIENT = import.meta.env.RADROOTS_WEB_NOSTR_CLIENT;
+if (!NOSTR_CLIENT || typeof NOSTR_CLIENT !== 'string') throw new Error('Missing env var: RADROOTS_WEB_NOSTR_CLIENT');
-const RADROOTS_RELAY = import.meta.env.VITE_PUBLIC_RADROOTS_RELAY;
-if (!RADROOTS_RELAY || typeof RADROOTS_RELAY !== 'string') throw new Error('Missing env var: VITE_PUBLIC_RADROOTS_RELAY');
+const RADROOTS_RELAY = import.meta.env.RADROOTS_WEB_RELAY_URL;
+if (!RADROOTS_RELAY || typeof RADROOTS_RELAY !== 'string') throw new Error('Missing env var: RADROOTS_WEB_RELAY_URL');
const PROD = import.meta.env.MODE === 'production';
diff --git a/apps-lib/src/lib/utils/geo.ts b/apps-lib/src/lib/utils/geo.ts
@@ -1,6 +1,6 @@
import type { GeolocationPoint } from "@radroots/geo";
-export const geop_is_valid = (point?: GeolocationPoint): boolean => {
+export const geop_is_valid = (point?: GeolocationPoint): point is GeolocationPoint => {
if (!point) return false;
return !(point.lat === 0 && point.lng === 0);
};