Skip to content

Commit 8b47ae7

Browse files
authored
Merge pull request #86 from WebDevStudios/bug/windows-build-fix-2026-04-10
Adjustments to allow for theme to build on Windows + Performance fixes
2 parents 1207ed9 + a11cb3d commit 8b47ae7

31 files changed

Lines changed: 3110 additions & 1723 deletions

.devcontainer/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Theme Dev Container
22

3-
A **theme-only** dev container so you can work on WDS BT without installing PHP or Node locally—whether you’re at WDS (using the project template) or anywhere else. The stack matches [WebDevStudios/wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer): **PHP 8.2** and **Node 24**.
3+
This is the **supported development environment** for WDS BT: a theme-only container so you do not need PHP or Node installed on the host. The stack matches [WebDevStudios/wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer): **PHP 8.2** and **Node 24**.
4+
5+
PHP linting uses Composer scripts that call **`vendor/bin/phpcs`** and **`vendor/bin/phpcbf`** (`composer run-script phpcs` / `phpcs-fix`)—no extra wrapper scripts. Run those inside the container (or any Linux/macOS shell with Composer deps installed) for consistent results.
46

57
## Usage
68

79
1. Open this theme repo in Cursor or VS Code.
8-
2. Choose **Reopen in Container** (or run **Dev Containers: Reopen in Container** from the command palette).
9-
3. After the container builds, run `npm run setup` if needed (postCreate runs `npm ci && composer install`).
10+
2. Choose **Reopen in Container** (or **Dev Containers: Reopen in Container** from the command palette).
11+
3. After the container builds, `postCreateCommand` runs `npm ci && composer install`. Use `npm run setup` from the theme root when you need a full clean install and build.
1012

1113
## What’s included
1214

1315
- PHP 8.2 with Composer and extensions: tokenizer, xmlwriter, simplexml, dom, mbstring
1416
- Node 24
17+
- **jq** (installed on container create) so `composer install` and Cursor-rules sync from `composer.json` succeed
1518
- VS Code extensions: Intelephense, ESLint, Prettier, Stylelint
1619

17-
When you use a full WordPress project (e.g. WDS project template), that project’s devcontainer is used for the site; this one is for standalone theme development only.
20+
When you use a full WordPress project (e.g. WDS project template), that project’s devcontainer runs the site; this one is for standalone theme development only.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
]
2525
}
2626
},
27+
"onCreateCommand": "sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq jq",
2728
"postCreateCommand": "npm ci && composer install --no-interaction",
2829
"remoteUser": "vscode"
2930
}

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# The version of your theme, manually updated by you.
22
# This version will be reflected in style.css, package.json, and composer.json.
3-
VERSION=1.4.5
3+
VERSION=1.4.6

.npmrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Allow legacy peer deps for WordPress ecosystem compatibility
22
legacy-peer-deps=true
33

4-
# Ensure scripts run with proper shell
5-
script-shell=/bin/bash
4+
# Do not set script-shell to /bin/bash here: that path does not exist on Windows and
5+
# causes `spawn /bin/bash ENOENT` during dependency install scripts. Use the platform
6+
# default (cmd.exe on Windows, sh on Unix). Unix/macOS developers can set
7+
# `script-shell` in ~/.npmrc if they need bash for all npm scripts.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# WDS BT
22

3-
## Version: 1.4.5
3+
## Version: 1.4.6
44

