# Contributing

Contributions to Ignite-Element are welcome and encouraged. Whether you fix bugs, add new features, or improve documentation, your efforts help improve Ignite-Element for everyone.

***

### **How to Contribute**

* [ ] **Fork the Repository**\
  Start by forking the Ignite-Element repository to your GitHub account.
* [ ] **Clone Your Fork**\
  Clone your fork to your local machine:

  ```bash
  git clone https://github.com/<your-username>/ignite-element.git
  cd ignite-element
  ```
* [ ] **Install Dependencies**\
  Install the required dependencies:

  ```bash
  pnpm install
  ```
* [ ] **Run Examples**\
  Examples of **XState**, **Redux**, and **MobX** are located in the `src/examples` directory. To start the server for each example, use the following commands:
  * **XState**:

    ```bash
    pnpm run examples:xstate
    ```
  * **Redux**:

    ```bash
    pnpm run examples:redux
    ```
  * **MobX**:

    ```bash
    pnpm run examples:mobx
    ```
* [ ] **Create a Feature Branch**\
  Create a new branch for your feature or bug fix:

  ```bash
  git checkout -b feature/my-new-feature
  ```
* [ ] **Follow Conventional Commits**\
  Use clear and descriptive commit messages that follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
  * `feat: add new decorator for isolated components`
  * `fix: correct rendering logic for shared components`
  * `docs: update contributing guidelines`
* [ ] **Write Tests**\
  Ensure tests cover your changes. We maintain an acceptable code coverage of **80% or higher**, and we have tests in place for most of the codebase:

  ```bash
  pnpm test
  ```
* [ ] **Commit Your Changes**\
  Commit your changes using a Conventional Commit message:

  ```bash
  git commit -m "feat: add new feature for tab navigation"
  ```
* [ ] **Push Your Changes**\
  Push your branch to your forked repository:

  ```bash
  git push origin feature/my-new-feature
  ```
* [ ] **Open a Pull Request**\
  Go to the original Ignite-Element repository and open a pull request. Include a clear description of your changes and any relevant issue numbers.

***

#### **Development Guidelines**

* [ ] **Code Style**\
  Follow the existing code style and conventions. Use `pnpm run lint` to check for linting errors:

  ```bash
  pnpm run lint
  ```
* [ ] **Testing**\
  Add or update tests for your changes. Run the test suite locally to ensure all tests pass:

  ```bash
  pnpm test
  ```
* [ ] **Code Coverage**\
  Maintain a minimum of **80% test coverage** for all contributions. Run the coverage report:

  ```bash
  pnpm run test:coverage
  ```
* [ ] **Documentation**\
  Update documentation for new features or changes to existing functionality.
* [ ] **Atomic Commits**\
  Keep commits small and focused. Group related changes together.
* [ ] **Stay Up-to-Date**\
  Sync your fork with the main repository regularly:

  ```bash
  git checkout main
  git pull upstream main
  git push origin main
  ```

***

#### **Ways to Contribute**

* **Report Bugs**\
  Found a bug? Open an issue with detailed steps to reproduce the problem.
* **Suggest Features**\
  Have an idea for a new feature? Share it by opening an issue or starting a discussion.
* **Fix Issues**\
  Browse open issues to find something you’d like to work on.
* **Improve Documentation**\
  Help keep the documentation clear, concise, and up-to-date.
* **Write Tests**\
  Add or improve tests to ensure code reliability and meet the coverage standard.

***

#### **Thank You for Contributing!**

Your contributions help Ignite-Element grow and improve. We’re grateful for your time and effort!
