Skip to content

Latest commit

 

History

History
158 lines (101 loc) · 4.24 KB

CONTRIBUTING.md

File metadata and controls

158 lines (101 loc) · 4.24 KB

Contributing to windicss

Thanks for your interest in contributing! Please read carefully through our guidelines below to ensure that your contribution adheres to our project's standards.

Issue Tracking

We use GitHub Issues to track all tasks related to this project.

Build the project locally

In order to contribute to windicss, you must first get a copy of the project running locally on your computer.

There are five steps to building this project:

  1. Set up Git and Install Node.js
  2. Fork the repository
  3. Clone your fork
  4. Install dependencies
  5. Build the project

Set up Git and Install Node.js

All GitHub projects are backed by a version control software called Git. You'll need to set up Git in order to contribute to any project on GitHub.

This specific project is written in JavaScript and uses Node.js as it's runtime. You'll need to install Node.js in order to run the project.

Fork the repository

A fork is a copy of a repository. Forking a repository lets you to make changes to your copy without affecting any of the original code.

Click Fork (in the top-right corner of the page) to copy this repository to your GitHub account.

Clone your fork

Use git to clone your fork to your computer.

git clone https://github.com/${username}/windicss.git

Install dependencies

This project uses pnpm, a command-line tool bundled with Node.js, to maintain third-party dependencies.

First, navigate into the project's directory

cd windicss

Next, use pnpm to install the project' dependencies

pnpm install

Build the project

Development Version

pnpm build

Production Version

pnpm build:prod

Submit a Pull Request

After you successfully build the project, you can make some changes of your own.

There are five steps to submit pull request:

  1. Create a new branch
  2. Make your changes
  3. Test your changes
  4. Push your changes
  5. Open a Pull Request

Create a new branch

git branch fix-issue-123
git checkout fix-issue-123

Make your changes

Make sure your code is following TypeScript Style Guide.

Lint your code:

pnpm lint

Test your changes

You should add a new test file for your changes into test folder, the file should has extension .test.ts.

Run tests:

pnpm test

Generate coverage report:

pnpm coverage

Test changes in a real project

To test the changes you made, you can use the playground project.

  1. In the windicss root project directory, run:

    pnpm install
  2. In the first terminal, run pnpm dev in the windicss project directory, and in the second one open the playground directory and run pnpm dev.

    This would set up a watcher that would rebuild the windi.css file in the playground directory every time you make a change in the windicss source code. You would need something like Live Server to see your changes in the browser.

Development

Open two editors, one with the windicss repo, one with your actual project.

Push your changes

git add .
git commit -m "fix issue 123"
git push origin fix-issue-123

Open a Pull Request

  1. Find the New Pull Request button
  2. Select the option to compare across forks
  3. Select your fork(${username}/windicss) in the head repository option
  4. Select your branch in the compare option
  5. Click Create Pull Request

License

By contributing, you agree that your contributions will be licensed under its MIT license.