fix: accept schema v3 metadata for ordinary function exports - #1
Conversation
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>
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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".
| !functions.is_empty() | ||
| && functions | ||
| .iter() | ||
| .any(|function| function.get("kind").is_none()) |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
cargo eqtstreated every schema v3 crate with default reactive capabilities as missing per-export descriptors, so ordinary function-only metadata (the READMEaddexample) failed to parse.kind, and treatletas a reserved TypeScript identifier.Test plan
cargo test --workspace --all-features --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo fmt --all -- --checkcargo eqts build --target bunon a crate that only exports#[eqts::export] pub fn add(a: u32, b: u32) -> u32Made with Cursor