55
[![WebDevStudios. Your Success is Our Mission.](https://webdevstudios.com/wp-content/uploads/2024/02/wds-banner.png)](https://webdevstudios.com/contact/)
66

7-
### What's New in 1.4.0
7+
### What's New in 1.4.6
88

99
- **Block Showcase**: Powerful development tool (admin-only) to discover, preview, and inspect all registered blocks with their attributes in an organized, interactive format.
1010
- **Template-specific style loading**: Template and CPT CSS are built separately and enqueued only when the current request matches (404, search, archive, page templates, custom post types). Styles in `build/css/templates/` are discovered automatically—no PHP config needed. Reduces unused CSS for better Lighthouse scores.
@@ -53,7 +53,7 @@ WDS BT is a foundational WordPress block theme designed for maximum flexibility
5353
| Responsive Design | Ensures optimal display and functionality across devices. |
5454
| Foundation Theme | Flexible base theme optimized for extensive customization. |
5555
| Automated Code Quality | Modern linting configurations with PHP 8.3 compatibility, ESLint 9 flat config, WordPress coding standards, and automated quality checks. |
56-
| DevContainer | [.devcontainer](.devcontainer) for **theme-only** workflow: PHP 8.2, Node 24, Composer. Usable by anyone (not just WDS); matches [wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer) when using the project template. |
56+
| DevContainer | **Recommended:** [.devcontainer](.devcontainer) for theme development (PHP 8.2, Node 24, Composer). This is the standard environment for active development on this repo. Matches [wds-devcontainer](https://github.com/WebDevStudios/wds-devcontainer) when using the project template. |
5757
| Third-party Block Style Overrides | Conditionally enqueue and override third-party block styles for efficient asset delivery. |
5858
| Accessibility Compliance | Built-in WCAG 2.2 compliance with automated Pa11y checks. |
5959
| Enhanced Webpack Configuration | Refined Webpack setup for improved dependency resolution and optimized asset management. |
@@ -70,19 +70,19 @@ WDS BT is a foundational WordPress block theme designed for maximum flexibility
7070
## Requirements
7171

7272
- WordPress 6.4+ (tested upto 6.9.1)
73-
- PHP 8.2+ (fully tested with PHP 8.4)
74-
- [NPM](https://npmjs.com) (v11+)
75-
- [Node](https://nodejs.org) (v25+)
76-
- [Composer 2+](https://getcomposer.org/)
73+
- **Development:** use the **[dev container](.devcontainer)** (supported path for PHP, Node, Composer, and linting). It ships PHP 8.2 and Node 24 aligned with this theme.
74+
- PHP 8.2+ and [Composer 2+](https://getcomposer.org/) when running outside the container (CI, deployment, or contributor preference)
75+
- [NPM](https://npmjs.com) (v11+) and [Node](https://nodejs.org) (v24+ per `package.json` engines) for build scripts
7776
- License: [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)
7877

7978
## Getting Started
8079

81-
1. Clone this repository to your WordPress theme directory (`wp-content/themes/`).
82-
2. Activate WDS BT from your WordPress admin panel under Appearance > Themes.
83-
3. Run `npm run setup` to install dependencies and perform an initial build.
80+
1. Clone this repository into your WordPress theme directory (`wp-content/themes/`), or symlink it there.
81+
2. **Open in the dev container:** In Cursor or VS Code, choose **Reopen in Container** so PHP, Node, and Composer match the project (see [.devcontainer/README.md](.devcontainer/README.md)).
82+
3. From the theme root, run `npm run build` (after `postCreateCommand`’s `npm ci && composer install`). Use `npm run setup` when you need a full reset and install from scratch.
83+
4. Activate WDS BT from your WordPress admin under **Appearance → Themes**.
8484

85-
**Theme-only dev (no local PHP/Node):** Open this repo in Cursor or VS Code and choose **Reopen in Container**. The [.devcontainer](.devcontainer) provides PHP 8.2 and Node 24 so you can run `npm run setup` and build without installing tooling locally—works for everyone, not only WDS projects.
85+
Contributors should use the dev container for day-to-day work so PHPCS, ESLint, and builds share one environment. PHP coding standards run through Composer (`composer run-script phpcs`) and invoke **`vendor/bin/phpcs`** directly.
8686

8787
## Documentation
8888

@@ -129,15 +129,15 @@ Register block styles in `inc/hooks/register-block-styles.php`. Override core bl
129129

130130
## Linting & Lefthook
131131

132-
PHP (PHPCS), JavaScript (ESLint), and CSS/SCSS (Stylelint) use the latest WordPress standards; warnings are treated as failures. On commit, Lefthook runs auto-fix, re-stages changed files, then runs strict lint. Do not use `--no-verify`; CI runs the same checks. Full config and policy: **[docs/linting-and-hooks.md](docs/linting-and-hooks.md)**.
132+
PHP (PHPCS), JavaScript (ESLint), and CSS/SCSS (Stylelint) use the latest WordPress standards; warnings are treated as failures. Composer scripts invoke **`vendor/bin/phpcs`** and **`vendor/bin/phpcbf`** (see `composer.json`). On commit, Lefthook runs auto-fix, re-stages changed files, then runs strict lint. Do not use `--no-verify`; CI runs the same checks. Full config and policy: **[docs/linting-and-hooks.md](docs/linting-and-hooks.md)**.
133133

134134
## Dynamic Block Pattern Categories
135135

136136
Block pattern categories are registered from subfolders of `patterns/`. Add a folder (e.g. `patterns/cards/`), put pattern PHP files in it, and set each file’s `Categories` header to the folder name (e.g. `Categories: cards`). No extra code is required.
137137

138138
## Accessibility & Quality
139139

140-
Run `npm run a11y` for Pa11y-based accessibility checks and `npm run lighthouse` for performance and SEO scores. CI runs security and code-quality checks. Cross-platform notes (rimraf, PHP detection) are in **[docs/accessibility-and-quality.md](docs/accessibility-and-quality.md)**.
140+
Run `npm run a11y` for Pa11y-based accessibility checks and `npm run lighthouse` for performance and SEO scores. CI runs security and code-quality checks. Additional tooling notes are in **[docs/accessibility-and-quality.md](docs/accessibility-and-quality.md)**.
141141

142142
## Contributing and Support
143143

assets/scss/base/forms.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ textarea {
1313
}
1414

1515
select {
16+
-webkit-appearance: none;
17+
-moz-appearance: none;
1618
appearance: none;
1719
outline: 0;
1820
background: url(../images/icons/icon-arrow-down.svg) no-repeat right 0.8em

0 commit comments

Comments
 (0)