Skip to content

Commit

Permalink
chore: split core, http api server and cli out from ipfs module (#3288)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
achingbrain authored Sep 28, 2020
1 parent 445f213 commit 2bb1b3b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 612 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,33 @@
},
"dependencies": {
"abort-controller": "^3.0.0",
"any-signal": "^1.1.0",
"any-signal": "^2.0.0",
"bignumber.js": "^9.0.0",
"cids": "^1.0.0",
"debug": "^4.1.0",
"debug": "^4.1.1",
"form-data": "^3.0.0",
"ipfs-core-utils": "^0.4.0",
"ipfs-utils": "^3.0.0",
"ipld-block": "^0.10.0",
"ipld-block": "^0.10.1",
"ipld-dag-cbor": "^0.17.0",
"ipld-dag-pb": "^0.20.0",
"ipld-raw": "^6.0.0",
"iso-url": "^0.4.7",
"it-last": "^1.0.2",
"it-map": "^1.0.2",
"it-last": "^1.0.4",
"it-map": "^1.0.4",
"it-tar": "^1.2.2",
"it-to-buffer": "^1.0.0",
"it-to-stream": "^0.1.1",
"it-to-buffer": "^1.0.2",
"it-to-stream": "^0.1.2",
"merge-options": "^2.0.0",
"multiaddr": "^8.0.0",
"multiaddr-to-uri": "^6.0.0",
"multibase": "^3.0.0",
"multicodec": "^2.0.0",
"multicodec": "^2.0.1",
"multihashes": "^3.0.1",
"nanoid": "^3.0.2",
"nanoid": "^3.1.12",
"node-fetch": "^2.6.0",
"parse-duration": "^0.4.4",
"stream-to-it": "^0.2.1",
"stream-to-it": "^0.2.2",
"uint8arrays": "^1.1.0"
},
"devDependencies": {
Expand All @@ -76,8 +76,8 @@
"go-ipfs": "^0.6.0",
"interface-ipfs-core": "^0.140.0",
"ipfsd-ctl": "^7.0.0",
"it-all": "^1.0.1",
"it-concat": "^1.0.0",
"it-all": "^1.0.4",
"it-concat": "^1.0.1",
"it-pipe": "^1.1.0",
"nock": "^13.0.2"
},
Expand Down
5 changes: 5 additions & 0 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ const errorHandler = async (response) => {
error = new HTTP.TimeoutError(response)
}

// This also gets returned
if (msg && msg.includes('request timed out')) {
error = new HTTP.TimeoutError(response)
}

// If we managed to extract a message from the response, use it
if (msg) {
error.message = msg
Expand Down
2 changes: 0 additions & 2 deletions src/pin/rm-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
return async function * rmAll (source, options = {}) {
options = options || {}

for await (const { path, recursive } of normaliseInput(source)) {
const searchParams = new URLSearchParams(options.searchParams)
searchParams.append('arg', `${path}`)
Expand Down
Loading

0 comments on commit 2bb1b3b

Please sign in to comment.