Skip to content

feat: eql-types — TypeScript bindings (stacked on #236)#268

Merged
coderdan merged 2 commits into
eql_v3from
dan/eql-types-ts-bindings
Jun 16, 2026
Merged

feat: eql-types — TypeScript bindings (stacked on #236)#268
coderdan merged 2 commits into
eql_v3from
dan/eql-types-ts-bindings

Conversation

@coderdan

@coderdan coderdan commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Stacked on #236 (now merged). Adds the ts-rs layer to the eql-types crate:

  • TS derive + #[ts(export, export_to = "v3/")] on every v3 domain type, the term newtypes, and Identifier
  • Checked-in generated bindings: crates/eql-types/bindings/v3/*.ts (30 files). Term newtypes export as named TS aliases (export type Hmac256 = string) imported by every domain binding
  • mise run types:generate (clean-regenerate) and mise run types:check (regenerate + fail on diff/untracked), with a freshness-gate step in the rust-crates CI job

JSON Schemas follow in a further stacked PR.

Closes #287.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f16b72ce-0f43-41d1-90fc-00aee555b96e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dan/eql-types-ts-bindings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderdan coderdan force-pushed the dan/eql-types-ts-bindings branch 7 times, most recently from 29418a0 to 16ce202 Compare June 15, 2026 06:28
Base automatically changed from dan/eql-types-crate to eql_v3 June 15, 2026 07:19
@coderdan coderdan force-pushed the dan/eql-types-ts-bindings branch from 16ce202 to 73acb8e Compare June 15, 2026 07:25
@freshtonic freshtonic self-requested a review June 16, 2026 05:26
@coderdan coderdan force-pushed the dan/eql-types-ts-bindings branch from 73acb8e to 0250c37 Compare June 16, 2026 05:31
Stacks on the Rust-only eql-types crate. Every v3 domain type, the term
newtypes, and Identifier gain a TS derive with
bindings to crates/eql-types/bindings/v3/ (28 files, checked in). Term
newtypes export as named TS aliases (export type Hmac256 = string) that
every domain binding imports.

mise types:generate clean-regenerates the bindings; types:check
regenerates and fails on any diff or untracked output, wired into the
rust-crates CI job as a freshness gate.
@coderdan coderdan force-pushed the dan/eql-types-ts-bindings branch from 0250c37 to db988b3 Compare June 16, 2026 05:45

@freshtonic freshtonic 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.

Approving — conditional on the three minor fixes flagged inline below. None are blockers: the substance of the codegen layer is correct and coverage is complete (30 structs → 30 #[ts(export)] attributes → 30 checked-in bindings under bindings/v3/), the generated TS is accurate, and the regenerate-and-swap script + CI freshness gate are sound.

Three minor items, posted inline:

  1. serde-json-impl ts-rs feature appears unused (Cargo.toml).
  2. Crate-naming suggestion: eql-typeseql-types-postgres (Cargo.toml).
  3. FYI on the cargo testbindings/ write side effect (README.md).

One extra nit not tied to a line: the PR description says "28 files" but there are 30 .ts bindings under bindings/v3/ — worth correcting so reviewers' file counts line up.

Comment thread crates/eql-types/Cargo.toml Outdated
@@ -2,10 +2,11 @@
name = "eql-types"

@freshtonic freshtonic Jun 16, 2026

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.

Naming suggestion: consider eql-types-postgres. The domain types here are prefixed with PostgreSQL type names (int2 / int4 / int8 / timestamptz / text), so the crate is implicitly Postgres-flavoured. Renaming it now leaves room for future database-vendor-native EQL type crates (e.g. eql-types-<vendor>) without a disruptive rename later, while there are still few external consumers.

This is fine as a separate follow-up — it needn't block or fold into this bindings PR. A rename ripples beyond these changes: the crate is path-referenced by eql-scalars' dev-dependencies, and the test:crates / types:generate / types:check mise tasks all hardcode -p eql-types. Keeping it as its own small PR keeps that churn out of this focused codegen change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deserves a separate discussion. IMHO this crate defines the consumer shapes which should be consistent. If it turns out that XYZ DB needs a different shape I'd prefer to create an internal adapter crate and avoid changes to upstream consumers (stack, proxy etc).

Comment thread crates/eql-types/README.md
…te in-place regen

- Drop the `serde-json-impl` ts-rs feature: no v3 type carries a
  serde_json::Value/Map/Number field, so it only pulled serde_json into
  ts-rs's build graph for nothing. Bindings regenerate byte-identically
  without it (verified via `mise run types:check`).
- README: note that a plain `cargo test` / `mise run test:crates`
  regenerates `bindings/` in place as a side effect — only `types:generate`
  isolates the write via the temp-dir swap.
@coderdan coderdan merged commit bbce385 into eql_v3 Jun 16, 2026
25 of 28 checks passed
@coderdan coderdan deleted the dan/eql-types-ts-bindings branch June 16, 2026 07:41
coderdan added a commit that referenced this pull request Jun 16, 2026
feat: eql-types — JSON Schemas (stacked on #268)
tobyhede pushed a commit that referenced this pull request Jun 20, 2026
…te in-place regen

- Drop the `serde-json-impl` ts-rs feature: no v3 type carries a
  serde_json::Value/Map/Number field, so it only pulled serde_json into
  ts-rs's build graph for nothing. Bindings regenerate byte-identically
  without it (verified via `mise run types:check`).
- README: note that a plain `cargo test` / `mise run test:crates`
  regenerates `bindings/` in place as a side effect — only `types:generate`
  isolates the write via the temp-dir swap.
tobyhede pushed a commit that referenced this pull request Jun 20, 2026
feat: eql-types — TypeScript bindings (stacked on #236)
tobyhede pushed a commit that referenced this pull request Jun 20, 2026
feat: eql-types — JSON Schemas (stacked on #268)
tobyhede pushed a commit that referenced this pull request Jun 22, 2026
…te in-place regen

- Drop the `serde-json-impl` ts-rs feature: no v3 type carries a
  serde_json::Value/Map/Number field, so it only pulled serde_json into
  ts-rs's build graph for nothing. Bindings regenerate byte-identically
  without it (verified via `mise run types:check`).
- README: note that a plain `cargo test` / `mise run test:crates`
  regenerates `bindings/` in place as a side effect — only `types:generate`
  isolates the write via the temp-dir swap.
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