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

Commit e443160

Browse files
committed
chore: upgrade all deps to typed versions
- Uses default aegir ts config - Fixes all ts errors - Fully types core-api in ipfs-core-types package - Makes ipfs-core implement types from ipfs-core-types package - Removes duplicate types, ipfs-core-types as single source of type truth - Reduces use of external APIs by internal components in ipfs-core
1 parent c47a633 commit e443160

File tree

245 files changed

+4362
-4497
lines changed

Some content is hidden

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

245 files changed

+4362
-4497
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ node_modules
1919
dist
2020
build
2121
bundle.js
22+
tsconfig-types.aegir.json
2223

2324
# Deployment files
2425
.npmrc

examples/browser-browserify/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', async () => {
2525
async function display (cid) {
2626
for await (const data of node.cat(cid)) {
2727
document.getElementById('cid').innerText = cid
28-
document.getElementById('content').innerText = data
28+
document.getElementById('content').innerText = new TextDecoder().decode(data)
2929
document.getElementById('output').setAttribute('style', 'display: block')
3030
}
3131
}

examples/browser-ipns-publish/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"ipfs": "^0.54.4",
1717
"ipfs-http-client": "^49.0.4",
1818
"ipfs-utils": "^6.0.1",
19-
"ipns": "^0.8.0",
19+
"ipns": "^0.10.0",
2020
"it-last": "^1.0.4",
2121
"p-retry": "^4.2.0",
2222
"uint8arrays": "^2.1.3"

examples/custom-ipfs-repo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"datastore-fs": "^2.0.0",
1414
"ipfs": "^0.54.4",
15-
"ipfs-repo": "^8.0.0",
15+
"ipfs-repo": "^9.0.0",
1616
"it-all": "^1.0.4"
1717
},
1818
"devDependencies": {

examples/traverse-ipld-graphs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"cids": "^1.1.5",
1717
"ipfs": "^0.54.4",
1818
"ipld-block": "^0.11.0",
19-
"ipld-dag-pb": "^0.20.0",
19+
"ipld-dag-pb": "^0.22.0",
2020
"ipld-git": "^0.6.1",
2121
"ipld-ethereum": "^5.0.1",
2222
"multihashing-async": "^2.1.2"

packages/interface-ipfs-core/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@
4343
"chai-as-promised": "^7.1.1",
4444
"chai-subset": "^1.6.0",
4545
"cids": "^1.1.5",
46-
"delay": "^4.4.0",
46+
"delay": "^5.0.0",
4747
"dirty-chai": "^2.0.1",
48-
"err-code": "^2.0.3",
49-
"ipfs-unixfs": "^2.0.3",
50-
"ipfs-unixfs-importer": "^5.0.0",
48+
"err-code": "^3.0.1",
49+
"ipfs-unixfs": "https://gitpkg.now.sh/ipfs/js-ipfs-unixfs/packages/ipfs-unixfs?fix/declare-interface-types-in-d-ts",
50+
"ipfs-unixfs-importer": "https://gitpkg.now.sh/ipfs/js-ipfs-unixfs/packages/ipfs-unixfs-importer?fix/declare-interface-types-in-d-ts",
5151
"ipfs-utils": "^6.0.1",
5252
"ipld-block": "^0.11.0",
53-
"ipld-dag-cbor": "^0.17.0",
54-
"ipld-dag-pb": "^0.20.0",
55-
"ipns": "^0.8.0",
56-
"is-ipfs": "^2.0.0",
53+
"ipld-dag-cbor": "^0.18.0",
54+
"ipld-dag-pb": "^0.22.0",
55+
"ipns": "^0.10.0",
56+
"is-ipfs": "^4.0.0",
5757
"iso-random-stream": "^1.1.1",
5858
"it-all": "^1.0.4",
59-
"it-buffer-stream": "^1.0.5",
59+
"it-buffer-stream": "^2.0.0",
6060
"it-concat": "^1.0.1",
6161
"it-drain": "^1.0.3",
6262
"it-first": "^1.0.4",

packages/interface-ipfs-core/src/cat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const all = require('it-all')
1010
const drain = require('it-drain')
1111
const { getDescribe, getIt, expect } = require('./utils/mocha')
1212
const testTimeout = require('./utils/test-timeout')
13-
const importer = require('ipfs-unixfs-importer')
13+
const { importer } = require('ipfs-unixfs-importer')
1414

1515
/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
1616
/**

packages/interface-ipfs-core/src/dag/get.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const uint8ArrayFromString = require('uint8arrays/from-string')
55
const dagPB = require('ipld-dag-pb')
66
const DAGNode = dagPB.DAGNode
77
const dagCBOR = require('ipld-dag-cbor')
8-
const importer = require('ipfs-unixfs-importer')
9-
const Unixfs = require('ipfs-unixfs')
8+
const { importer } = require('ipfs-unixfs-importer')
9+
const { UnixFS } = require('ipfs-unixfs')
1010
const all = require('it-all')
1111
const CID = require('cids')
1212
const { getDescribe, getIt, expect } = require('../utils/mocha')
@@ -193,7 +193,7 @@ module.exports = (common, options) => {
193193
const cidv0 = cidv1.toV0()
194194

195195
const output = await ipfs.dag.get(cidv0)
196-
expect(Unixfs.unmarshal(output.value.Data).data).to.eql(input)
196+
expect(UnixFS.unmarshal(output.value.Data).data).to.eql(input)
197197
})
198198

199199
it('should be able to get part of a dag-cbor node', async () => {

packages/interface-ipfs-core/src/files/cp.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ module.exports = (common, options) => {
8080
await ipfs.files.write(src1, [], {
8181
create: true
8282
})
83+
8384
await expect(ipfs.files.cp(src1, `${parent}/child`)).to.eventually.be.rejectedWith(Error)
8485
.that.has.property('message').that.matches(/"identity"/)
8586
})

packages/interface-ipfs-core/src/files/touch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = (common, options) => {
3333
})
3434

3535
const stat2 = await ipfs.files.stat(testPath)
36-
expect(stat2).to.have.nested.deep.property('mtime', expectedMtime)
36+
expect(stat2).to.have.deep.nested.property('mtime', expectedMtime)
3737
}
3838

3939
before(async () => { ipfs = (await common.spawn()).api })

0 commit comments

Comments
 (0)