@solidrt/cli 0.0.45 → 0.0.46

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 CHANGED
@@ -34,7 +34,8 @@ Two reliable checks that need no GUI:
34
34
  2. `bunx srt render src/index.tsx --size 480x640 --duration 1 --fps 2` -
35
35
  renders offscreen via EGL and writes `frame-NNNNNN.png`. This actually
36
36
  proves the app renders. Combine with `--fps`/`--duration` (defaults
37
- 1280x720, 60fps, 1s).
37
+ 1280x720, 60fps, 1s). No display needed: rendering uses SDL's offscreen
38
+ driver (falling back to a hidden window where EGL cannot go headless).
38
39
 
39
40
  Also headless: the bundled flux runtime runs a plain `.js` file directly -
40
41
  `node_modules/@solidrt/<platform>/flux script.js` (e.g.
@@ -43,9 +44,10 @@ access. The right tool for micro-benchmarks and for probing flux module
43
44
  behavior in isolation.
44
45
 
45
46
  `render` gotchas:
46
- - Frames are written to the RUNTIME's working dir (`~/.local/share/SolidRT/go/`),
47
- NOT the directory you ran the command from. Look there for the PNGs.
48
- - The recording includes a debug overlay (FPS/REQ/MiB/CPU) in a corner.
47
+ - Frames land in the directory you ran the command from; `-o <path>` picks a
48
+ different directory (or a path prefix for the `-NNNNNN.png` names).
49
+ - `--size` is physical output pixels: layout runs at exactly that size
50
+ (display scale is pinned to 1), so frames are identical on every machine.
49
51
  - Run from the project directory. There is no `bunx --cwd` flag.
50
52
 
51
53
  ## Dev server proxies (when clients on other devices need your machine's data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/cli",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "license": "MIT",
5
5
  "author": "Antoine van Wel",
6
6
  "type": "module",
@@ -22,22 +22,22 @@
22
22
  "@jridgewell/remapping": "^2.3.0",
23
23
  "@jridgewell/trace-mapping": "^0.3.25",
24
24
  "@modelcontextprotocol/sdk": "^1.29.0",
25
- "babel-preset-solid": "2.0.0-beta.26",
25
+ "babel-preset-solid": "2.0.0-beta.31",
26
26
  "bonjour-service": "^1.4.0",
27
27
  "qrcode-generator": "^2.0.4",
28
28
  "zod": "^4.4.3"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@solidrt/darwin-arm64": "0.0.45",
32
- "@solidrt/linux-arm64-gnu": "0.0.45",
33
- "@solidrt/linux-x64-gnu": "0.0.45",
34
- "@solidrt/win32-x64-msvc": "0.0.45"
31
+ "@solidrt/darwin-arm64": "0.0.46",
32
+ "@solidrt/linux-arm64-gnu": "0.0.46",
33
+ "@solidrt/linux-x64-gnu": "0.0.46",
34
+ "@solidrt/win32-x64-msvc": "0.0.46"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "typescript": "^7"
38
38
  },
39
39
  "devDependencies": {
40
- "@solidrt/flux-types": "0.0.45",
40
+ "@solidrt/flux-types": "0.0.46",
41
41
  "@types/babel__core": "^7.20.5",
42
42
  "@types/bun": "latest"
43
43
  }
@@ -10,12 +10,12 @@
10
10
  "android": "srt client --android"
11
11
  },
12
12
  "dependencies": {
13
- "@solidrt/core": "0.0.45",
14
- "@solidrt/components": "0.0.45"
13
+ "@solidrt/core": "0.0.46",
14
+ "@solidrt/components": "0.0.46"
15
15
  },
16
16
  "devDependencies": {
17
- "@solidrt/cli": "0.0.45",
18
- "@solidrt/flux-types": "0.0.45",
17
+ "@solidrt/cli": "0.0.46",
18
+ "@solidrt/flux-types": "0.0.46",
19
19
  "typescript": "^7"
20
20
  }
21
21
  }
@@ -5,6 +5,8 @@
5
5
  "jsx": "preserve",
6
6
  "jsxImportSource": "@solidrt/core",
7
7
  "moduleResolution": "bundler",
8
+ "allowImportingTsExtensions": true,
9
+ "noEmit": true,
8
10
  "strict": true,
9
11
  "skipLibCheck": true,
10
12
  "types": ["@solidrt/flux-types"]
package/server/main.ts CHANGED
@@ -16,8 +16,7 @@ import { appendLog, clientList, handleControl, resolveQuery } from "./control"
16
16
  import { printQr } from "./qr"
17
17
  import { createTunnelEndpoint, TUNNEL_PROTOCOL } from "./tunnel"
18
18
 
19
- // argv layout differs between hosts; the config JSON is always the last argument.
20
- let config: Config = JSON.parse(argv[argv.length - 1]!)
19
+ let config: Config = JSON.parse(argv[0]!)
21
20
  state.config = config
22
21
  state.sourceDir = config.sourceDir
23
22
  state.projectDir = config.projectDir
