Skip to content

fix!: update to esm only export #236

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

Merged
merged 35 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6785f17
fix: update to esm libp2p and deps
achingbrain Apr 26, 2022
51d2135
chore: revert interface to type
achingbrain Apr 26, 2022
e110b2f
chore: restore license
achingbrain Apr 26, 2022
2045fde
fix: more of the go-gossipsub tests passing
achingbrain Apr 26, 2022
2d74e27
fix: tests passing
achingbrain Apr 27, 2022
43a4d61
Merge remote-tracking branch 'origin/master' into fix/update-libp2p-deps
achingbrain Apr 27, 2022
18db40e
chore: update ci
achingbrain Apr 27, 2022
f65d56d
chore: do not wait in order
achingbrain Apr 27, 2022
cd09f89
fix: browser tests
achingbrain Apr 27, 2022
3619aca
chore: run go tests on node
achingbrain Apr 27, 2022
07c130b
chore: add missing dep
achingbrain Apr 28, 2022
4df0d81
chore: another missing dep
achingbrain Apr 28, 2022
4a703b8
chore: missing deps
achingbrain Apr 28, 2022
02da20a
chore: slow ci is slow
achingbrain Apr 28, 2022
6d36b4b
chore: remove libp2p dep in favour of programatic streams
achingbrain May 1, 2022
102c68b
chore: add missing dep
achingbrain May 1, 2022
903d698
chore: ensure we get the right number of connections
achingbrain May 1, 2022
b653f00
fix: test mesh at time of publish
achingbrain May 2, 2022
1d65689
chore: partial revert
achingbrain May 2, 2022
9278534
chore: test mesh before use
achingbrain May 2, 2022
6d0afe9
chore: only wait for the heartbeat of the node under test
achingbrain May 2, 2022
1ec595c
chore: update interfaces
achingbrain May 4, 2022
86a27a6
fix: flaky test and #208
mpetrunic May 4, 2022
799dd3f
fix: event awaiting
mpetrunic May 4, 2022
25e7838
fix: gossip test for piggyback control
mpetrunic May 5, 2022
0c3e41f
Merge remote-tracking branch 'origin/master' into fix/update-libp2p-deps
mpetrunic May 5, 2022
4a37d22
attempt to fix firefox test
mpetrunic May 6, 2022
cc97f84
chore: disable firefox tests
wemeetagain May 7, 2022
da13c30
chore: add missing protons dev dep
achingbrain May 10, 2022
a02f25a
update package name to include chainsafe namespace
mpetrunic May 10, 2022
983a40b
update readme
mpetrunic May 10, 2022
278ec73
Update package name
dapplion May 10, 2022
8b7961c
Revert "Update package name"
dapplion May 10, 2022
0407eae
Merge remote-tracking branch 'origin/master' into fix/update-libp2p-deps
mpetrunic May 10, 2022
01f3ecd
fix ci
mpetrunic May 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .aegir.js

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ module.exports = {
// Allow to place comments before the else {} block
'brace-style': 'off',
indent: 'off'
},
globals: {
'BigInt':true
}
}
33 changes: 15 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: lts/*
- run: npm install
- run: npm run lint
- run: npm run prebuild
- run: npm run build
- run: npx aegir dep-check
test-node:
needs: check
Expand All @@ -33,8 +33,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run prebuild
- run: npx aegir test -t node --cov --bail -- --exit
- run: npm run test:node -- --cov --bail -- --exit
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
Expand All @@ -45,24 +44,22 @@ jobs:
with:
node-version: lts/*
- run: npm install
- run: npm run prebuild
- run: npx aegir test -t browser -t webworker --bail -- --exit
test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- run: npm install
- run: npm run prebuild
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox -- --exit
- run: npm run test:browser -- -t webworker --bail -- --exit
# test-firefox:
# needs: check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: lts/*
# - run: npm install
# - run: npm run test:browser -- -t webworker --bail -- --browser firefox -- --exit
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [check, test-node, test-chrome, test-firefox]
needs: [check, test-node, test-chrome]
steps:
- uses: google-github-actions/release-please-action@v3
id: release
Expand Down Expand Up @@ -90,4 +87,4 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
if: ${{ steps.release.outputs.release_created }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.idea/
node_modules/
src/
package-lock.json
yarn.lock
dist/
docs/
.nyc_output/coverage-final.json
.vscode/settings.json
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ src/
dist/

# Don't format the auto-generated protobuf files
ts/message/rpc.d.ts
ts/message/rpc.js
ts/message/rpc.ts
File renamed without changes.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@

## Table of Contents

- [Specs](#specs)
- [Install](#Install)
- [Usage](#Usage)
- [API](#API)
- [Contribute](#Contribute)
- [License](#License)
- [js-libp2p-gossipsub](#js-libp2p-gossipsub)
- [Lead Maintainer](#lead-maintainer)
- [Table of Contents](#table-of-contents)
- [Specs](#specs)
- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Create a gossipsub implementation](#create-a-gossipsub-implementation)
- [Contribute](#contribute)
- [License](#license)

## Specs

Expand All @@ -26,12 +30,12 @@ Gossipsub is an implementation of pubsub based on meshsub and floodsub. You can

## Install

`npm install libp2p-gossipsub`
`npm install @chainsafe/libp2p-gossipsub`

## Usage

```javascript
const Gossipsub = require('libp2p-gossipsub')
const Gossipsub = require('@chainsafe/libp2p-gossipsub')

const gsub = new Gossipsub(libp2p, options)

Expand Down
64 changes: 33 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
{
"name": "libp2p-gossipsub",
"name": "@chainsafe/libp2p-gossipsub",
"version": "0.14.0",
"description": "A typescript implementation of gossipsub",
"leadMaintainer": "Cayman Nava <[email protected]>",
"main": "src/index.js",
"files": [
"src",
"dist"
],
"types": "src/index.d.ts",
"type": "module",
"types": "dist/ts/index.d.ts",
"exports": {
".": {
"import": "./dist/ts/index.js"
}
},
"scripts": {
"lint": "eslint --ext .ts ts",
"release": "aegir release --no-types",
"prebuild": "tsc -p tsconfig.build.json",
"build": "npm run build:proto && npm run build:proto-types && cp -R ts/message src && npm run build:types",
"build:proto": "pbjs -t static-module --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o ts/message/rpc.js ./ts/message/rpc.proto",
"build:proto-types": "pbts -o ts/message/rpc.d.ts ts/message/rpc.js",
"build:types": "aegir build --no-types",
"build": "tsc -p tsconfig.build.json",
"generate": "protons ./ts/message/rpc.proto",
"prepare": "npm run build",
"pretest": "npm run build",
"benchmark": "node ./node_modules/.bin/benchmark 'test/benchmark/time-cache.test.js' --local",
"test": "aegir test",
"test:node": "aegir test --target node",
"test:browser": "aegir test --target browser"
"test": "aegir test -f './dist/test/*.spec.js'",
"test:node": "npm run test -- --target node",
"test:browser": "npm run test -- --target browser"
},
"repository": {
"type": "git",
Expand All @@ -40,35 +42,38 @@
},
"homepage": "https://github.com/ChainSafe/js-libp2p-gossipsub#readme",
"dependencies": {
"@types/debug": "^4.1.7",
"debug": "^4.3.1",
"@libp2p/crypto": "^0.22.12",
"@libp2p/interfaces": "^1.3.31",
"@libp2p/logger": "^1.1.4",
"@libp2p/peer-id": "^1.1.10",
"@libp2p/peer-record": "^1.0.8",
"@libp2p/pubsub": "^1.2.21",
"@libp2p/topology": "^1.1.7",
"denque": "^1.5.0",
"err-code": "^3.0.1",
"iso-random-stream": "^2.0.2",
"it-pipe": "^1.1.0",
"libp2p-crypto": "^0.21.2",
"libp2p-interfaces": "4.0.4",
"it-pipe": "^2.0.3",
"multiformats": "^9.6.4",
"peer-id": "^0.16.0",
"protobufjs": "^6.11.2",
"protons-runtime": "^1.0.4",
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"@chainsafe/as-sha256": "^0.2.4",
"@chainsafe/libp2p-noise": "^4.1.1",
"@dapplion/benchmark": "^0.1.6",
"@types/chai": "^4.2.3",
"@dapplion/benchmark": "^0.2.2",
"@libp2p/floodsub": "^1.0.5",
"@libp2p/interface-compliance-tests": "^1.1.32",
"@libp2p/peer-id-factory": "^1.0.9",
"@libp2p/peer-store": "^1.0.12",
"@multiformats/multiaddr": "^10.1.8",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "^3.0.2",
"@typescript-eslint/parser": "^3.0.2",
"aegir": "^36.0.2",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"chai-spies": "^1.0.0",
"datastore-core": "^7.0.1",
"delay": "^5.0.0",
"detect-node": "^2.1.0",
"dirty-chai": "^2.0.1",
"eslint": "^7.1.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
Expand All @@ -77,22 +82,19 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"it-pair": "^1.0.0",
"libp2p": "0.36.1",
"libp2p-floodsub": "^0.29.1",
"libp2p-interfaces-compliance-tests": "^4.0.8",
"libp2p-mplex": "^0.10.7",
"libp2p-websockets": "^0.16.2",
"lodash": "^4.17.15",
"multiaddr": "^10.0.0",
"os": "^0.1.1",
"p-event": "^5.0.1",
"p-retry": "^4.2.0",
"p-times": "^2.1.0",
"p-wait-for": "^3.1.0",
"p-wait-for": "^3.2.0",
"prettier": "^2.0.5",
"promisify-es6": "^1.0.3",
"protons": "^3.0.4",
"sinon": "^11.1.1",
"time-cache": "^0.3.0",
"ts-node": "^10.7.0",
"ts-sinon": "^2.0.2",
"typescript": "4.6.2",
"util": "^0.12.3"
},
Expand Down
Loading