Migrate posts react to pure command runner#93
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the tlon posts react subcommand onto the “pure command-runner” architecture, while leaving other posts subcommands on the legacy dispatcher. It adds a new pure runner with process-backed runtime deps, updates main.ts routing so only posts react uses the new runner, and adds unit + CLI matrix coverage to lock in legacy-compatible behavior and output.
Changes:
- Added a pure
posts reactcommand runner (scripts/commands/posts.ts) with legacy-compatible parsing, ID formatting, and output. - Added a process-backed runtime dependency adapter for posts (
scripts/posts-runtime.ts) and routed onlyposts reactthrough it inscripts/main.ts. - Added unit tests and CLI matrix cases covering
posts reactbehavior and a legacy sentinel (posts unreact --help).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/posts-runtime.ts | Adds process-backed PostsDeps adapter (auth + API facade + stdout/stderr writers) for the new runner. |
| scripts/main.ts | Routes tlon posts react ... through the new pure runner while keeping other posts subcommands on legacy dispatch. |
| scripts/commands/posts.ts | Implements the pure posts react runner (arg parsing, post ID normalization, reaction call, shared error handling). |
| scripts/commands/posts.test.ts | Adds unit tests validating help/usage behavior, payload formatting, call ordering, and error handling semantics. |
| scripts/cli-test-matrix.ts | Adds CLI coverage for posts react help/auth behavior and a non-react legacy sentinel (posts unreact --help). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ], | ||
| "Usage: tlon posts react" | ||
| ), | ||
| helpCase( |
There was a problem hiding this comment.
not sure this should be here since this only touches react right?
There was a problem hiding this comment.
Yeah, this is intentional. Since the PR changes the top-level posts dispatch, I wanted one guard proving non-react paths still stay on the legacy route. posts unreact --help is just a boundary check for that.
Summary
Migrates
tlon posts reactto the pure command-runner architecture. Next PR will migrate everything, this is just demonstrating the shape/scale.posts reactrunner plus process-backed runtime deps.posts react ...through the new runner; all otherpostspaths stay on legacy dispatch.reactlegacy sentinel.Testing
npm run check