react-slate is a monorepo with multiple npm packages. The infrastructure is handled by yarn workspaces and Lerna.
The website is powered by Docusaurus with actual documentation living inside docs/ directory. If you want to locally see the changes, please follow the steps below:
git clone https://github.com/zamotany/react-slate.git(if you haven't)cd websiteyarnyarn start
This will spawn a server at http://localhost:3000 with the website. Now, whenever you make changes to docs/, reload the page and see your changes.
In order to contribute to the codebase, please follow the steps below to setup the development environment:
git clone https://github.com/zamotany/react-slate.git(if you haven't)cd react-slateyarn
From this point, you can use the following scripts:
yarn build- Transpilesrc/files tobuild/in every package frompackages/.yarn watch- Same asbuild, but also watches for changes in every package frompackages/.yarn flow- Runflowto type check the code.yarn lint- Run ESLint to line the code.yarn test- Run Jest to execute test suites.yarn format- Run Prettier to fix formating (usually you don't have to do it, since the prettier is integrated into ESLint).yarn link-packages- Runyarn linkin every package frompackages/.yarn add-contributor- Adds new contributor to a contributors list inREADME.md.
If you want to manually test your changes or see it in action, there's a package react-slate-playground, which you can use to experiment. Inside this project everything is liked, so all you need to do is run yarn build or yarn watch and then node ./packages/react-slate-playground/bin or yarn start to run it.
Alternatively, if you already have a project which uses react-slate, you can run yarn link-packages and then link each package to in your project using yarn link <package-name> eg: yarn link react-slate. Remember to run yarn build after making changes or have yarn watch running.
- Please make sure the test, flow and lint are passing.
- Please add yourself to a contributors list by running
yarn add-contributor.