@wp-operations/wp-app 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +24 -14
  2. package/dist/index.js +243 -489
  3. package/dist/main.js +340 -574
  4. package/package.json +8 -11
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **The `wp-now` revival.** A zero-config local WordPress dev server on `@php-wasm/node`: no Docker, no MySQL, no XAMPP. Point it at a theme, a plugin, or a full core checkout and it starts.
4
4
 
5
- When `wp-now` was deprecated in favor of the blueprint-centric Playground CLI, the simple `wp-now start` workflow went with it. `wp-app` brings it back — a maintained GPL fork of the original [wp-now source](https://github.com/WordPress/playground-tools) (full credit to the WordPress contributors), extended for classic, vendor-package-driven development.
5
+ When `wp-now` was deprecated in favor of the blueprint-centric Playground CLI, the simple `wp-now start` workflow went with it. `wp-app` brings it back — same one-command experience, running on the **current** php-wasm engine (PHP 7.4 – 8.5).
6
6
 
7
7
  ## Install
8
8
 
@@ -10,24 +10,30 @@ When `wp-now` was deprecated in favor of the blueprint-centric Playground CLI, t
10
10
  npm install -g @wp-operations/wp-app
11
11
  ```
12
12
 
13
+ Requires Node.js >= 20.10.
14
+
13
15
  ## Usage
14
16
 
15
17
  ```bash
16
18
  wp-app start # auto-detects project type from cwd
17
19
  wp-app start --path=my-theme # explicit path
18
- wp-app start --php=8.0 --wp=6.4 # pin PHP / WordPress versions
20
+ wp-app start --php=8.3 --wp=6.8 # pin PHP / WordPress versions
19
21
  wp-app start --wp=classicpress # run ClassicPress instead (lightweight, no Gutenberg)
20
- wp-app start --port=8881 --reset # fresh environment (wipes wp-content + SQLite db)
22
+ wp-app start --port=8881 --reset # fresh site (wipes the managed WordPress + database)
21
23
  wp-app dev # start + restart on file changes
22
24
  wp-app build # composer install + npm build script, when present
23
25
  wp-app php -- -r 'echo PHP_VERSION;' # PHP CLI via php-wasm
26
+ wp-app php -- script.php # run a PHP file
24
27
  ```
25
28
 
26
- Cores are downloaded once into `~/.wp-app/` and served with the SQLite database integration plugin — each project gets an isolated `wp-content` and database. Login: `admin` / `password`.
29
+ Login: `admin` / `password`.
27
30
 
28
- ## ClassicPress
31
+ ## How data is stored
29
32
 
30
- `--wp=classicpress` fetches the latest ClassicPress release; `--wp=classicpress-2.4.1` pins a version. ClassicPress is a WordPress fork without Gutenberg — everything else (modes, SQLite, mounts) works identically. If you build classic themes with actions and filters, this is the lighter engine.
33
+ - Core downloads are cached once in `~/.wp-app/cache/`
34
+ - Each project gets a full persistent WordPress site in `~/.wp-app/sites/<project>-<hash>/` — files and SQLite database survive restarts; `--reset` deletes exactly this directory and never your project
35
+ - Your project directory is mounted *into* that site (as a theme, plugin, or wp-content overlay) — edits are live without restarts
36
+ - Set the `WP_APP_HOME` environment variable to relocate all of the above (CI, portable drives, or the `.local` repo convention via `@wp-operations/wp-ide`)
31
37
 
32
38
  ## Modes
33
39
 
@@ -35,18 +41,22 @@ Auto-detected from the project directory, or forced with `--mode`:
35
41
 
36
42
  | Mode | Detected when | What runs |
37
43
  |------|--------------|-----------|
38
- | `theme` | `style.css` with a Theme Name header | Core + your directory mounted as a theme, auto-activated |
39
- | `plugin` | PHP file with a Plugin Name header | Core + your directory mounted as a plugin, auto-activated |
40
- | `wp-content` | `plugins/` + `themes/` dirs | Core + your directory as `wp-content` |
41
- | `wordpress` | Full core checkout | Your core, SQLite-backed |
44
+ | `theme` | `style.css` with a Theme Name header | Managed WP + your directory mounted as a theme, auto-activated |
45
+ | `plugin` | PHP file with a Plugin Name header | Managed WP + your directory mounted as a plugin, auto-activated |
46
+ | `wp-content` | `plugins/` + `themes/` dirs | Managed WP + your entries overlaid on `wp-content` |
47
+ | `wordpress` | Full core checkout | Your core served directly, SQLite-backed |
42
48
  | `wordpress-develop` | Core dev checkout | The `build/` directory |
43
- | `index` | An `index.php` | Plain PHP server |
44
- | `playground` | None of the above (e.g. empty dir) | Throwaway fresh install |
49
+ | `index` | An `index.php` | Plain PHP server, no WordPress |
50
+ | `playground` | None of the above (e.g. empty dir) | Fresh managed install |
51
+
52
+ ## ClassicPress
53
+
54
+ `--wp=classicpress` fetches the latest ClassicPress release; `--wp=classicpress-2.4.1` pins a version. Everything else (modes, SQLite, mounts) works identically.
45
55
 
46
56
  ## Part of wp-operations
47
57
 
48
- `wp-app` is the foundation of [wp-operations](https://github.com/wordpress-operations/wordpress-operations) — an open-source operations toolchain for classic WordPress/ClassicPress development: PSR-4 vendor packages as plugins, an AI skills library with security guidelines, monorepo tooling (`@wp-operations/wp-ide`), and a unified operations CLI (`@wp-operations/wp-ops`).
58
+ `wp-app` is the foundation of [wp-operations](https://github.com/wordpress-operations/wordpress-operations) — an open-source operations toolchain for classic WordPress development: PSR-4 vendor packages as plugins, an AI skills library with security guidelines, monorepo tooling (`@wp-operations/wp-ide`), and a unified operations CLI (`@wp-operations/wp-ops`).
49
59
 
50
60
  ## Credits & License
51
61
 
52
- GPL-2.0-or-later. Forked from [`@wp-now/wp-now`](https://github.com/WordPress/playground-tools) by the WordPress contributors — thank you for building it right the first time.
62
+ GPL-2.0-or-later. Continues the workflow of [`@wp-now/wp-now`](https://github.com/WordPress/playground-tools) by the WordPress contributors, rebuilt on the current [WordPress Playground](https://github.com/WordPress/wordpress-playground) engine (`@php-wasm/*`, `@wp-playground/wordpress`).