Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 30 additions & 11 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
'use strict'

module.exports = {
karma: {
// multi-bucket pinset migrations are slow
browserNoActivityTimeout: 240 * 1000
},
webpack: {
node: {
// this is needed until level stops using node buffers in browser code
Buffer: true,
const path = require('path')

// needed by cbor, binary-parse-stream and nofilter
stream: true
const esbuild = {
// this will inject all the named exports from 'node-globals.js' as globals
inject: [path.join(__dirname, 'scripts/node-globals.js')],
plugins: [
{
name: 'node built ins', // this will make the bundler resolve node builtins to the respective browser polyfill
setup (build) {
build.onResolve({ filter: /^stream$/ }, () => {
return { path: require.resolve('readable-stream') }
})
build.onResolve({ filter: /^assert$/ }, () => {
return { path: require.resolve('assert') }
})
build.onResolve({ filter: /^util$/ }, () => {
return { path: require.resolve('util') }
})
build.onResolve({ filter: /^events$/ }, () => {
return { path: require.resolve('events') }
})
}
}
]
}

module.exports = {
test: {
browser: esbuild
},
build: {
config: esbuild
}
}
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"docs": "aegir docs"
},
"dependencies": {
"cbor": "^6.0.1",
"cbor": "^7.0.2",
"cids": "^1.0.0",
"datastore-core": "^3.0.0",
"debug": "^4.1.0",
"fnv1a": "^1.0.1",
"interface-datastore": "^3.0.3",
"ipld-dag-pb": "^0.20.0",
"ipld-dag-pb": "^0.21.0",
"it-length": "^1.0.1",
"multibase": "^3.0.0",
"multicodec": "^2.0.0",
Expand All @@ -58,17 +58,21 @@
"varint": "^6.0.0"
},
"devDependencies": {
"aegir": "^30.3.0",
"aegir": "^31.0.0",
"assert": "^2.0.0",
"datastore-car": "^1.2.0",
"datastore-fs": "^3.0.0",
"datastore-level": "^3.0.0",
"datastore-level": "^4.0.0",
"events": "^3.2.0",
"it-all": "^1.0.2",
"just-safe-set": "^2.1.0",
"level-5": "npm:level@^5.0.0",
"level-6": "npm:level@^6.0.0",
"ncp": "^2.0.0",
"readable-stream": "^3.6.0",
"rimraf": "^3.0.0",
"sinon": "^9.0.2"
"sinon": "^9.0.2",
"util": "^0.12.3"
},
"engines": {
"node": ">=10.0.0",
Expand Down
4 changes: 4 additions & 0 deletions scripts/node-globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// file: node-globals.js
// @ts-nocheck
export const { Buffer } = require('buffer')
export const process = require('process/browser')
2 changes: 1 addition & 1 deletion test/fixtures/repo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const loadFixture = require('aegir/fixtures')
const loadFixture = require('aegir/utils/fixtures')
const { CONFIG_KEY, VERSION_KEY, createStore } = require('../../src/utils')

async function createRepo (repoOptions, prefix) {
Expand Down
2 changes: 1 addition & 1 deletion test/migrations/migration-9-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { cidToKey, PIN_DS_KEY } = require('../../migrations/migration-9/utils')
const { createStore } = require('../../src/utils')
const CID = require('cids')
const CarDatastore = require('datastore-car')
const loadFixture = require('aegir/fixtures')
const loadFixture = require('aegir/utils/fixtures')
const multibase = require('multibase')

function pinToCid (key, pin) {
Expand Down