Skip to content

Commit fe0e803

Browse files
committed
docs: Add generator system documentation and comprehensive project files
- Add GENERATOR-SYSTEM.md with multi-block plugin documentation - Documents CPT, taxonomy, and SCF field group generation - Add complete documentation suite (CODE_OF_CONDUCT.md, CONTRIBUTING.md, DEVELOPMENT.md, SECURITY.md, SUPPORT.md, USAGE.md) - Add SCF integration with class-options.php and class-scf-json.php - Add example field group JSON with all SCF field types - Add JSON Schema validation for field groups - Add comprehensive test coverage for options and SCF - Update agent system (development-assistant, scaffold-generator) - Remove chatmodes in favour of development assistant - Add Prettier config and update linting standards - Upgrade to Node 24.x Related: Multi-block plugin scaffold generator with full CPT/taxonomy/SCF support
1 parent d21027b commit fe0e803

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+11960
-1
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
>0.5%
2+
last 2 versions
3+
not dead
4+
extends @wordpress/browserslist-config

.coderabbit.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
$schema: https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
2+
language: "en"
3+
chat:
4+
auto_reply: true
5+
reviews:
6+
request_changes_workflow: true
7+
high_level_summary: true
8+
poem: false
9+
review_status: true
10+
collapse_walkthrough: true
11+
path_filters:
12+
- "!build/**"
13+
- "!node_modules/**"
14+
- "!assets/css/*.map"
15+
- "!logs/**"
16+
auto_review:
17+
enabled: true
18+
drafts: false
19+
base_branches:
20+
- "main"
21+
- "develop"
22+
- "feature/*"
23+
- "fix/*"
24+
- "update/*"
25+
path_instructions:
26+
- path: "**/block.json"
27+
instructions: |
28+
Review block.json configuration for WordPress block plugins:
29+
- Ensure JSON syntax is valid and properly formatted
30+
- Verify block name, title, description, and category are present
31+
- Check for correct use of supports, attributes, and styles
32+
- Validate icon and keywords fields for discoverability
33+
- Confirm textdomain and namespace usage
34+
- Ensure block is registered for both frontend and editor
35+
- Check for accessibility compliance and ARIA attributes
36+
- Validate custom properties don't conflict with core block functionality
37+
- path: "**/src/**/*.js"
38+
instructions: |
39+
Review JavaScript for WordPress block plugin:
40+
- Check for proper WordPress script enqueueing in block.json
41+
- Validate accessibility enhancements don't conflict with core features
42+
- Ensure performance optimization and avoid unnecessary dependencies
43+
- Check compatibility with WordPress script loading patterns
44+
- Verify proper event handling and DOM manipulation
45+
- Ensure scripts work with both frontend and editor interfaces
46+
- path: "**/src/**/style.scss"
47+
instructions: |
48+
Review SCSS for WordPress block plugin:
49+
- Prefer block.json configuration over custom CSS when possible
50+
- Ensure SCSS enhances rather than replaces block.json settings
51+
- Check for proper use of CSS custom properties from block.json
52+
- Validate responsive design using consistent breakpoints
53+
- Ensure accessibility compliance in custom styles
54+
- Check for performance optimization (minimal CSS, efficient selectors)
55+
- Verify styles don't conflict with core WordPress block styles
56+
- Ensure proper CSS organization and maintainability
57+
- path: "**/src/**/render.php"
58+
instructions: |
59+
Review render.php for WordPress block plugin:
60+
- Ensure server-side rendering follows WordPress block standards
61+
- Validate secure coding practices (sanitization, validation, escaping)
62+
- Check for proper use of block attributes and context
63+
- Ensure compatibility with latest WordPress version
64+
- Check for performance optimization in render functions
65+
- Ensure functions don't conflict with block editor functionality
66+
- path: "**/tests/*.{js,php}"
67+
instructions: |
68+
Review test files for WordPress block plugin:
69+
- Ensure valid syntax, logical structure, and clear instructions
70+
- Check for descriptive test names and clear test structure
71+
- Include both positive and negative test cases
72+
- Reference the block or feature under test
73+
- Be linted and pass all style checks
74+
- Ensure tests have comprehensive inline documentation

