-
-
Notifications
You must be signed in to change notification settings - Fork 1
Scaffold WordPress block theme with mustache templates, modern build pipeline, and comprehensive tooling #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
…omprehensive build system Co-authored-by: ashleyshaw <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a comprehensive WordPress block theme scaffold with mustache template support, modern build pipeline, and extensive tooling for professional theme development. The scaffold provides a complete foundation for creating WordPress block themes with Full Site Editing (FSE) support.
Key changes include:
- Full WordPress block theme architecture with templates, parts, patterns, and style variations
- Mustache template system for dynamic configuration throughout all theme files
- Modern development workflow with Webpack, testing suites, and CI/CD automation
Reviewed Changes
Copilot reviewed 46 out of 50 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.js | Webpack configuration for asset compilation with SCSS support |
| theme.json | Global theme configuration with mustache variables for colors, typography, and spacing |
| package.json | Node.js dependencies and build scripts for development workflow |
| functions.php | Main theme setup with asset enqueuing and WordPress feature support |
| templates/*.html | Block templates for core WordPress template hierarchy |
| parts/*.html | Reusable template parts for header and footer |
| styles/dark.json | Dark mode style variation with color palette overrides |
| src/js/*.js | Frontend and editor JavaScript with WordPress integration |
| src/css/*.scss | SCSS source files with WordPress block styles |
| inc/*.php | PHP includes for patterns, block styles, customizer, and template functions |
| tests/* | Comprehensive testing suite including PHP, JavaScript, and E2E tests |
| .github/workflows/*.yml | CI/CD automation for testing, deployment, and performance monitoring |
| .github/copilot-*.md | GitHub Copilot integration with custom instructions |
| docs/*.md | Community health files including README, contributing guidelines, and support documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 'style-loader', | ||
| 'css-loader', |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SCSS configuration uses 'style-loader' which injects CSS into JavaScript bundles. For WordPress themes, you should use MiniCssExtractPlugin.loader to generate separate CSS files that can be properly enqueued.
| "name": "Primary" | ||
| }, | ||
| { | ||
| "slug": "secondary", |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after 'secondary' should be removed for consistency.
|
|
||
| // Test theme initialization | ||
| expect( () => { | ||
| const {{theme_slug|camelCase}} = { |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using mustache variables directly in JavaScript variable names can cause syntax errors. Consider using a more predictable variable name or ensure proper validation of the camelCase transformation.
| } ); | ||
|
|
||
| // Theme utilities | ||
| const {{theme_slug|camelCase}} = { |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mustache variable {{theme_slug|camelCase}} used as a JavaScript object name could result in invalid syntax if the camelCase transformation produces reserved keywords or invalid identifiers.
| const { PanelBody, TextControl } = wp.components; | ||
| const { __ } = wp.i18n; | ||
|
|
||
| const {{theme_slug|camelCase}}Sidebar = () => { |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using mustache variables in function names can lead to invalid JavaScript syntax. Consider using a static function name or implementing proper validation for the camelCase transformation.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Ash Shaw <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Ash Shaw <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Ash Shaw <[email protected]>
This PR implements a complete WordPress block theme scaffold with mustache template support, addressing the requirements outlined in the repo-template.md specification.
Overview
The scaffold provides a production-ready foundation for WordPress block themes with Full Site Editing (FSE) support, featuring a mustache template system for dynamic configuration and a modern development workflow.
Key Features
WordPress Block Theme Architecture
theme.jsonconfigurationMustache Template System
The entire theme uses mustache variables for easy customization:
{{theme_name}},{{version}},{{author}}{{primary_color}},{{font_family}},{{spacing_*}}{{hero_title}},{{footer_text}},{{cta_button_text}}{{min_wp_version}},{{content_width}}Modern Build Pipeline
@wordpress/scriptsfor asset compilationComprehensive Testing
Quality Assurance
CI/CD Automation
Developer Experience
@wordpress/envCommunity Health
Complete community health files including:
File Structure
The scaffold follows WordPress theme standards and modern development practices:
Usage
Developers can use this scaffold to quickly bootstrap new WordPress block themes:
npm install && composer installnpm run startnpm run buildThe mustache template system allows for easy theme variants and white-label deployments by simply updating the template variables.
Standards Compliance
This scaffold provides everything needed for professional WordPress block theme development, from initial setup through deployment and maintenance.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.