-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat(TS): expose TS interfaces, add type tests #128
feat(TS): expose TS interfaces, add type tests #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! 🍺
refactors types in readme to use TS type notation which is the most common type notation in the JS ecosystem
I'd say this is very subjective, and while I appreciate the effort that went into the changes you made, this module is not a TypeScript project and the type grammar as it was in the README is maintainer preference. If there's a spec that governs this within project documentation that I'm unaware of, please do link it and I'll reconsider. TypeScript does not yet rule the world 😄
I would also prefer the typedefs moved out of the project and into https://github.com/DefinitelyTyped/DefinitelyTyped where they can be properly tested, maintained, and supported, separately.
I was not aware of these preferences, I thought that it will actually make maintenance easier. I mean the style I've replaced wasn't even used consistently so I thought that this will be an improvement. Will revert.
Actually, DefinitelyTyped recommends to post type definitions directly to projects and only post them there as a last resort. There is no one at DT who does this "properly tested, maintained, and supported". This is all done by volunteers, there are no active maintainers. It's also a much better developer experience if one doesn't have to install and maintain extra The chances are much higher that if someone changes the interface here he will also update the types. This is much less likely if the types are hosted at DT. All in all I wouldn't recommend moving the types there. |
Generally speaking for projects that I maintain, when the typedefs are simple I keep them local. When they get complex to the point where I have to learn TypeScript to maintain the definitions, I request that they be externally hosted. For folks who are fans of TypeScript and/or work with it often, this is a non-issue. For others, it's an additional maintenance burden. I'm all for making things more convenient for other developers, but this is not a TypeScript project (at least, not at present). And what precious little time I have for open source these days doesn't allow for maintaining definitions for a language variant that I have no interest in. Honestly - I don't even know what the functional difference between a If this is something you're particularly passionate about, it might be good to petition @mafintosh to add you as a maintainer so you can convert it to TypeScript and take over maintenance. I wouldn't mind that in the least. |
If you don't want to review future changes in TS types I will happily do this for you if you CC me. To explain my changes: The I've mostly followed the DT styleguide and added tests for the whole module interface to make sure that isn't broken by me and it won't be broken by another refactoring. |
So do I understand you correctly, you would rather prefer moving the whole definition to DT instead of accepting my changes? Then we'll have to provide a migration path for users of this module. We will ultimately have to remove the types here and break most TS users. I can do the submission to DT. Any ideas on how you would handle the breakage? |
@mafintosh Would you mind adding me as an additional maintainer to this project so that I can help managing the TS defintion? |
@BendingBender added you, whats your npm username? |
It's bendingbender. |
@shellscape Are you OK with me merging this now? @mafintosh added me as a maintainer, I'll take care of the TS definitions if you don't mind. |
@BendingBender that sounds good to me. welcome aboard! |
@shellscape Can you do a new release? |
Sure thing. It'll probably be tomorrow morning (ET). I'm away until late tonight. |
@BendingBender is this a major or minor release in your opinion? |
Should be minor IMO. The only problematic thing is the fixed type for the All the other changes are backwards-compatible. |
This PR contains:
Breaking Changes?
If yes, please describe the breakage.
Please Describe Your Changes
Options
interfaceskipComments
optiontsd
helper to run the tests automatically along with unit tests