diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..290ad02 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/main.yml b/.github/workflows/js-test-and-release.yml similarity index 70% rename from .github/workflows/main.yml rename to .github/workflows/js-test-and-release.yml index c9772b6..8630dc5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/js-test-and-release.yml @@ -2,10 +2,10 @@ name: test & maybe release on: push: branches: - - master + - master # with #262 - ${{{ github.default_branch }}} pull_request: branches: - - master + - master # with #262 - ${{{ github.default_branch }}} jobs: @@ -35,7 +35,10 @@ jobs: node-version: ${{ matrix.node }} - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:node - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: node test-chrome: needs: check @@ -47,6 +50,10 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:chrome + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: chrome test-chrome-webworker: needs: check @@ -58,6 +65,10 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:chrome-webworker + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: chrome-webworker test-firefox: needs: check @@ -69,6 +80,10 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:firefox + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: firefox test-firefox-webworker: needs: check @@ -80,6 +95,10 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run --if-present test:firefox-webworker + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: firefox-webworker test-electron-main: needs: check @@ -91,6 +110,10 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npx xvfb-maybe npm run --if-present test:electron-main + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: electron-main test-electron-renderer: needs: check @@ -102,13 +125,17 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npx xvfb-maybe npm run --if-present test:electron-renderer + - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + with: + directory: ./.nyc_output + flags: electron-renderer release: needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer] runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}' steps: - - uses: actions/checkout@v2.4.0 + - uses: actions/checkout@v2 with: fetch-depth: 0 - uses: actions/setup-node@v2 @@ -117,7 +144,7 @@ jobs: - uses: ipfs/aegir/actions/cache-node-modules@master - uses: ipfs/aegir/actions/docker-login@master with: - docker-token: ${{ secrets.DOCKER_USERNAME }} + docker-token: ${{ secrets.DOCKER_TOKEN }} docker-username: ${{ secrets.DOCKER_USERNAME }} - run: npm run --if-present release env: diff --git a/LICENSE b/LICENSE index b0b237f..20ce483 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,4 @@ +This project is dual licensed under MIT and Apache-2.0. + MIT: https://www.opensource.org/licenses/mit -Apache-2.0: https://www.apache.org/licenses/license-2.0 \ No newline at end of file +Apache-2.0: https://www.apache.org/licenses/license-2.0 diff --git a/LICENSE-MIT b/LICENSE-MIT index 749aa1e..72dc60d 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/package.json b/package.json index c093dcb..da109df 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,43 @@ "name": "@libp2p/utils", "version": "1.0.2", "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", - "leadMaintainer": "Vasco Santos ", + "homepage": "https://github.com/libp2p/js-libp2p-utils#readme", + "license": "Apache-2.0 OR MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/libp2p/js-libp2p-utils.git" + }, + "bugs": { + "url": "https://github.com/libp2p/js-libp2p-utils/issues" + }, "type": "module", + "types": "./dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ], + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" + ] + } + }, + "files": [ + "src", + "dist/src", + "!dist/test", + "!**/*.tsbuildinfo" + ], "exports": { + ".": { + "import": "./dist/src/index.js" + }, "./multiaddr/is-loopback": { "import": "./dist/src/multiaddr/is-loopback.js", "types": "./dist/src/multiaddr/is-loopback.d.ts" @@ -30,63 +64,12 @@ "types": "./dist/src/stream-to-ma-connr.d.ts" } }, - "typesVersions": { - "*": { - "*": [ - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "dist/src/*", - "dist/src/*/index" - ] + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "sourceType": "module" } }, - "files": [ - "src", - "dist/src" - ], - "scripts": { - "lint": "aegir lint", - "dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js", - "build": "tsc", - "pretest": "npm run build", - "test": "aegir test -f ./dist/test/**/*.js", - "test:chrome": "npm run test -- -t browser", - "test:chrome-webworker": "npm run test -- -t webworker", - "test:firefox": "npm run test -- -t browser -- --browser firefox", - "test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox", - "test:node": "npm run test -- -t node --cov", - "test:electron-main": "npm run test -- -t electron-main", - "release": "semantic-release" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/libp2p/js-libp2p-utils.git" - }, - "license": "Apache-2.0 OR MIT", - "bugs": { - "url": "https://github.com/libp2p/js-libp2p-utils/issues" - }, - "homepage": "https://github.com/libp2p/js-libp2p-utils#readme", - "devDependencies": { - "@libp2p/interfaces": "^0.2.0", - "@types/debug": "^4.1.5", - "aegir": "^36.1.2", - "it-pair": "^1.0.0", - "it-pipe": "^1.1.0", - "streaming-iterables": "^6.0.0", - "util": "^0.12.3" - }, - "dependencies": { - "@achingbrain/ip-address": "^8.1.0", - "@multiformats/multiaddr": "^10.1.1", - "abortable-iterator": "^3.0.0", - "debug": "^4.3.0", - "err-code": "^3.0.1", - "is-loopback-addr": "^1.0.0", - "private-ip": "^2.1.1" - }, "release": { "branches": [ "master" @@ -167,5 +150,37 @@ "@semantic-release/github", "@semantic-release/git" ] + }, + "scripts": { + "lint": "aegir lint", + "dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js", + "build": "tsc", + "pretest": "npm run build", + "test": "aegir test -f ./dist/test/**/*.js", + "test:chrome": "npm run test -- -t browser", + "test:chrome-webworker": "npm run test -- -t webworker", + "test:firefox": "npm run test -- -t browser -- --browser firefox", + "test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox", + "test:node": "npm run test -- -t node --cov", + "test:electron-main": "npm run test -- -t electron-main", + "release": "semantic-release" + }, + "dependencies": { + "@achingbrain/ip-address": "^8.1.0", + "@multiformats/multiaddr": "^10.1.1", + "abortable-iterator": "^3.0.0", + "debug": "^4.3.0", + "err-code": "^3.0.1", + "is-loopback-addr": "^1.0.0", + "private-ip": "^2.1.1" + }, + "devDependencies": { + "@libp2p/interfaces": "^0.2.0", + "@types/debug": "^4.1.5", + "aegir": "^36.1.2", + "it-pair": "^1.0.0", + "it-pipe": "^1.1.0", + "streaming-iterables": "^6.0.0", + "util": "^0.12.3" } }