Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 18, 2025

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

  • Full Site Editing (FSE) support with comprehensive theme.json configuration
  • Block templates for all major WordPress template types (index, single, page, archive, 404, search)
  • Template parts for reusable components (header, footer)
  • Block patterns with mustache variables for hero sections, CTAs, and team layouts
  • Style variations including dark mode support
  • Custom block styles for enhanced design flexibility

Mustache Template System

The entire theme uses mustache variables for easy customization:

  • Theme metadata: {{theme_name}}, {{version}}, {{author}}
  • Design tokens: {{primary_color}}, {{font_family}}, {{spacing_*}}
  • Content placeholders: {{hero_title}}, {{footer_text}}, {{cta_button_text}}
  • Configuration: {{min_wp_version}}, {{content_width}}

Modern Build Pipeline

  • Webpack with @wordpress/scripts for asset compilation
  • SCSS/PostCSS processing with autoprefixer and optimization
  • JavaScript compilation with modern ES6+ support
  • Development server with hot reloading
  • Production builds with minification and optimization

Comprehensive Testing

  • PHPUnit tests for WordPress theme functionality
  • Jest tests for JavaScript components
  • Playwright end-to-end tests across multiple browsers
  • Accessibility testing with automated a11y checks
  • Performance monitoring with Core Web Vitals

Quality Assurance

  • Linting for PHP (PHPCS), JavaScript (ESLint), and CSS (Stylelint)
  • WordPress Coding Standards enforcement
  • Security headers and best practices implementation
  • Cross-browser compatibility testing

CI/CD Automation

  • GitHub Actions workflows for testing, deployment, and performance monitoring
  • Multi-version testing across PHP 8.0-8.2 and WordPress 6.4+
  • Automated deployment to WordPress.org
  • Code quality checks on every PR

Developer Experience

  • GitHub Copilot integration with custom instructions and chat mode
  • WordPress environment setup with @wordpress/env
  • Development scripts for common tasks
  • Comprehensive documentation including setup, customization, and contribution guides

Community Health

Complete community health files including:

  • Detailed README with installation and usage instructions
  • Contributing guidelines with development workflow
  • Security policy for responsible disclosure
  • Support documentation with troubleshooting guides
  • Changelog template following Keep a Changelog format

File Structure

The scaffold follows WordPress theme standards and modern development practices:

├── .github/                 # Workflows and Copilot configuration
├── assets/                  # Static assets (images, fonts)
├── inc/                     # PHP functionality (patterns, styles, customizer)
├── parts/                   # Template parts (header, footer)
├── src/                     # Source files for build process
├── styles/                  # Style variations
├── templates/               # Block templates
├── tests/                   # Comprehensive test suite
├── theme.json               # Global theme configuration
├── functions.php            # Theme setup and functionality
└── Build configuration files

Usage

Developers can use this scaffold to quickly bootstrap new WordPress block themes:

  1. Clone the repository
  2. Customize mustache variables for branding and configuration
  3. Install dependencies with npm install && composer install
  4. Start development with npm run start
  5. Build for production with npm run build

The mustache template system allows for easy theme variants and white-label deployments by simply updating the template variables.

Standards Compliance

  • ✅ WordPress Coding Standards (PHP, JS, CSS)
  • ✅ WCAG 2.1 AA accessibility guidelines
  • ✅ WordPress Theme Review requirements
  • ✅ GPL v3 licensing
  • ✅ Semantic versioning
  • ✅ Modern web standards and best practices

This scaffold provides everything needed for professional WordPress block theme development, from initial setup through deployment and maintenance.

Original prompt

Scaffold a WordPress block theme using mustache templates for all metadata, configs, and content. Include theme.json, style.css, templates, parts, patterns, styles, assets, and all config files. Add automated build scripts, testing, CI, README, changelog, and community health files. For full structure and standards, see repo-template.md.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Scaffold WordPress block theme with mustache templates Scaffold WordPress block theme with mustache templates, modern build pipeline, and comprehensive tooling Oct 18, 2025
Copilot AI requested a review from ashleyshaw October 18, 2025 17:54
@ashleyshaw ashleyshaw requested a review from Copilot October 19, 2025 02:44
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +24 to +25
'style-loader',
'css-loader',
Copy link

Copilot AI Oct 19, 2025

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.

Copilot uses AI. Check for mistakes.
"name": "Primary"
},
{
"slug": "secondary",
Copy link

Copilot AI Oct 19, 2025

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.

Copilot uses AI. Check for mistakes.

// Test theme initialization
expect( () => {
const {{theme_slug|camelCase}} = {
Copy link

Copilot AI Oct 19, 2025

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.

Copilot uses AI. Check for mistakes.
} );

// Theme utilities
const {{theme_slug|camelCase}} = {
Copy link

Copilot AI Oct 19, 2025

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.

Copilot uses AI. Check for mistakes.
const { PanelBody, TextControl } = wp.components;
const { __ } = wp.i18n;

const {{theme_slug|camelCase}}Sidebar = () => {
Copy link

Copilot AI Oct 19, 2025

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.

Copilot uses AI. Check for mistakes.
ashleyshaw and others added 3 commits October 19, 2025 09:47
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]>
@ashleyshaw ashleyshaw marked this pull request as ready for review October 19, 2025 02:47
@ashleyshaw ashleyshaw merged commit 9951370 into main Oct 19, 2025
1 of 2 checks passed
@ashleyshaw ashleyshaw deleted the copilot/scaffold-wordpress-block-theme branch October 19, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants