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/CHANGELOG.md b/CHANGELOG.md index 70e8d49c..8dcb4b9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## [4.0.2](https://github.com/multiformats/js-multihash/compare/v4.0.1...v4.0.2) (2021-03-03) + + +### Bug Fixes + +* revert to node12 ([adf5a6c](https://github.com/multiformats/js-multihash/commit/adf5a6c1af5176ef2ba7dd6bb9d429b043c7c88d)) + + + +## [4.0.1](https://github.com/multiformats/js-multihash/compare/v4.0.0...v4.0.1) (2021-03-01) + + +### Bug Fixes + +* downgrade varint ([#118](https://github.com/multiformats/js-multihash/issues/118)) ([e84aabb](https://github.com/multiformats/js-multihash/commit/e84aabbd906fa7a5cdea69c4633d4bb87e01a898)) + + + +# [4.0.0](https://github.com/multiformats/js-multihash/compare/v3.1.2...v4.0.0) (2021-03-01) + + +### Bug Fixes + +* update to new aegir ([#115](https://github.com/multiformats/js-multihash/issues/115)) ([1d8348d](https://github.com/multiformats/js-multihash/commit/1d8348d11d7c8b5cebd22b74ffbd9cf4a69ac786)) + + +### BREAKING CHANGES + +* No longer supports deep type imports only from the entrypoint. + + + +## [3.1.3-0](https://github.com/multiformats/js-multihash/compare/v3.1.2...v3.1.3-0) (2021-02-13) + + + ## [3.1.2](https://github.com/multiformats/js-multihash/compare/v3.1.1...v3.1.2) (2021-01-26) diff --git a/package.json b/package.json index 4d0116a6..d18854be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multihashes", - "version": "3.1.2", + "version": "4.0.2", "description": "multihash implementation", "keywords": [ "multihash", @@ -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", - "varint": "^6.0.0" + "multibase": "^4.0.1", + "uint8arrays": "^2.1.3", + "varint": "^5.0.2" }, "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": ">=12.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