Skip to content

Contributing

Note: we prefer English language for all communication.

Creating an issue

#

Before creating an issue please ensure that the problem is not already reported.

If you want to report a bug, create a reproduction using StackBlitz or CodeSandbox. If you want to request a feature, add motivation section and some usage examples.

Sending a Pull Request

#
  1. fork and clone the repository
  2. create a development branch from v3
  3. install dependencies from the root of the repo (node@18 and npm@8 are required):
    Terminal window
    npm install
    Note: this command installs dependencies for all packages, but only builds packages included in @reatom/framework, like core, utils, async, etc.
  4. build the package you are editing from the root of the repo:
    Terminal window
    npx turbo run build --filter=<PACKAGE_NAME>
    Replace <PACKAGE_NAME> with the relevant package name like persist or npm-react
  5. make changes and commit them
  6. upload feature branch and create a Pull Request to merge changes to v3
  7. link your PR to the issue using a closing keyword or provide changes description with motivation and explanation in the comment (example: fix #74)
  8. wait until a team member responds

Creating a package

#

The goal of Reatom ecosystem is to provide adapters for Web APIs and popular npm modules. Therefore, the process of creating a new package is almost identical to editing an existing one (Sending a Pull Request), but you should also create the package using an interactive script ran in the repository root:

Terminal window
npm run package-generator

Add needed dependencies by running npm install in your package’s directory. If you’re making an adapter for a particular npm library (like @reatom/npm-react for React), the library should be saved as peer: npm install --save-peer <LIBRARY>

Package naming rule

#

Packages that integrate Reatom with external APIs should have their names prefixed with API or library source kind: node-, npm-, web-. For example, @reatom/npm-history provides an adapter for the history package. Similarly, a potential adapter for Web History API would be named @reatom/web-history.

Coding guide

#
  • bug fixes should also add tests that reproduce the addressed bug
  • all new features should be tested and documented
  • use // @ts-ignore if you not sure why error appears or you think it could be better, use // @ts-expect-error if you sure that error is a mistake

Commit messages

#

Commit messages should follow the Conventional Commits specification:

<type>[optional scope]: <description>

Allowed <type>

#
  • chore: any repository maintainance changes
  • feat: code change that adds a new feature
  • fix: bug fix
  • perf: code change that improves performance
  • refactor: code change that is neither a feature addition nor a bug fix nor a performance improvement
  • docs: documentation only changes
  • ci: a change made to CI configurations and scripts
  • style: cosmetic code change
  • test: change that only adds or corrects tests
  • revert: change that reverts previous commits

Allowed <scope>

#

Package directory name. Eg: /packages/effects is scoped as effects.

<description> rules

#
  • should be written in English
  • should be in imperative mood (like change instead changed or changes)
  • should not be capitalized
  • should not have period (.) at the end

Commit message examples

#
docs: fix typo in npm-react
fix(core): add check for atoms with equal ids