lecodes-cli 0.7.1 → 0.7.2
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 -3
- package/dist/index.js +255 -243
- package/package.json +3 -3
- package/runtime/sdk/compile/bundler.ts +4 -2
- package/runtime/sdk/compile/compileProject.ts +6 -1
- package/runtime/sdk/inject.ts +1 -1
- package/runtime/sdk/ui/UINode.ts +13 -5
- package/runtime/sdk-types.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ lecodes init myapp # scaffold a local project (starter + types
|
|
|
33
33
|
cd myapp
|
|
34
34
|
# …edit main.ts in VS Code (IntelliSense works out of the box)…
|
|
35
35
|
lecodes dev # run it on a device with hot reload (scan the QR)
|
|
36
|
-
lecodes
|
|
36
|
+
lecodes compile -o app.js # compile to a self-contained bundle for LeCodes Desktop
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Or work against a project **on the platform**:
|
|
@@ -51,7 +51,7 @@ lecodes push -m "Tweak the menu" # push as a new checkpoint
|
|
|
51
51
|
|
|
52
52
|
| Command | What it does |
|
|
53
53
|
| --- | --- |
|
|
54
|
-
| `init [dir]` | Scaffold a new **local** project (no login, no server): a starter `main.ts`, the SDK types + a `tsconfig.json` for IntelliSense, and a `.lecodesignore`. Run it with `dev`, or compile it with `
|
|
54
|
+
| `init [dir]` | Scaffold a new **local** project (no login, no server): a starter `main.ts`, the SDK types + a `tsconfig.json` for IntelliSense, and a `.lecodesignore`. Run it with `dev`, or compile it with `compile`. `dir` defaults to the current folder. Idempotent — existing files are kept. |
|
|
55
55
|
| `install` | **Standalone build only.** Install the unpacked release bundle so `lecodes` is on your PATH: copies the `lecodes`+`chisel`+`runtime/` bundle to a library folder, then (Linux/macOS) symlinks it into a `bin` dir. PATH itself is edited only with `--modify-path` (appends `export PATH=…` to your shell rc on Linux/macOS, or adds the folder to your user PATH on Windows); otherwise it prints how to finish. Per-user by default; `--system` installs to `/usr/local` (needs sudo, and `/usr/local/bin` is already on PATH). `--dir <path>` overrides the library folder, `--bin <path>` the symlink folder. Refuses when run from an npm/source install (there, install globally with your package manager). |
|
|
56
56
|
| `login` | Authorize in the browser; stores an access token in `~/.lecodes/config.json`. `--token <pat>` to use a token created in the web UI instead, `--api <url>` for the API origin (default `https://le.codes`), `--web <url>` for the app origin. |
|
|
57
57
|
| `clone <uuid\|url> [dir]` | Download a project's file tree + binary resources, plus `.d.ts` types and a `tsconfig.json` for IntelliSense. `--no-types` to skip types. |
|
|
@@ -59,7 +59,7 @@ lecodes push -m "Tweak the menu" # push as a new checkpoint
|
|
|
59
59
|
| `pull` | Overwrite local files with the project's current remote state. `--force` to discard local edits. |
|
|
60
60
|
| `push` | Push all local changes as **one** new checkpoint. `-m`/`--message` for the message, `--force` to override the "server moved on" guard. |
|
|
61
61
|
| `dev` | Run the project **on a device straight from your machine, with hot reload** — no login or server needed. Starts a LAN dev server and prints a QR code; scan it with the LeCodes app (or pass the URL to the desktop host with `?t=poll`). Every save recompiles and hot-swaps the running app in place (errors roll back to the last good version); the device's `console.log` and errors stream back to the terminal. Assets are served from the working tree; custom shaders still need a prior `push` (their artifacts compile server-side). `--port <n>` (default 4499), `--host <ip>` to override the auto-detected LAN address, `--entry <path>`, `--no-qr`. The URL stays stable across runs (token in `.lecodes/dev.json`). |
|
|
62
|
-
| `
|
|
62
|
+
| `compile` | Compile the project to a single JS bundle, printed to **stdout** (pipeable). Works on a cloned/created project (binary asset URLs resolved from the server) **or a local `init` project** (no login — `asset()` resources resolve on the host via `fetchLocal`, so the bundle is self-contained for LeCodes Desktop). `-o`/`--out <file>` to write a file, `--entry <path>` to override the entrypoint, `--no-header` to omit the metadata header, `--no-minify` to keep the bundle readable (skips chisel's compress + mangle — larger output, real identifier names), `--no-sourcemap` to skip the inlined source map (smaller output; runtime errors then report generated positions only), `--public-url <url>` to resolve assets from a URL prefix instead. Diagnostics go to stderr. Formerly `preview`, which still works as an alias. |
|
|
63
63
|
| `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`. |
|
|
64
64
|
| `design init` | Scaffold the design folder: `screens/`, `shared/`, `meta.json`, and a `CLAUDE.md` documenting the conventions for AI assistants. |
|
|
65
65
|
| `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`. |
|