mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
fix: update to aegir v31
This commit is contained in:
parent
4ee3e1973b
commit
1e1740f727
24
.aegir.js
24
.aegir.js
@ -1,5 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
const Libp2p = require('./src')
|
const Libp2p = require('./src')
|
||||||
const { MULTIADDRS_WEBSOCKETS } = require('./test/fixtures/browser')
|
const { MULTIADDRS_WEBSOCKETS } = require('./test/fixtures/browser')
|
||||||
const Peers = require('./test/fixtures/peers')
|
const Peers = require('./test/fixtures/peers')
|
||||||
@ -47,16 +48,23 @@ const after = async () => {
|
|||||||
await libp2p.stop()
|
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 = {
|
module.exports = {
|
||||||
bundlesize: { maxSize: '220kB' },
|
build: {
|
||||||
hooks: {
|
bundlesizeMax: '220kB'
|
||||||
pre: before,
|
|
||||||
post: after
|
|
||||||
},
|
},
|
||||||
webpack: {
|
test: {
|
||||||
node: {
|
before,
|
||||||
// needed by bcrypto
|
after,
|
||||||
Buffer: true
|
browser: {
|
||||||
|
config: {
|
||||||
|
buildConfig: esbuild
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
package.json
12
package.json
@ -53,6 +53,12 @@
|
|||||||
"browser": {
|
"browser": {
|
||||||
"@motrix/nat-api": false
|
"@motrix/nat-api": false
|
||||||
},
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": "ipfs",
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!.aegir.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@motrix/nat-api": "^0.3.1",
|
"@motrix/nat-api": "^0.3.1",
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
@ -110,7 +116,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nodeutils/defaults-deep": "^1.1.0",
|
"@nodeutils/defaults-deep": "^1.1.0",
|
||||||
"abortable-iterator": "^3.0.0",
|
"abortable-iterator": "^3.0.0",
|
||||||
"aegir": "^29.2.0",
|
"aegir": "ipfs/aegir#feat/remove-webpack-karma",
|
||||||
"chai-bytes": "^0.1.2",
|
"chai-bytes": "^0.1.2",
|
||||||
"chai-string": "^1.5.0",
|
"chai-string": "^1.5.0",
|
||||||
"delay": "^4.4.0",
|
"delay": "^4.4.0",
|
||||||
@ -141,7 +147,9 @@
|
|||||||
"p-wait-for": "^3.2.0",
|
"p-wait-for": "^3.2.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sinon": "^9.2.4",
|
"sinon": "^9.2.4",
|
||||||
"uint8arrays": "^2.0.5"
|
"uint8arrays": "^2.0.5",
|
||||||
|
"url": "^0.11.0",
|
||||||
|
"util": "^0.12.3"
|
||||||
},
|
},
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"David Dias <daviddias.p@gmail.com>",
|
"David Dias <daviddias.p@gmail.com>",
|
||||||
|
2
scripts/node-globals.js
Normal file
2
scripts/node-globals.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
export const { Buffer } = require('buffer')
|
@ -22,8 +22,12 @@ module.exports = generate
|
|||||||
module.exports.NONCE_LENGTH = 24
|
module.exports.NONCE_LENGTH = 24
|
||||||
module.exports.KEY_LENGTH = KEY_LENGTH
|
module.exports.KEY_LENGTH = KEY_LENGTH
|
||||||
|
|
||||||
|
try {
|
||||||
// @ts-ignore This condition will always return 'false' since the types 'Module | undefined'
|
// @ts-ignore This condition will always return 'false' since the types 'Module | undefined'
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
generate(process.stdout)
|
generate(process.stdout)
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user