Welcome Contributors!
We’d love to accept your patches and contributions to this project. There are just a few guidelines you need to follow.Before contributing, make sure you’ve completed the Getting Started setup and have a local environment running.
Prerequisites
Before you can contribute, you need:Development Environment
Set up your local development environment following the Getting Started guide.
Understand the Codebase
Review the Architecture to understand the project structure.
Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.Sign the CLA
Head over to Google’s CLA site to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once. If you’ve already submitted one (even if it was for a different project), you probably don’t need to do it again.
Getting Started with Contributions
1. Fork and Clone the Repository
2. Create a Branch
3. Make Your Changes
4. Test Your Changes
Before submitting, ensure all tests pass:5. Commit Your Changes
The project uses lint-staged with husky to automatically lint and format code before commits.
6. Push and Create Pull Request
googleforcreators/web-stories-wp:main.
Code Review Process
All submissions, including submissions by project members, require review.Code Review
Maintainers will review your code. Be responsive to feedback and make requested changes.
We use GitHub pull requests for code review. Consult GitHub Help for more information on using pull requests.
Coding Standards
JavaScript/TypeScript
The project uses:- ESLint for linting JavaScript/TypeScript
- Prettier for code formatting
- WordPress coding standards via
@wordpress/eslint-plugin
PHP
The project follows WordPress PHP coding standards:- PHP_CodeSniffer for linting
- PHPStan for static analysis
- PHPMD for mess detection
CSS
The project uses Stylelint for CSS and styled-components:Other Files
Markdown:Automated Formatting
The project uses lint-staged to automatically format files on commit:package.json:297-314 for the complete configuration.
Writing Tests
When to Write Tests
Always include tests when:- Adding new features
- Fixing bugs
- Modifying existing functionality
Test Types
Unit Tests
Test individual functions and components in isolation
Integration Tests
Test how components work together in the browser
E2E Tests
Test complete user workflows from start to finish
Commit Message Guidelines
Write clear, descriptive commit messages: Good commit messages:Pull Request Guidelines
PR Title
Use a clear, descriptive title:Add video captions supportFix media upload race conditionUpdate React to v18
PR Description
Include:- What - What changes are being made
- Why - Why these changes are needed
- How - How the changes solve the problem
- Testing - How to test the changes
- Screenshots - Visual changes (if applicable)
Community Guidelines
This project follows Google’s Open Source Community Guidelines. Be respectful and inclusive:- Use welcoming and inclusive language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Focus on what’s best for the community
Development Scripts Reference
Build Scripts
Testing Scripts
Linting Scripts
Formatting Scripts
Environment Scripts
package.json:198-295 for all available scripts.
Getting Help
GitHub Issues
Report bugs or request features
GitHub Discussions
Ask questions and discuss ideas
Getting Started
Development setup guide
Architecture
Understand the codebase