lecodes-cli 0.3.0 → 0.5.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 +3 -0
- package/dist/index.js +889 -507
- package/package.json +9 -4
- package/runtime/sdk/canvas/Canvas.ts +105 -0
- package/runtime/sdk/compile/aspectMacro.ts +42 -0
- package/runtime/sdk/compile/assetMacro.ts +44 -0
- package/runtime/sdk/compile/bundler.ts +173 -0
- package/runtime/sdk/compile/compileProject.ts +96 -0
- package/runtime/sdk/compile/header.ts +46 -0
- package/runtime/sdk/compile/index.ts +12 -0
- package/runtime/sdk/compile/sourcemap.ts +25 -0
- package/runtime/sdk/core/Aspect.ts +2 -2
- package/runtime/sdk/core/signals.ts +277 -0
- package/runtime/sdk/g2/CharacterController2D.ts +5 -4
- package/runtime/sdk/g2/Node2D.ts +1 -1
- package/runtime/sdk/g2/Physics2D.ts +22 -12
- package/runtime/sdk/g2/Scene2D.ts +12 -0
- package/runtime/sdk/g2/{Shape.ts → Shape2D.ts} +10 -10
- package/runtime/sdk/g2/Sprite.ts +7 -2
- package/runtime/sdk/g2/Texture2D.ts +4 -2
- package/runtime/sdk/g2/{Trigger.ts → Trigger2D.ts} +9 -9
- package/runtime/sdk/gl/CharacterController.ts +101 -0
- package/runtime/sdk/gl/Node.ts +11 -2
- package/runtime/sdk/gl/Physics.ts +65 -41
- package/runtime/sdk/gl/Scene.ts +18 -0
- package/runtime/sdk/gl/Shape.ts +98 -0
- package/runtime/sdk/gl/Texture.ts +2 -2
- package/runtime/sdk/gl/Trigger.ts +46 -0
- package/runtime/sdk/gl/physicsEvents.ts +20 -0
- package/runtime/sdk/inject.ts +12 -5
- package/runtime/sdk/runtime/camera.ts +31 -0
- package/runtime/sdk/runtime/device.ts +26 -0
- package/runtime/sdk/runtime/share.ts +9 -0
- package/runtime/sdk/ui/UI.ts +5 -1
- package/runtime/sdk/ui/UIButton.ts +11 -5
- package/runtime/sdk/ui/UIContainer.ts +28 -13
- package/runtime/sdk/ui/UIImage.ts +5 -0
- package/runtime/sdk/ui/UIInput.ts +10 -0
- package/runtime/sdk/ui/UINode.ts +206 -8
- package/runtime/sdk/ui/UIScreen.ts +10 -5
- package/runtime/sdk/ui/UIScrollable.ts +10 -5
- package/runtime/sdk/ui/UISpacer.ts +4 -0
- package/runtime/sdk/ui/UIText.ts +21 -5
- package/runtime/sdk/ui/UIVideo.ts +5 -0
- package/runtime/sdk/ui/UIVirtualizedList.ts +5 -0
- package/runtime/sdk/ui/UIWidget.ts +10 -5
- package/runtime/sdk/canvas/Label.ts +0 -57
- package/runtime/sdk/gl/Collider.ts +0 -29
package/README.md
CHANGED
|
@@ -41,6 +41,9 @@ lecodes preview > app.js # compile the local project to JS
|
|
|
41
41
|
| `pull` | Overwrite local files with the project's current remote state. `--force` to discard local edits. |
|
|
42
42
|
| `push` | Push all local changes as **one** new checkpoint. `-m`/`--message` for the message, `--force` to override the "server moved on" guard. |
|
|
43
43
|
| `preview` | Compile the local project to a single JS bundle, printed to **stdout** (pipeable). `-o`/`--out <file>` to write a file, `--entry <path>` to override the entrypoint, `--no-header` to omit the metadata header, `--public-url <url>` for the asset URL prefix. Diagnostics go to stderr. |
|
|
44
|
+
| `design [serve]` | **LeCodes Design** — a live canvas of screens for AI-driven prototyping (needs the optional `lecodes-design` package). Works inside a cloned project **or standalone in any folder** (no login/project needed). Starts a dev server + browser board showing every `design/screens/*.ts` as a working prototype with the `meta.json` flow edges; screens hot-reload as files change. Drag an unselected screen anywhere to move it, click to select it — a selected screen is interactive (tap, scroll, type; arrow keys nudge it). The canvas edits `meta.json` directly: drag the connect handle onto another screen to draw an edge, click an edge to edit its label/activator (with a dropdown of the source screen's named elements) or delete it, click the header note to edit a description. Double-click any rendered text to edit it in place — the string literal is rewritten in the screen's source file (dynamic text is declined safely). Double-click an image (or drop an image file from your OS onto it) to replace it: the file is stored in `design/assets/` and the `asset()` path is rewritten. Hint mode (`H`) outlines interactive elements, editable texts and replaceable images; selecting or hovering an edge highlights its activator element on the source screen — and hovering that element highlights the edge. Middle-drag or scroll pans from anywhere; ctrl+wheel/pinch zooms. `--port <n>` (default 4477), `--dir <folder>` (default `design/`), `--no-open`. |
|
|
45
|
+
| `design init` | Scaffold the design folder: `screens/`, `shared/`, `meta.json`, and a `CLAUDE.md` documenting the conventions for AI assistants. |
|
|
46
|
+
| `design snapshot [screen…]` | Render design screens headless (needs `lecodes-renderer`). One screen → semantic JSON to stdout; otherwise JSON files in `design/.snapshots/`; `--png` also rasterizes PNGs (needs `@napi-rs/canvas`); `--out-dir <dir>`, `--logs`. |
|
|
44
47
|
| `render` | Render the local project (**UI + 2D**). By default emits a semantic JSON description (great for AI/automated checks) to stdout or `-o`/`--out <file>`; `--png [file]` rasterizes a PNG (default `screenshot.png`, `--scale <n>` for DPR). A creator-2d scene is composited **under** the UI; `--time <ms>` advances its physics/animation. `asset('./x.png')` resources (images, sprite textures) load from the local working tree by default — use `--remote-assets` (or an explicit `--public-url`) to fetch them from the server instead (which then needs `--wait-network`). `--width`/`--height` set the viewport (default 390×844). Requires the optional `lecodes-renderer` package (`npm i -D lecodes-renderer@^0.2.0`); PNG also needs `@napi-rs/canvas`. 3D scenes aren't rendered. |
|
|
45
48
|
|
|
46
49
|
## How it works
|