.devcontainer/Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# WordPress Multi-Block Plugin Development Container
2+
FROM mcr.microsoft.com/devcontainers/php:1-8.1-bullseye
3+
4+
# Install additional PHP extensions
5+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
&& apt-get -y install --no-install-recommends \
7+
default-mysql-client \
8+
libzip-dev \
9+
libpng-dev \
10+
libjpeg-dev \
11+
libwebp-dev \
12+
subversion \
13+
unzip \
14+
wget \
15+
&& docker-php-ext-configure gd --with-jpeg --with-webp \
16+
&& docker-php-ext-install -j$(nproc) gd mysqli pdo_mysql zip \
17+
&& apt-get clean \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# Install WP-CLI
21+
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
22+
&& chmod +x wp-cli.phar \
23+
&& mv wp-cli.phar /usr/local/bin/wp
24+
25+
# Install Composer
26+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
27+
28+
# Install Node.js and npm (LTS version)
29+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
30+
&& apt-get install -y nodejs \
31+
&& npm install -g npm@latest
32+
33+
# Set up PHP configuration
34+
RUN echo "memory_limit=512M" >> /usr/local/etc/php/conf.d/memory.ini \
35+
&& echo "upload_max_filesize=64M" >> /usr/local/etc/php/conf.d/uploads.ini \
36+
&& echo "post_max_size=64M" >> /usr/local/etc/php/conf.d/uploads.ini \
37+
&& echo "max_execution_time=300" >> /usr/local/etc/php/conf.d/timeout.ini
38+
39+
# Create workspace directory
40+
WORKDIR /workspace
41+
42+
# Set up non-root user
43+
ARG USERNAME=vscode
44+
ARG USER_UID=1000
45+
ARG USER_GID=$USER_UID
46+
47+
# Ensure proper permissions
48+
RUN chown -R $USERNAME:$USERNAME /workspace
49+
50+
USER $USERNAME
51+
52+
# Default command
53+
CMD ["sleep", "infinity"]

