mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 08:01:10 +00:00
[AZ-450] [AZ-451] [AZ-452] [AZ-454] Externalize URLs + accessors
Refactor batch 1 of 2 for the 01-testability-refactoring epic (AZ-447). Minimal-surgical edits to make the UI's external dependencies overridable for the test profiles in _docs/02_document/tests/environment.md. - AZ-450 (C03): tile URLs externalized to VITE_OSM_TILE_URL and VITE_ESRI_TILE_URL with the production strings as defaults. Fixes the AC-N3 / NFT-RES-03 air-gap regression and lets the e2e profile's tile-stub serve tiles deterministically. - AZ-451 (C04): Leaflet marker icon imported from the pinned leaflet package as a Vite asset; removes the unpkg.com CDN reference (also fixes the leaflet@1.7.1 vs ^1.9.4 mismatch). - AZ-452 (C05): getApiBase() accessor reading VITE_API_BASE_URL. request(), refreshToken(), and createSSE() prepend the prefix. Default '' preserves every call site. - AZ-454 (C07): JSDoc on setToken/getToken documenting the test-override intent so future cleanup doesn't delete them. Also: .env.example documents every VITE_* var; vite-env.d.ts declares ImportMetaEnv; .gitignore now excludes /dist and *.tsbuildinfo (tracked-by-mistake cache file removed). Build verification: `bunx tsc -b --noEmit` passes. No tests in this run (testability-run exemption per refactor SKILL — tests land in autodev Step 6). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# Azaion UI — Vite build-time environment variables.
|
||||
#
|
||||
# All variables here are read at build time via `import.meta.env.VITE_*` and
|
||||
# inlined by Vite. Copy this file to `.env.local` (gitignored) for local
|
||||
# dev; CI / Docker pass the same variables through the build environment.
|
||||
#
|
||||
# Every variable is OPTIONAL. When unset, the SPA falls back to production-
|
||||
# default behavior:
|
||||
# - VITE_API_BASE_URL : '' (relative paths; SPA and suite share nginx)
|
||||
# - VITE_OWM_API_KEY : undefined → getWeatherData returns null
|
||||
# - VITE_OWM_BASE_URL : https://api.openweathermap.org/data/2.5
|
||||
# - VITE_OSM_TILE_URL : https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
|
||||
# - VITE_ESRI_TILE_URL : https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
|
||||
|
||||
# Prefix for every API request (production: empty; tests / alt deployments: set).
|
||||
# A trailing slash is stripped automatically.
|
||||
# Example: VITE_API_BASE_URL=http://azaion-ui:80
|
||||
VITE_API_BASE_URL=
|
||||
|
||||
# OpenWeatherMap API key. Required for the FlightsPage weather feature.
|
||||
# Leave unset in CI tests — the e2e profile routes to owm-stub.
|
||||
VITE_OWM_API_KEY=<your-openweathermap-api-key>
|
||||
|
||||
# OpenWeatherMap REST base URL. Default targets the public endpoint; tests
|
||||
# override to point at the owm-stub service.
|
||||
# Example for the e2e profile: http://owm-stub:8081/data/2.5
|
||||
VITE_OWM_BASE_URL=
|
||||
|
||||
# OSM map tile URL template (Leaflet TileLayer.url).
|
||||
# Example for the e2e profile: http://tile-stub:8082/{z}/{x}/{y}.png
|
||||
VITE_OSM_TILE_URL=
|
||||
|
||||
# Esri satellite tile URL template (Leaflet TileLayer.url for the satellite layer).
|
||||
# Example for the e2e profile: http://tile-stub:8082/sat/{z}/{y}/{x}
|
||||
VITE_ESRI_TILE_URL=
|
||||
Reference in New Issue
Block a user