@expofp/config

中文文档
3.49.2发布于 2026/11/14MITTypeScriptES Module近 30 天下载 8417

ExpoFP SDK internal: config layer and schemas

原始使用文档

@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. Keys whose capability has been retired (?hide=, ?centerxy=, ?lang=, …) are listed in retiredKeys and swallowed, so an old link opens a clean plan instead of replaying its query as search text.

Also: applyIntents (dispatch selectBooth / changeLanguage / … to the floor plan), serializeConfigResources (collect schema-tagged assets + payloads for offline copies and normalized expo folders), resolveUrl / compactUrl (the $/<expo>/<hash>/<name> ⇄ https://<expo>.expofp.com/immutable/<hash>/<name> codec of a normalized folder's store refs — loadConfig follows the folder's pointer manifest.json to its immutable snapshot and expands the refs, so an effective config only ever carries full URLs), and toDebugSettings (config schema → @expofp/debug panel). Types re-export from @expofp/schema.

版本与发布记录

@expofp/config 共发布 116 个版本,首次发布于 2026/07/16;过去 12 个月发布了 116 个版本。

版本发布日期距今
3.49.2latest2026/11/14今天
0.0.0-experimental.3b0db16feat/wayfinding-compiler2026/11/13今天
3.49.12026/11/121 天前
3.49.02026/11/112 天前
3.48.02026/11/112 天前
3.47.22026/11/103 天前

其他发布通道:multi-venue → 0.0.0-experimental.cf063fc,stable → 3.47.0,eurotier → 0.0.0-experimental.6dabc65,feat/wayfinding-compiler → 0.0.0-experimental.3b0db16。

关于 @expofp/config 的常见问题

@expofp/config 是什么?

ExpoFP SDK internal: config layer and schemas

如何安装 @expofp/config?

在项目目录运行 npm install @expofp/config,或使用 pnpm add / yarn add / bun add。

@expofp/config 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@expofp/config 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@expofp/config 可以商用吗?

@expofp/config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@expofp/config 的下载量有多少?

根据 npm 官方下载统计,@expofp/config 在 2026/10/14 – 2026/11/12 这 30 天内被下载 8,417 次,日均约 281 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@expofp/config 还在维护吗?

最新版本 3.49.2 发布于 2026/11/14(今天);至今共发布 116 个版本,其中过去 12 个月发布了 116 个;首次发布于 2026/07/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。