Thank you for your interest in contributing to Craby!
- Code of Conduct
- Getting Help
- How to Contribute
- Development Setup
- Unit Tests
- E2E Testing
- Code Quality Checks
- Pull Request Process
- Commit Message Guidelines
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to dev.ghlee@gmail.com.
If you have questions or need help getting started, use GitHub Discussions.
- Report bugs: Open an issue with a clear description and reproduction steps.
- Suggest features: Start a discussion or open an issue.
- Improve documentation: Fix typos, add examples, or clarify instructions.
- Submit pull requests: Fix bugs, add features, or improve existing code.
Craby uses mise to manage Node.js and Rust versions.
mise trust && mise install # Rust nightly + Node LTS
yarn install # Install JS dependencies
yarn prepare # Full build (all packages)yarn workspace @craby/cli-bindings build
yarn workspace crabygen run execute <command> [options]cd examples/craby-test
yarn crabygen <command> [options]cargo test --all # Run all Rust unit tests
cargo insta test --workspace # Run snapshot tests and collect diffs
cargo insta review --workspace # Review and accept snapshot changesIf your changes affect code generation, snapshot tests will fail. Always run
cargo insta review --workspaceand carefully inspect each diff before accepting.
yarn workspaces foreach --all --topological-dev run typecheck # Type check all packagesThe NAPI bindings tests load the native binary against an actual Metro bundle. Start the Metro bundler from one of the example apps first, then run the tests:
# Terminal 1 — start Metro (use either 0.76 or 0.80)
cd examples/0.76 # or examples/0.80
yarn start
# Terminal 2 — run Vitest
yarn workspace @craby/cli-bindings testWhen modifying craby_codegen:
- Add the new type/method case to
crates/craby_codegen/src/tests/mod.rs - Run
cargo insta test --workspace→cargo insta review --workspaceto update snapshots - Add the corresponding method to
examples/craby-test/src/NativeCrabyTest.ts(TS spec) andexamples/craby-test/crates/lib/src/craby_test_impl.rs(Rust impl), then regenerate and build:cd examples/craby-test yarn crabygen codegen # regenerate bindings yarn crabygen build # build native libraries
- Include all regenerated files (under
examples/craby-test/) in the same commit as the codegen change. This keeps the generated artifacts in sync and avoids stale diffs in later PRs. - Add an E2E assertion in
examples/test-suites/src/test-suites.ts
E2E testing runs the full workflow on a real React Native app.
-
Build CLI bindings:
yarn workspace @craby/cli-bindings build
-
Generate code and build native libraries:
cd examples/craby-test yarn crabygen codegen yarn crabygen build
Test against both React Native versions:
examples/0.80— React Native 0.80examples/0.76— React Native 0.76
For each app:
Metro must be running before launching the app. Without it the JS bundle won't load and all tests will fail.
cd examples/<version>
yarn startyarn pod:install # Install CocoaPods dependencies
yarn ios # Build and launch on simulatorOr build manually via Xcode using examples/<version>/ios/*.xcworkspace.
yarn android # Build and launch on emulator/deviceOr build manually via Android Studio.
- Launch the app on your device/simulator/emulator
- Tap Run All Tests
- Verify all items show Passed
- Test on both React Native versions (0.76 and 0.80)
- Test on both iOS and Android
- All tests must pass before submitting a PR
Run these locally before opening a PR.
yarn lint:all # Lint + format check
yarn lint:fix # Auto-fixcargo clippy --all -- --deny warnings # Lint
cargo fmt --all -- --check # Format check
cargo fmt --all # Format (apply)
cargo test --all # Tests- Fork the repository
- Implement your change and run all quality checks
- Commit following the commit message guidelines
- Open a PR against the
mainbranch - A maintainer will approve the CI workflow — all checks must pass before merge
We follow Conventional Commits:
<type>: <description>
[optional body]
[optional footer]
Common types: feat, fix, chore, docs, refactor, test
Thank you for contributing to Craby!