Skip to content

fix: accept schema v3 metadata for ordinary function exports - #1

Merged
undivisible merged 1 commit into
mainfrom
fix/schema-v3-plain-function-metadata
Aug 20, 2026
Merged

fix: accept schema v3 metadata for ordinary function exports#1
undivisible merged 1 commit into
mainfrom
fix/schema-v3-plain-function-metadata

Conversation

@undivisible

Copy link
Copy Markdown
Contributor

Summary

  • cargo eqts treated every schema v3 crate with default reactive capabilities as missing per-export descriptors, so ordinary function-only metadata (the README add example) failed to parse.
  • Reject schema v3 only when a function actually omits kind, and treat let as a reserved TypeScript identifier.
  • Add parser, CLI, JSON value, camelCase, and trybuild coverage for previously untested edges.

Test plan

  • cargo test --workspace --all-features --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo fmt --all -- --check
  • cargo eqts build --target bun on a crate that only exports #[eqts::export] pub fn add(a: u32, b: u32) -> u32

Made with Cursor

eqts always advertises reactive capabilities, so cargo-eqts rejected crates that only export regular functions. Treat a missing kind as the ambiguous case and cover parser, CLI, and macro edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c263ffe0-2850-410d-a0f6-d0ed749987cb)

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9431b11034

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cargo-eqts/src/main.rs
!functions.is_empty()
&& functions
.iter()
.any(|function| function.get("kind").is_none())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject null export kinds as missing descriptors

When schema-v3 metadata declares reactive capabilities but an export contains "kind": null, this check treats the field as present and bypasses the ambiguity guard. Serde then deserializes the null into FunctionWire.kind: None and defaults the export to ExportKind::Function, so a reactive u64 handle can be emitted through an ordinary-value loader. Treat null as missing by checking that the value is non-null or validating the deserialized descriptor explicitly.

Useful? React with 👍 / 👎.

@undivisible
undivisible merged commit 902161c into main Aug 20, 2026
7 checks passed
@undivisible
undivisible deleted the fix/schema-v3-plain-function-metadata branch August 20, 2026 11:31
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.

1 participant