Skip to content

Commit 4144a93

Browse files
achingbrainvasco-santosrvagg
authored
chore: upgrade repo to new multiformats module (#313)
Replaces `cids`, `multibase`, `multihashes` etc with new `multiformats` module. BREAKING CHANGE: The blockstore now takes instances of the new `CID` class and returns `Uint8Arrays` Co-authored-by: Vasco Santos <[email protected]> Co-authored-by: Rod Vagg <[email protected]>
1 parent b82938f commit 4144a93

File tree

76 files changed

+1759
-2094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1759
-2094
lines changed

.aegir.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
11
'use strict'
2-
const path = require('path')
3-
4-
/** @type {import('aegir').Options["build"]["config"]} */
5-
const esbuild = {
6-
inject: [path.join(__dirname, 'scripts/node-globals.js')],
7-
plugins: [
8-
{
9-
name: 'node built ins',
10-
setup (build) {
11-
build.onResolve({ filter: /^stream$/ }, () => {
12-
return { path: require.resolve('readable-stream') }
13-
})
14-
}
15-
}
16-
]
17-
}
182

193
/** @type {import('aegir').PartialOptions} */
204
module.exports = {
21-
test: {
22-
browser: {
23-
config: {
24-
buildConfig: esbuild
25-
}
26-
}
27-
},
285
build: {
29-
bundlesizeMax: '130kB',
30-
config: esbuild
6+
bundlesizeMax: '47kB'
317
}
328
}

.github/workflows/main.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515
- run: npm install
16-
- run: npx aegir lint
17-
- run: npx aegir ts -p check
16+
- run: npm run lint
1817
# or
1918
# - uses: gozala/[email protected]
2019
- run: npx aegir build
@@ -28,7 +27,7 @@ jobs:
2827
strategy:
2928
matrix:
3029
os: [windows-latest, ubuntu-latest, macos-latest]
31-
node: [14, 15]
30+
node: [14, 16]
3231
fail-fast: true
3332
steps:
3433
- uses: actions/checkout@v2
@@ -45,7 +44,7 @@ jobs:
4544
- uses: actions/checkout@v2
4645
- uses: microsoft/playwright-github-action@v1
4746
- run: npm install
48-
- run: npx aegir test -t browser -t webworker --bail # add --cov later when its fixed
47+
- run: npx aegir test -t browser -t webworker --bail
4948
- uses: codecov/codecov-action@v1
5049
test-firefox:
5150
needs: check
@@ -62,7 +61,7 @@ jobs:
6261
- uses: actions/checkout@v2
6362
- uses: microsoft/playwright-github-action@v1
6463
- run: npm install
65-
- run: npx aegir test -t browser -t webworker --bail --timeout 10000 -- --browser webkit
64+
- run: npx aegir test -t browser -t webworker --bail -- --browser webkit
6665
# test-electron-main:
6766
# needs: check
6867
# runs-on: ubuntu-latest
@@ -76,4 +75,4 @@ jobs:
7675
# steps:
7776
# - uses: actions/checkout@v2
7877
# - run: npm install
79-
# - run: npx xvfb-maybe aegir test -t electron-renderer --bail
78+
# - run: npx xvfb-maybe aegir test -t electron-renderer --bail

package.json

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@
55
"leadMaintainer": "Alex Potsides <[email protected]>",
66
"main": "src/index.js",
77
"types": "dist/src/index.d.ts",
8+
"tsd": {
9+
"directory": "test"
10+
},
811
"files": [
912
"src",
1013
"dist"
1114
],
1215
"browser": {
1316
"rimraf": false,
1417
"datastore-fs": "datastore-level",
15-
"./src/lock.js": "./src/lock-memory.js",
16-
"./src/default-options.js": "./src/default-options-browser.js"
18+
"./src/locks/fs.js": "./src/locks/memory.js",
19+
"./src/default-options.js": "./src/default-options.browser.js"
1720
},
1821
"scripts": {
1922
"prepare": "aegir build --no-bundle",
20-
"test": "aegir test",
23+
"test": "tsd && aegir test",
2124
"test:node": "aegir test -t node",
2225
"test:browser": "aegir test -t browser",
2326
"test:webworker": "aegir test -t webworker",
2427
"build": "aegir build",
25-
"lint": "aegir lint",
28+
"lint": "aegir ts -p check && aegir lint",
2629
"release": "aegir release",
2730
"release-minor": "aegir release --type minor",
2831
"release-major": "aegir release --type major",
@@ -47,46 +50,45 @@
4750
"devDependencies": {
4851
"@types/bytes": "^3.1.0",
4952
"@types/debug": "^4.1.5",
50-
"@types/memdown": "^3.0.0",
51-
"@types/ncp": "^2.0.4",
5253
"@types/proper-lockfile": "^4.1.1",
5354
"@types/rimraf": "^3.0.0",
54-
"aegir": "^33.1.0",
55+
"aegir": "^34.0.0",
5556
"assert": "^2.0.0",
57+
"blockstore-datastore-adapter": "^1.0.0",
5658
"events": "^3.3.0",
59+
"ipfs-utils": "^8.1.3",
5760
"it-all": "^1.0.2",
5861
"it-drain": "^1.0.1",
5962
"it-first": "^1.0.2",
6063
"just-range": "^2.1.0",
61-
"memdown": "^6.0.0",
62-
"multihashing-async": "^2.1.0",
63-
"ncp": "^2.0.0",
64-
"process": "^0.11.10",
65-
"readable-stream": "^3.6.0",
6664
"rimraf": "^3.0.0",
67-
"sinon": "^10.0.0",
65+
"sinon": "^11.1.1",
66+
"tsd": "^0.17.0",
6867
"url": "^0.11.0",
6968
"util": "^0.12.3"
7069
},
7170
"dependencies": {
71+
"@ipld/dag-cbor": "^6.0.4",
72+
"@ipld/dag-pb": "^2.1.0",
7273
"bytes": "^3.1.0",
73-
"cids": "^1.1.6",
74-
"datastore-core": "^4.0.0",
75-
"datastore-fs": "^4.0.0",
76-
"datastore-level": "^5.0.0",
74+
"cborg": "^1.3.4",
7775
"debug": "^4.1.0",
7876
"err-code": "^3.0.1",
79-
"interface-datastore": "^4.0.0",
80-
"ipfs-repo-migrations": "^8.0.0",
81-
"ipfs-utils": "^7.0.0",
82-
"ipld-block": "^0.11.0",
77+
"eslint-plugin-ava": "^12.0.0",
78+
"interface-blockstore": "^1.0.0",
79+
"interface-datastore": "^5.0.0",
80+
"ipfs-repo-migrations": "^9.0.0",
8381
"it-filter": "^1.0.2",
82+
"it-map": "^1.0.5",
83+
"it-merge": "^1.0.2",
84+
"it-parallel-batch": "^1.0.9",
85+
"it-pipe": "^1.1.0",
8486
"it-pushable": "^1.4.0",
8587
"just-safe-get": "^2.0.0",
8688
"just-safe-set": "^2.1.0",
8789
"merge-options": "^3.0.4",
88-
"multibase": "^4.0.1",
89-
"multihashes": "^4.0.2",
90+
"mortice": "^2.0.1",
91+
"multiformats": "^9.0.4",
9092
"p-queue": "^6.0.0",
9193
"proper-lockfile": "^4.0.0",
9294
"sort-keys": "^4.0.0",

scripts/node-globals.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/backends.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/blockstore-utils.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/blockstore.js

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)