Skip to content

Commit 4f090de

Browse files
committed
fix(examples): Ensure WordPress and frontend start concurrently
Updated example:start scripts in both toolbar demos to use concurrently properly. WordPress and frontend now start together using concurrently, with a 5 second delay on frontend to ensure WordPress completes startup. Changes: - Separated wp-env setup (npm install) into wp:ensure script - Modified wp:start to only run wp-env start (no blocking npm install) - Used concurrently to run both services in parallel - Added sleep 5 before frontend start to allow wp-env initialization
1 parent 481c20f commit 4f090de

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/next/toolbar-demo/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"scripts": {
77
"example:dev": "npm --prefix ./example-app run dev",
88
"example:build": "npm --prefix ./example-app run build",
9-
"example:start": "node scripts/setup-env.js && concurrently \"npm run wp:start\" \"npm run example:dev\"",
9+
"example:start": "node scripts/setup-env.js && npm run wp:ensure && concurrently \"npm run wp:start\" \"sleep 5 && npm run example:dev\"",
1010
"example:stop": "npm run wp:stop",
11-
"wp:start": "npm install && wp-env start",
11+
"wp:ensure": "npm install",
12+
"wp:start": "wp-env start",
1213
"wp:stop": "wp-env stop",
1314
"wp:destroy": "wp-env destroy"
1415
},

examples/vanilla/toolbar-demo/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"scripts": {
66
"example:build": "npm run example:dev:install && npm run wp:start && npm run example:start",
77
"example:dev:install": "cd example-app && npm install && cd ..",
8-
"example:start": "node scripts/setup-env.js && concurrently \"npm run wp:start\" \"npm run example:dev\"",
8+
"example:start": "node scripts/setup-env.js && npm run wp:ensure && concurrently \"npm run wp:start\" \"sleep 5 && npm run example:dev\"",
99
"example:stop": "npm run wp:stop",
1010
"example:prune": "wp-env destroy && npm run example:build && npm run example:start",
1111
"example:dev": "npm --prefix ./example-app run dev",
12-
"wp:start": "npm install && wp-env start",
12+
"wp:ensure": "npm install",
13+
"wp:start": "wp-env start",
1314
"wp:stop": "wp-env stop",
1415
"wp:destroy": "wp-env destroy",
1516
"wp-env": "wp-env"

0 commit comments

Comments
 (0)