diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e81b21c..334948de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,6 @@ jobs: - run: npx aegir build - run: npx aegir dep-check - uses: ipfs/aegir/actions/bundle-size@master - name: size with: github_token: ${{ secrets.GITHUB_TOKEN }} test-node: @@ -27,7 +26,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - node: [12, 14] + node: [14, 15] fail-fast: true steps: - uses: actions/checkout@v2 @@ -35,22 +34,33 @@ jobs: with: node-version: ${{ matrix.node }} - run: npm install - - run: npx nyc --reporter=lcov aegir test -t node -- --bail + - run: npx aegir test -t node --bail --cov - uses: codecov/codecov-action@v1 test-chrome: needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 - run: npm install - - run: npx aegir test -t browser -t webworker --bail + - run: npx aegir test -t browser -t webworker --bail --cov + - uses: codecov/codecov-action@v1 test-firefox: needs: check runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 + - run: npm install + - run: npx aegir test -t browser -t webworker --bail -- --browser firefox + test-webkit: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: microsoft/playwright-github-action@v1 - run: npm install - - run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless + - run: npx aegir test -t browser -t webworker --bail -- --browser webkit test-electron-main: needs: check runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 83922d23..01782c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ node_modules dist docs -yarn.lock \ No newline at end of file +yarn.lock +.nyc_output \ No newline at end of file diff --git a/package.json b/package.json index dce71322..90c1e9a7 100644 --- a/package.json +++ b/package.json @@ -30,30 +30,24 @@ }, "main": "src/index.js", "types": "dist/src/index.d.ts", - "typesVersions": { - "*": { - "src/*": [ - "dist/src/*", - "dist/src/*/index" - ], - "src/": [ - "dist/src/index" - ] - } - }, "repository": "github:multiformats/js-multihash", "dependencies": { - "multibase": "^3.1.0", - "uint8arrays": "^2.0.5", + "multibase": "^4.0.1", + "uint8arrays": "^2.1.3", "varint": "^6.0.0" }, "devDependencies": { - "aegir": "^30.3.0", - "ipfs-utils": "^5.0.1" + "aegir": "^31.0.0", + "ipfs-utils": "^6.0.1" }, "eslintConfig": { "extends": "ipfs" }, + "aegir": { + "build": { + "bundlesizeMax": "5.8kB" + } + }, "contributors": [ "David Dias ", "Hugo Dias ", @@ -79,7 +73,7 @@ "Alan Shaw " ], "engines": { - "node": ">=10.0.0", + "node": ">=14.0.0", "npm": ">=6.0.0" } } diff --git a/src/index.js b/src/index.js index 09809c08..dfb18d4f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,5 @@ /** * Multihash implementation in JavaScript. - * - * @module multihash */ 'use strict' @@ -19,6 +17,7 @@ for (const key in names) { const name = /** @type {HashName} */(key) codes[names[name]] = name } +Object.freeze(codes) /** * Convert the given multihash to a hex encoded string. @@ -229,7 +228,7 @@ function prefix (multihash) { module.exports = { names, - codes: Object.freeze(codes), + codes, toHexString, fromHexString, toB58String, diff --git a/src/types.ts b/src/types.d.ts similarity index 100% rename from src/types.ts rename to src/types.d.ts