Skip to content

Latest commit

 

History

History
143 lines (97 loc) · 3.22 KB

File metadata and controls

143 lines (97 loc) · 3.22 KB

Contributing to @mts-pjsc/image-optimize

Thank you for your interest in contributing! This document provides guidelines for contributing to this project.

How to Contribute

Reporting Bugs

Before creating bug reports, please check the existing issues. When creating a bug report, include:

  • Clear title and description
  • Steps to reproduce the problem
  • Expected behavior vs actual behavior
  • Code samples that demonstrate the issue
  • Environment details (React version, Node.js version, Browser, OS)

Suggesting Enhancements

Enhancement suggestions are welcome! Please provide:

  • Clear description of the enhancement
  • Use cases and why it would be useful
  • Possible implementation approach (if you have ideas)

Pull Requests

  1. Fork the repository and create your branch from main
  2. Make your changes following our coding standards
  3. Build and test your changes by running npm run build
  4. Commit your changes using Conventional Commits:
    • feat: for new features
    • fix: for bug fixes
    • docs: for documentation changes
    • chore: for maintenance tasks
    • refactor: for code refactoring
  5. Push to your fork and submit a pull request

Development Setup

Prerequisites

  • Node.js (latest LTS version recommended)
  • npm or pnpm

Setup Steps

# Clone your fork
git clone https://github.com/YOUR_USERNAME/image-optimize-react.git
cd image-optimize-react

# Install dependencies
npm install

# Build the library
npm run build

Coding Standards

This project uses ESLint and follows TypeScript best practices. Key principles:

Code Style

  • Line length: Maximum 120 characters
  • Indentation: 4 spaces
  • Quotes: Use double quotes " or template literals `
  • Semicolons: Always use semicolons
  • Braces: Always use braces for control structures

Example

// Good
if (condition) {
    doSomething();
}

const message = `Hello ${name}`;

// Bad
if (condition) doSomething();

const message = 'Hello ' + name;

Commit Messages

Follow Conventional Commits:

feat: add support for new ESLint rule
fix: correct TypeScript configuration issue
docs: update README with new examples
chore: upgrade dependencies

Testing

Before submitting your PR:

# Run linter
npm run eslint

# Build the library
npm run build

# Check for security vulnerabilities
npm audit

All tests must pass before your PR can be merged.

Review Process

  1. Automated checks run on every PR (tests, linting, security)
  2. Manual review by maintainers
  3. Feedback may be provided - please address comments
  4. Approval - once approved, your PR will be merged

Release Process

Releases are automated:

  1. Maintainer merges PR to main
  2. Version is bumped automatically
  3. Changelog is generated
  4. NPM package is published
  5. GitHub release is created

Questions?

  • Open an issue with the question label
  • Check existing issues and discussions

License

By contributing, you agree that your contributions will be licensed under the Apache-2.0 License.


Thank you for contributing to @mts-pjsc/image-optimize! 🎉