@zylem/editor 0.7.3 → 0.7.5

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zylem Game Toolkit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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.