Thanks for your interest in contributing! This guide covers the end-to-end workflow: setting up the repo, making changes, writing tests, documenting, versioning, and releasing.
- Node.js 20+ (see
.nvmrc) - npm 10+
- Familiarity with React Native, TypeScript, and testing.
git clone https://github.com/polprog-tech/native-ui.git
cd native-ui
npm installThe library lives in packages/native-ui. The Storybook app lives in
apps/storybook and renders live examples from the library's stories/
folder.
# Start Storybook in dev mode
npm run storybook
# Build the library (required after touching src/ when consumed via file:)
npm run build --workspace=@polprog/native-ui
# Run the library tests in watch mode
npm run test:watch --workspace=@polprog/native-ui- Fork & branch - branch names:
feat/...,fix/...,docs/...,chore/.... - Code - keep edits surgical; match the existing style.
- Tests - every new component needs unit tests; every bug fix needs a regression test.
- Stories - every new component needs a story under
packages/native-ui/stories/. Runnpm run stories:checkto verify. - Changeset - run
npx changesetand pick the semver bump (patch/minor/major). Commit the generated file. - CI - all jobs (typecheck, lint, tests, story coverage, Storybook build, Chromatic) must pass.
Commits follow Conventional Commits:
feat(Button): add `destructive` variant
fix(Switch): correct iOS off-state track colour
docs(readme): refresh typography scale table
Every component in @polprog/native-ui must:
- Match the iOS Human Interface Guidelines / Android Material metrics exactly (font sizes, paddings, corner radii, control heights). When in doubt, measure the the native platform counterpart.
- Be accessible: role, label,
accessibilityHintwhere helpful; respectreduceMotion. - Ship a Storybook story demonstrating every variant and state.
- Ship unit tests for core behaviour (rendering, interaction, a11y).
- Build on top of the primitive layer (
Box,VStack,HStack, ...) rather than raw React Native views wherever practical.
Rule of thumb: if a component is used by only one app, it belongs in that app. If two or more apps need it, it belongs in
native-ui.
Releases are automated via Changesets:
- Contributors add
.changeset/*.mdentries in their PRs. - When merged, the
releaseworkflow opens a Version Packages PR that bumps versions and updatesCHANGELOG.md. - Merging the Version Packages PR publishes to npm and pushes a tag.
Maintainers with NPM_TOKEN and GITHUB_TOKEN can trigger manual releases
with npm run release.
Please report security issues privately - see SECURITY.md.
Participation is governed by our Code of Conduct.