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

Commit e174bba

Browse files
authored
feat: split out code, convert to typescript (#111)
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110). New implementation modules are: * libp2p-pubsub * libp2p-connection * libp2p-topology * Converts code to typescript (fixes #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
1 parent bc88106 commit e174bba

File tree

198 files changed

+5398
-4141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+5398
-4141
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
with:
1717
node-version: 16
1818
- run: npm install
19-
- run: npm run lint
2019
- run: npm run build
20+
- run: npm run lint
2121
- run: npm run dep-check
2222
test-node:
2323
needs: check

LICENSE

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
The MIT License (MIT)
1+
This project is dual licensed under MIT and Apache-2.0.
22

3-
Copyright (c) 2017 Protocol Labs Inc.
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
3+
MIT: https://www.opensource.org/licenses/mit
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-APACHE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

LICENSE-MIT

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "js-libp2p-interfaces",
33
"version": "1.0.0",
44
"description": "Interfaces for JS Libp2p",
5-
"leadMaintainer": "Jacob Heun <[email protected]>",
65
"private": true,
76
"scripts": {
87
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
@@ -16,7 +15,7 @@
1615
},
1716
"bugs": "https://github.com/libp2p/js-libp2p-interfaces/issues",
1817
"homepage": "https://github.com/libp2p/js-libp2p-interfaces#readme",
19-
"license": "MIT",
18+
"license": "(Apache-2.0 OR MIT)",
2019
"repository": {
2120
"type": "git",
2221
"url": "git+https://github.com/libp2p/js-libp2p-interfaces.git"

packages/compliance-tests/README.md

-7
This file was deleted.

packages/compliance-tests/package.json

-88
This file was deleted.

packages/compliance-tests/src/connection/index.js

-10
This file was deleted.

packages/compliance-tests/src/pubsub/emit-self.js

-69
This file was deleted.

packages/compliance-tests/src/pubsub/index.js

-21
This file was deleted.

packages/compliance-tests/src/pubsub/utils.js

-10
This file was deleted.

0 commit comments

Comments
 (0)