All work on Rock happens directly on GitHub. Contributors send pull requests which go through review process.
Working on your first pull request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
- Fork the repo and create your branch from
main(a guide on how to fork a repository). - Run
pnpm ito install all required dependencies. - Run
pnpm watchto automatically build the changed files. - Now you are ready to do the changes.
Please make sure the version of React Native matches the one present in devDependencies of Rock. Otherwise, you may get unexpected errors.
Because of a modular design of the Rock, we recommend developing using symbolic links to its packages. This way you can use it seamlessly in the tested project, as you'd use the locally installed Rock CLI. Here's what you need to run in the terminal:
cd /path/to/cloned/rock/
pnpm link-packagesAnd then in your test project link dependencies you're using, e.g.:
cd /my/test/project/
pnpm link rock @rock-js/platform-android @rock-js/platform-ios @rock-js/plugin-metroSet node-linker to hoisted in your test project's .npmrc file for pnpm to place the node_modules in a way that React Native platform tooling expects:
node-linker=hoisted
When using Metro plugin, you'll need to update the watchFolders to hint Metro to look for symlinks in Rock project. You can do this by adding the following to your metro.config.js:
{
watchFolders: [path.resolve(__dirname, '../path/to/rock')],
}This configuration is not necessary when using Re.Pack plugin.
pnpm rock start
pnpm rock run:androidIn order to test changes to create-app package, you need to run the following commands:
# Ensure fresh build
pnpm build
# Start local verdaccio registry (in one terminal), keep it open
pnpm verdaccio:init
# Publish packages to verdaccio (in another terminal)
pnpm verdaccio:publish
# Remove pnpm dlx cache, so that new version of package is used
rm -rf ~/Library/Caches/pnpm/dlx/
# Run tests
pnpm e2e
# Or Create Rock app
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm create rock --registry http://localhost:4873
# Then use pnpm install with registry
echo "node-linker=hoisted" > .npmrc
NPM_CONFIG_REGISTRY=http://localhost:4873 pnpm install
# Then link packages (see above)
pnpm link --global ...
# Clean up
pnpm verdaccio:resetCurrently we use TypeScript for typechecking, eslint with prettier for linting and formatting the code and jest for testing.
pnpm lint: runeslintandprettierpnpm test: run unit tests
We prefix our commit messages with one of the following to signify the kind of change:
- build: Changes that affect the build system or external dependencies
- ci, chore: Changes to our CI configuration files and scripts
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code
- test: Adding missing tests or correcting existing tests
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that TypeScript,
eslintand all tests are passing. - Preview the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
This part is for maintainers only, documenting steps to manually publish the packages with Changesets.
- Pull latest changes for the stable branch.
- Run
pnpm run publish, it will tag the packages aslatest. - Chose an appropriate version from the available options.
- Create release notes in the project's Release tab.
- Pull latest changes for the
mainbranch. - Run
pnpm run publish:next, it will tag the packages asnext. - Use
Custom prereleaseoption and go with-alpha.Nconvention. - Create release notes in the project's Release tab.
- Pull latest changes for the N.x branch (where N stands for major legacy version).
- Run
pnpm run publish --dist-tag N.xto tag the packages asN.x. - Chose an appropriate version from the available options.
- Create release notes in the project's Release tab.
You can report issues on our bug tracker. Please follow the issue template when opening an issue.
This repository is using bot to automatically mark issues and PRs as stale and close them. The "stale" label is added after 90 days of inactivity, and it's getting closed 7 days later. If you find the issue important or you want to keep it open for any particular reason, please show any activity in the issue or contact maintainers to add the "no-stale-bot" label, which prevents bot from closing the issues.
By contributing to Rock, you agree that your contributions will be licensed under its MIT license.