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

Export a *type* for BufferedMetricsLogger #120

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

Mr0grog
Copy link
Collaborator

@Mr0grog Mr0grog commented Oct 31, 2024

Even though we started generating TypeScript types from the JSDoc a while back, it turns out BufferedMetricsLogger was getting exported as a value and not a type, which technically works in TS, but is definitely not what you want. This changes up our syntax a bit to get the compiler to do the right thing, and adds a basic test of the types to make sure we don't regress.

Fixes #119.

Worth thinking about briefly before landing: are there other types we should be taking more care to export here?

Even though we started generating TypeScript types from the JSDoc a while back, it turns out `BufferedMetricsLogger` was getting exported as a value and not a type, which technically works in TS, but is definitely not what you want. This changes up our syntax a bit to get the compiler to do the right thing, and adds a basic test of the types to make sure we don't regress.

Fixes #119.
This package is compatible with Node.js 12, and so needs types from Node.js 12 (loading newer types causes TypeScript tests to error).
@Mr0grog Mr0grog force-pushed the 119-if-you-want-types-you-probably-want-actual-types branch from dd60e02 to 74fc9ae Compare November 1, 2024 04:18
@Mr0grog
Copy link
Collaborator Author

Mr0grog commented Nov 1, 2024

OK, I’m going to go ahead and merge this, then publish a v0.11.3a1 pre-release for users to verify this fix with.

@Mr0grog Mr0grog merged commit a834a05 into main Nov 1, 2024
10 checks passed
@Mr0grog Mr0grog deleted the 119-if-you-want-types-you-probably-want-actual-types branch November 1, 2024 04:24
Mr0grog added a commit that referenced this pull request Nov 12, 2024
In #120, I added a test of our built types. Since we do a clean build of the types before publishing, we should also do a final check of those build results just to avoid any accidental issues for things that weren't fully checked (usually CI protects us here, but since we publish manually, a final check is useful!).
Mr0grog added a commit that referenced this pull request Nov 17, 2024
In #120, I added a test of our built types. Since we do a clean build of the types before publishing, we should also do a final check of those build results just to avoid any accidental issues for things that weren't fully checked (usually CI protects us here, but since we publish manually, a final check is useful!).
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.

BufferedMetricsLogger can't be used as a type
1 participant