Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit ca69f8b

Browse files
authored
chore: upgrde aegir (#18)
Configures aegir to bundle node buffers for this module as level uses it.
1 parent d3faa30 commit ca69f8b

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

.aegir.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict'
2+
3+
module.exports = {
4+
webpack: {
5+
node: {
6+
// this is needed until level stops using node buffers in browser code
7+
Buffer: true
8+
}
9+
}
10+
}

migrations/migration-8/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const path = require('path')
43
const CID = require('cids')
54
const Key = require('interface-datastore').Key
65
const core = require('datastore-core')
@@ -49,7 +48,7 @@ function keyToCid (key) {
4948
async function process (repoPath, options, keyFunction){
5049
const { StorageBackend, storageOptions } = utils.getDatastoreAndOptions(options, 'blocks')
5150

52-
const baseStore = new StorageBackend(path.join(repoPath, 'blocks'), storageOptions)
51+
const baseStore = new StorageBackend(`${repoPath}/blocks`, storageOptions)
5352
await baseStore.open()
5453
const store = await maybeWithSharding(baseStore, storageOptions)
5554
await store.open()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"yargs-promise": "^1.1.0"
5959
},
6060
"devDependencies": {
61-
"aegir": "^23.0.0",
61+
"aegir": "^25.0.0",
6262
"chai": "^4.2.0",
6363
"chai-as-promised": "^7.1.1",
6464
"dirty-chai": "^2.0.1",

src/repo/lock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict'
22

3-
const path = require('path')
43
const debug = require('debug')
54
const { lock } = require('proper-lockfile')
65

@@ -15,7 +14,7 @@ const lockFile = 'repo.lock'
1514
* @returns {Promise<Object>}
1615
*/
1716
exports.lock = async (version, dir) => {
18-
const file = path.join(dir, lockFile)
17+
const file = `${dir}/${lockFile}`
1918
log('locking %s', file)
2019
const release = await lock(dir, { lockfilePath: file })
2120
return {

test/migrations/migration-8-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const chaiAsPromised = require('chai-as-promised')
77
chai.use(chaiAsPromised)
88
const expect = chai.expect
99

10-
const path = require('path')
1110
const migration = require('../../migrations/migration-8')
1211
const Key = require('interface-datastore').Key
1312
const Datastore = require('datastore-fs')
@@ -68,7 +67,7 @@ function maybeWithSharding (filestore, options) {
6867
}
6968

7069
async function bootstrapBlocks (dir, encoded, options) {
71-
const baseStore = new Datastore(path.join(dir, 'blocks'), { extension: '.data', createIfMissing: true })
70+
const baseStore = new Datastore(`${dir}/blocks`, { extension: '.data', createIfMissing: true })
7271
await baseStore.open()
7372
const store = await maybeWithSharding(baseStore, options)
7473
await store.open()
@@ -84,7 +83,7 @@ async function bootstrapBlocks (dir, encoded, options) {
8483
}
8584

8685
async function validateBlocks (dir, shouldBeEncoded, options) {
87-
const baseStore = new Datastore(path.join(dir, 'blocks'), { extension: '.data', createIfMissing: false })
86+
const baseStore = new Datastore(`${dir}/blocks`, { extension: '.data', createIfMissing: false })
8887
await baseStore.open()
8988
const store = await maybeWithSharding(baseStore, options)
9089
await store.open()

0 commit comments

Comments
 (0)