Skip to content

Commit 9a8771c

Browse files
committed
Add wp-env, Codespaces, and WordPress Playground support
Add a basic wp-env configuration for local development, a devcontainer for GitHub Codespaces support, and a WordPress Playground blueprint for quick browser-based testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent df7cfbd commit 9a8771c

4 files changed

Lines changed: 53 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Theme Image Block",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:22",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
6+
},
7+
"postCreateCommand": "npm install",
8+
"forwardPorts": [8888],
9+
"portsAttributes": {
10+
"8888": {
11+
"label": "WordPress",
12+
"onAutoForward": "notify"
13+
}
14+
}
15+
}

.wp-env.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"core": "WordPress/WordPress#6.9",
3+
"phpVersion": "8.2",
4+
"plugins": [
5+
"."
6+
],
7+
"config": {
8+
"WP_DEBUG": true,
9+
"WP_DEBUG_LOG": true,
10+
"SCRIPT_DEBUG": true
11+
}
12+
}

blueprint.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"landingPage": "/wp-admin/post-new.php",
3+
"preferredVersions": {
4+
"php": "8.2",
5+
"wp": "latest"
6+
},
7+
"steps": [
8+
{
9+
"step": "installPlugin",
10+
"pluginData": {
11+
"resource": "wordpress.org/plugins",
12+
"slug": "theme-image-block"
13+
}
14+
},
15+
{
16+
"step": "login"
17+
}
18+
]
19+
}

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,20 @@
3333
"copy-webpack-plugin": "^13.0.1",
3434
"npm-package-json-lint": "^9.1.0",
3535
"webpack": "^5.105.2",
36+
"@wordpress/env": "^10.0.0",
3637
"webpack-cli": "^6.0.1"
3738
},
3839
"scripts": {
3940
"build": "webpack --mode production",
4041
"start": "webpack --mode development --watch",
4142
"lint": "eslint ./blocks/src",
4243
"fix": "eslint ./blocks/src --fix",
43-
"lint:package": "node ./node_modules/npm-package-json-lint/dist/cli.js ./"
44+
"lint:package": "node ./node_modules/npm-package-json-lint/dist/cli.js ./",
45+
"env:start": "wp-env start",
46+
"env:stop": "wp-env stop",
47+
"env:destroy": "wp-env destroy",
48+
"env:cli": "wp-env run cli",
49+
"env:logs": "wp-env logs"
4450
},
4551
"npmpackagejsonlint": {
4652
"extends": "@wordpress/npm-package-json-lint-config"

0 commit comments

Comments
 (0)