Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
fix: update to aegir 31 and others deps (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored Mar 2, 2021
1 parent 8afa8e6 commit bcf2ba2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: yarn lint
- run: yarn build
- uses: gozala/typescript-error-reporter-action@v1.0.4
- run: yarn aegir dep-check -- -i aegir
- run: npm install
- run: npx aegir lint
- run: npx aegir ts -p check
# or
# - uses: gozala/typescript-error-reporter-action@v1.0.8
- 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:
Expand All @@ -34,34 +35,45 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn
- run: npx nyc --reporter=lcov npm run test:node -- --bail
- run: npm install
- 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
- run: yarn
- run: yarn aegir test -t browser -t webworker
- uses: microsoft/playwright-github-action@v1
- run: npm install
- 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
- run: yarn
- run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless
- 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 -- --browser webkit
test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: npx xvfb-maybe yarn aegir test -t electron-main --bail
- run: npm install
- run: npx xvfb-maybe aegir test -t electron-main --bail
test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn
- run: npx xvfb-maybe yarn aegir test -t electron-renderer --bail
- run: npm install
- run: npx xvfb-maybe aegir test -t electron-renderer --bail
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"url": "https://github.com/multiformats/js-cid/issues"
},
"dependencies": {
"multibase": "^3.0.1",
"multicodec": "^2.1.0",
"multihashes": "^3.1.0",
"uint8arrays": "^2.0.5"
"multibase": "^4.0.1",
"multicodec": "^3.0.1",
"multihashes": "^4.0.1",
"uint8arrays": "^2.1.3"
},
"devDependencies": {
"@sinonjs/samsam": "^5.3.0",
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
const mh = require('multihashes')
const multibase = require('multibase')
const multicodec = require('multicodec')
const { baseTable: codecs } = require('multicodec/src/base-table.js')
const CIDUtil = require('./cid-util')
const uint8ArrayConcat = require('uint8arrays/concat')
const uint8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayEquals = require('uint8arrays/equals')

const codecs = multicodec.nameToCode
const codecInts = /** @type {CodecName[]} */(Object.keys(codecs)).reduce((p, name) => {
p[codecs[name]] = name
return p
}, /** @type {Record<CodecNumber, CodecName>} */({}))
}, /** @type {Record<CodecCode, CodecName>} */({}))

const symbol = Symbol.for('@ipld/js-cid/CID')

Expand All @@ -26,7 +26,7 @@ const symbol = Symbol.for('@ipld/js-cid/CID')
* @typedef {0|1} CIDVersion
* @typedef {import('multibase').BaseNameOrCode} BaseNameOrCode
* @typedef {import('multicodec').CodecName} CodecName
* @typedef {import('multicodec').CodecNumber} CodecNumber
* @typedef {import('multicodec').CodecCode} CodecCode
*/

/**
Expand Down Expand Up @@ -221,7 +221,7 @@ class CID {
/**
* The codec of the CID in its number form.
*
* @returns {CodecNumber}
* @returns {CodecCode}
*/
get code () {
return codecs[this.codec]
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('CID', () => {
expect(() => {
new CID(1, 'this-codec-doesnt-exist', hash).toBaseEncodedString()
}).to.throw(
'Codec `this-codec-doesnt-exist` not found'
'Codec "this-codec-doesnt-exist" not found'
)
})

Expand Down

0 comments on commit bcf2ba2

Please sign in to comment.