-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BOUNTY] Community Improvement Bounty - libp2p - TypeScript bindings for js-libp2p-* #21
Comments
Note - The Community Improvement Bounties are funded by the ETHBerlin fundraising efforts - if your project needs these bounties to work better with libp2p - consider helping out. High incentives make happy hackers |
The reward for this hack project is 1000 EUR. Good luck! |
@raulk I am interested in working on this, I am at ETHBerlin |
@samparsky I didn’t know that was possible. Mind sharing a link to a page that describes this feature? Feel free to start working on it. Make sure you start off with the existing definitions, as noted in the bounty! Good luck 👍 |
Hi all. Really interested in this feature. |
@Alexis-ROYER Are you at ETHBerlin? |
@Alexis-ROYER Yeah I could use some help. Can you reach out via telegram, my telegram username is |
@raulk I wasn't able to complete everything during the hackathon, I have opened a PR here for And a draft PR to the |
@samparsky are you going to finish these? Otherwise I’ll have a shot later. Thanks! |
@philipstanislaus Yeah I am going to, do you wanna work on it together? |
@philipstanislaus It was quite much to finish up during the hackathon as there are 13 repositories requiring types addition. Also, types generation is being automated via JSDoc as its much more easier to maintain. you can check out libp2p/js-libp2p-bootstrap#95 to have an idea We can split it up if you are interested |
Got it, looking forward to use them!
Thanks!
|
@philipstanislaus Are you interested in splitting it up and working on it together? |
@samparsky sure, let’s do that. I’ll get back to you in a bit. |
@samparsky @philipstanislaus thanks for working on this. Let me know in case you need any help 🙂 |
@samparsky @philipstanislaus @vasco-santos I'd be happy to help out as well. |
@ryanchristo You can reach out to me on telegram but I am not sure I need any more help right now |
@vasco-santos How is it possible to reach out to you? There is a limitation to automating the generation of typings right now. Right now it's difficult to generate automatically correct typings for default exports. i.e. modules with the following module.exports = function(){} or exports default function() {} It requires manually adding the type details to Although automatically generating types for named exports works perfectly i.e. exports.create = function(){}
or
module.exports = {} You can see an example here in the PR to |
I bet it could be worth fixing / augmenting tsd-jsdoc in order to bring the minimum of constraints on the libp2p code:
I'm giving a try on that. (*) tsd-jsdoc comes with [email protected] by default (and I assume it has been developed with this former version of jsdoc). (**) Such as default exports. |
@samparsky let's discuss that on libp2p/js-libp2p#208, can you post that there? We can also involve jacob on it |
@samparsky I looked into this, but it seems I won't have the capacity to make significant contributions in the next 2 weeks – deadlines, you know ;) Let me know if I can be of any other help. Thanks! |
I have just found out the jsdoc-tsd library, similar to (and visibly inspired from) tsd-jsdoc. I've made a couple of tests with both, but I could not figure out whether one was better than the other. I keep on trying to fix tsd-jsdoc for the moment. |
@Alexis-ROYER Cool! keep me posted if you are able to fix it |
@Alexis-ROYER I have created an issue on jsdoc-tsd repo, currently looking at ways of solving it |
I've got a very first 'export default' declaration with tsd-jsdoc! The code is still ugly, but it's on the way. I clean it a bit, then I start a draft PR out of your tsd-jsdoc#96 issue. |
Still work to do on the tsd-jsdoc#98 PR, but I have now reached a state that could be worth testing on real code. Checkout from my tsd-jsdoc fork and run tsd-jsdoc from it, using the As I said before, work is still going on on that PR, but it should support by now:
I think it should work with [email protected], but I've not tested it explicitely yet. If not, please get back to [email protected] for the moment. Refer to the ongoing |
Hi all, it's been a while since I did libp2p/js-libp2p#346 I didn't realize there was a need for, so didn't bother to update it, but I did continue to create them for the modules I used. Anyway I've got declaration files for around 60% of js-libp2p-* Some interfaces might be old, because I created them a few months after initially posting them. Also for the people tackling this, while most of the jsdoc is a good reference some of them are also not accurate (PeerInfo vs string was a common one iirc) I'll post the files I have later today. EDIT: there were a lot less changes than expected so I've just modified the original gist https://gist.github.com/IwraStudios/eecd07e060cf49145a974ec160c775ec |
Trying to make sure I'm up to date, is this correct?
If I want some sort of approximate types should I start with the polkadot-js project or @Alexis-ROYER 's thing? |
@mcclure I bet we'd better forget the jsdoc approach. After giving it a try, I eventually came to the conclusion that it will be easier to write the .d.ts files and maintain them directly. Let us know. |
Hi, are you still interested in funding this feature? I'm currently working on it at DefinitelyTyped, but will move those type definitions to the js-ipfs in a moment. |
FYI The libp2p work has already started and we aim to ship soon |
TypeScript bindings for js-libp2p-*
We want to make js-libp2p pleasurable to use from TypeScript. Get the TypeScript definitions in order, and run with 1000 EUR! 🤑
This will not only help TypeScript developers, but also plain old JavaScript developers who use VSCode or other IDEs that support TypeScript-sourced autocompletion for plain JS.
See devgrant 8 in the libp2p/devgrants tracker: libp2p/devgrants#8
The brief for this bounty can be found here: https://github.com/libp2p/devgrants/blob/master/008-typescript-bindings.md.
How to qualify
Check out the existing TypeScript definition files maintained by the Polkadot project.
Start with the libp2p entrypoint, and browse the imports.
We would like to port these over to the js-libp2p-* repos, so they can be maintained there, for the benefit of the entire community. You should:
package.json
file in all affected repos to trigger the TS definition tests. We'd like the build to break loudly and dramatically if we make changes to the API that break the definition files.Submit pull requests to each js-libp2p-* repo as you progress.
Resources
Definitely start with the definition files under the polkadot-js repo.
Check out these past discussions:
Feel free to use @raulk as a walking encyclopedia for all things libp2p.
Judging Criteria
Prizes
The text was updated successfully, but these errors were encountered: