feat: task 1.3 vite dev proxy + tsconfig hardening
Same-origin dev proxy via Vite's server.proxy:
- /api/* -> ${VITE_DEV_DIRECTUS_URL}/* (Directus REST + GraphQL)
- /ws-business -> ws://.../websocket (Directus business-plane WS)
- /ws-live -> ${VITE_DEV_PROCESSOR_WS_URL} (Processor live WS, Phase 1.5)
WS proxy targets derive ws:// scheme from the http(s) Directus URL.
loadEnv reads VITE_DEV_* overrides; sensible localhost defaults.
tsconfig.app.json: noUncheckedIndexedAccess + noImplicitOverride.
.env.example documents the two override vars; .env.local is gitignored
via the existing *.local pattern.
README "Local dev" section: proxy table + override instructions + port
collision workaround.
Deviation: spec called for .env.dev.example/.env.dev.local but Vite's
dev mode is "development" not "dev", so mode-specific files would be
.env.development.* and Vite wouldn't auto-load .env.dev.local. Switched
to the standard Vite .env.example/.env.local convention. Documented in
the task's Done section.
Plus: backfill 1.2 commit SHA (9918418) in its Done section.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Local dev overrides for vite.config.ts proxy targets.
|
||||
# Copy to .env.local (gitignored, auto-loaded by Vite) and edit to point
|
||||
# at your local services. Both have sensible defaults matching the dev
|
||||
# compose stack — only override when you need to.
|
||||
|
||||
# Directus REST + GraphQL + business-plane WebSocket host.
|
||||
# Defaults to http://localhost:8055 (the dev compose default).
|
||||
# The WS proxy target is derived by swapping http(s):// for ws(s)://.
|
||||
VITE_DEV_DIRECTUS_URL=http://localhost:8055
|
||||
|
||||
# Processor live-position WebSocket. Defaults to ws://localhost:8081
|
||||
# (the LIVE_WS_PORT default in the processor's Phase 1.5 task spec).
|
||||
VITE_DEV_PROCESSOR_WS_URL=ws://localhost:8081
|
||||
Reference in New Issue
Block a user