Skip to content

Commit 2bb1b3b

Browse files
authored
chore: split core, http api server and cli out from ipfs module (#3288)
Decomposes the main ipfs module into separate core, http api server and cli modules which encapsulate the different parts of ipfs. This allows us to: 1. Omit modules/code/dependencies if they aren't going to be used 2. Reduces the amount of tests being run in series The average time of a CI job has gone from just under 20 minutes to just over 10 minutes. Outliers here are electron tests (which should be fixed by #3251) and webworker tests which will need further investigation. Fixes #2678 Fixes #2877
1 parent 445f213 commit 2bb1b3b

File tree

5 files changed

+18
-612
lines changed

5 files changed

+18
-612
lines changed

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,33 @@
4141
},
4242
"dependencies": {
4343
"abort-controller": "^3.0.0",
44-
"any-signal": "^1.1.0",
44+
"any-signal": "^2.0.0",
4545
"bignumber.js": "^9.0.0",
4646
"cids": "^1.0.0",
47-
"debug": "^4.1.0",
47+
"debug": "^4.1.1",
4848
"form-data": "^3.0.0",
4949
"ipfs-core-utils": "^0.4.0",
5050
"ipfs-utils": "^3.0.0",
51-
"ipld-block": "^0.10.0",
51+
"ipld-block": "^0.10.1",
5252
"ipld-dag-cbor": "^0.17.0",
5353
"ipld-dag-pb": "^0.20.0",
5454
"ipld-raw": "^6.0.0",
5555
"iso-url": "^0.4.7",
56-
"it-last": "^1.0.2",
57-
"it-map": "^1.0.2",
56+
"it-last": "^1.0.4",
57+
"it-map": "^1.0.4",
5858
"it-tar": "^1.2.2",
59-
"it-to-buffer": "^1.0.0",
60-
"it-to-stream": "^0.1.1",
59+
"it-to-buffer": "^1.0.2",
60+
"it-to-stream": "^0.1.2",
6161
"merge-options": "^2.0.0",
6262
"multiaddr": "^8.0.0",
6363
"multiaddr-to-uri": "^6.0.0",
6464
"multibase": "^3.0.0",
65-
"multicodec": "^2.0.0",
65+
"multicodec": "^2.0.1",
6666
"multihashes": "^3.0.1",
67-
"nanoid": "^3.0.2",
67+
"nanoid": "^3.1.12",
6868
"node-fetch": "^2.6.0",
6969
"parse-duration": "^0.4.4",
70-
"stream-to-it": "^0.2.1",
70+
"stream-to-it": "^0.2.2",
7171
"uint8arrays": "^1.1.0"
7272
},
7373
"devDependencies": {
@@ -76,8 +76,8 @@
7676
"go-ipfs": "^0.6.0",
7777
"interface-ipfs-core": "^0.140.0",
7878
"ipfsd-ctl": "^7.0.0",
79-
"it-all": "^1.0.1",
80-
"it-concat": "^1.0.0",
79+
"it-all": "^1.0.4",
80+
"it-concat": "^1.0.1",
8181
"it-pipe": "^1.1.0",
8282
"nock": "^13.0.2"
8383
},

src/lib/core.js

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ const errorHandler = async (response) => {
7171
error = new HTTP.TimeoutError(response)
7272
}
7373

74+
// This also gets returned
75+
if (msg && msg.includes('request timed out')) {
76+
error = new HTTP.TimeoutError(response)
77+
}
78+
7479
// If we managed to extract a message from the response, use it
7580
if (msg) {
7681
error.message = msg

src/pin/rm-all.js

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const toUrlSearchParams = require('../lib/to-url-search-params')
77

88
module.exports = configure(api => {
99
return async function * rmAll (source, options = {}) {
10-
options = options || {}
11-
1210
for await (const { path, recursive } of normaliseInput(source)) {
1311
const searchParams = new URLSearchParams(options.searchParams)
1412
searchParams.append('arg', `${path}`)

0 commit comments

Comments
 (0)