package/server/rebuild.ts CHANGED
@@ -16,6 +16,7 @@ function buildReload(code: string, manifest?: string) {
16
16
  return {
17
17
  type: "reload",
18
18
  proxyHttp: config.proxyHttp,
19
+ args: config.args,
19
20
  ...(manifest ? { manifest } : {}),
20
21
  code,
21
22
  }
package/server/state.ts CHANGED
@@ -17,6 +17,9 @@ export type Config = {
17
17
  * MCP-triggered reload, or undefined when srt was started without a source.
18
18
  * Moved by the repl `load` command via /__internal__/reload. */
19
19
  entry?: string
20
+ /** The session's app arguments (the srt command-line tail after a bare
21
+ * "--"), included in every reload push as flux:process argv. */
22
+ args: string[]
20
23
  /** Minify the rebuild output, mirroring the srt --minify flag. */
21
24
  minify: boolean
22
25
  /** How the server invokes the external bundler: [bunPath, bundleCliPath],
package/src/args.ts CHANGED
@@ -1,7 +1,16 @@
1
1
  import { parseArgs } from "node:util"
2
2
  import { resolve } from "node:path"
3
3
 
4
+ // Everything after a bare "--" is the app's argument vector, kept out of
5
+ // parseArgs (which would fold it into positionals) and forwarded verbatim to
6
+ // the runner, where it becomes flux:process argv. srt's own flags may follow
7
+ // the source file, so the separator is required.
8
+ let rawArgs = process.argv.slice(2)
9
+ let appArgsSep = rawArgs.indexOf("--")
10
+ export let appArgs = appArgsSep === -1 ? [] : rawArgs.slice(appArgsSep + 1)
11
+
4
12
  export let { values, positionals } = parseArgs({
13
+ args: appArgsSep === -1 ? rawArgs : rawArgs.slice(0, appArgsSep),
5
14
  options: {
6
15
  dev: { type: "boolean", short: "d", default: false },
7
16
  minify: { type: "boolean", short: "m", default: false },
@@ -126,6 +135,7 @@ run/server options:
126
135
  --proxy-http Route fetch calls through the dev server (HTTP cache enabled)
127
136
  --capture <file> Record connected clients' key events to a script file
128
137
  --tunnel Accept ticket-paired clients through the p2p tunnel
138
+ -- <args...> Everything after -- reaches the app on every client (flux:process argv)
129
139
 
130
140
  run/client options:
131
141
  --size <WxH> Window size (default: 1280x720)
@@ -160,5 +170,8 @@ render options:
160
170
  --script <file> Script file to replay (default: no scripted input)
161
171
  --fps <N> Frames per second (default: 60)
162
172
  --duration <N> Duration in seconds (default: 1)
163
- --size <WxH> Frame size (default: 1280x720)`)
173
+ --size <WxH> Frame size in physical pixels (default: 1280x720)
174
+ -o, --output <path> Where frames land: a directory (frame-NNNNNN.png inside it)
175
+ or a path prefix (default: the current directory)
176
+ -- <args...> Everything after -- is passed to the app (flux:process argv)`)
164
177
  }
@@ -1,4 +1,4 @@
1
- import { source, values } from "../args"
1
+ import { appArgs, source, values } from "../args"
2
2
  import { requireBinary, run } from "../util"
3
3
  import { bundleTo } from "../bundler"
4
4
  import { resolve } from "path"
@@ -12,7 +12,13 @@ export async function runRenderCommand() {
12
12
  if (values.duration) playbackArgs.push("--duration", values.duration)
13
13
  if (values.size) playbackArgs.push("--size", values.size)
14
14
  if (values.script) playbackArgs.push("--script", resolve(values.script))
15
+ // Always absolute: the runtime chdirs into the app's data sandbox before
16
+ // frames are written, so a bare prefix would land the PNGs there.
17
+ playbackArgs.push("--out", resolve(values.output ?? "."))
15
18
  playbackArgs.push(resolve(jsOutfile))
19
+ // The runner takes everything after the source path verbatim as the app's
20
+ // argument vector (flux:process argv).
21
+ playbackArgs.push(...appArgs)
16
22
  let exit = await run(runner, playbackArgs)
17
23
  process.exit(exit)
18
24
  }
package/src/dev-server.ts CHANGED
@@ -2,7 +2,7 @@ import { resolve } from "path"
2
2
  import { tmpdir, networkInterfaces } from "node:os"
3
3
  import { fileURLToPath } from "node:url"
4
4
  import { state, print, printErr, requireBinary, pipeAbovePrompt, shutdown } from "./util"
5
- import { values } from "./args"
5
+ import { appArgs, values } from "./args"
6
6
 
7
7
  export const DEV_HOST = "127.0.0.1"
8
8
  export const DEFAULT_DEV_PORT = 0x8844
@@ -41,6 +41,9 @@ export function buildReload(payload: { code?: string | null; bytecode?: string;
41
41
  return {
42
42
  type: "reload",
43
43
  proxyHttp: values["proxy-http"],
44
+ // The session's app arguments ride every push (flux:process argv), so
45
+ // remote clients see the same vector as the local one.
46
+ args: appArgs,
44
47
  ...(manifest ? { manifest } : {}),
45
48
  ...rest,
46
49
  }
@@ -213,6 +216,7 @@ export async function startServer() {
213
216
  address,
214
217
  proxyHttp: values["proxy-http"],
215
218
  entry: state.source,
219
+ args: appArgs,
216
220
  minify: values.minify,
217
221
  bundlerCmd: [process.execPath, bundleCli],
218
222
  cache: values["proxy-http"],