@burdenoff/fe-libs 2026.514.1 → 2026.514.2

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.
@@ -23,12 +23,22 @@ export declare const PROD_HOSTS: Set<string>;
23
23
  export declare const ALPHA_HOSTS: Set<string>;
24
24
  export declare function getCurrentHostname(): string;
25
25
  /**
26
- * Resolve runtime gateway URLs from the current hostname.
26
+ * Resolve runtime gateway URLs from the current hostname, with an optional
27
+ * env-driven override for localhost dev servers.
27
28
  *
28
29
  * Priority:
29
- * 1. Known production domains (all products) production gateways
30
- * 2. Known alpha/staging domains (all products) alpha gateways
31
- * 3. Everything else local development defaults
30
+ * 1. Known production domains → PROD_GATEWAYS (hostname always wins for real deploys)
31
+ * 2. Known alpha/staging domains → ALPHA_GATEWAYS
32
+ * 3. Localhost-like host: `VITE_GATEWAY_TARGET` env var, case-insensitive
33
+ * - `'prod'` → PROD_GATEWAYS (emits a one-time console warning — mutations write to real data)
34
+ * - `'alpha'` → ALPHA_GATEWAYS
35
+ * - `'local'` or anything else → LOCAL_DEFAULTS
36
+ * 4. Everything else (unknown deployed domain, or localhost with no env):
37
+ * LOCAL_DEFAULTS (fails loud against a missing local stack rather than
38
+ * silently writing to prod — see BOFF-2507).
39
+ *
40
+ * Set the override in `<app-shell>/.env.local` (gitignored by Vite) to test
41
+ * a localhost dev server against a remote backend without editing source.
32
42
  */
33
43
  export declare function resolveGatewayUrls(): RuntimeGatewayUrls;
34
44
  //# sourceMappingURL=gatewayUrls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gatewayUrls.d.ts","sourceRoot":"","sources":["../../../src/shared/config/gatewayUrls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAoBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAkC/B,CAAC;AAEF,eAAO,MAAM,UAAU,aAGrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,aAA2D,CAAC;AAEpF,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CASvD"}
1
+ {"version":3,"file":"gatewayUrls.d.ts","sourceRoot":"","sources":["../../../src/shared/config/gatewayUrls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAoBD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAkC/B,CAAC;AAEF,eAAO,MAAM,UAAU,aAGrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW,aAA2D,CAAC;AAEpF,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AA8BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CA6BvD"}
@@ -15,9 +15,33 @@ var e = {
15
15
  function o() {
16
16
  return typeof window > "u" ? "" : window.location.hostname.toLowerCase();
17
17
  }
18
- function s() {
18
+ function s(e) {
19
+ return e ? e === "localhost" || e === "127.0.0.1" || e === "0.0.0.0" || e === "[::1]" || e === "::1" || e.endsWith(".localhost") || e.endsWith(".local.burdenoff.com") : !1;
20
+ }
21
+ var c = !1;
22
+ function l() {
19
23
  let r = o();
20
- return i.has(r) ? t : a.has(r) ? e : n;
24
+ if (i.has(r)) return t;
25
+ if (a.has(r)) return e;
26
+ if (s(r)) {
27
+ let n = u();
28
+ if (n === "prod") return c || (c = !0, console.warn("[gatewayUrls] WARNING: localhost dev server is configured to hit PRODUCTION backends (VITE_GATEWAY_TARGET=prod). Any mutation will modify real prod data. Remove the env var or delete .env.local to disable.")), t;
29
+ if (n === "alpha") return e;
30
+ }
31
+ return n;
32
+ }
33
+ function u() {
34
+ try {
35
+ return {
36
+ BASE_URL: "/",
37
+ DEV: !1,
38
+ MODE: "production",
39
+ PROD: !0,
40
+ SSR: !1
41
+ }?.VITE_GATEWAY_TARGET?.toLowerCase();
42
+ } catch {
43
+ return;
44
+ }
21
45
  }
22
46
  //#endregion
23
- export { r as ALL_PRODUCT_DOMAINS, a as ALPHA_HOSTS, i as PROD_HOSTS, o as getCurrentHostname, s as resolveGatewayUrls };
47
+ export { r as ALL_PRODUCT_DOMAINS, a as ALPHA_HOSTS, i as PROD_HOSTS, o as getCurrentHostname, l as resolveGatewayUrls };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.514.1",
3
+ "version": "2026.514.2",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {