`package.json` points `main` / `module` / `types` at `lib/…` paths that nothing generates. We've been papering over it with metro's `source` exports condition (and `unstable_conditionNames` in the macOS example), but that only works for local-path consumers running metro. A real npm tarball needs compiled `lib/` output.
This is the gate to the v1.0 npm publish goal.
Scope
- Add react-native-builder-bob as a devDependency — the standard RN-library build tool (used by most community modules).
- Configure bob targets: `module` (ESM JS) + `typescript` (declaration files). Skip `commonjs` — RN + modern bundlers consume ESM; can add later if a consumer needs it.
- Wire `package.json`:
- `prepare` script → `bob build` (runs on `npm install` in the repo + before publish).
- Confirm `main` / `module` / `types` / `exports` point at the generated paths bob produces.
- Keep the `source` exports condition first so local-path + metro dev still reads `src/` directly.
- Add `lib/` to `.gitignore` (build artifact, not committed).
- Verify `npm pack --dry-run` produces a tarball containing `lib/module/`, `lib/typescript/`, `src/`, `ios/`, `android/` (src + native), the podspec, `app.plugin.js`, `react-native.config.js`.
- CI: add a `build` job (or extend typecheck) that runs `bob build` so a broken build is caught.
Out of scope
- Actually publishing to npm (that's the v1.0 release moment — separate).
- API changes.
This is the last scaffolding gate before v1.0 is publishable.
`package.json` points `main` / `module` / `types` at `lib/…` paths that nothing generates. We've been papering over it with metro's `source` exports condition (and `unstable_conditionNames` in the macOS example), but that only works for local-path consumers running metro. A real npm tarball needs compiled `lib/` output.
This is the gate to the v1.0 npm publish goal.
Scope
Out of scope
This is the last scaffolding gate before v1.0 is publishable.