Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 09ebc56

Browse files
refactor: Update dependencies to latest
1 parent 2bcb488 commit 09ebc56

Some content is hidden

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

44 files changed

+201
-176
lines changed

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const runSequence = require('run-sequence')
55

66
require('require-dir')('tasks')
77

8-
gulp.task('default', done => {
8+
gulp.task('default', (done) => {
99
runSequence(
1010
'lint',
1111
'test',

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,21 @@
2424
},
2525
"devDependencies": {
2626
"babel-core": "^6.1.21",
27-
"babel-eslint": "^5.0.0-beta6",
27+
"babel-eslint": "^5.0.0-beta9",
2828
"babel-loader": "^6.2.0",
2929
"babel-plugin-transform-runtime": "^6.1.18",
3030
"babel-preset-es2015": "^6.0.15",
3131
"babel-runtime": "^6.3.19",
3232
"chai": "^3.4.1",
3333
"concurrently": "^1.0.0",
34-
"eslint-config-standard": "^4.4.0",
34+
"eslint": "^2.0.0-rc.0",
35+
"eslint-config-standard": "^5.1.0",
36+
"eslint-plugin-promise": "^1.0.8",
3537
"eslint-plugin-standard": "^1.3.1",
3638
"glob-stream": "5.3.1",
3739
"gulp": "^3.9.0",
3840
"gulp-bump": "^1.0.0",
39-
"gulp-eslint": "^1.0.0",
41+
"gulp-eslint": "^2.0.0-rc-3",
4042
"gulp-filter": "^3.0.1",
4143
"gulp-git": "^1.6.0",
4244
"gulp-load-plugins": "^1.0.0",

src/api/add.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Wreck = require('wreck')
22

3-
module.exports = send => {
3+
module.exports = (send) => {
44
return function add (files, opts, cb) {
55
if (typeof (opts) === 'function' && cb === undefined) {
66
cb = opts

src/api/block.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
get: argCommand(send, 'block/get'),
88
stat: argCommand(send, 'block/stat'),

src/api/cat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return argCommand(send, 'cat')
77
}

src/api/commands.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const command = require('../cmd-helpers').command
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return command(send, 'commands')
77
}

src/api/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
get: argCommand(send, 'config'),
88
set (key, value, opts, cb) {

src/api/dht.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
findprovs: argCommand(send, 'dht/findprovs'),
88
get (key, opts, cb) {
@@ -37,8 +37,8 @@ module.exports = send => {
3737

3838
return send('dht/get', key, opts)
3939
.then(
40-
res => handleResult(done, null, res),
41-
err => handleResult(done, err)
40+
(res) => handleResult(done, null, res),
41+
(err) => handleResult(done, err)
4242
)
4343
}
4444

src/api/diag.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const command = require('../cmd-helpers').command
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
net: command(send, 'diag/net'),
88
sys: command(send, 'diag/sys')

src/api/id.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
module.exports = send => {
3+
module.exports = (send) => {
44
return function id (idParam, cb) {
55
if (typeof idParam === 'function') {
66
cb = idParam

src/api/log.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
const ndjson = require('ndjson')
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
tail (cb) {
88
if (typeof cb !== 'function' && typeof Promise !== 'undefined') {
99
return send('log/tail', null, {}, null, false)
10-
.then(res => res.pipe(ndjson.parse()))
10+
.then((res) => res.pipe(ndjson.parse()))
1111
}
1212

1313
return send('log/tail', null, {}, null, false, (err, res) => {

src/api/ls.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return argCommand(send, 'ls')
77
}

src/api/mount.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
module.exports = send => {
3+
module.exports = (send) => {
44
return function mount (ipfs, ipns, cb) {
55
if (typeof ipfs === 'function') {
66
cb = ipfs

src/api/name.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
publish: argCommand(send, 'name/publish'),
88
resolve: argCommand(send, 'name/resolve')

src/api/object.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const argCommand = require('../cmd-helpers').argCommand
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
get: argCommand(send, 'object/get'),
88
put (file, encoding, cb) {

src/api/pin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
module.exports = send => {
3+
module.exports = (send) => {
44
return {
55
add (hash, opts, cb) {
66
if (typeof opts === 'function') {

src/api/ping.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict'
22

3-
module.exports = send => {
3+
module.exports = (send) => {
44
return function ping (id, cb) {
55
if (typeof cb !== 'function' && typeof Promise !== 'undefined') {
66
return send('ping', id, {n: 1}, null)
7-
.then(res => res[1])
7+
.then((res) => res[1])
88
}
99

1010
return send('ping', id, { n: 1 }, null, function (err, res) {

src/api/refs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const cmds = require('../cmd-helpers')
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
const refs = cmds.argCommand(send, 'refs')
77
refs.local = cmds.command(send, 'refs/local')
88

src/api/swarm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const cmds = require('../cmd-helpers')
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
peers: cmds.command(send, 'swarm/peers'),
88
connect: cmds.argCommand(send, 'swarm/connect')

src/api/update.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const command = require('../cmd-helpers').command
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return {
77
apply: command(send, 'update'),
88
check: command(send, 'update/check'),

src/api/version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const command = require('../cmd-helpers').command
44

5-
module.exports = send => {
5+
module.exports = (send) => {
66
return command(send, 'version')
77
}

src/load-commands.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function loadCommands (send) {
3232
const files = requireCommands()
3333
const cmds = {}
3434

35-
Object.keys(files).forEach(file => {
35+
Object.keys(files).forEach((file) => {
3636
cmds[file] = files[file](send)
3737
})
3838

tasks/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const runSequence = require('run-sequence')
88

99
const config = require('./config')
1010

11-
gulp.task('clean', done => {
11+
gulp.task('clean', (done) => {
1212
rimraf('./dist', done)
1313
})
1414

@@ -30,7 +30,7 @@ gulp.task('build:minified', () => {
3030
.pipe(gulp.dest('dist/'))
3131
})
3232

33-
gulp.task('build', ['clean'], done => {
33+
gulp.task('build', ['clean'], (done) => {
3434
runSequence(
3535
'build:nonminified',
3636
'build:minified',

tasks/daemons.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
const gulp = require('gulp')
44
const fs = require('fs')
5+
const path = require('path')
56

67
let daemons
78

8-
gulp.task('daemons:start', done => {
9-
startDisposableDaemons(d => {
9+
gulp.task('daemons:start', (done) => {
10+
startDisposableDaemons((d) => {
1011
daemons = d
1112
done()
1213
})
1314
})
1415

15-
gulp.task('daemons:stop', done => {
16+
gulp.task('daemons:stop', (done) => {
1617
stopDisposableDaemons(daemons, () => {
1718
daemons = null
1819
done()
@@ -33,7 +34,8 @@ function startDisposableDaemons (callback) {
3334
function finish () {
3435
counter++
3536
if (counter === 3) {
36-
fs.writeFileSync(__dirname + '/../test/tmp-disposable-nodes-addrs.json', JSON.stringify(apiAddrs))
37+
const targetPath = path.join(__dirname, '/../test/tmp-disposable-nodes-addrs.json')
38+
fs.writeFileSync(targetPath, JSON.stringify(apiAddrs))
3739
callback(ipfsNodes)
3840
}
3941
}
@@ -48,11 +50,11 @@ function startDisposableDaemons (callback) {
4850

4951
console.log(' ipfs init done - (bootstrap and mdns off) - ' + key)
5052

51-
ipfsNodes[key].setConfig('Bootstrap', null, err => {
53+
ipfsNodes[key].setConfig('Bootstrap', null, (err) => {
5254
if (err) {
5355
throw err
5456
}
55-
ipfsNodes[key].setConfig('Discovery', '{}', err => {
57+
ipfsNodes[key].setConfig('Discovery', '{}', (err) => {
5658
if (err) {
5759
throw err
5860
}
@@ -62,7 +64,7 @@ function startDisposableDaemons (callback) {
6264
'Access-Control-Allow-Origin': ['*']
6365
}
6466
}
65-
ipfsNodes[key].setConfig('API', JSON.stringify(headers), err => {
67+
ipfsNodes[key].setConfig('API', JSON.stringify(headers), (err) => {
6668
if (err) {
6769
throw err
6870
}
@@ -97,7 +99,7 @@ function stopDisposableDaemons (daemons, callback) {
9799

98100
function stopIPFSNode (daemons, key, cb) {
99101
let nodeStopped
100-
daemons[key].stopDaemon(err => {
102+
daemons[key].stopDaemon((err) => {
101103
if (err) {
102104
throw err
103105
}

tasks/release.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function npmPublish (done) {
2020
const publish = spawn('npm', ['publish'])
2121
publish.stdout.pipe(process.stdout)
2222
publish.stderr.pipe(process.stderr)
23-
publish.on('close', code => {
23+
publish.on('close', (code) => {
2424
if (code !== 0) return fail(`npm publish. Exiting with ${code}.`)
2525

2626
$.util.log('Published to npm.')
@@ -54,18 +54,18 @@ gulp.task('release:bump', () => {
5454
.pipe($.tagVersion())
5555
})
5656

57-
gulp.task('release:push', done => {
57+
gulp.task('release:push', (done) => {
5858
const remote = $.util.remote || 'origin'
5959
$.util.log('Pushing to git...')
60-
$.git.push(remote, 'master', {args: '--tags'}, err => {
60+
$.git.push(remote, 'master', {args: '--tags'}, (err) => {
6161
if (err) return fail(err.message)
6262

6363
$.util.log(`Pushed to git ${remote}:master`)
6464
done()
6565
})
6666
})
6767

68-
gulp.task('release:publish', done => {
68+
gulp.task('release:publish', (done) => {
6969
$.git.status({args: '-s'}, (err, stdout) => {
7070
if (err) return fail(err.message)
7171

@@ -80,7 +80,7 @@ gulp.task('release:publish', done => {
8080
})
8181
})
8282

83-
gulp.task('release', done => {
83+
gulp.task('release', (done) => {
8484
runSequence(
8585
'lint',
8686
'test',

tasks/test.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ const gulp = require('gulp')
44
const Server = require('karma').Server
55
const $ = require('gulp-load-plugins')()
66
const runSequence = require('run-sequence')
7+
const path = require('path')
78

89
const config = require('./config')
910

1011
require('./daemons')
1112

12-
gulp.task('test', done => {
13+
gulp.task('test', (done) => {
1314
runSequence(
1415
'test:node',
1516
'test:browser',
1617
done
1718
)
1819
})
1920

20-
gulp.task('test:node', done => {
21+
gulp.task('test:node', (done) => {
2122
runSequence(
2223
'daemons:start',
2324
'mocha',
@@ -26,7 +27,7 @@ gulp.task('test:node', done => {
2627
)
2728
})
2829

29-
gulp.task('test:browser', done => {
30+
gulp.task('test:browser', (done) => {
3031
runSequence(
3132
'daemons:start',
3233
'karma',
@@ -45,9 +46,9 @@ gulp.task('mocha', () => {
4546
}))
4647
})
4748

48-
gulp.task('karma', done => {
49+
gulp.task('karma', (done) => {
4950
new Server({
50-
configFile: __dirname + '/../karma.conf.js',
51+
configFile: path.join(__dirname, '/../karma.conf.js'),
5152
singleRun: true
5253
}, done).start()
5354
})

0 commit comments

Comments
 (0)