@zylem/editor 0.7.4 → 0.8.8
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/LICENSE +1 -1
- package/README.md +92 -0
- package/dist/zylem-editor.d.ts +339 -339
- package/dist/zylem-editor.js +59 -5911
- package/package.json +46 -10
- package/dist/zylem-editor.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @zylem/editor
|
|
2
|
+
|
|
3
|
+
SolidJS debug UI and scene editor for [Zylem](https://github.com/zylem-game-lib/zylem)
|
|
4
|
+
games. The editor ships as a `<zylem-editor>` web component plus a host API, and
|
|
5
|
+
talks to a running `@zylem/game-lib` game over the typed
|
|
6
|
+
[`@zylem/bridge`](https://github.com/zylem-game-lib/zylem/tree/main/packages/bridge)
|
|
7
|
+
channel. It never imports game internals; everything it knows about the scene
|
|
8
|
+
arrives as bridge payloads.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add @zylem/editor @zylem/game-lib
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`@zylem/game-lib` is a peer dependency. `@zylem/bridge` and `@zylem/ui` are
|
|
17
|
+
regular dependencies; the UI package is bundled (with its CSS inlined for the
|
|
18
|
+
shadow-DOM mount), while the bridge stays external so the editor and the game
|
|
19
|
+
share one module instance and therefore one channel.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import '@zylem/game-lib/web-components';
|
|
25
|
+
import { registerZylemEditor } from '@zylem/editor';
|
|
26
|
+
|
|
27
|
+
registerZylemEditor();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<zylem-game></zylem-game>
|
|
32
|
+
<zylem-editor launcher-mode="floating"></zylem-editor>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For a host that wants to drive the editor programmatically, see
|
|
36
|
+
`mountZylemEditor`, `attachEditorStateBridge`, and the undo/redo, catalog, and
|
|
37
|
+
transform exports in `src/index.ts`.
|
|
38
|
+
|
|
39
|
+
## Development
|
|
40
|
+
|
|
41
|
+
Requires Node `v22.12.0` (see `.nvmrc`) and [pnpm](https://pnpm.io/).
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm install
|
|
45
|
+
|
|
46
|
+
# Dev harness at http://localhost:3332 -- boots a real game (WebGL, wasm
|
|
47
|
+
# physics, game-side bridge adapter) with the editor overlaid on it.
|
|
48
|
+
pnpm dev
|
|
49
|
+
|
|
50
|
+
# Library build (tsup) into dist/
|
|
51
|
+
pnpm build
|
|
52
|
+
|
|
53
|
+
pnpm typecheck
|
|
54
|
+
pnpm lint
|
|
55
|
+
pnpm test
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Working against local checkouts
|
|
59
|
+
|
|
60
|
+
This repo is one of the Zylem polyrepos managed by
|
|
61
|
+
[`zylem-workspace`](https://github.com/zylem-game-lib/zylem-workspace) (`zw`).
|
|
62
|
+
By default the editor resolves `@zylem/game-lib`, `@zylem/bridge`, and
|
|
63
|
+
`@zylem/ui` from npm. To develop against sibling checkouts instead:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
zw link dev # swap @zylem/* deps for link:../<repo> overrides
|
|
67
|
+
zw link prod # back to registry ranges before committing
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`vite.config.ts` already allows the sibling directories (`../zylem`,
|
|
71
|
+
`../zylem-ui`, `../behaviors`, `../runtime`) in `server.fs.allow`, so linked
|
|
72
|
+
packages -- including the physics wasm served from `../runtime/dist` -- work
|
|
73
|
+
in the dev harness without further configuration.
|
|
74
|
+
|
|
75
|
+
Commit registry ranges, not `link:` specifiers.
|
|
76
|
+
|
|
77
|
+
### Bridge protocol
|
|
78
|
+
|
|
79
|
+
The editor and `@zylem/game-lib` are versioned independently but both pin
|
|
80
|
+
`@zylem/bridge`. When the bridge protocol changes, bump this package's
|
|
81
|
+
`@zylem/bridge` range (`zw update @zylem/bridge --to latest`) and cut an editor
|
|
82
|
+
release that matches the game-lib release consuming the same bridge version.
|
|
83
|
+
|
|
84
|
+
## Release
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
zw bump @zylem/editor --message "..." # bump, build, commit, tag
|
|
88
|
+
zw publish @zylem/editor
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Or manually: `pnpm version patch && git push --follow-tags`. The
|
|
92
|
+
`prepublishOnly` script runs the production build and the unit tests.
|