You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed custom setup and dev scripts in favor of simplified npm scripts for app and WordPress management. Updated .wp-env.json for new PHP version, plugin paths, and config values. Improved README with clearer setup instructions, troubleshooting, and port configuration. Adjusted Vite config for default port fallback and cleaned up package.json scripts.
Copy file name to clipboardExpand all lines: examples/vanilla/toolbar-demo/README.md
+66-81Lines changed: 66 additions & 81 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,65 +1,27 @@
1
-
# Toolbar Demo - Vanilla JavaScript + Vite
1
+
# Vanilla JavaScript Toolbar Demo
2
2
3
-
> A complete example of `@wpengine/hwp-toolbar` with vanilla JavaScript and Vite
3
+
In this example we show how to integrate the Headless WordPress Toolbar into a vanilla JavaScript application using Vite as the build tool and WordPress backend using WPGraphQL.
4
4
5
-
This example demonstrates how to integrate the Headless WordPress Toolbar into a vanilla JavaScript application using Vite as the build tool.
5
+
## Getting Started
6
6
7
-
## Features
8
-
9
-
- ✅ Vanilla JavaScript (no framework)
10
-
- ✅ Vite for fast development
11
-
- ✅ TypeScript support (types available)
12
-
- ✅ WordPress toolbar integration
13
-
- ✅ State management example
14
-
- ✅ Custom node registration
15
-
- ✅ Dark/light mode support
16
-
- ✅ wp-env configuration
17
-
18
-
## Prerequisites
7
+
> [!IMPORTANT]
8
+
> Docker Desktop needs to be installed to run WordPress locally.
19
9
20
-
- Node.js >= 18
21
-
- pnpm (for workspace setup)
22
-
- Docker (for wp-env)
23
-
24
-
## Quick Start
25
-
26
-
From the example directory:
27
-
28
-
```bash
29
-
# Install dependencies and start WordPress + Vite
30
-
npm run example:build
31
-
32
-
# Or, if already set up:
33
-
npm run example:start
34
-
```
10
+
1. Run `npm run example:setup` to install dependencies and configure the local WP server.
11
+
2. Run `npm run example:start` to start the WP server and Vite development server.
> When you kill the long running process this will not shutdown the local WP instance, only Vite. You must run `npm run example:stop` to kill the local WP server.
0 commit comments