Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit b5152d8

Browse files
Gozalaachingbrain
andauthored
fix: regressions introduced by new releases of CID & multicodec (#3442)
Few regressions had been introduced by multiformats/js-cid@0e11f03#diff-25a6634263c1b1f6fc4697a04e2b9904ea4b042a89af59dc93ec1f5d44848a26 multiformats/js-multicodec@25cf33f This changes fix two remaining problems: 1. Change type of codec from string to code name. 2. No longer import removed JSON file and use exported table instead. Co-authored-by: achingbrain <[email protected]>
1 parent cacbfc6 commit b5152d8

File tree

48 files changed

+70
-62
lines changed

Some content is hidden

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

48 files changed

+70
-62
lines changed

examples/browser-add-readable-stream/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"keywords": [],
1313
"license": "MIT",
1414
"devDependencies": {
15-
"ipfs": "^0.52.1",
15+
"ipfs": "^0.52.2",
1616
"test-ipfs-example": "^2.0.3"
1717
}
1818
}

examples/browser-browserify/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"concat-stream": "^2.0.0",
1919
"execa": "^4.0.3",
2020
"http-server": "^0.12.3",
21-
"ipfs": "^0.52.1",
21+
"ipfs": "^0.52.2",
2222
"rimraf": "^3.0.2",
2323
"test-ipfs-example": "^2.0.3"
2424
},

examples/browser-create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"dot-prop": "^5.0.0",
7-
"ipfs": "^0.52.1",
7+
"ipfs": "^0.52.2",
88
"ipfs-css": "^0.13.1",
99
"react": "^16.8.6",
1010
"react-dom": "^16.8.6",

examples/browser-exchange-files/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"browserify": "^16.2.3",
1515
"execa": "^4.0.3",
1616
"http-server": "^0.12.3",
17-
"ipfs-http-client": "^48.1.1",
17+
"ipfs-http-client": "^48.1.2",
1818
"uint8arrays": "^1.1.0"
1919
},
2020
"dependencies": {
21-
"ipfs": "^0.52.1",
21+
"ipfs": "^0.52.2",
2222
"it-all": "^1.0.4",
2323
"rimraf": "^3.0.2",
2424
"test-ipfs-example": "^2.0.3"

examples/browser-http-client-upload-file/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
],
1616
"license": "MIT",
1717
"dependencies": {
18-
"ipfs-http-client": "^48.1.1"
18+
"ipfs-http-client": "^48.1.2"
1919
},
2020
"devDependencies": {
21-
"ipfs": "^0.52.1",
21+
"ipfs": "^0.52.2",
2222
"parcel-bundler": "^1.12.4",
2323
"react": "^16.8.6",
2424
"react-dom": "^16.8.6",

examples/browser-ipns-publish/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"license": "MIT",
1414
"dependencies": {
1515
"human-crypto-keys": "^0.1.4",
16-
"ipfs": "^0.52.1",
17-
"ipfs-http-client": "^48.1.1",
16+
"ipfs": "^0.52.2",
17+
"ipfs-http-client": "^48.1.2",
1818
"ipfs-utils": "^5.0.0",
1919
"ipns": "^0.8.0",
2020
"it-last": "^1.0.4",

examples/browser-mfs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"webpack-cli": "^3.3.11"
2323
},
2424
"dependencies": {
25-
"ipfs": "^0.52.1",
25+
"ipfs": "^0.52.2",
2626
"mime-sniffer": "~0.0.3"
2727
}
2828
}

examples/browser-parceljs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"author": "",
1919
"license": "ISC",
2020
"dependencies": {
21-
"ipfs": "^0.52.1"
21+
"ipfs": "^0.52.2"
2222
},
2323
"devDependencies": {
2424
"@babel/cli": "^7.1.5",

examples/browser-readablestream/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"webpack": "^4.43.0"
2222
},
2323
"dependencies": {
24-
"ipfs": "^0.52.1",
24+
"ipfs": "^0.52.2",
2525
"it-to-stream": "^0.1.2",
2626
"videostream": "^3.2.0"
2727
}

