Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Latest commit

 

History

History
60 lines (44 loc) · 3.62 KB

CONTRIBUTING.md

File metadata and controls

60 lines (44 loc) · 3.62 KB

Contributing to React Cool Form

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Working on your first Pull Request? You can learn how from this free video series.

Pull Request Process

  1. Fork the repository and create your branch from master.
  2. Run yarn to install dependencies.
  3. If you’ve fixed a bug or added code that should be tested.
  4. Ensure the test suite passes by running yarn test.
  5. Update related documents with details of changes to the interface.
  6. Update related examples if needed.
  7. Make sure your code lints by running yarn lint.
  8. Run yarn changeset to add a changeset.

Development Workflow

You can test new features or debug an issue by the way that I'm using.

  1. Run yarn link-pkg to link the package into the app directory.
  2. Run yarn start to create an ESM build and type definition file by rollup watch mode.
  3. Access the app directory.
  4. In the app directory, run yarn link-pkg to link with the package then run yarn start:dev to start development.
  5. Try something cool via the Playground.

Useful Commands

There're several useful commands that you can use during the development:

  • yarn link-pkg links the package into the app directory. You can develop or debug it via the playground.
  • yarn start creates a dist folder with an ESM build and type definition file by rollup watch mode.
  • yarn build:dev creates a dist folder with an ESM build and type definition file for development.
  • yarn build:prod creates a dist folder with package builds (CJS, ESM, and UMD) and type definition file. You can test the package locally via yarn link-pkg or yarn link.
  • yarn changeset adds a changeset.
  • yarn lint:code lints all .js and .tsx? files.
  • yarn lint:type runs the TypeScript type-checks.
  • yarn lint:format formats all files except the file list of .prettierignore.
  • yarn lint lints code, type, and format.
  • yarn test runs the complete test suite.
  • yarn test:watch runs an interactive test watcher (helpful in development).
  • yarn test:cov runs the complete test suite with coverage report.
  • yarn size checks the bundle size of each format.
  • yarn clean:build deletes the dist build folder.
  • yarn clean:size: deletes the .size-snapshot.json file.
  • yarn clean:cov deletes the coverage report folder.
  • yarn clean deletes the build, coverage, and size snapshot.

Style Guide

We use ESLint, StyleLint and Prettier for code style and formatting. Run yarn lint after making any changes to the code. Then, our linter will catch most issues that might exist in your code.

However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at Airbnb’s Style Guide will guide you in the right direction.

License

By contributing to React Cool Form, you agree that your contributions will be licensed under its MIT license.