Contributing to PurifyCSS
We welcome contributions from the community! Whether it's a bug report, a new feature, or an improvement to the documentation, your help is appreciated.
Development Setup
To get started with development, you'll need to set up the project locally.
-
Fork and Clone: Fork the repository on GitHub, then clone your fork locally.
git clone https://github.com/YOUR_USERNAME/purifycss.git cd purifycss
-
Install Dependencies: The project uses npm to manage its dependencies. Install them by running:
npm install
Project Scripts
The package.json
file contains several scripts to help with development:
-
npm run build
: Builds the project from thesrc/
directory into thelib/
directory using Rollup. This creates both CommonJS and ES Module versions of the library. -
npm run dev
: Starts a watch process that automatically rebuilds the library whenever you make changes to the source files insrc/
. -
npm run test
: Runs the entire test suite using Jest. All tests are located in the__tests__
directory.
Code Style
This project uses ESLint to enforce a consistent code style. The rules are defined in the .eslintrc
file. Before submitting a pull request, please ensure your code conforms to these standards. You can check your code by running your editor's ESLint integration or by setting up a pre-commit hook.
Submitting a Pull Request
- Create a new branch for your feature or bugfix.
- Make your changes and add tests for them if applicable.
- Ensure all tests pass by running
npm run test
. - Commit your changes with a clear and descriptive message.
- Push your branch to your fork.
- Open a pull request from your fork to the
purifycss/purifycss
master
branch.
Please provide a clear description of the changes in your pull request.