Contributing
Development server
We are using Vite to power our playground, which caches all the built @rjsf/* distributions.
In order to test the playground locally after a new clone or fresh pull from main, run the following from the root directory of the monorepo:
npm install
npm run build
cd packages/playground
npm start
This will start the live development server showcasing components at localhost:8080.
Whenever you make changes to source code, stop the running playground and return to the root directory and rerun npm run build.
Thanks to nx caching, this should only rebuild what is necessary.
After the build is complete, return to the root of the playground and restart the server via npm start.
First time step
If this is the first time you have cloned the repo, run the npm run prepare script that will set up husky to provide a git precommit hook that will format and lint any code you have added to a PR.
Optional development process
With the large number of packages, sometimes running npm run build or npm start from the root directory will overwhelm an underpowered computer.
If that is the situation for you, you can instead use npm run build-serial to build the packages one at a time instead of all at once.
Also, if you are only working on one package, you can npm run build and npm run test from within the subdirectory.
Finally, you can simply npm start inside of the playground directory to test changes if you have already built all of your packages, without needing to watch all of the packages via the root directory npm start.
Troubleshooting build failures
Sometimes your local builds fail and you can't figure out why. This is most likely to happen after rebase to main due
to package.json changes upstream. There are two commands you can use to (hopefully) get your environment back to a
working state. Try running the following two commands:
npm run refresh-node-modules
npm run clean-build
The first command will delete all of the node_modules directories in the environment and then rerun npm install.
The second command cleans up the typescript build cache files before retrying the build.
Worst case scenario when neither of those commands work, try running npm run nuke-build-env and then rerun the two commands.
Cloud builds
When building in environments with limited memory, such as Netlify, it's recommended to use npm run build-serial that builds the packages serially.