Skip to content

Latest commit

 

History

History
110 lines (67 loc) · 2.96 KB

CONTRIBUTING.md

File metadata and controls

110 lines (67 loc) · 2.96 KB

Contributing

Setup

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

Development

This project follows a monorepo structure. Each folder inside packages is an independent package that can be consumed in isolation.

Tooling

  • 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

Commands

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

Linking packages

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

Commiting changes

All commits should follow the commit strategy

Tests

All commits that fix bugs or add features need a test that should follow the testing strategy

Creating a Pull Request

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.

License

By contributing your code to this GitHub repository, you agree to license your contribution under the MIT license.