8000 feat(cli): rename compile back to analyze, as a function and a command by colinhacks · Pull Request #195 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

feat(cli): rename compile back to analyze, as a function and a command - #195

Merged
colinhacks merged 2 commits into
mainfrom
analyze-name
Nov 6, 2026
Merged

colinhacks merged 2 commits into
mainfrom
analyze-name

Conversation

@colinhacks
Copy link
Copy Markdown
Owner

Renames the type defs call back to analyze: analyze() from reylo and reylo analyze. "Compile" reads as producing a build artifact, and this call returns a statement's types. Neither name has been published, so there is no alias.

import { analyze } from "reylo";

const defs = await analyze({ sql: "select id, name from users where id = :id" });
npx reylo analyze queries/

What changes

Before After
compile(), CompileInput analyze(), AnalyzeInput
reylo compile reylo analyze
src/compile.ts src/analyze-api.ts, since src/analyze.ts is the cache and sessions
tests/compile.test.ts tests/analyze-api.test.ts
tests/compile-cli.test.ts tests/analyze-cli.test.ts
engine/cli/src/compile.rs engine/cli/src/analyze.rs
Docs anchor #compile #analyze

The internal compile in src/execute.ts, which rewrites placeholders, keeps its name.

A fix found on the way

reylo installed its signal handlers just after starting the binary. A signal sent once the binary could answer, but before the handlers were in, ended the command and left the binary running. The handlers now go in first. This is its own commit.

The test for it failed under load: 3 of 120 parallel runs before the fix, 0 of 360 after, with the machine's load average above 240.

Checked

  • nub run typecheck, and nub run test with both test databases: 365 passed, 0 skipped.
  • cargo build --workspace --all-targets with no warning, and the tests of reylo and reylo-engine-core.
  • nub run build in site/, with the #analyze anchor and the FAQ's link to it in the output.

Copilot AI balanced review requested due to automatic review settings November 6, 2026 05:27
@vercel
vercel Bot commented Nov 6, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reylo Ready Ready Preview Nov 6, 2026 6:23am UTC

Request Review

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

I reviewed both commits: renaming the type-defs API and command from compile back to analyze, and the separate fix to the order in which src/cli.ts sets up its signal handlers.

  • Public API rename: compile()/CompileInput become analyze()/AnalyzeInput across src/index.ts, src/build-time.ts (BuildTime) and src/tooling.ts. Tooling in src/tooling-loader.ts is BuildTime & {…}, so it picks up the new name without an edit.
  • Module and test renames: src/compile.ts becomes src/analyze-api.ts, which keeps it apart from src/analyze.ts, the cache and sessions module. The bundle test now checks that src/analyze-api.ts stays out of the root's browser bundle.
  • Binary command: reylo compile becomes reylo analyze in engine/cli/src/main.rs and engine/cli/src/analyze.rs, including the usage text, the error prefixes and the reylo generate removal message.
  • Internal compile kept: the placeholder rewriter in src/execute.ts keeps its name. src/index.ts drops the compileQuery alias, since the public name no longer clashes with it.
  • Docs, skill and spec strings: the #analyze anchor, the FAQ link and the link in SKILL.md all match. The schema's description, the generated spec/index.ts 8000 and the published 0.1.0.json changed together.
  • Signal handlers before spawn: the forwarders go in before the child starts. Signal handlers only run on a later turn of the event loop, so by then child has its value from the synchronous spawn call.

I grepped the whole repository at head: no stale reylo compile, compile.ts, compile.rs, CompileInput or #compile reference remains.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

A signal sent once the binary could answer, before the handlers were in, ended the command and left the binary running.
Compile reads as producing a build artifact, and this returns a statement's types.
@colinhacks
colinhacks merged commit ab20c49 into main Nov 6, 2026
33 checks passed
@colinhacks
colinhacks deleted the analyze-name branch November 6, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0