Skip to content

Commit

Permalink
chore: upgrade repo to new multiformats module (#313)
Browse files Browse the repository at this point in the history
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 <vasco.santos@moxy.studio>
Co-authored-by: Rod Vagg <rod@vagg.org>
  • Loading branch information
3 people committed Jul 9, 2021
1 parent b82938f commit 4144a93
Show file tree
Hide file tree
Showing 76 changed files with 1,759 additions and 2,094 deletions.
26 changes: 1 addition & 25 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
'use strict'
const path = require('path')

/** @type {import('aegir').Options["build"]["config"]} */
const esbuild = {
inject: [path.join(__dirname, 'scripts/node-globals.js')],
plugins: [
{
name: 'node built ins',
setup (build) {
build.onResolve({ filter: /^stream$/ }, () => {
return { path: require.resolve('readable-stream') }
})
}
}
]
}

/** @type {import('aegir').PartialOptions} */
module.exports = {
test: {
browser: {
config: {
buildConfig: esbuild
}
}
},
build: {
bundlesizeMax: '130kB',
config: esbuild
bundlesizeMax: '47kB'
}
}
11 changes: 5 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir lint
- run: npx aegir ts -p check
- run: npm run lint
# or
# - uses: gozala/typescript-error-reporter-action@v1.0.8
- run: npx aegir build
Expand All @@ -28,7 +27,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [14, 15]
node: [14, 16]
fail-fast: true
steps:
- uses: actions/checkout@v2
Expand All @@ -45,7 +44,7 @@ jobs:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- run: npm install
- run: npx aegir test -t browser -t webworker --bail # add --cov later when its fixed
- run: npx aegir test -t browser -t webworker --bail
- uses: codecov/codecov-action@v1
test-firefox:
needs: check
Expand All @@ -62,7 +61,7 @@ jobs:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- run: npm install
- run: npx aegir test -t browser -t webworker --bail --timeout 10000 -- --browser webkit
- run: npx aegir test -t browser -t webworker --bail -- --browser webkit
# test-electron-main:
# needs: check
# runs-on: ubuntu-latest
Expand All @@ -76,4 +75,4 @@ jobs:
# steps:
# - uses: actions/checkout@v2
# - run: npm install
# - run: npx xvfb-maybe aegir test -t electron-renderer --bail
# - run: npx xvfb-maybe aegir test -t electron-renderer --bail
48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"leadMaintainer": "Alex Potsides <alex@achingbrain.net>",
"main": "src/index.js",
"types": "dist/src/index.d.ts",
"tsd": {
"directory": "test"
},
"files": [
"src",
"dist"
],
"browser": {
"rimraf": false,
"datastore-fs": "datastore-level",
"./src/lock.js": "./src/lock-memory.js",
"./src/default-options.js": "./src/default-options-browser.js"
"./src/locks/fs.js": "./src/locks/memory.js",
"./src/default-options.js": "./src/default-options.browser.js"
},
"scripts": {
"prepare": "aegir build --no-bundle",
"test": "aegir test",
"test": "tsd && aegir test",
"test:node": "aegir test -t node",
"test:browser": "aegir test -t browser",
"test:webworker": "aegir test -t webworker",
"build": "aegir build",
"lint": "aegir lint",
"lint": "aegir ts -p check && aegir lint",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
Expand All @@ -47,46 +50,45 @@
"devDependencies": {
"@types/bytes": "^3.1.0",
"@types/debug": "^4.1.5",
"@types/memdown": "^3.0.0",
"@types/ncp": "^2.0.4",
"@types/proper-lockfile": "^4.1.1",
"@types/rimraf": "^3.0.0",
"aegir": "^33.1.0",
"aegir": "^34.0.0",
"assert": "^2.0.0",
"blockstore-datastore-adapter": "^1.0.0",
"events": "^3.3.0",
"ipfs-utils": "^8.1.3",
"it-all": "^1.0.2",
"it-drain": "^1.0.1",
"it-first": "^1.0.2",
"just-range": "^2.1.0",
"memdown": "^6.0.0",
"multihashing-async": "^2.1.0",
"ncp": "^2.0.0",
"process": "^0.11.10",
"readable-stream": "^3.6.0",
"rimraf": "^3.0.0",
"sinon": "^10.0.0",
"sinon": "^11.1.1",
"tsd": "^0.17.0",
"url": "^0.11.0",
"util": "^0.12.3"
},
"dependencies": {
"@ipld/dag-cbor": "^6.0.4",
"@ipld/dag-pb": "^2.1.0",
"bytes": "^3.1.0",
"cids": "^1.1.6",
"datastore-core": "^4.0.0",
"datastore-fs": "^4.0.0",
"datastore-level": "^5.0.0",
"cborg": "^1.3.4",
"debug": "^4.1.0",
"err-code": "^3.0.1",
"interface-datastore": "^4.0.0",
"ipfs-repo-migrations": "^8.0.0",
"ipfs-utils": "^7.0.0",
"ipld-block": "^0.11.0",
"eslint-plugin-ava": "^12.0.0",
"interface-blockstore": "^1.0.0",
"interface-datastore": "^5.0.0",
"ipfs-repo-migrations": "^9.0.0",
"it-filter": "^1.0.2",
"it-map": "^1.0.5",
"it-merge": "^1.0.2",
"it-parallel-batch": "^1.0.9",
"it-pipe": "^1.1.0",
"it-pushable": "^1.4.0",
"just-safe-get": "^2.0.0",
"just-safe-set": "^2.1.0",
"merge-options": "^3.0.4",
"multibase": "^4.0.1",
"multihashes": "^4.0.2",
"mortice": "^2.0.1",
"multiformats": "^9.0.4",
"p-queue": "^6.0.0",
"proper-lockfile": "^4.0.0",
"sort-keys": "^4.0.0",
Expand Down
3 changes: 0 additions & 3 deletions scripts/node-globals.js

This file was deleted.

25 changes: 0 additions & 25 deletions src/backends.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/blockstore-utils.js

This file was deleted.

158 changes: 0 additions & 158 deletions src/blockstore.js

This file was deleted.

Loading

0 comments on commit 4144a93

Please sign in to comment.