@solidrt/cli 0.0.10 → 0.0.11
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/AGENTS.md +46 -0
- package/README.md +2 -0
- package/package.json +6 -6
- package/src/args.ts +2 -0
- package/src/cache.ts +2 -1
- package/src/dev-server.ts +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @solidrt/cli - agent notes
|
|
2
|
+
|
|
3
|
+
Dense, self-contained facts for running and verifying a SolidRT app. Full docs
|
|
4
|
+
live in docs/ (and the website). For the authoring model (elements, props,
|
|
5
|
+
reactivity), see @solidrt/core (its AGENTS.md).
|
|
6
|
+
|
|
7
|
+
`srt` is the dev tool. Bun is a dev prerequisite only; SolidRT apps run on the
|
|
8
|
+
bundled `flux` runtime, not on Bun. Invoke via `bunx srt <command>`.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
- `bunx srt run src/index.tsx` - dev server + a local client window, watches and
|
|
13
|
+
hot-reloads. NEEDS A DISPLAY (opens a GUI window). Not usable headless.
|
|
14
|
+
- `bunx srt bundle src/index.tsx` - transpile to `<file>.srt.js`. With
|
|
15
|
+
`--compile`, emits `.srt.bin` bytecode. `--minify`, `--dev`, `--stdout`,
|
|
16
|
+
`--output` also available.
|
|
17
|
+
- `bunx srt record src/index.tsx [flags]` - render OFFSCREEN to PNG frames.
|
|
18
|
+
- `bunx srt server [file]` / `bunx srt client` - the two halves of `run`
|
|
19
|
+
separately (server distributes code; clients on other devices connect to it).
|
|
20
|
+
|
|
21
|
+
## Verifying without a display (headless / CI / agent box)
|
|
22
|
+
|
|
23
|
+
Two reliable checks that need no GUI:
|
|
24
|
+
|
|
25
|
+
1. `bunx srt bundle src/index.tsx` - exit 0 means the app compiles. Fast.
|
|
26
|
+
2. `bunx srt record src/index.tsx --size 480x640 --duration 1 --fps 2` -
|
|
27
|
+
renders offscreen via EGL/wgpu and writes `frame-NNNNNN.png`. This actually
|
|
28
|
+
proves the app renders. Combine with `--fps`/`--duration` (defaults
|
|
29
|
+
1280x720, 60fps, 1s).
|
|
30
|
+
|
|
31
|
+
`record` gotchas:
|
|
32
|
+
- Frames are written to the RUNTIME's working dir (`~/.local/share/SolidRT/go/`),
|
|
33
|
+
NOT the directory you ran the command from. Look there for the PNGs.
|
|
34
|
+
- The recording includes a debug overlay (FPS/REQ/MiB/CPU) in a corner.
|
|
35
|
+
- Run from the project directory. There is no `bunx --cwd` flag.
|
|
36
|
+
|
|
37
|
+
## Dev server proxies (when clients on other devices need your machine's data)
|
|
38
|
+
|
|
39
|
+
- `--proxy-http` - route `fetch` through the dev server; responses cached in
|
|
40
|
+
`.srt-cache.db` (delete the file to clear).
|
|
41
|
+
- `--proxy-files` - route flux:fs (`file`/`dir`/`write`) through the dev server.
|
|
42
|
+
Exposes your dev machine's files to all clients; use with care.
|
|
43
|
+
|
|
44
|
+
## REPL (opened by `run`/`server`)
|
|
45
|
+
|
|
46
|
+
`load <file>`, `reload [n]`, `stop [n]`, `list`, `!<cmd>`, `quit`/`exit`.
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidrt/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Antoine van Wel",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/",
|
|
12
12
|
"src/",
|
|
13
|
-
"
|
|
13
|
+
"AGENTS.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/core": "^7.28.5",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"qrcode-generator": "^2.0.4"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@solidrt/darwin-arm64": "0.0.
|
|
24
|
-
"@solidrt/linux-x64-gnu": "0.0.
|
|
25
|
-
"@solidrt/win32-x64-msvc": "0.0.
|
|
23
|
+
"@solidrt/darwin-arm64": "0.0.11",
|
|
24
|
+
"@solidrt/linux-x64-gnu": "0.0.11",
|
|
25
|
+
"@solidrt/win32-x64-msvc": "0.0.11"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@solidrt/core": "0.0.
|
|
28
|
+
"@solidrt/core": "0.0.11",
|
|
29
29
|
"typescript": "^5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
package/src/args.ts
CHANGED
|
@@ -13,6 +13,7 @@ export let { values, positionals } = parseArgs({
|
|
|
13
13
|
fps: { type: "string" },
|
|
14
14
|
duration: { type: "string" },
|
|
15
15
|
size: { type: "string" },
|
|
16
|
+
stats: { type: "boolean", default: false },
|
|
16
17
|
android: { type: "boolean", default: false },
|
|
17
18
|
device: { type: "string" },
|
|
18
19
|
},
|
|
@@ -77,6 +78,7 @@ run/server options:
|
|
|
77
78
|
|
|
78
79
|
run/client options:
|
|
79
80
|
--size <WxH> Window size (default: 1280x720)
|
|
81
|
+
--stats Show the debug stats overlay (FPS, memory, frame timings)
|
|
80
82
|
|
|
81
83
|
client options:
|
|
82
84
|
--android Install and launch the client on a connected Android device
|
package/src/cache.ts
CHANGED
|
@@ -48,7 +48,8 @@ export function isEnabled(): boolean {
|
|
|
48
48
|
|
|
49
49
|
// Strings returned by bun:sqlite carry an internal representation that
|
|
50
50
|
// Headers.set() rejects, even when value-identical to an acceptable string
|
|
51
|
-
// (Bun bug, present through 1.3.14). Rebuilding each char
|
|
51
|
+
// (Bun bug oven-sh/bun#28266, present through 1.3.14). Rebuilding each char
|
|
52
|
+
// yields a clean string.
|
|
52
53
|
function reflatten(s: string): string {
|
|
53
54
|
return Array.from(s, (c) => String.fromCharCode(c.charCodeAt(0))).join("")
|
|
54
55
|
}
|
package/src/dev-server.ts
CHANGED
|
@@ -157,7 +157,7 @@ export function startServer() {
|
|
|
157
157
|
print(`[cli] Client connected ${ws.remoteAddress}`)
|
|
158
158
|
// Advertise our real LAN address so clients dialed over the adb loopback
|
|
159
159
|
// can show/remember the directly reachable address (see connection.rs).
|
|
160
|
-
ws.send(JSON.stringify({ type: "welcome", address: state.serverUrl }))
|
|
160
|
+
ws.send(JSON.stringify({ type: "welcome", address: state.serverUrl, stats: values.stats }))
|
|
161
161
|
if (state.currentCode) {
|
|
162
162
|
ws.send(buildReload({ code: state.currentCode }))
|
|
163
163
|
}
|