examples/browser-script-tag/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"test-ipfs-example": "^2.0.3"
1717
},
1818
"dependencies": {
19-
"ipfs": "^0.52.1"
19+
"ipfs": "^0.52.2"
2020
}
2121
}

examples/browser-service-worker/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"webpack-dev-server": "3.11.0"
2323
},
2424
"dependencies": {
25-
"ipfs": "^0.51.0",
25+
"ipfs": "^0.52.0",
2626
"ipfs-message-port-client": "^0.3.0",
2727
"ipfs-message-port-protocol": "^0.3.0",
2828
"ipfs-message-port-server": "^0.3.0",

examples/browser-sharing-node-across-tabs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"worker-plugin": "4.0.3"
2525
},
2626
"dependencies": {
27-
"ipfs": "^0.52.1",
27+
"ipfs": "^0.52.2",
2828
"ipfs-message-port-client": "^0.4.1",
2929
"ipfs-message-port-server": "^0.4.1"
3030
},

examples/browser-video-streaming/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"test-ipfs-example": "^2.0.3"
1717
},
1818
"dependencies": {
19-
"ipfs": "^0.52.1"
19+
"ipfs": "^0.52.2"
2020
}
2121
}

examples/browser-vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"core-js": "^3.6.4",
14-
"ipfs": "^0.52.1",
14+
"ipfs": "^0.52.2",
1515
"vue": "^2.6.11"
1616
},
1717
"devDependencies": {

examples/browser-webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"webpack-dev-server": "^3.11.0"
2828
},
2929
"dependencies": {
30-
"ipfs": "^0.52.1"
30+
"ipfs": "^0.52.2"
3131
},
3232
"browserslist": [
3333
">1%",

examples/circuit-relaying/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"license": "MIT",
1616
"dependencies": {
1717
"delay": "^4.4.0",
18-
"ipfs": "^0.52.1",
18+
"ipfs": "^0.52.2",
1919
"ipfs-pubsub-room": "^2.0.1",
2020
"uint8arrays": "^1.1.0"
2121
},
2222
"devDependencies": {
2323
"execa": "^4.0.3",
2424
"ipfs-css": "^0.13.1",
25-
"ipfs-http-client": "^48.1.1",
25+
"ipfs-http-client": "^48.1.2",
2626
"parcel-bundler": "^1.12.4",
2727
"rimraf": "^3.0.2",
2828
"tachyons": "^4.11.1",

examples/custom-ipfs-repo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license": "MIT",
1212
"dependencies": {
1313
"datastore-fs": "^2.0.0",
14-
"ipfs": "^0.52.1",
14+
"ipfs": "^0.52.2",
1515
"ipfs-repo": "^7.0.0",
1616
"it-all": "^1.0.4"
1717
},

examples/custom-ipld-formats/daemon-node.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
const codecName = 'dag-test'
66
const codecNumber = 392091
77

8-
const baseTable = require('multicodec/src/base-table.json')
9-
baseTable[codecName] = codecNumber
8+
const table = require('multicodec/src/base-table')
9+
// @ts-ignore
10+
table.baseTable = {
11+
...table.baseTable,
12+
[codecName]: codecNumber
13+
}
1014

1115
// now require modules as usual
12-
const IPFSDaemon = require('ipfs-cli/src/daemon')
16+
const IPFSDaemon = require('ipfs-daemon')
1317
const multihashing = require('multihashing-async')
1418
const multihash = multihashing.multihash
1519
const multicodec = require('multicodec')

examples/custom-ipld-formats/in-process-node.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
const codecName = 'dag-test'
66
const codecNumber = 392091
77

8-
const baseTable = require('multicodec/src/base-table.json')
9-
baseTable[codecName] = codecNumber
8+
const table = require('multicodec/src/base-table')
9+
// @ts-ignore
10+
table.baseTable = {
11+
...table.baseTable,
12+
[codecName]: codecNumber
13+
}
1014

1115
// now require modules as usual
1216
const IPFS = require('ipfs-core')

examples/custom-ipld-formats/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"test-ipfs-example": "^2.0.3"
1212
},
1313
"dependencies": {
14-
"cids": "1.0.2",
15-
"ipfs-cli": "^0.1.0",
16-
"ipfs-core": "^0.2.1",
17-
"ipfs-http-client": "^48.1.1",
14+
"cids": "^1.0.0",
15+
"ipfs-daemon": "^0.3.1",
16+
"ipfs-core": "^0.3.0",
17+
"ipfs-http-client": "^48.1.2",
1818
"multicodec": "^2.0.1",
1919
"multihashing-async": "^2.0.1",
2020
"uint8arrays": "^1.1.0"

examples/custom-libp2p/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"license": "MIT",
1212
"dependencies": {
13-
"ipfs": "^0.52.1",
13+
"ipfs": "^0.52.2",
1414
"libp2p": "^0.29.3",
1515
"libp2p-bootstrap": "^0.12.1",
1616
"libp2p-kad-dht": "^0.20.1",

examples/explore-ethereum-blockchain/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"keywords": [],
1111
"license": "MIT",
1212
"devDependencies": {
13-
"ipfs": "^0.52.1",
14-
"ipfs-http-client": "^48.1.1",
13+
"ipfs": "^0.52.2",
14+
"ipfs-http-client": "^48.1.2",
1515
"ipfsd-ctl": "^7.1.1",
1616
"ipld-ethereum": "^5.0.1",
1717
"test-ipfs-example": "^2.0.3"

examples/http-client-browser-pubsub/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
"author": "Alan Shaw",
1313
"license": "MIT",
1414
"dependencies": {
15-
"ipfs-http-client": "^48.1.1"
15+
"ipfs-http-client": "^48.1.2"
1616
},
1717
"browserslist": [
1818
"last 2 versions and not dead and > 2%"
1919
],
2020
"devDependencies": {
2121
"execa": "^4.0.3",
2222
"go-ipfs": "^0.7.0",
23-
"ipfs": "^0.52.1",
23+
"ipfs": "^0.52.2",
2424
"ipfsd-ctl": "^7.1.1",
2525
"parcel-bundler": "^1.12.4",
2626
"test-ipfs-example": "^2.0.3"

examples/http-client-bundle-webpack/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"license": "MIT",
1414
"keywords": [],
1515
"dependencies": {
16-
"ipfs-http-client": "^48.1.1",
16+
"ipfs-http-client": "^48.1.2",
1717
"react": "^16.8.6",
1818
"react-dom": "^16.8.6"
1919
},
@@ -24,7 +24,7 @@
2424
"babel-loader": "^8.0.5",
2525
"copy-webpack-plugin": "^5.0.4",
2626
"execa": "^4.0.3",
27-
"ipfs": "^0.52.1",
27+
"ipfs": "^0.52.2",
2828
"ipfsd-ctl": "^7.1.1",
2929
"react-hot-loader": "^4.12.21",
3030
"rimraf": "^3.0.2",

examples/http-client-name-api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Tara Vancil <[email protected]>",
1414
"license": "MIT",
1515
"dependencies": {
16-
"ipfs-http-client": "^48.1.1"
16+
"ipfs-http-client": "^48.1.2"
1717
},
1818
"devDependencies": {
1919
"execa": "^4.0.3",

examples/ipfs-101/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"author": "David Dias <[email protected]>",
1111
"license": "MIT",
1212
"dependencies": {
13-
"ipfs": "^0.52.1",
13+
"ipfs": "^0.52.2",
1414
"it-all": "^1.0.4",
1515
"uint8arrays": "^1.1.0"
1616
},

examples/run-in-electron/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"devDependencies": {
1919
"electron": "^6.0.0",
2020
"electron-rebuild": "^1.8.4",
21-
"ipfs": "^0.52.1",
21+
"ipfs": "^0.52.2",
2222
"test-ipfs-example": "^2.0.3"
2323
},
2424
"greenkeeper": {

examples/running-multiple-nodes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"test-ipfs-example": "^2.0.3"
1414
},
1515
"dependencies": {
16-
"ipfs": "^0.52.1"
16+
"ipfs": "^0.52.2"
1717
}
1818
}

examples/traverse-ipld-graphs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"cids": "^1.0.0",
17-
"ipfs": "^0.52.1",
17+
"ipfs": "^0.52.2",
1818
"ipld-block": "^0.11.0",
1919
"ipld-dag-pb": "^0.20.0",
2020
"ipld-git": "^0.6.1",

examples/types-use-ipfs-from-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "example-types-use-ipfs-from-ts",
33
"private": true,
44
"dependencies": {
5-
"ipfs": "^0.52.1"
5+
"ipfs": "^0.52.2"
66
},
77
"devDependencies": {
88
"typescript": "4.0.x"

examples/types-use-ipfs-from-ts/src/main.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default async function main() {
1414

1515
console.log('Added file:', file.path, file.cid.toString())
1616
try {
17-
// @ts-expect-error CID has no toUpperCase method
1817
file.cid.toUpperCase()
1918
} catch (error) {
2019

examples/types-use-ipfs-from-typed-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "example-types-use-ipfs-from-typed-js",
33
"private": true,
44
"dependencies": {
5-
"ipfs": "^0.52.1"
5+
"ipfs": "^0.52.2"
66
},
77
"devDependencies": {
88
"typescript": "4.0.x"

examples/types-use-ipfs-from-typed-js/src/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async function main () {
1717

1818
console.log('Added file:', file.path, file.cid.toString())
1919
try {
20-
// @ts-expect-error CID has no toUpperCase method
2120
file.cid.toUpperCase()
2221
} catch(error) {
2322

packages/interface-ipfs-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"chai": "^4.2.0",
3535
"chai-as-promised": "^7.1.1",
3636
"chai-subset": "^1.6.0",
37-
"cids": "1.0.2",
37+
"cids": "^1.0.0",
3838
"delay": "^4.4.0",
3939
"dirty-chai": "^2.0.1",
4040
"err-code": "^2.0.3",

packages/ipfs-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"bignumber.js": "^9.0.0",
3333
"byteman": "^1.3.5",
3434
"cid-tool": "^1.0.0",
35-
"cids": "1.0.2",
35+
"cids": "^1.0.0",
3636
"debug": "^4.1.1",
3737
"err-code": "^2.0.3",
3838
"execa": "^5.0.0",

packages/ipfs-cli/src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ const escapeControlCharacters = (str) => {
252252
* CID properties
253253
*
254254
* @param {object} obj - all keys/values in this object will be have control characters stripped
255-
* @param {string} cidBase - any encountered CIDs will be stringified using this base
255+
* @param {import('cids').BaseNameOrCode} cidBase - any encountered CIDs will be stringified using this base
256256
* @returns {object}
257257
*/
258258
const makeEntriesPrintable = (obj, cidBase = 'base58btc') => {

packages/ipfs-core-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"any-signal": "^2.0.0",
4242
"blob-to-it": "^1.0.1",
4343
"browser-readablestream-to-it": "^1.0.1",
44-
"cids": "1.0.2",
44+
"cids": "^1.0.0",
4545
"err-code": "^2.0.3",
4646
"ipfs-utils": "^5.0.0",
4747
"it-all": "^1.0.4",

packages/ipfs-core-utils/src/cid.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const CID = require('cids')
1212
*
1313
* @param {CID|Uint8Array|string} input - The CID to encode
1414
* @param {Object} [options] - Optional options
15-
* @param {string} [options.base] - Name of multibase codec to encode the CID with
15+
* @param {import('cids').BaseNameOrCode} [options.base] - Name of multibase codec to encode the CID with
1616
* @param {boolean} [options.upgrade] - Automatically upgrade v0 CIDs to v1 when
1717
* necessary. Default: true.
1818
* @returns {string} - CID in string representation

0 commit comments

Comments
 (0)