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

chore: update deps #71

Merged
merged 3 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 26 additions & 7 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
'use strict'

module.exports = {
webpack: {
node: {
// this is needed until keccak and cipher-base stop using node streams in browser code
stream: true,
const path = require('path')

// this is needed until core-util-is stops using node buffers in browser code
Buffer: true
/** @type {import('aegir').Options["build"]["config"]} */
const esbuild = {
inject: [path.join(__dirname, 'scripts/node-globals.js')],
plugins: [
{
name: 'node built ins',
setup (build) {
build.onResolve({ filter: /^stream$/ }, () => {
return { path: require.resolve('readable-stream') }
})
}
}
]
}

/** @type {import('aegir').PartialOptions} */
module.exports = {
test: {
browser: {
config: {
buildConfig: esbuild
}
}
},
build: {
config: esbuild
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output
Expand Down
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
language: node_js
cache: npm
dist: bionic

branches:
only:
- master
- /^release\/.*$/

stages:
- check
- test
- cov

node_js:
- '10'
- 'lts/*'
- 'node'

os:
- linux
- osx
- windows

script: npx nyc -s npm run test:node -- --bail
script: npm run test:node -- --cov
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
include:
- os: windows
cache: false

- stage: check
script:
- npx aegir commitlint --travis
- npx aegir dep-check
- npm run lint

Expand All @@ -34,7 +44,7 @@ jobs:
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
script: npx aegir test -t browser -t webworker -- --browser firefox

notifications:
email: false
email: false
3 changes: 2 additions & 1 deletion eth-block-list/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const CID = require('cids')
const multihash = require('multihashes')
const multicodec = require('multicodec')
const EthBlockFromRpc = require('ethereumjs-block/from-rpc')
const uint8ArrayToString = require('uint8arrays/to-string')

const dagEthBlockList = require('../index')
const resolver = dagEthBlockList.resolver
Expand Down Expand Up @@ -139,7 +140,7 @@ describe('IPLD format resolver (local)', () => {
expect(cid.codec).to.equal('eth-block-list')
const mhash = multihash.decode(cid.multihash)
expect(mhash.name).to.equal('keccak-256')
expect(mhash.digest.toString('hex')).to.equal(ethBlock.header.uncleHash.toString('hex'))
expect(uint8ArrayToString(mhash.digest, 'base16')).to.equal(ethBlock.header.uncleHash.toString('hex'))
})

it('should create CID, no options', async () => {
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,24 @@
],
"license": "MIT",
"dependencies": {
"buffer": "^5.6.0",
"buffer": "^6.0.3",
"cids": "^1.0.0",
"ethereumjs-account": "^3.0.0",
"ethereumjs-block": "^2.2.1",
"ethereumjs-tx": "^2.1.1",
"merkle-patricia-tree": "^3.0.0",
"multicodec": "^2.0.0",
"multihashes": "^3.0.1",
"multicodec": "^3.0.1",
"multihashes": "^4.0.2",
"multihashing-async": "^2.0.0",
"rlp": "^2.2.4"
},
"devDependencies": {
"aegir": "^25.0.0",
"aegir": "^33.0.0",
"assert": "^2.0.0",
"promisify-es6": "^1.0.3",
"uint8arrays": "^1.0.0"
"readable-stream": "^3.6.0",
"uint8arrays": "^2.1.4",
"util": "^0.12.3"
},
"contributors": [
"Volker Mische <volker.mische@gmail.com>",
Expand Down
2 changes: 2 additions & 0 deletions scripts/node-globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @ts-nocheck
export const { Buffer } = require('buffer')
2 changes: 1 addition & 1 deletion util/cidFromHash.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = cidFromHash

function cidFromHash (codec, rawhash, options) {
// `CID` expects a string for the multicodec
const codecName = multicodec.print[codec]
const codecName = multicodec.getNameFromCode(codec)
options = options || {}
const hashAlg = options.hashAlg || 'keccak-256'
const version = typeof options.version === 'undefined' ? 1 : options.version
Expand Down
2 changes: 1 addition & 1 deletion util/createUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const createUtil = (codec, deserialize) => {
const options = Object.assign(defaultOptions, userOptions)

const multihash = await multihashing(binaryBlob, options.hashAlg)
const codecName = multicodec.print[codec]
const codecName = multicodec.getNameFromCode(codec)
const cid = new CID(options.cidVersion, codecName, multihash)

return cid
Expand Down