Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

feat: split out code, convert to typescript #111

Merged
merged 12 commits into from
Nov 22, 2021
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 6, 2021

  • Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes Remove code from interfaces module #110). New implementation modules are:
    • libp2p-pubsub
    • libp2p-connection
    • libp2p-topology
  • Converts code to typescript (fixes Incompatible argument types #101)
  • Adds types for PeerData, PeerStore, Registrar and some other libp2p internals - these will need to be fleshed out properly in a subsequent PR
  • No CJS, only ESM, only forwards
  • Upgrades deps that have also gone ESM-only
  • Renames package folders for consistency

I've tried to break some of the circular dependencies in the interfaces (e.g. libp2p depends on pubsub, which depends on libp2p, which depends on pubsub, etc). This hasn't been possible in the tests so I've added @ts-expect-error where we access these properties with the aim to revisit it once this has been rolled up to libp2p itself.

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces, some adjustment may be necessary as this gets rolled out

@achingbrain achingbrain changed the title feat: split out code feat: split out code, convert to typescript Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

This is amazing ❤️ could only do a quick review, but looks great

"bugs": {
"url": "https://github.com/libp2p/js-libp2p-interfaces/issues"
},
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-connection#readme#readme",
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a placeholder Readme file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/interfaces-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/topology-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/connection-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This PR is included in version @libp2p/pubsub-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove code from interfaces module Incompatible argument types
2 participants