Contributions are always welcome, no matter how large or small.
Before contributing, please read the code of conduct.
- Ensure your environment is running Node.js 10+
- Git clone the React Decoy repository.
- From the root of the repository, run
npm install
to install development dependencies.
This project was bootstrapped using TDSX, to enable a consistent pre-configured environment for development of TypeScript-based utility packages.
If you’re new to TypeScript and React, checkout this handy cheatsheet
TDSX scaffolded the library inside /src
, and also set up a Parcel-based playground for it inside /example
.
The recommended workflow is to run TSDX in one terminal:
npm start
This builds to /dist
and runs the project in watch mode so any edits you save inside /src
causes a rebuild to /dist
.
Then run the example inside another:
cd example
npm install # to install dependencies
npm start
The default example imports and live reloads whatever is in /dist
, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. No symlinking required; TDSX uses Parcel's aliasing.
To do a one-off build, use npm run build
.
To run tests, use npm test
.
Code quality is managed with prettier
, husky
, and lint-staged
. The respective fields in package.json
can be adjusted to change their configuration.
Jest tests are set up to run with npm test
. This runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.
TSDX uses Rollup v1.x as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.
tsconfig.json
is set up to interpret dom
and esnext
types, as well as react
for jsx
.
Please submit pull requests to initiate discussions about your contributions, and allow us to merge them!
- Fork the repo and create your branch from
master
. - If you’ve changed APIs, update the documentation.
- Make sure your code lints.
- Push your changes to your own fork.
- Create your pull request.
By contributing to React Decoy, you agree that your contributions will be licensed under The Unlicense.