@everframe/metro

中文文档
1.7.0发布于 2026/11/04MITTypeScriptES Module近 30 天下载 2396

Metro serializer integration that stamps a build identity into React Native bundles for Everframe symbolication.

原始使用文档

@everframe/metro

withEverframe(config, { projectRoot, dev }) preserves the existing Metro configuration and adds a synchronous identity polyfill for Android and iOS. It generates a build ID and writes .everframe/<buildId>/manifest.partial.json with an identity.js polyfill. The polyfill sets globalThis.__EVERFRAME_BUILD__ before application modules execute.

Each platform has its own ID and bundle name: index.android.bundle on Android, main.jsbundle on iOS. Native version, release labels and OTA provider update IDs must not replace this bundle identity. Set enabled: false when the corresponding SDK is excluded from a build.

Use one isolated staging directory for each build job. Metro stages both platforms at configuration time. Collection reads the generated identity from the composed map, checks the staged partial and compiled build ID, and promotes that completed build to latest-<platform>.json. A later configuration load before collection is safe; do not run another Metro invocation between collection and upload. Retain matching bytecode and maps; reusing a build ID with different generated bytes is not a new release.

After the Hermes compiler has emitted bytecode and its composed map:

npx @everframe/cli build collect --staging .everframe --platform android \
  --bundle path/to/index.android.bundle \
  --source-map path/to/index.android.bundle.map
npx @everframe/cli build verify --staging .everframe --platform android --release
npx @everframe/cli sourcemaps upload-hermes --manifest .everframe \
  --platform android --app-id "$EVERFRAME_APP_ID"

Provide the scoped EVERFRAME_API_TOKEN only to the build/upload process. See the Expo Updates guide for export and loaded-bundle identity.

Source commit provenance

Current React Native SDKs attach the loaded Hermes bundle identity to ordinary feedback reports as well as crashes. Release-health monitoring can be disabled; the report still resolves the exact uploaded bundle, including OTA updates sharing a native version/build.

React Native iOS/Android builds record an optional Git commit, branch, and dirty status. Metro captures these before writing staging files; collection and upload preserve that snapshot, including Expo exports and OTA updates. Keep .everframe/ in your Git ignore rules. A missing Git checkout does not stop builds or uploads.

Explicit withEverframe(config, { commit: '<full-sha>' }) takes precedence over local HEAD, then CI fallback (GITHUB_SHA, CI_COMMIT_SHA, BITBUCKET_COMMIT, BUILD_SOURCEVERSION). Use a full 40- or 64-character hexadecimal commit. Detached checkouts omit the branch; unavailable status is unknown, not clean.

everframe sourcemaps upload-hermes, upload-expo-export, and native dsym, elf, and r8 upload commands accept --commit <full-sha>. An override with a different commit drops recorded branch/dirty facts. Legacy staged records without provenance stay unknown; delayed staged uploads never read the uploader's HEAD. Direct single-artifact uploads detect Git at invocation from the working directory, so use --commit when uploading older files. Aggregate native dsym upload-build and elf upload-build commands (including Xcode/Gradle integration) leave source provenance unknown by default: their symbols may include reused or vendor binaries. Use --commit only when every selected artifact belongs to that source commit; otherwise upload each known artifact with its own explicit commit. Automatic per-artifact native source attribution remains follow-up work.

The service must support the additive vcs manifest field before using these tooling versions. Older clients remain supported by the updated service. Deploy server support before publishing the new tooling; do not strip provenance in response to an arbitrary upload failure.

版本与发布记录

@everframe/metro 共发布 14 个版本,首次发布于 2026/10/12;过去 12 个月发布了 14 个版本。

版本发布日期距今
1.7.0latest2026/11/049 天前
1.6.72026/10/2916 天前
1.6.52026/10/2717 天前
1.6.42026/10/2717 天前
1.6.22026/10/2717 天前
1.6.12026/10/2420 天前

关于 @everframe/metro 的常见问题

@everframe/metro 是什么?

Metro serializer integration that stamps a build identity into React Native bundles for Everframe symbolication.

如何安装 @everframe/metro?

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

@everframe/metro 支持 TypeScript 吗?

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

@everframe/metro 支持 ESM 还是 CommonJS?

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

@everframe/metro 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@everframe/metro 可以商用吗?

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

@everframe/metro 的下载量有多少?

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

@everframe/metro 还在维护吗?

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