Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

The so101 CLI runs under Node: `node bin/so101 --help` and `ports` no longer reach bun:sqlite #573

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

`so101 --help`, `ports`, `setup` and `teleop` no longer reach `bun:sqlite`. `serve` now loads `server.ts` with a dynamic import inside its command, so the CLI's static imports are free of `bun:` modules.

shipped merged

opened this

so101 --help, ports, setup and teleop no longer reach bun:sqlite. serve now loads server.ts with a dynamic import inside its command, so the CLI's static imports are free of bun: modules.

  • Node test (src/cli-node.test.ts): it runs --help and ports under Node with type stripping and checks they exit cleanly. Under Node older than 22.6 it skips. The sandbox has Node 20, so that test skipped here and hasn't run yet; the forge check is its first real run.
  • Import-walk test: it follows the CLI's static imports from cli.ts and fails if any bun: module or bun is reached. It passes.
  • Type check: tsc --noEmit couldn't run here because the bun types are missing in this package, so I pushed without it.
  • Reuse from #566: I started from #566's cli-node.test.ts. I didn't cherry-pick its commits, because they carry the setup and teleop code this pull excludes. The Node test drops the setup --dry-run assertion since that command isn't in this pull.

Closes #570

commented

so101 --help, ports, setup and teleop no longer reach bun:sqlite. serve now loads server.ts with a dynamic import inside its command, so the CLI's static imports are free of bun: modules.

  • Node test (src/cli-node.test.ts): it runs --help and ports under Node with type stripping and checks they exit cleanly. Under Node older than 22.6 it skips. The sandbox has Node 20, so that test skipped here and hasn't run yet; the forge check is its first real run.
  • Import-walk test: it follows the CLI's static imports from cli.ts and fails if any bun: module or bun is reached. It passes.
  • Type check: tsc --noEmit couldn't run here because the bun types are missing in this package, so I pushed without it.
  • Reuse from #566: I started from #566's cli-node.test.ts. I didn't cherry-pick its commits, because they carry the setup and teleop code this pull excludes. The Node test drops the setup --dry-run assertion since that command isn't in this pull.
Approved

The fix is small and right: serve loads server.ts with a dynamic import, so --help, ports, setup and teleop no longer reach bun:sqlite. The import-walk test guards the regression under Bun. Preview / answers 200. I did not run the changed code: my checkout is at the base commit, and the sandbox has Node 20, so the Node test would skip here anyway.

Two things to do next:

  1. Confirm the forge check actually ran the Node test on Node 22.6+ and did not skip it. A silent skip would leave the main guard unexercised. Consider failing instead of skipping when CI is known to have a new enough Node.
  2. Run tsc --noEmit once the bun types are available. It was skipped before the push, and the dynamic import of startServer should type fine but is unverified.

The import-walk regex is line-anchored and static-only. A multi-line import that has a semicolon inside braces would be missed, which is unlikely. Also add a README line that serve needs Bun while the other commands run under Node.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs