@expofp/config
The effective-config layer for the ExpoFP SDK. loadConfig() assembles the runtime's single copy of
the expo data by layering manifest (+ legacy data.js) → options → localStorage → URL, resolving
$refs via @expofp/resolve against @expofp/schema; setConfig/getConfig hold the result.
setConfig(await loadConfig(manifestUrl));
const config = getConfig();
Schema validation of the manifest and referenced documents (data.js, drawing, wayfinding) is an
opt-in diagnostic — off by default (parsing the large expo documents costs time). Enable it per page
load with ?validateSchema=1 in the URL or efp-validateSchema=true in localStorage (also a
@expofp/debug panel toggle); timing for the parses it turns on logs on the efp:config:validate
namespace. It is a load-time input only — the effective config never carries it.
Intents from the URL ride the query in two forms, merged canonical-first: the bracketed array
(?intents[0][name]=selectBooth&intents[0][args][0]=A-12) and a typable shortcut — the intent name
as the key (?selectBooth=A-12, ?changeLanguage=fr; multi-arg via ?name[0]=…&name[1]=…). The
shortcut keys are the IntentsSchema arm names, so the schema stays the URL allowlist; one shortcut
per intent name, and a value that doesn't fit its intent is dropped (a visitor-edited URL never
breaks boot).
The legacy URL grammar (legacy-url.ts) is the compact deep-link language the floor plan has
always spoken — ?<slug>, ?route:B-12:A-3:false, ?tour=t1, ?planner=a:b&from=c, one-shot
params like ?blue-dot=…. parseLegacyQuery turns a raw location.search into typed commands and
serializeSelection writes a selection back in the same grammar (round-trip covered by tests), so
shared links stay bidirectional. The floor plan's url-dispatch service binds the commands to
stores and public methods; this codec stays pure — no DOM, no stores.
Also: applyIntents (dispatch selectBooth / changeLanguage / … to the floor plan),
serializeConfigResources (collect schema-tagged assets + payloads for offline copies), and
toDebugSettings (config schema → @expofp/debug panel). Types re-export from @expofp/schema.
Build/test: nx build config · nx test config.