Skip to main content

Contributing

Bug reports, fixes and documentation improvements are welcome. Report a bug with the bug template.

Set up​

You need Bun 1.4.4 or newer. iOS work needs Xcode 27; Android work needs the Android SDK and NDK that NitroUI requires.

bun install # links the workspace, copies tgfx into vendor/ and prepares the example
bun run specs # regenerates nitrogen/generated after a spec change
PathContents
packages/nitro-ui-sketch/srcThe TypeScript API, the components and the *.nitro.ts specs.
packages/nitro-ui-sketch/cppThe shared C++ ink engine and the hybrid objects.
packages/nitro-ui-sketch/ios, objcThe iOS views (Swift) and the Metal canvas view.
packages/nitro-ui-sketch/androidThe Android views (Kotlin) and the JNI bridge.
exampleA NitroUI app that calls the API, and the native tests.
websiteThis documentation site.

After changing a *.nitro.ts spec or a type it imports, regenerate the bindings with bun run specs. Never edit nitrogen/generated.

Checks​

CI runs these on every pull request:

bun run lint
bun run format:check # `bun run format` fixes formatting
bun run typecheck
bun run test # TypeScript unit tests
bun run test:cpp # host C++ tests of the ink engine (clang++)

Tests​

Native behaviour is covered by nitro-ui-harness tests in example/__tests__, which run inside the example app:

bun run test:ios --device "<simulator name or UDID>"
bun run test:android --device <adb-serial>

Name tests that only apply to one platform *.ios.harness.ts or *.android.harness.ts.

Pull requests​

  • Keep the Swift and Kotlin implementations in step. If a behaviour differs between platforms, document it.
  • Add an entry under ## [Unreleased] in packages/nitro-ui-sketch/CHANGELOG.md for user-visible changes.
  • Add or update harness tests for native behaviour.

Documentation site​

The site lives in website/, a standalone Docusaurus project outside the Bun workspace.

cd website
bun install
bun run start # dev server with live reload
bun run build # production build; broken links fail it

The changelog page renders packages/nitro-ui-sketch/CHANGELOG.md directly, so release notes need no second copy.