Export TypeScript types for btcmap.org via ts-rs - #103
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The frontend fetches bindings/ from GitHub instead of needing a local checkout with a Rust toolchain. cargo test regenerates the directory, so a CI diff check keeps the committed copy honest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cargo.toml: kept both dependency groups (master's SPKI-pinning TLS stack and this branch's ts-rs). The new MeResponse.geofence field from master gained the ts-rs number override, and bindings/ was regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #102 — TypeScript type generation for btcmap.org as a parallel dev tool.
What this does
ts-rsand derivesTSon the 39 v4 response/request structs btcmap.org consumes (opt-in per struct; the unconsumedeventsmodule is deliberately skipped)Placestruct describing the dynamicfields-driven responses ofGET /v4/places, kept in sync withservice::element::TAGSby a unit testbindings/(the generated output) so consumers fetch it straight from GitHub — no Rust toolchain or checkout of this repo needed.cargo testregenerates the directory, and a new CI step fails if a commit leaves it staledevtools export-ts-types [target-dir]subcommand for exporting the bindings to an arbitrary directory locally#[ts(rename = ...)]so every binding has a unique file/type name; 64-bit integers are exported asnumber(JSON transport), RFC 3339 timestamps asstringWhat this deliberately does not do
docs/rest/— the MD docs workflow is untouchedmain.rs, or handler changes; nothing new is served or publishedTest plan
cargo test— full suite green, including the 39export_bindings_*tests andplace_type_covers_all_generate_tags_fieldsdevtools export-ts-types <dir>verified against a scratch dir (39 files) and a real btcmap.org checkout, wherepnpm typecheckandpnpm lintpass over the generated filesCompanion frontend PR: teambtcmap/btcmap.org#1243 (should land after this one).
🤖 Generated with Claude Code