๐ค Contribution Guide โ
Welcome to the Bagisto community! We appreciate your interest in contributing to our open-source e-commerce platform.
๐ Bug Reports โ
We highly value active collaboration among our community members to continually enhance Bagisto's performance and reliability.
Reporting Guidelines โ
When filing a bug report, please include:
- Clear Title: Descriptive and specific
- Detailed Description: Explain the problem thoroughly
- Reproduction Steps: Step-by-step instructions
- Code Sample: Minimal code that reproduces the issue
- Environment Details: OS, PHP version, Bagisto version
๐ก Feature Requests โ
We welcome proposals for new features and enhancements!
Feature Proposal Process โ
- Check Existing Issues: Search for similar requests
- Create Detailed Proposal: Include use cases and implementation ideas
- Discuss with Community: Engage in issue discussions
- Submit Implementation: Provide code contribution
๐ฟ Branch Selection โ
Choose the appropriate branch for your contribution:
# For general bug fixes (stable branch)
git checkout v2.3
git checkout -b fix/issue-description
# For critical bugs in stable version
git checkout v2.3
git checkout -b hotfix/critical-issue
# For new features and breaking changes
git checkout master
git checkout -b feature/new-functionality
Branch Guidelines โ
Type | Target Branch | Description |
---|---|---|
๐ Bug Fixes | v2.3 (stable) | General bug fixes for stable release |
๐จ Critical Fixes | v2.3 (stable) | Security or critical issues |
โจ Breaking Changes | master | New features with potential breaking changes |
๐จ Styling Guidelines โ
Tailwind CSS Class Ordering โ
Maintain consistency in Tailwind CSS class organization following Tailwind's official sorting guidelines:
Recommended Class Order:
<!-- Layout โ Flexbox โ Spacing โ Sizing โ Typography โ Visual โ Misc -->
<div class="flex flex-col justify-center items-center p-4 w-full h-screen text-lg font-bold bg-white border rounded-lg shadow-md hover:shadow-lg">
Content here
</div>
Class Sorting Reference
For detailed information about how classes should be sorted, refer to the official Tailwind CSS class sorting guide.
๐งช Testing โ
Running Tests โ
Ensure all tests pass before submitting your pull request:
Pest Tests (Unit/Feature Tests):
To run Pest tests, navigate to your project's root directory and use the following commands:
# Run the full test suite
php artisan test
# Run specific test files
php artisan test tests/Feature/YourTestFile.php
# Run tests with coverage
php artisan test --coverage
Playwright Tests (End-to-End Tests):
To run Playwright tests, navigate to the root directory of either the Shop
or Admin
package, then execute:
# Run Playwright tests from the package root
npx playwright test --config=tests/e2e-pw/playwright.config.ts
This command will execute all end-to-end tests defined in the Playwright configuration for the selected package.
Prerequisite
Before running Playwright tests, ensure you have both npx
and playwright
installed in your development environment.
Pint Tests (Code Formatting):
Pint is a PHP code style fixer that helps maintain consistent formatting across the codebase. It automatically applies standards like PSR-2 and PSR-12, making your code cleaner and easier to review. Before committing, run Pint to ensure your changes follow the project's coding standards.
# Check code formatting
vendor/bin/pint --test
# Fix code formatting
vendor/bin/pint
Important
All three test types (Pest, Playwright, and Pint) must pass before your PR can be merged. Run tests locally to avoid CI failures.
๐ Coding Standards โ
Bagisto follows established PHP standards for consistency and readability:
Standards We Follow โ
PHPDoc Example โ
/**
* Register a service with CoreServiceProvider.
*
* @param string|array $loader
* @param \Closure|string|null $concrete
* @param bool $shared
* @return void
*/
protected function registerFacades($loader, $concrete = null, $shared = false): void
{
// Implementation here
}
Automatic Formatting
You can use Pint to automatically format your code according to these standards:
vendor/bin/pint
๐ Security Vulnerabilities โ
Security Issues
If you discover a security vulnerability, DO NOT create a public issue.
Contact: Email support@bagisto.com immediately
Security Report Should Include: โ
- Detailed description of the vulnerability
- Steps to reproduce the issue
- Potential impact assessment
- Suggested fix (if available)
Thank you for contributing to Bagisto! ๐