src/: TypeScript API (index.tsx,index.web.tsx) and Nitro spec insrc/specs/*.nitro.ts.- Native:
android/(Kotlin + C++ adapter) andios/(Swift). Generated bindings live undernitrogen/(c++/kotlin/swift) — do not edit. - Example app:
example/(Yarn workspace) for local testing on iOS/Android/Web. - Plugin:
plugin/Expo config plugin code. Tests:src/__tests__/.
yarn prepare: Build library with bob and run Nitro codegen; required after changing specs and before publishing.yarn nitrogen: Regenerate native bindings from specs.yarn typecheck: TypeScript checks.yarn lint: ESLint + Prettier. Auto-fix withyarn lint --fix.yarn test: Jest (react-native preset).- Example app:
yarn start,yarn ios,yarn android,yarn web(proxied toexample/). yarn clean: Remove build outputs (lib/, example and Android/iOS builds).
- TypeScript with 2-space indent, single quotes, trailing commas (es5) — enforced by Prettier and ESLint (
eslint.config.mjs). - Naming: camelCase (vars/functions), PascalCase (classes/types). Use
.web.tsxfor web-specific entry. - Public API lives in
src/. Modify behavior viasrc/specs/*.nitro.tsand native implementations; never hand-editnitrogen/generated/**.
- Framework: Jest with
react-nativepreset. Place tests insrc/__tests__/*.test.ts(x). - Add/adjust tests for new features and bug fixes; keep tests deterministic.
- Run locally with
yarn test. Type safety is enforced byyarn typecheck.
- Conventional Commits enforced via commitlint (e.g.,
feat: add playback speed). - Hooks (lefthook): pre-commit runs
eslintandtsc; commit message is linted. - PRs: include a clear description, linked issues, platform impact, and updated docs (e.g.,
README.md,docs/MIGRATION.md). If native changes, verify on both iOS and Android; update theexample/app if behavior changes.
- Bridge is implemented with
react-native-nitro-modules. Define the surface insrc/specs/*.nitro.ts, implement natively (Kotlin/Swift), then regenerate withyarn nitrogen/yarn prepare. - Android/iOS permissions: verify microphone access during local testing (see example app configuration).