1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

chore: update dependencies

This commit is contained in:
Ruben Bridgewater
2017-05-26 10:27:17 +02:00
parent e0eed43579
commit 4d103b4aee
18 changed files with 75 additions and 62 deletions

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const path = require('path') const path = require('path')
const RedisProcess = require('../test/lib/redis-process') const RedisProcess = require('../test/lib/redis-process')
let rp let rp

View File

@@ -2,17 +2,20 @@
## v.3.0.0-alpha1 - XX XXX, 2017 ## v.3.0.0-alpha1 - XX XXX, 2017
Version three is mainly a release to remove a lot of old cruft and open the doors for new features again. Version three is mainly a release to remove a lot of old cruft and open the
It became a hassle to implement new things while supporting all the old and deprecated features. doors for new features again. It became a hassle to implement new things while
supporting all the old and deprecated features.
Therefore this is going to a big breaking change. For most of these there's likely not much to change, Therefore this is going to a big breaking change. For most of these there's
but some of the changes are significant like dropping support for callbacks! To mitigate this breakage likely not much to change, but you might encounter some of these changes!
there's a migration library you can include. It restores e.g. support for callbacks and some of the dropped To mitigate this breakage there's a migration library you can include. It
options and it will warn you in case you use any removed feature or option. restores e.g. support for some of the dropped options and it will warn you
in case you use any removed feature or option.
It will not restore the support for old Node.js versions, the return value of (p)(un)subscribe calls, It will not restore the support for old Node.js versions, the return value of
the backpressure indicator and the changed connectTimeout behavior. It will also only partially restore (p)(un)subscribe calls, the backpressure indicator and the changed
snake_case support and maybe more. connectTimeout behavior. It will also only partially restore snake_case support
and maybe more.
Breaking Changes Breaking Changes
@@ -31,13 +34,16 @@ Breaking Changes
- Removed `Redis.print` helper function - Removed `Redis.print` helper function
- Removed backpressure indicator from function return value - Removed backpressure indicator from function return value
- Changed return value of `(p)(un)subscribe` - Changed return value of `(p)(un)subscribe`
- Return an array with the number of current subscribed channels and an array with all affected channels - Return an array with the number of current subscribed channels and an array
with all affected channels
- Changed `connectTimeout` (connect_timeout) option - Changed `connectTimeout` (connect_timeout) option
- This timeout does not limit the total retry time anymore - This timeout does not limit the total retry time anymore
- From now on this will only set the stream timeout to connect to the host - From now on this will only set the stream timeout to connect to the host
- Changed return value for `multi` and `batch` in case of an error - Changed return value for `multi` and `batch` in case of an error
- If an error occurs for one of the calls, the result is from now on always going to be an error - If an error occurs for one of the calls, the result is from now on always
- The result of all queries can be inspected on the error through the `result` attribute going to be an error
- The result of all queries can be inspected on the error through the `result`
attribute
- Only emit ready when all commands were truly send to Redis - Only emit ready when all commands were truly send to Redis
## v.2.7.2 - 14 Mar, 2017 ## v.2.7.2 - 14 Mar, 2017

View File

