Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(bindgen): check for corresponding .zig file #15896

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Dec 20, 2024

When generating bindings for foo.bind.ts, ensure a foo.zig file exists next to it. Builds will fail downstream if this is missing, this error just makes it surface sooner and in a more clear manner.

@DonIsaac DonIsaac added the build An issue related to building or compiling label Dec 20, 2024
@DonIsaac DonIsaac requested a review from paperdave December 20, 2024 05:53
@robobun
Copy link

robobun commented Dec 20, 2024

Updated 10:07 PM PT - Dec 20th, 2024

@DonIsaac, your commit 1399f2a has passed in #8389! 🎉


🧪   try this PR locally:

bunx bun-pr 15896

@@ -1,5 +1,9 @@
// This is the public API for `bind.ts` files
// It is aliased as `import {} from 'bindgen'`
/**
Copy link
Member

Choose a reason for hiding this comment

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

does jsdoc make this a comment for the file or the next declared symbol (Type)? i could be totally wrong and this form is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for //? no. It should make one for /** */ but I'm not seeing it. Maybe there's a problem with the tsconfig?

Copy link
Member

@paperdave paperdave left a comment

Choose a reason for hiding this comment

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

thank you for adding the additional assertion

@@ -196,6 +200,23 @@ export namespace t {
export const ByteString = builtinType<string>()("ByteString");
/**
* DOMString but encoded as `[]const u8`
*
* @example
Copy link
Member

Choose a reason for hiding this comment

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

i think simple examples like these aren't worth their line count, especially when my laptop screen can only fit 70 lines of code at once. this is why i try to write extremely concise comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes it appear nicely when hovering over the symbol.
image

If this was ts-only, VSCode would still perform syntax highlighting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah the hover doesn't appear in screenshots :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build An issue related to building or compiling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants