waygraph / resolveBaseUrl
Function: resolveBaseUrl()
resolveBaseUrl(
projectDir):Promise<string|undefined>
Defined in: src/runtime/waygraph-config.ts:310
Single source of truth for a project's base URL. Was three independently drifted copies (src/cli/flags.ts, src/live/traverse/traverse.ts, src/live/auto/auto.ts), each checking a slightly different subset of sources in a different order - real duplication, not just stylistic, since one copy skipped config.waygraph.* nesting and another checked WAYGRAPH_BASE_URL first instead of last. Checked in this order:
WAYGRAPH_BASE_URL- a real shell export, or one loaded from a.envfile (seeloadEnvFiles, called here so every caller gets native.envsupport for free, not just whichever command remembered to call it).- A
waygraph.config.*file'sbaseUrl.
Parameters
projectDir
string
Returns
Promise<string | undefined>