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

Commit

Permalink
Merge pull request #209 from ipfs/update-deps
Browse files Browse the repository at this point in the history
refactor: Update dependencies to latest
  • Loading branch information
daviddias committed Feb 8, 2016
2 parents 2bcb488 + 09ebc56 commit f1f6937
Show file tree
Hide file tree
Showing 44 changed files with 201 additions and 176 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const runSequence = require('run-sequence')

require('require-dir')('tasks')

gulp.task('default', done => {
gulp.task('default', (done) => {
runSequence(
'lint',
'test',
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@
},
"devDependencies": {
"babel-core": "^6.1.21",
"babel-eslint": "^5.0.0-beta6",
"babel-eslint": "^5.0.0-beta9",
"babel-loader": "^6.2.0",
"babel-plugin-transform-runtime": "^6.1.18",
"babel-preset-es2015": "^6.0.15",
"babel-runtime": "^6.3.19",
"chai": "^3.4.1",
"concurrently": "^1.0.0",
"eslint-config-standard": "^4.4.0",
"eslint": "^2.0.0-rc.0",
"eslint-config-standard": "^5.1.0",
"eslint-plugin-promise": "^1.0.8",
"eslint-plugin-standard": "^1.3.1",
"glob-stream": "5.3.1",
"gulp": "^3.9.0",
"gulp-bump": "^1.0.0",
"gulp-eslint": "^1.0.0",
"gulp-eslint": "^2.0.0-rc-3",
"gulp-filter": "^3.0.1",
"gulp-git": "^1.6.0",
"gulp-load-plugins": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/api/add.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Wreck = require('wreck')

module.exports = send => {
module.exports = (send) => {
return function add (files, opts, cb) {
if (typeof (opts) === 'function' && cb === undefined) {
cb = opts
Expand Down
2 changes: 1 addition & 1 deletion src/api/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
get: argCommand(send, 'block/get'),
stat: argCommand(send, 'block/stat'),
Expand Down
2 changes: 1 addition & 1 deletion src/api/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

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

module.exports = send => {
module.exports = (send) => {
return argCommand(send, 'cat')
}
2 changes: 1 addition & 1 deletion src/api/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

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

module.exports = send => {
module.exports = (send) => {
return command(send, 'commands')
}
2 changes: 1 addition & 1 deletion src/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
get: argCommand(send, 'config'),
set (key, value, opts, cb) {
Expand Down
6 changes: 3 additions & 3 deletions src/api/dht.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
findprovs: argCommand(send, 'dht/findprovs'),
get (key, opts, cb) {
Expand Down Expand Up @@ -37,8 +37,8 @@ module.exports = send => {

return send('dht/get', key, opts)
.then(
res => handleResult(done, null, res),
err => handleResult(done, err)
(res) => handleResult(done, null, res),
(err) => handleResult(done, err)
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/api/diag.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
net: command(send, 'diag/net'),
sys: command(send, 'diag/sys')
Expand Down
2 changes: 1 addition & 1 deletion src/api/id.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

module.exports = send => {
module.exports = (send) => {
return function id (idParam, cb) {
if (typeof idParam === 'function') {
cb = idParam
Expand Down
4 changes: 2 additions & 2 deletions src/api/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

const ndjson = require('ndjson')

module.exports = send => {
module.exports = (send) => {
return {
tail (cb) {
if (typeof cb !== 'function' && typeof Promise !== 'undefined') {
return send('log/tail', null, {}, null, false)
.then(res => res.pipe(ndjson.parse()))
.then((res) => res.pipe(ndjson.parse()))
}

return send('log/tail', null, {}, null, false, (err, res) => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

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

module.exports = send => {
module.exports = (send) => {
return argCommand(send, 'ls')
}
2 changes: 1 addition & 1 deletion src/api/mount.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

module.exports = send => {
module.exports = (send) => {
return function mount (ipfs, ipns, cb) {
if (typeof ipfs === 'function') {
cb = ipfs
Expand Down
2 changes: 1 addition & 1 deletion src/api/name.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
publish: argCommand(send, 'name/publish'),
resolve: argCommand(send, 'name/resolve')
Expand Down
2 changes: 1 addition & 1 deletion src/api/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
get: argCommand(send, 'object/get'),
put (file, encoding, cb) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/pin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

module.exports = send => {
module.exports = (send) => {
return {
add (hash, opts, cb) {
if (typeof opts === 'function') {
Expand Down
4 changes: 2 additions & 2 deletions src/api/ping.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

module.exports = send => {
module.exports = (send) => {
return function ping (id, cb) {
if (typeof cb !== 'function' && typeof Promise !== 'undefined') {
return send('ping', id, {n: 1}, null)
.then(res => res[1])
.then((res) => res[1])
}

return send('ping', id, { n: 1 }, null, function (err, res) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/refs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
const refs = cmds.argCommand(send, 'refs')
refs.local = cmds.command(send, 'refs/local')

Expand Down
2 changes: 1 addition & 1 deletion src/api/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
peers: cmds.command(send, 'swarm/peers'),
connect: cmds.argCommand(send, 'swarm/connect')
Expand Down
2 changes: 1 addition & 1 deletion src/api/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

module.exports = send => {
module.exports = (send) => {
return {
apply: command(send, 'update'),
check: command(send, 'update/check'),
Expand Down
2 changes: 1 addition & 1 deletion src/api/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

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

module.exports = send => {
module.exports = (send) => {
return command(send, 'version')
}
2 changes: 1 addition & 1 deletion src/load-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function loadCommands (send) {
const files = requireCommands()
const cmds = {}

Object.keys(files).forEach(file => {
Object.keys(files).forEach((file) => {
cmds[file] = files[file](send)
})

Expand Down
4 changes: 2 additions & 2 deletions tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const runSequence = require('run-sequence')

const config = require('./config')

gulp.task('clean', done => {
gulp.task('clean', (done) => {
rimraf('./dist', done)
})

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

gulp.task('build', ['clean'], done => {
gulp.task('build', ['clean'], (done) => {
runSequence(
'build:nonminified',
'build:minified',
Expand Down
18 changes: 10 additions & 8 deletions tasks/daemons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

const gulp = require('gulp')
const fs = require('fs')
const path = require('path')

let daemons

gulp.task('daemons:start', done => {
startDisposableDaemons(d => {
gulp.task('daemons:start', (done) => {
startDisposableDaemons((d) => {
daemons = d
done()
})
})

gulp.task('daemons:stop', done => {
gulp.task('daemons:stop', (done) => {
stopDisposableDaemons(daemons, () => {
daemons = null
done()
Expand All @@ -33,7 +34,8 @@ function startDisposableDaemons (callback) {
function finish () {
counter++
if (counter === 3) {
fs.writeFileSync(__dirname + '/../test/tmp-disposable-nodes-addrs.json', JSON.stringify(apiAddrs))
const targetPath = path.join(__dirname, '/../test/tmp-disposable-nodes-addrs.json')
fs.writeFileSync(targetPath, JSON.stringify(apiAddrs))
callback(ipfsNodes)
}
}
Expand All @@ -48,11 +50,11 @@ function startDisposableDaemons (callback) {

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

ipfsNodes[key].setConfig('Bootstrap', null, err => {
ipfsNodes[key].setConfig('Bootstrap', null, (err) => {
if (err) {
throw err
}
ipfsNodes[key].setConfig('Discovery', '{}', err => {
ipfsNodes[key].setConfig('Discovery', '{}', (err) => {
if (err) {
throw err
}
Expand All @@ -62,7 +64,7 @@ function startDisposableDaemons (callback) {
'Access-Control-Allow-Origin': ['*']
}
}
ipfsNodes[key].setConfig('API', JSON.stringify(headers), err => {
ipfsNodes[key].setConfig('API', JSON.stringify(headers), (err) => {
if (err) {
throw err
}
Expand Down Expand Up @@ -97,7 +99,7 @@ function stopDisposableDaemons (daemons, callback) {

function stopIPFSNode (daemons, key, cb) {
let nodeStopped
daemons[key].stopDaemon(err => {
daemons[key].stopDaemon((err) => {
if (err) {
throw err
}
Expand Down
10 changes: 5 additions & 5 deletions tasks/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function npmPublish (done) {
const publish = spawn('npm', ['publish'])
publish.stdout.pipe(process.stdout)
publish.stderr.pipe(process.stderr)
publish.on('close', code => {
publish.on('close', (code) => {
if (code !== 0) return fail(`npm publish. Exiting with ${code}.`)

$.util.log('Published to npm.')
Expand Down Expand Up @@ -54,18 +54,18 @@ gulp.task('release:bump', () => {
.pipe($.tagVersion())
})

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

$.util.log(`Pushed to git ${remote}:master`)
done()
})
})

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

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

gulp.task('release', done => {
gulp.task('release', (done) => {
runSequence(
'lint',
'test',
Expand Down
11 changes: 6 additions & 5 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ const gulp = require('gulp')
const Server = require('karma').Server
const $ = require('gulp-load-plugins')()
const runSequence = require('run-sequence')
const path = require('path')

const config = require('./config')

require('./daemons')

gulp.task('test', done => {
gulp.task('test', (done) => {
runSequence(
'test:node',
'test:browser',
done
)
})

gulp.task('test:node', done => {
gulp.task('test:node', (done) => {
runSequence(
'daemons:start',
'mocha',
Expand All @@ -26,7 +27,7 @@ gulp.task('test:node', done => {
)
})

gulp.task('test:browser', done => {
gulp.task('test:browser', (done) => {
runSequence(
'daemons:start',
'karma',
Expand All @@ -45,9 +46,9 @@ gulp.task('mocha', () => {
}))
})

gulp.task('karma', done => {
gulp.task('karma', (done) => {
new Server({
configFile: __dirname + '/../karma.conf.js',
configFile: path.join(__dirname, '/../karma.conf.js'),
singleRun: true
}, done).start()
})
Loading

0 comments on commit f1f6937

Please sign in to comment.