mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 02:22: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'
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
package.json
12
package.json
@ -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
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.KEY_LENGTH = KEY_LENGTH
|
||||
|
||||
// @ts-ignore This condition will always return 'false' since the types 'Module | undefined'
|
||||
if (require.main === module) {
|
||||
// @ts-ignore
|
||||
generate(process.stdout)
|
||||
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) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user