Skip to content

Commit

Permalink
refactor: move ipfs to peer deps
Browse files Browse the repository at this point in the history
Doing this reduced the size of `node_modules` in the js-IPFS module
for me by about 300MB.

Does require the user to bring their own version, but they can
also skip installing go-IPFS if, for example, they are only going
to use js-IPFS.
  • Loading branch information
achingbrain committed Jan 24, 2020
1 parent d728d5c commit e1cd001
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
18 changes: 17 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ os:
- osx
- windows

script: npx nyc -s npm run test:node -- --timeout 60000
script:
- npm install ipfs
- npm install ipfs-http-client
- npm install go-ipfs-dep
- npx nyc -s npm run test:node -- --timeout 60000
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

jobs:
Expand All @@ -31,25 +35,37 @@ jobs:
addons:
chrome: stable
script:
- npm install ipfs
- npm install ipfs-http-client
- npm install go-ipfs-dep
- npx aegir test -t browser -t webworker --bail --timeout 60000

- stage: test
name: firefox
addons:
firefox: latest
script:
- npm install ipfs
- npm install ipfs-http-client
- npm install go-ipfs-dep
- npx aegir test -t browser -t webworker --bail --timeout 60000 -- --browsers FirefoxHeadless

- stage: test
name: electron-main
os: osx
script:
- npm install ipfs
- npm install ipfs-http-client
- npm install go-ipfs-dep
- npx aegir test -t electron-main --bail --timeout 60000

- stage: test
name: electron-renderer
os: osx
script:
- npm install ipfs
- npm install ipfs-http-client
- npm install go-ipfs-dep
- npx aegir test -t electron-renderer --bail --timeout 60000
notifications:
email: false
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ Version 1.0.0 changed a bit the api and the options methods take so please read
npm install --save ipfsd-ctl
```

Please ensure your project also has dependencies on `ipfs`, `ipfs-http-client` and `go-ipfs-dep`.

```sh
npm install --save ipfs
npm install --save ipfs-http-client
npm install --save go-ipfs-dep
```

If you are only going to use the `go` implementation of IPFS, you can skip installing the `js` implementation and vice versa, though both will require the `ipfs-http-client` module.

If you are only using the `proc` type in-process IPFS node, you can skip installing `go-ipfs-dep` and `ipfs-http-client`.

## Usage

### Spawning a single IPFS controller: `createController`
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
"debug": "^4.1.1",
"execa": "^4.0.0",
"fs-extra": "^8.1.0",
"go-ipfs-dep": "~0.4.22",
"ipfs": "0.40.0",
"ipfs-http-client": "^41.0.0",
"ipfs-utils": "^0.7.1",
"ky": "^0.16.1",
"ky-universal": "^0.3.0",
Expand All @@ -77,6 +74,11 @@
"husky": "^4.0.10",
"lint-staged": "^10.0.2"
},
"peerDependencies": {
"go-ipfs-dep": "*",
"ipfs": "*",
"ipfs-http-client": "*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-ipfsd-ctl.git"
Expand Down

0 comments on commit e1cd001

Please sign in to comment.