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'
const Buffer = require('safe-buffer').Buffer
const Buffer = require('buffer').Buffer
const path = require('path')
const RedisProcess = require('../test/lib/redis-process')
let rp

View File

@@ -2,17 +2,20 @@
## 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.
It became a hassle to implement new things while supporting all the old and deprecated features.
Version three is mainly a release to remove a lot of old cruft and open the
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,
but some of the changes are significant like dropping support for callbacks! To mitigate this breakage
there's a migration library you can include. It restores e.g. support for callbacks and some of the dropped
options and it will warn you in case you use any removed feature or option.
Therefore this is going to a big breaking change. For most of these there's
likely not much to change, but you might encounter some of these changes!
To mitigate this breakage there's a migration library you can include. It
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,
the backpressure indicator and the changed connectTimeout behavior. It will also only partially restore
snake_case support and maybe more.
It will not restore the support for old Node.js versions, the return value of
(p)(un)subscribe calls, the backpressure indicator and the changed
connectTimeout behavior. It will also only partially restore snake_case support
and maybe more.
Breaking Changes
@@ -31,13 +34,16 @@ Breaking Changes
- Removed `Redis.print` helper function
- Removed backpressure indicator from function return value
- 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
- 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
- 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
- The result of all queries can be inspected on the error through the `result` attribute
- If an error occurs for one of the calls, the result is from now on always
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
## v.2.7.2 - 14 Mar, 2017

View File

@@ -1,17 +1,22 @@
'use strict'
// 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 tls = require('tls')
const util = require('util')
const utils = require('./lib/utils')
const Command = require('./lib/command')
const Queue = require('double-ended-queue')
const Queue = require('denque')
const errorClasses = require('./lib/customErrors')
const EventEmitter = require('events')
const Parser = require('redis-parser')
const commands = require('redis-commands')
const Errors = require('redis-errors')
const debug = require('./lib/debug')
const unifyOptions = require('./lib/createClient')
const SUBSCRIBE_COMMANDS = {
@@ -913,9 +918,10 @@ exports.createClient = function () {
exports.RedisClient = RedisClient
exports.Multi = require('./lib/multi')
exports.AbortError = errorClasses.AbortError
exports.RedisError = Parser.RedisError
exports.ParserError = Parser.ParserError
exports.ReplyError = Parser.ReplyError
exports.RedisError = Errors.RedisError
exports.ParserError = Errors.ParserError
exports.ReplyError = Errors.ReplyError
exports.InterruptError = Errors.InterruptError
// Add all redis commands / nodeRedis api to the client
require('./lib/individualCommands')

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
'use strict'
const assert = require('assert')
const Queue = require('double-ended-queue')
const Queue = require('denque')
const utils = require('../lib/utils')
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) => {
clientMock.offlineQueue.push(createCommandObj(), createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
utils.replyInOrder(clientMock, () => {
assert.strictEqual(clientMock.offlineQueue.length, 0)
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) => {
clientMock.commandQueue.push(createCommandObj(), createCommandObj(), createCommandObj())
clientMock.commandQueue.push(createCommandObj())
clientMock.commandQueue.push(createCommandObj())
clientMock.commandQueue.push(createCommandObj())
utils.replyInOrder(clientMock, () => {
assert.strictEqual(clientMock.commandQueue.length, 0)
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) => {
clientMock.commandQueue.push(createCommandObj(), createCommandObj())
clientMock.offlineQueue.push(createCommandObj(), createCommandObj())
clientMock.commandQueue.push(createCommandObj())
clientMock.commandQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
clientMock.offlineQueue.push(createCommandObj())
utils.replyInOrder(clientMock, (err, res) => {
if (err) throw err
assert.strictEqual(clientMock.commandQueue.length, 0)