@@ -1,17 +1,22 @@
'use strict' 'use strict'
// TODO: Replace all for in loops! // TODO: Replace all for in loops!
const Buffer = require('safe-buffer').Buffer // TODO: Replace all `Error` with `RedisError` and improve errors in general
// We have to replace the error codes and make them coherent.
// We also have to use InterruptError s instead of AbortError s.
// The Error messages might be improved as well.
// TODO: Rewrite this to classes
const Buffer = require('buffer').Buffer
const net = require('net') const net = require('net')
const tls = require('tls') const tls = require('tls')
const util = require('util') const util = require('util')
const utils = require('./lib/utils') const utils = require('./lib/utils')
const Command = require('./lib/command') const Command = require('./lib/command')
const Queue = require('double-ended-queue') const Queue = require('denque')
const errorClasses = require('./lib/customErrors') const errorClasses = require('./lib/customErrors')
const EventEmitter = require('events') const EventEmitter = require('events')
const Parser = require('redis-parser') const Parser = require('redis-parser')
const commands = require('redis-commands') const Errors = require('redis-errors')
const debug = require('./lib/debug') const debug = require('./lib/debug')
const unifyOptions = require('./lib/createClient') const unifyOptions = require('./lib/createClient')
const SUBSCRIBE_COMMANDS = { const SUBSCRIBE_COMMANDS = {
@@ -913,9 +918,10 @@ exports.createClient = function () {
exports.RedisClient = RedisClient exports.RedisClient = RedisClient
exports.Multi = require('./lib/multi') exports.Multi = require('./lib/multi')
exports.AbortError = errorClasses.AbortError exports.AbortError = errorClasses.AbortError
exports.RedisError = Parser.RedisError exports.RedisError = Errors.RedisError
exports.ParserError = Parser.ParserError exports.ParserError = Errors.ParserError
exports.ReplyError = Parser.ReplyError exports.ReplyError = Errors.ReplyError
exports.InterruptError = Errors.InterruptError
// Add all redis commands / nodeRedis api to the client // Add all redis commands / nodeRedis api to the client
require('./lib/individualCommands') require('./lib/individualCommands')

View File

@@ -1,30 +1,27 @@
'use strict' 'use strict'
const util = require('util')
const assert = require('assert') const assert = require('assert')
const RedisError = require('redis-parser').RedisError const RedisError = require('redis-errors').RedisError
const ADD_STACKTRACE = false
function AbortError (obj, stack) { class AbortError extends RedisError {
assert(obj, 'The options argument is required') constructor (obj, stack) {
assert.strictEqual(typeof obj, 'object', 'The options argument has to be of type object') assert(obj, 'The options argument is required')
assert.strictEqual(typeof obj, 'object', 'The options argument has to be of type object')
RedisError.call(this, obj.message, ADD_STACKTRACE) super(obj.message)
Object.defineProperty(this, 'message', { Object.defineProperty(this, 'message', {
value: obj.message || '', value: obj.message || '',
configurable: true, configurable: true,
writable: true writable: true
}) })
if (stack || stack === undefined) { if (stack || stack === undefined) {
Error.captureStackTrace(this, AbortError) Error.captureStackTrace(this, AbortError)
} }
for (let keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) { for (let keys = Object.keys(obj), key = keys.pop(); key; key = keys.pop()) {
this[key] = obj[key] this[key] = obj[key]
}
} }
} }
util.inherits(AbortError, RedisError)
Object.defineProperty(AbortError.prototype, 'name', { Object.defineProperty(AbortError.prototype, 'name', {
value: 'AbortError', value: 'AbortError',
configurable: true, configurable: true,

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Queue = require('double-ended-queue') const Queue = require('denque')
const utils = require('./utils') const utils = require('./utils')
const Command = require('./command') const Command = require('./command')

View File

@@ -26,24 +26,24 @@
"lint": "eslint . --fix" "lint": "eslint . --fix"
}, },
"dependencies": { "dependencies": {
"double-ended-queue": "^2.1.0-0", "denque": "^1.1.1",
"redis-commands": "^1.2.0", "redis-commands": "^1.2.0",
"redis-parser": "^2.6.0", "redis-errors": "^1.0.0",
"safe-buffer": "^5.0.1" "redis-parser": "^3.0.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
}, },
"devDependencies": { "devDependencies": {
"coveralls": "^2.11.2", "coveralls": "^2.11.2",
"cross-spawn": "^5.1.0",
"intercept-stdout": "~0.1.2", "intercept-stdout": "~0.1.2",
"metrics": "^0.1.9", "metrics": "^0.1.9",
"mocha": "^3.2.0", "mocha": "^3.2.0",
"nyc": "^8.3.0", "nyc": "^8.3.0",
"standard": "^10.0.2", "standard": "^10.0.2",
"tcp-port-used": "^0.1.2", "tcp-port-used": "^0.1.2",
"uuid": "^2.0.1", "uuid": "^2.0.1"
"win-spawn": "^2.0.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('../lib/config') const config = require('../lib/config')
const helper = require('../helper') const helper = require('../helper')

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('../lib/config') const config = require('../lib/config')
const helper = require('../helper') const helper = require('../helper')

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const config = require('../lib/config') const config = require('../lib/config')
const helper = require('../helper') const helper = require('../helper')
const redis = config.redis const redis = config.redis

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('../lib/config') const config = require('../lib/config')
const helper = require('../helper') const helper = require('../helper')

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('../lib/config') const config = require('../lib/config')
const helper = require('../helper') const helper = require('../helper')

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('./lib/config') const config = require('./lib/config')
const helper = require('./helper') const helper = require('./helper')

View File

@@ -4,7 +4,7 @@
const config = require('./config') const config = require('./config')
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const spawn = require('win-spawn') const spawn = require('cross-spawn')
const tcpPortUsed = require('tcp-port-used') const tcpPortUsed = require('tcp-port-used')
// wait for redis to be listening in // wait for redis to be listening in

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('./lib/config') const config = require('./lib/config')
const helper = require('./helper') const helper = require('./helper')

View File

@@ -1,10 +1,9 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const intercept = require('intercept-stdout')
const config = require('./lib/config') const config = require('./lib/config')
const helper = require('./helper') const helper = require('./helper')
const fork = require('child_process').fork const fork = require('child_process').fork

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('./lib/config') const config = require('./lib/config')
const helper = require('./helper') const helper = require('./helper')

View File

@@ -1,6 +1,6 @@
'use strict' 'use strict'
const Buffer = require('safe-buffer').Buffer const Buffer = require('buffer').Buffer
const assert = require('assert') const assert = require('assert')
const config = require('./lib/config') const config = require('./lib/config')
const helper = require('./helper') const helper = require('./helper')

View File

@@ -1,7 +1,7 @@
'use strict' 'use strict'
const assert = require('assert') const assert = require('assert')
const Queue = require('double-ended-queue') const Queue = require('denque')
const utils = require('../lib/utils') const utils = require('../lib/utils')
describe('utils.js', () => { describe('utils.js', () => {
@@ -72,7 +72,8 @@ describe('utils.js', () => {
}) })
it('elements in the offline queue. Reply after the offline queue is empty and respect the commandObj callback', (done) => { it('elements in the offline queue. Reply after the offline queue is empty and respect the commandObj callback', (done) => {
clientMock.offlineQueue.push(createCommandObj(), createCommandObj()) clientMock.offlineQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
utils.replyInOrder(clientMock, () => { utils.replyInOrder(clientMock, () => {
assert.strictEqual(clientMock.offlineQueue.length, 0) assert.strictEqual(clientMock.offlineQueue.length, 0)
assert.strictEqual(resCount, 2) assert.strictEqual(resCount, 2)
@@ -82,7 +83,9 @@ describe('utils.js', () => {
}) })
it('elements in the offline queue. Reply after the offline queue is empty and respect the commandObj error emit', (done) => { it('elements in the offline queue. Reply after the offline queue is empty and respect the commandObj error emit', (done) => {
clientMock.commandQueue.push(createCommandObj(), createCommandObj(), createCommandObj()) clientMock.commandQueue.push(createCommandObj())
clientMock.commandQueue.push(createCommandObj())
clientMock.commandQueue.push(createCommandObj())
utils.replyInOrder(clientMock, () => { utils.replyInOrder(clientMock, () => {
assert.strictEqual(clientMock.commandQueue.length, 0) assert.strictEqual(clientMock.commandQueue.length, 0)
assert.strictEqual(errCount, 3) assert.strictEqual(errCount, 3)
@@ -98,8 +101,10 @@ describe('utils.js', () => {
}) })
it('elements in the offline queue and the commandQueue. Reply all other commands got handled respect the commandObj', (done) => { it('elements in the offline queue and the commandQueue. Reply all other commands got handled respect the commandObj', (done) => {
clientMock.commandQueue.push(createCommandObj(), createCommandObj()) clientMock.commandQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj(), createCommandObj()) clientMock.commandQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
utils.replyInOrder(clientMock, (err, res) => { utils.replyInOrder(clientMock, (err, res) => {
if (err) throw err if (err) throw err
assert.strictEqual(clientMock.commandQueue.length, 0) assert.strictEqual(clientMock.commandQueue.length, 0)