.devcontainer/README.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Development Container
2+
3+
This directory contains configuration for VS Code Dev Containers, providing a consistent Docker-based development environment.
4+
5+
## Overview
6+
7+
```mermaid
8+
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#1e4d78', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#15354f', 'lineColor': '#333333', 'secondaryColor': '#f0f0f0', 'tertiaryColor': '#e8e8e8', 'background': '#ffffff', 'mainBkg': '#1e4d78', 'textColor': '#333333', 'nodeBorder': '#15354f', 'clusterBkg': '#f8f9fa', 'clusterBorder': '#dee2e6', 'titleColor': '#333333'}}}%%
9+
flowchart TB
10+
subgraph Container["Dev Container"]
11+
PHP["PHP 8.1"]
12+
Node["Node.js 20"]
13+
Composer["Composer"]
14+
WPCLI["WP-CLI"]
15+
end
16+
17+
subgraph Services["Docker Services"]
18+
WP["WordPress<br/>:8080"]
19+
MySQL["MariaDB<br/>:3306"]
20+
PMA["phpMyAdmin<br/>:8081"]
21+
Mail["MailHog<br/>:8025"]
22+
end
23+
24+
Container --> WP
25+
WP --> MySQL
26+
PMA --> MySQL
27+
WP --> Mail
28+
```
29+
30+
## Quick Start
31+
32+
1. **Install Prerequisites:**
33+
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
34+
- [VS Code](https://code.visualstudio.com/)
35+
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
36+
37+
2. **Open in Container:**
38+
- Open this folder in VS Code
39+
- Click "Reopen in Container" when prompted
40+
- Wait for the container to build (first time only)
41+
42+
3. **Access Services:**
43+
- WordPress: <http://localhost:8080>
44+
- phpMyAdmin: <http://localhost:8081>
45+
- MailHog: <http://localhost:8025>
46+
47+
## Files
48+
49+
### `devcontainer.json`
50+
51+
VS Code Dev Container configuration:
52+
53+
- Node.js 20 and PHP 8.1 environments
54+
- Recommended VS Code extensions
55+
- Port forwarding configuration
56+
- Post-create and post-start commands
57+
58+
### `docker-compose.yml`
59+
60+
Docker Compose services:
61+
62+
| Service | Port | Description |
63+
|---------|------|-------------|
64+
| `wordpress` | 8080 | WordPress with plugin mounted |
65+
| `db` | 3306 | MariaDB database |
66+
| `phpmyadmin` | 8081 | Database management UI |
67+
| `mailhog` | 8025 | Email testing (SMTP: 1025) |
68+
69+
### `Dockerfile`
70+
71+
Custom container image with:
72+
73+
- PHP 8.1 with extensions (gd, mysqli, zip)
74+
- Node.js 20 LTS
75+
- Composer
76+
- WP-CLI
77+
- Development tools
78+
79+
## Usage
80+
81+
### Starting the Environment
82+
83+
```bash
84+
# Using VS Code (recommended)
85+
# Click "Reopen in Container" or run command:
86+
# Remote-Containers: Reopen in Container
87+
88+
# Using Docker Compose directly
89+
cd .devcontainer && docker-compose up -d
90+
```
91+
92+
### WordPress CLI
93+
94+
```bash
95+
# Access WP-CLI
96+
wp --info
97+
98+
# Create admin user
99+
wp user create admin [email protected] --role=administrator --user_pass=admin
100+
101+
# Activate plugin/theme
102+
wp plugin activate {{slug}}
103+
wp theme activate {{theme_slug}}
104+
```
105+
106+
### Database Access
107+
108+
```bash
109+
# Connect to MySQL
110+
mysql -h db -u wordpress -pwordpress wordpress
111+
112+
# Or use phpMyAdmin at http://localhost:8081
113+
```
114+
115+
### Email Testing
116+
117+
All emails are captured by MailHog:
118+
119+
- SMTP: localhost:1025
120+
- Web UI: <http://localhost:8025>
121+
122+
## Customization
123+
124+
### Adding PHP Extensions
125+
126+
Edit `Dockerfile`:
127+
128+
```dockerfile
129+
RUN docker-php-ext-install -j$(nproc) your-extension
130+
```
131+
132+
### Adding VS Code Extensions
133+
134+
Edit `devcontainer.json`:
135+
136+
```json
137+
"customizations": {
138+
"vscode": {
139+
"extensions": [
140+
"your.extension-id"
141+
]
142+
}
143+
}
144+
```
145+
146+
### Changing PHP/Node Versions
147+
148+
Edit `devcontainer.json` features:
149+
150+
```json
151+
"features": {
152+
"ghcr.io/devcontainers/features/node:1": {
153+
"version": "20"
154+
},
155+
"ghcr.io/devcontainers/features/php:1": {
156+
"version": "8.2"
157+
}
158+
}
159+
```
160+
161+
## Troubleshooting
162+
163+
### Container Won't Start
164+
165+
```bash
166+
# Rebuild container
167+
docker-compose down -v
168+
docker-compose build --no-cache
169+
docker-compose up -d
170+
```
171+
172+
### Database Connection Issues
173+
174+
```bash
175+
# Check if MySQL is running
176+
docker-compose ps
177+
178+
# Restart database
179+
docker-compose restart db
180+
```
181+
182+
### Permission Issues
183+
184+
```bash
185+
# Fix file permissions
186+
sudo chown -R $(whoami):$(whoami) .
187+
```
188+
189+
## Related Documentation
190+
191+
- [VS Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers)
192+
- [Docker Compose](https://docs.docker.com/compose/)
193+
- [WP-CLI Commands](https://developer.wordpress.org/cli/commands/)

0 commit comments

Comments
 (0)