The following steps will get you up and running to contribute to Spark:
- Fork the repo
- Clone your fork locally
git clone https://github.com/<your_github_username>/spark.git
cd spark
- Setup all the dependencies and packages. This command will install dependencies.
npm install
If you run into any problem during this step, feel free to open an issue
This project follows a monorepo structure. Each folder inside packages
is an independent package that can be consumed in isolation.
- NPM as package manager and to handle workspaces
- Lerna to manage and publish packages
- Vite to bundle packages
- Storybook for rapid UI component development and testing
- Vitest and RTL for testing components and hooks
Some of the most important commands are listed below.
-
npm install
install all dependencies -
npm run build
run build for all packages -
npm run build:watch
run build for all packages in watch mode -
npm run release
publish changed packages -
npm run lint
check for linting issues -
npm run prettier
check for formatting issues and fixes them -
npm run storybook:start
start storybook in development mode -
npm run storybook:build
build storybook
During development sometimes linking a package from this monorepo into your project could be useful
- Build packages in watch mode so changes can be detected
npm run build:watch
- Go to the package and link it
cd packages/components/button
npm link
- Link the package in your project
cd my-awesome-project
npm link "@spark-ui/dummy" // Make sure to use quotes around package name
Where you're done with your tests you may unlink the package with the following commands:
cd my-awesome-project
npm unlink --no-save "@spark-ui/dummy"
npm uninstall --global "@spark-ui/dummy"
All commits should follow the commit strategy
All commits that fix bugs or add features need a test that should follow the testing strategy
Since Spark is a community project pull requests are more than welcome. However, before working on a large change, it is best to open an issue first to discuss it with the maintainers.
When in doubt try to keep your Pull Request as small as possible. To give a Pull Request the best chance of getting accepted, don't add more than one feature or bug fix per Pull Request. It's often best to create two smaller Pull Requests than one big one.
- Follow the setup steps described above
- Create a new branch
git checkout -b my-branch
- Make changes, commit and push to your fork
git push -u origin HEAD
- Go to the repository and open a Pull Request.
By contributing your code to this GitHub repository, you agree to license your contribution under the MIT license.