Skip to content

Add check for backend command generate-bindings#1115

Merged
kasbah merged 2 commits intomainfrom
kb/ci-generate-bindings
Mar 13, 2026
Merged

Add check for backend command generate-bindings#1115
kasbah merged 2 commits intomainfrom
kb/ci-generate-bindings

Conversation

@kasbah
Copy link
Member

@kasbah kasbah commented Mar 11, 2026

Checks that we ran generate-bindings i.e. no diff in the output when it is run again.

@kasbah kasbah force-pushed the kb/ci-generate-bindings branch 3 times, most recently from 59994f3 to d507a42 Compare March 11, 2026 18:31
@epatters epatters added the build CI/CD, linting, deployments, and anything Nix label Mar 11, 2026
@kasbah kasbah force-pushed the kb/ci-generate-bindings branch from d04671a to 1f07af1 Compare March 11, 2026 18:34
@kasbah kasbah marked this pull request as ready for review March 11, 2026 18:46
@kasbah kasbah requested a review from jmoggr as a code owner March 11, 2026 18:46
Comment on lines -83 to +100
Command::GenerateBindings => {
use qubit::TypeScript;

let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("pkg")
.join("src")
.join("index.ts");

rpc::router()
.as_codegen()
.write_type(&path, TypeScript::new())
.expect("Failed to write TypeScript bindings");

info!("Successfully generated TypeScript bindings to: {}", path.display());
return;
}
Command::GenerateBindings => unreachable!(),
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved this so we can run generate-bindings without the DATABASE_URL env variable.

@jmoggr
Copy link
Collaborator

jmoggr commented Mar 12, 2026

I'm wondering if this should become part of the nix build process instead of a check. We have a similar pattern for catcolab-wasm: in local dev it's generated with a pnpm/cargo command, when deployed it's built as a Nix package. I supposed a possibly meaningful difference is that the generate artifact is committed, but IMO we probably shouldn't be doing that anyway.

The change itself fine if we don't want to open the bigger can of worms right now.

@kasbah
Copy link
Member Author

kasbah commented Mar 12, 2026

We can talk about that separately but I am only aiming for a quick fix of the existing dev experience with this.

@epatters epatters added the backend Backend, including web server and database label Mar 12, 2026
@epatters epatters changed the title Add check for generate-bindings Add check for backend command generate-bindings Mar 12, 2026
@jmoggr
Copy link
Collaborator

jmoggr commented Mar 13, 2026

What exactly was the issue that this was meant to solve? I could see a couple ways this could help, but I'm wondering what specifically motivated this?

@kasbah
Copy link
Member Author

kasbah commented Mar 13, 2026

I want to freely run generate-bindings in the dev CLI (#1106), because it's a necessary build step, so it's annoying that the files are changing when I do that.

@kasbah kasbah merged commit 8b27fa3 into main Mar 13, 2026
16 checks passed
@epatters epatters deleted the kb/ci-generate-bindings branch March 13, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend, including web server and database build CI/CD, linting, deployments, and anything Nix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants