@wp-operations/wp-ide 0.3.0 → 0.3.1
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.
- package/README.md +8 -41
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,55 +1,22 @@
|
|
|
1
1
|
# @wp-operations/wp-ide
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## The editor
|
|
3
|
+
A simple WordPress-first editor in your browser, with a live preview. It comes with [wp-ops](../wp-ops):
|
|
6
4
|
|
|
7
5
|
```bash
|
|
8
|
-
npm install -g @wp-operations/wp-
|
|
6
|
+
npm install -g @wp-operations/wp-ops
|
|
9
7
|
cd my-platform
|
|
10
8
|
wp-ide serve --preview=http://localhost:8080
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
It opens on `http://127.0.0.1:4500/#token
|
|
14
|
-
|
|
15
|
-
- a sidebar of apps grouped by kind, plus your plugins and the full repository;
|
|
16
|
-
- a file tree and editor (Ctrl/Cmd+S saves) with the git branch and a list of changes;
|
|
17
|
-
- a live preview of the selected app from a running `wp-ops sandbox` (`--preview`).
|
|
18
|
-
|
|
19
|
-
It listens on 127.0.0.1 only, checks the Host header, and every API call needs the token from the printed URL. It never reads or writes `.git/`, `vendor/`, `node_modules/` or `.local/`, refuses paths outside the repository (including through links), and limits files to 400 KB.
|
|
20
|
-
|
|
21
|
-
## The platform repository contract
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
platform.json the platform's own config (copied from the theme)
|
|
25
|
-
.github/platform.json { platform, packages, apps: { <kind>: { label, folder, manifest } } }
|
|
26
|
-
.github/<kind>.json { "<slug>": { "server", "app_path", "theme_slug" } }
|
|
27
|
-
.github/workflows/composer.yml
|
|
28
|
-
packages/<vendor>/<name>/ plugins: composer.json "type": "psr4-plugin"
|
|
29
|
-
<kind folder>/<slug>/ apps: composer.json "type": "wp-app"
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
In `.github/platform.json`, `folder` defaults to the kind's key and `manifest` defaults to `.github/<key>.json`. Names are normalized exactly as the theme does it.
|
|
33
|
-
|
|
34
|
-
## API
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
import {
|
|
38
|
-
readLayout, hasLayout, layoutJson, findKind, // .github/platform.json
|
|
39
|
-
readManifest, writeManifest, // .github/<kind>.json
|
|
40
|
-
listApps, listPlugins, // apps and plugins, with warnings
|
|
41
|
-
editComposer, encodeJson, relativePath, // byte-identical to the theme's composer.json edits
|
|
42
|
-
slug, folder, // the theme's name normalization
|
|
43
|
-
startEditor, safePath, // the editor server
|
|
44
|
-
resolveProject, useLocalData, appServerOptions, runBlueprint, // .local convention, wp-app helpers
|
|
45
|
-
} from '@wp-operations/wp-ide';
|
|
46
|
-
```
|
|
11
|
+
It opens on `http://127.0.0.1:4500/#token=…` with:
|
|
47
12
|
|
|
48
|
-
|
|
13
|
+
- your apps, plugins and the whole repository in the sidebar;
|
|
14
|
+
- a file tree and editor (Ctrl/Cmd+S saves), the git branch and the list of changes;
|
|
15
|
+
- a live preview of the selected app from `wp-ops sandbox` (`--preview`).
|
|
49
16
|
|
|
50
|
-
|
|
17
|
+
It listens on 127.0.0.1 only, and every request needs the token from the printed URL. It never touches `.git/`, `vendor/`, `node_modules/` or `.local/`, stays inside the repository, and limits files to 400 KB.
|
|
51
18
|
|
|
52
|
-
|
|
19
|
+
wp-ops and wp-code also use it as a library: it reads the platform repository (`.github/platform.json`, the app manifests, apps and plugins) and makes the same composer.json edits the platform makes.
|
|
53
20
|
|
|
54
21
|
## License
|
|
55
22
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-operations/wp-ide",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "A simple WordPress-first browser editor with live preview, and the platform repository library used by wp-ops and wp-code. Comes with @wp-operations/wp-ops.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|