Skip to main content

Contributing

Thank you for your interest in contributing to Headless Shopify! This project welcomes contributions from the community.

How to Contributeโ€‹

Contributions can take many forms:

  • ๐Ÿ› Bug reports
  • ๐Ÿ’ก Feature requests
  • ๐Ÿ“ Documentation improvements
  • ๐Ÿ”ง Code contributions
  • ๐Ÿงช Testing and quality assurance

Getting Startedโ€‹

1. Fork the Repositoryโ€‹

Fork the headless-shopify repository to your GitHub account.

2. Clone Your Forkโ€‹

git clone https://github.com/YOUR_USERNAME/headless-shopify.git
cd headless-shopify

3. Create a Branchโ€‹

Create a feature branch for your changes:

git checkout -b feature/your-feature-name

Branch naming conventions:

  • feature/ - for new features
  • fix/ - for bug fixes
  • docs/ - for documentation updates
  • refactor/ - for code refactoring

4. Make Your Changesโ€‹

Follow the project's coding standards and style guide. Ensure your code:

  • Follows TypeScript best practices
  • Includes proper type definitions
  • Is properly formatted
  • Passes linting checks

5. Test Your Changesโ€‹

# Run linting
pnpm lint

# Build the project
pnpm build

# Test locally
pnpm dev

6. Commit Your Changesโ€‹

Write clear, descriptive commit messages:

git add .
git commit -m "feat: add new product filter feature"

Follow conventional commit format:

  • feat: - new features
  • fix: - bug fixes
  • docs: - documentation changes
  • style: - formatting changes
  • refactor: - code refactoring
  • test: - adding tests
  • chore: - maintenance tasks

7. Push to Your Forkโ€‹

git push origin feature/your-feature-name

8. Open a Pull Requestโ€‹

  1. Go to the original repository
  2. Click "New Pull Request"
  3. Select your fork and branch
  4. Fill out the PR template
  5. Submit the pull request

Pull Request Guidelinesโ€‹

Before Submittingโ€‹

  • Code follows the project's style guide
  • All tests pass
  • Documentation is updated if needed
  • Commit messages are clear and descriptive
  • Branch is up to date with main

PR Descriptionโ€‹

Include in your PR:

  • Purpose: What does this PR do?
  • Changes: What changes were made?
  • Testing: How was it tested?
  • Screenshots: If applicable, add screenshots
  • Related Issues: Reference any related issues

Code Styleโ€‹

TypeScriptโ€‹

  • Use TypeScript strictly
  • Avoid any types
  • Define proper interfaces and types
  • Use functional components for React

React Componentsโ€‹

// Good
interface Props {
title: string;
count: number;
}

export function Component({ title, count }: Props) {
return <div>{title}: {count}</div>;
}

File Namingโ€‹

  • React components: PascalCase.tsx
  • Utilities: camelCase.ts
  • Types: camelCase.types.ts
  • Tests: *.test.ts or *.spec.ts

Importsโ€‹

Organize imports in this order:

  1. React imports
  2. Third-party libraries
  3. Local components
  4. Utils and types
  5. Styles

Reporting Bugsโ€‹

When reporting bugs, please include:

  1. Description: Clear description of the bug
  2. Steps to Reproduce: How to reproduce the issue
  3. Expected Behavior: What should happen
  4. Actual Behavior: What actually happens
  5. Environment:
    • OS
    • Node.js version
    • Browser (if applicable)
  6. Screenshots: If applicable

Feature Requestsโ€‹

For feature requests, please:

  1. Check if the feature already exists or is planned
  2. Clearly describe the feature
  3. Explain the use case
  4. Describe the expected behavior

Questions and Discussionsโ€‹

For questions:

Code of Conductโ€‹

  • Be respectful and inclusive
  • Provide constructive feedback
  • Focus on what is best for the community
  • Show empathy towards others

Securityโ€‹

If you discover a security vulnerability:

  • Do not open a public issue
  • Email reachjoby@gmail.com
  • Provide details of the vulnerability
  • Allow time for a fix before public disclosure

Licenseโ€‹

By contributing, you agree that your contributions will be licensed under the MIT License.

Recognitionโ€‹

Contributors will be recognized in:

  • README.md contributors section
  • Release notes
  • Project documentation

Thank You!โ€‹

Your contributions help make this project better for everyone. Thank you for taking the time to contribute! ๐ŸŽ‰