- Library source lives in
src/(TypeScript hooks, Zustand store, platform bridges). Unit tests sit insrc/__tests__/. - Native shims reside in
ios/andandroid/. Keep edits in sync with the public TypeScript API. - Built artifacts are generated into
lib/via Bob; never edit files there directly. - The
example/workspace is a React Native app used for manual QA. Docs and specs are indocs/plusspec-*.md.
yarn preparerunsbob buildto emit CommonJS, ESM, and type bundles intolib/.yarn testexecutes Jest in JSDOM. Useyarn test --watchfor focused runs.yarn lintlints all JS/TS files with the React Native ESLint config;yarn typecheckrunstsc --noEmit.yarn checkchains lint, types, prepare, and test. Run locally before raising a PR.yarn example start|ios|androidboots the showcase app from the workspace root.
- Follow the configured ESLint (
@react-native/eslint-config) and Prettier (tab width 2, semicolons enabled) rules; runyarn lint --fix && yarn prettier . --writeif needed. - Use PascalCase for React components, camelCase for hooks/utilities (e.g.,
useAudioQueue), and SCREAMING_SNAKE_CASE for environment constants. - Keep platform-specific files suffixed with
.ios.ts,.android.ts, or.native.tsxwhere platform divergence is required.
- Write Jest specs beside source or under
src/__tests__with filenames ending in.test.ts[x]. - Prefer React Testing Library or plain Jest mocks; avoid snapshot churn unless documenting UI regressions.
- Target meaningful coverage for audio state reducers and native bridge adapters; add regression tests for reported issues before fixing.
- Commit messages should follow Conventional Commits (enforced via Commitlint and Lefthook). Scope by surface area, e.g.,
feat(player): support bookmarking. - Keep commits focused; include failing/ignored tests only with a linked follow-up.
- PRs target
main, reference the Linear ticket in the title (ENG-123 short summary), and describe problem, solution, verification (yarn check, platform QA), plus any screenshots for UI-facing changes.
- Lefthook runs ESLint and TypeScript pre-commit; fix staged files or skip with
SKIP=lint git commitonly in emergencies. - Releases go through
yarn release(release-it) afteryarn check. Follow the generated changelog prompts and verify the example app builds on both platforms first.