Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 79 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions packages/client/lib/client/commands-queue.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import LinkedList from 'yallist';
import RedisParser from 'redis-parser';
import * as LinkedList from 'yallist';
import { AbortError } from '../errors';
import { RedisCommandArguments, RedisCommandRawReply } from '../commands';

// We need to use 'require', because it's not possible with Typescript to import
// classes that are exported as 'module.exports = class`, without esModuleInterop
// set to true.
const RedisParser = require('redis-parser');

export interface QueueCommandOptions {
asap?: boolean;
chainId?: symbol;
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import RedisSocket, { RedisSocketOptions, RedisNetSocketOptions, RedisTlsSocketO
import RedisCommandsQueue, { PubSubListener, PubSubSubscribeCommands, PubSubUnsubscribeCommands, QueueCommandOptions } from './commands-queue';
import RedisClientMultiCommand, { RedisClientMultiCommandType } from './multi-command';
import { RedisMultiQueuedCommand } from '../multi-command';
import EventEmitter from 'events';
import { EventEmitter } from 'events';
import { CommandOptions, commandOptions, isCommandOptions } from '../command-options';
import { ScanOptions, ZMember } from '../commands/generic-transformers';
import { ScanCommandOptions } from '../commands/SCAN';
Expand Down
6 changes: 3 additions & 3 deletions packages/client/lib/client/socket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EventEmitter from 'events';
import net from 'net';
import tls from 'tls';
import { EventEmitter } from 'events';
import * as net from 'net';
import * as tls from 'tls';
import { encodeCommand } from '../commander';
import { RedisCommandArguments } from '../commands';
import { ConnectionTimeoutError, ClientClosedError, SocketClosedUnexpectedlyError } from '../errors';
Expand Down
6 changes: 5 additions & 1 deletion packages/client/lib/cluster/cluster-slots.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import calculateSlot from 'cluster-key-slot';
import RedisClient, { InstantiableRedisClient, RedisClientType } from '../client';
import { RedisClusterMasterNode, RedisClusterReplicaNode } from '../commands/CLUSTER_NODES';
import { RedisClusterClientOptions, RedisClusterOptions } from '.';
import { RedisModules, RedisScripts } from '../commands';

// We need to use 'require', because it's not possible with Typescript to import
// function that are exported as 'module.exports = function`, without esModuleInterop
// set to true.
const calculateSlot = require('cluster-key-slot');

export interface ClusterNode<M extends RedisModules, S extends RedisScripts> {
id: string;
client: RedisClientType<M, S>;
Expand Down
6 changes: 5 additions & 1 deletion packages/client/lib/cluster/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../test-utils';
import calculateSlot from 'cluster-key-slot';
import { ClusterSlotStates } from '../commands/CLUSTER_SETSLOT';
import { SQUARE_SCRIPT } from '../client/index.spec';

// We need to use 'require', because it's not possible with Typescript to import
// function that are exported as 'module.exports = function`, without esModuleInterop
// set to true.
const calculateSlot = require('cluster-key-slot');

describe('Cluster', () => {
testUtils.testWithCluster('sendCommand', async cluster => {
await cluster.connect();
Expand Down
15 changes: 0 additions & 15 deletions packages/client/lib/ts-declarations/redis-parser.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@redis/test-utils": "*",
"@types/node": "^16.11.7",
"@types/redis-parser": "^3.0.0",
"@types/sinon": "^10.0.6",
"@types/yallist": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^5.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/lib/dockers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { once } from 'events';
import { RedisModules, RedisScripts } from '@redis/client/lib/commands';
import RedisClient, { RedisClientType } from '@redis/client/lib/client';
import { promiseTimeout } from '@redis/client/lib/utils';
import path from 'path';
import * as path from 'path';
import { promisify } from 'util';
import { exec } from 'child_process';
const execAsync = promisify(exec);
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"compilerOptions": {
"declaration": true,
"allowJs": true,
"useDefineForClassFields": true
"useDefineForClassFields": true,
"esModuleInterop": false
},
"files": [
"./packages/client/lib/ts-declarations/cluster-key-slot.d.ts",
"./packages/client/lib/ts-declarations/redis-parser.d.ts"
"./packages/client/lib/ts-declarations/cluster-key-slot.d.ts"
],
"ts-node": {
"files": true
Expand Down