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

Commit 5aacf1c

Browse files
committed
Merge pull request #155 from ipfs/aegir
refactor: use aegir
2 parents 0276d78 + 892e247 commit 5aacf1c

Some content is hidden

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

97 files changed

+2041
-1858
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ build
3030
# Dependency directory
3131
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
3232
node_modules
33+
34+
lib
35+
dist

.npmignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/node_modules/
2+
**/*.log
3+
test/repo-tests*
4+
5+
# Logs
6+
logs
7+
*.log
8+
9+
coverage
10+
11+
# Runtime data
12+
pids
13+
*.pid
14+
*.seed
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
.grunt
24+
25+
# node-waf configuration
26+
.lock-wscript
27+
28+
build
29+
30+
# Dependency directory
31+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
32+
node_modules
33+
34+
test

.travis.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
sudo: false
12
language: node_js
23
node_js:
3-
- "4"
4-
- "5"
4+
- 4
5+
- 5
56

7+
# Make sure we have new NPM.
68
before_install:
7-
- npm i -g npm
8-
# Workaround for a permissions issue with Travis virtual machine images
9-
10-
addons:
11-
firefox: 'latest'
9+
- npm install -g npm
1210

1311
script:
12+
- npm run lint
1413
- npm test
14+
- npm run coverage
15+
16+
addons:
17+
firefox: 'latest'
1518

1619
before_script:
1720
- export DISPLAY=:99.0
1821
- sh -e /etc/init.d/xvfb start
22+
23+
after_success:
24+
- npm run coverage-publish

README.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
IPFS JavaScript Implementation
22
==============================
33

4-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
5-
[[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/ipfs/js-ipfs.svg?style=flat-square&branch=master)](https://travis-ci.org/ipfs/js-ipfs)
6-
![](https://img.shields.io/badge/coverage-75%25-yellow.svg?style=flat-square)
7-
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs)
8-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
4+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
5+
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
6+
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
7+
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs?branch=master)
8+
[![Travis CI](https://travis-ci.org/ipfs/js-ipfs.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs)
9+
[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs)
10+
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
911

10-
> IPFS JavaScript implementation.
12+
> IPFS JavaScript implementation.
1113
1214
# Description
1315

@@ -37,7 +39,7 @@ $ npm i ipfs --save
3739

3840
## Use in Node.js
3941

40-
```JavaScript
42+
```js
4143
var IPFS = require('ipfs')
4244

4345
var node = new IPFS()
@@ -57,7 +59,7 @@ The cli is availble through `jsipfs` in your terminal
5759

5860
The code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.
5961

60-
```JavaScript
62+
```js
6163
```
6264

6365
## Use in a browser using a script tag
@@ -100,40 +102,40 @@ IPFS Core is divided into separate subsystems, each of them exist in their own r
100102
▶ ┌───────────────────────────────────────────────────────────────────────────────┐
101103
│ IPFS Core │
102104
│ └───────────────────────────────────────────────────────────────────────────────┘
103-
104-
│ │
105-
106-
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
107-
│ │ │ │ │
108-
│ │ │ │ │ │
109-
▼ │ ▼ │ ▼
105+
106+
│ │
107+
108+
│ ┌──────────────┬──────────────┼────────────┬─────────────────┐
109+
│ │ │ │ │
110+
│ │ │ │ │ │
111+
▼ │ ▼ │ ▼
110112
│ ┌──────────────────┐ │ ┌──────────────────┐ │ ┌──────────────────┐
111113
│ │ │ │ │ │ │ │
112114
│ │ Block Service │ │ │ DAG Service │ │ │ IPFS Repo │
113115
│ │ │ │ │ │ │ │
114116
│ └──────────────────┘ │ └──────────────────┘ │ └──────────────────┘
115-
│ │ │ │
116-
IPFS Core │ ▼ │ ┌────┴────┐ │
117-
┌────────┐ │ ▼ ▼ │
118-
│ │ Block │ │ ┌────────┐┌────────┐ │
119-
└────────┘ │ │DAG Node││DAG Link│ │
120-
│ │ └────────┘└────────┘ │
117+
│ │ │ │
118+
IPFS Core │ ▼ │ ┌────┴────┐ │
119+
┌────────┐ │ ▼ ▼ │
120+
│ │ Block │ │ ┌────────┐┌────────┐ │
121+
└────────┘ │ │DAG Node││DAG Link│ │
122+
│ │ └────────┘└────────┘ │
121123
┌──────────────────┐ │ │ ┌──────────────────┐
122124
│ │ │ │ │ │ │
123125
│ Bitswap │◀────┤ ├──────▶│ Importer │
124126
│ │ │ │ │ │ │
125127
└──────────────────┘ │ │ └──────────────────┘
126-
│ │ │ │
127-
│ │ ┌────┴────┐
128-
│ │ │ ▼ ▼
128+
│ │ │ │
129+
│ │ ┌────┴────┐
130+
│ │ │ ▼ ▼
129131
│ │ ┌────────┐┌────────┐
130132
│ ┌──────────────────┐ │ │ │ layout ││chunker │
131133
│ │ │ ┌────────────┘ └────────┘└────────┘
132-
│ │ Files │◀────┘ │
133-
│ │ │
134-
│ └──────────────────┘ │
135-
▶ │
136-
134+
│ │ Files │◀────┘ │
135+
│ │ │
136+
│ └──────────────────┘ │
137+
▶ │
138+
137139
┌───────────────────────────────────────────────────────────────────────────────┐
138140
│ │
139141
│ │

karma.conf.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

package.json

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,19 @@
55
"bin": {
66
"jsipfs": "src/cli/bin.js"
77
},
8-
"main": "src/core/index.js",
8+
"main": "lib/core/index.js",
9+
"jsnext:main": "src/core/index.js",
910
"scripts": {
10-
"lint": "standard --verbose | snazzy",
11-
"coverage": "istanbul cover --print both -- _mocha test/core-tests/index.js",
12-
"coverage:http-api": "istanbul cover --print both -- _mocha test/http-api-tests/index.js",
13-
"test": "npm run test:node && npm run test:browser",
14-
"test:node": "npm run test:node:core && npm run test:node:http-api && npm run test:node:cli",
15-
"test:node:teamcity": "npm run test:node:core:teamcity && npm run test:node:http-api:teamcity && npm run test:node:cli:teamcity",
16-
"test:node:cli:teamcity": "mocha --reporter mocha-teamcity-reporter test/cli-tests/index.js",
17-
"test:node:core:teamcity": "mocha --reporter mocha-teamcity-reporter test/core-tests/index.js",
18-
"test:node:http-api:teamcity": "mocha --reporter mocha-teamcity-reporter test/http-api-tests/index.js",
19-
"test:node:cli": "mocha test/cli-tests/index.js",
20-
"test:node:core": "mocha test/core-tests/index.js",
21-
"test:node:http-api": "mocha test/http-api-tests/index.js",
22-
"test:browser": "karma start karma.conf.js",
23-
"test:browser:teamcity": "karma start --reporters teamcity --colors false karma.conf.js",
24-
"test:core": "mocha test/core-tests/index.js",
25-
"test:cli": "mocha test/cli-tests/index.js"
11+
"lint": "aegir-lint",
12+
"coverage": "aegir-coverage",
13+
"test": "aegir-test",
14+
"test:node": "aegir-test node",
15+
"test:browser": "aegir-test browser",
16+
"build": "aegir-build",
17+
"release": "aegir-release",
18+
"release:minor": "aegir-release minor",
19+
"release:major": "aegir-release major",
20+
"coverage-publish": "aegir-coverage publish"
2621
},
2722
"pre-commit": [
2823
"lint",
@@ -42,38 +37,26 @@
4237
},
4338
"homepage": "https://github.com/ipfs/js-ipfs#readme",
4439
"devDependencies": {
40+
"aegir": "^2.1.1",
4541
"async": "^1.5.2",
46-
"brfs": "^1.4.3",
4742
"buffer-loader": "0.0.1",
48-
"chai": "^3.4.1",
43+
"chai": "^3.5.0",
4944
"expose-loader": "^0.7.1",
5045
"form-data": "^1.0.0-rc3",
5146
"idb-plus-blob-store": "^1.0.0",
52-
"istanbul": "^0.4.1",
53-
"json-loader": "^0.5.4",
54-
"karma": "^0.13.19",
55-
"karma-chrome-launcher": "^0.2.2",
56-
"karma-cli": "^0.1.2",
57-
"karma-firefox-launcher": "^0.1.7",
58-
"karma-mocha": "^0.2.1",
59-
"karma-spec-reporter": "0.0.26",
60-
"karma-teamcity-reporter": "^0.2.2",
61-
"karma-webpack": "^1.7.0",
6247
"local-storage-blob-store": "0.0.3",
6348
"lodash": "^4.11.1",
6449
"mocha": "^2.3.4",
65-
"mocha-teamcity-reporter": "^1.0.0",
6650
"ncp": "^2.0.0",
6751
"nexpect": "^0.5.0",
6852
"pre-commit": "^1.1.2",
6953
"rimraf": "^2.4.4",
7054
"snazzy": "^3.0.1",
71-
"standard": "^6.0.7",
7255
"stream-to-promise": "^1.1.0",
73-
"transform-loader": "^0.2.3",
74-
"webpack": "^2.0.7-beta"
56+
"transform-loader": "^0.2.3"
7557
},
7658
"dependencies": {
59+
"babel-runtime": "^6.6.1",
7760
"bl": "^1.1.2",
7861
"boom": "^3.1.1",
7962
"bs58": "^3.0.0",
@@ -95,5 +78,20 @@
9578
"peer-info": "^0.6.2",
9679
"ronin": "^0.3.11",
9780
"temp": "^0.8.3"
81+
},
82+
"aegir": {
83+
"webpack": {
84+
"resolve": {
85+
"alias": {
86+
"node-forge": "../../../node_modules/peer-id/vendor/forge.bundle.js"
87+
}
88+
},
89+
"externals": {
90+
"fs": "{}",
91+
"ipfs-data-importing": "{ import: {} }",
92+
"libp2p-ipfs": "{}",
93+
"mkdirp": "{}"
94+
}
95+
}
9896
}
9997
}

src/cli/commands/block/get.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24
const utils = require('../../utils')
35
const bs58 = require('bs58')

src/cli/commands/block/put.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24
const utils = require('../../utils')
35
const bs58 = require('bs58')

src/cli/commands/cat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24

35
module.exports = Command.extend({

src/cli/commands/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24
const debug = require('debug')
35
const get = require('lodash.get')

src/cli/commands/config/replace.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24
const debug = require('debug')
35
const path = require('path')

src/cli/commands/config/show.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24
const debug = require('debug')
35
const log = debug('cli:config')

src/cli/commands/daemon.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
'use strict'
22

33
const Command = require('ronin').Command
4-
const httpAPI = require('../../http-api')
4+
const HttpAPI = require('../../http-api')
55
const debug = require('debug')
66
const log = debug('cli:daemon')
77
log.error = debug('cli:daemon:error')
88

9+
let httpAPI
10+
911
module.exports = Command.extend({
1012
desc: 'Start a long-running daemon process',
1113

1214
run: (name) => {
1315
console.log('Initializing daemon...')
16+
httpAPI = new HttpAPI()
1417
httpAPI.start((err) => {
1518
if (err) {
1619
return log.error(err)

src/cli/commands/dns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Command = require('ronin').Command
24

35
module.exports = Command.extend({

0 commit comments

Comments
 (0)