fix: update to aegir v31

This commit is contained in:
Hugo Dias 2021-02-22 15:42:03 +00:00
parent 4ee3e1973b
commit 1e1740f727
No known key found for this signature in database
GPG Key ID: 9F61AFCAB8C717A0
4 changed files with 36 additions and 14 deletions

View File

@ -1,5 +1,6 @@
'use strict'
const path = require('path')
const Libp2p = require('./src')
const { MULTIADDRS_WEBSOCKETS } = require('./test/fixtures/browser')
const Peers = require('./test/fixtures/peers')
@ -47,16 +48,23 @@ const after = async () => {
await libp2p.stop()
}
/** @type {import('aegir').Options["build"]["config"]} */
const esbuild = {
inject: [path.join(__dirname, './scripts/node-globals.js')]
}
/** @type {import('aegir').PartialOptions} */
module.exports = {
bundlesize: { maxSize: '220kB' },
hooks: {
pre: before,
post: after
build: {
bundlesizeMax: '220kB'
},
webpack: {
node: {
// needed by bcrypto
Buffer: true
test: {
before,
after,
browser: {
config: {
buildConfig: esbuild
}
}
}
}

View File

@ -53,6 +53,12 @@
"browser": {
"@motrix/nat-api": false
},
"eslintConfig": {
"extends": "ipfs",
"ignorePatterns": [
"!.aegir.js"
]
},
"dependencies": {
"@motrix/nat-api": "^0.3.1",
"abort-controller": "^3.0.0",
@ -110,7 +116,7 @@
"devDependencies": {
"@nodeutils/defaults-deep": "^1.1.0",
"abortable-iterator": "^3.0.0",
"aegir": "^29.2.0",
"aegir": "ipfs/aegir#feat/remove-webpack-karma",
"chai-bytes": "^0.1.2",
"chai-string": "^1.5.0",
"delay": "^4.4.0",
@ -141,7 +147,9 @@
"p-wait-for": "^3.2.0",
"rimraf": "^3.0.2",
"sinon": "^9.2.4",
"uint8arrays": "^2.0.5"
"uint8arrays": "^2.0.5",
"url": "^0.11.0",
"util": "^0.12.3"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",

2
scripts/node-globals.js Normal file
View File

@ -0,0 +1,2 @@
// @ts-nocheck
export const { Buffer } = require('buffer')

View File

@ -22,8 +22,12 @@ module.exports = generate
module.exports.NONCE_LENGTH = 24
module.exports.KEY_LENGTH = KEY_LENGTH
try {
// @ts-ignore This condition will always return 'false' since the types 'Module | undefined'
if (require.main === module) {
// @ts-ignore
generate(process.stdout)
}
} catch (error) {
}