-
Notifications
You must be signed in to change notification settings - Fork 21
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: add ts types #70
Conversation
License: MIT Signed-off-by: Henrique Dias <[email protected]>
License: MIT Signed-off-by: Henrique Dias <[email protected]>
License: MIT Signed-off-by: Henrique Dias <[email protected]>
@hugomrdias all files seem to be exporting all constants and codecs in One more question: are the types automatically generated by the release command? Didn't see any information. |
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.
left some comments everything else looks good
i dont understand what you mean, are you talking about the .d.ts ? bundle size is not affected by this.
yes plus docs based on the types, |
License: MIT Signed-off-by: Henrique Dias <[email protected]>
@hugomrdias just updated according to your comments. However, the generation of the docs fail: Looking at And this causes the error: |
humm it should work check this https://multiformats.github.io/js-multihash/index.html |
ah got it, define the |
@hugomrdias unfortunately, the same error persists |
src/base-table.js
Outdated
*/ | ||
|
||
/** | ||
* @type {Record<CodecName,CodecNumber>} |
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.
this will cause the error you are seeing, use the types in types.ts instead
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.
If I use types.ts, then it will complain it's a recursive dependency, because types.ts gets the types from base-table. I'm separating them now. I'll need to generate two files this way anyways.
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.
The commit I just pushed works! not pushed...
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.
ahhh right thats why i just ignore this type in multihash https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L16 😱
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.
Pushed
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.
LGTM but i would call types.ts -> generated-types.ts and add a comment at the top saying "DO NOT CHANGE THIS FILE ITS AUTOGENERATED by blal blah"
License: MIT Signed-off-by: Henrique Dias <[email protected]>
That ^