nestjs-redis

Redis module for Nest framework (node.js). Support node-redis & ioredis.

MIT License

Downloads
316.3K
Stars
384
Committers
3

Bot releases are hidden (Show)

nestjs-redis - v10.0.0-alpha.3 - Pre Release

Published by liaoliaots 25 days ago

  • new TypeScript build options, "module": "Node16", "moduleResolution": "Node16"
  • add exports type field in package.json for modern Node.js
  • this lib requires Node.js>=16.13.0 (the first lts version) or higher
  • publish test
nestjs-redis - v10.0.0-alpha.2 - Incoming Changes

Published by liaoliaots 25 days ago

  • This lib support both node-redis and ioredis, the minimum required version is node-redis^4.1.0, ioredis^5.0.0.
  • In some cases InjectRedis and InjectCluster won't handle dependencies correctly(for example: a module import RedisModule and re-export it will cause "Cannot resolve dependency" error) thus leading to errors and there is no better solution so InjectRedis and InjectCluster will be removed and please use RedisManager&ClusterManager instead which is the most stable solution.
nestjs-redis - v9.0.5 Latest Release

Published by liaoliaots almost 2 years ago

9.0.5 - 2023-01-01

Other

  • chore(license): update [year] part (#422)
  • docs: use correct actions url (#419)
  • docs: restore old docs, include v2, v3 and v4 (#419)

Dependencies

  • chore(deps-dev): bump tsc-alias from 1.7.0 to 1.8.2 (#410)
  • chore(deps): bump dependencies to latest (#410)(#420)
  • chore(sample): bump dependencies to latest (#412)(#423)
nestjs-redis - nestjs-redis-health: v9.0.4

Published by liaoliaots almost 2 years ago

9.0.4 - 2023-01-01

Other

  • chore(license): update [year] part (#422)

Dependencies

  • chore(deps-dev): bump tsc-alias from 1.7.0 to 1.8.2 (#410)
nestjs-redis - v9.0.4

Published by liaoliaots almost 2 years ago

9.0.4 - 2022-11-06

Other

  • docs: fix typos, add badges, update (#378) (#384) (#385)
  • ci: upgrade ubuntu version to ubuntu-22.04 (#381)
  • ci: use pnpm/action-setup@v2 instead of a specified version (#383)
  • ci: add testing for node18 LTS (#383)

Dependencies

  • chore(deps): bump tslib from v2.4.0 to v2.4.1 (#379)
  • chore(deps): bump dependencies to latest (#370) (#371) (#379) (#382)
nestjs-redis - nestjs-redis-health: v9.0.3

Published by liaoliaots almost 2 years ago

9.0.3 - 2022-11-06

Dependencies

  • chore(deps): bump tslib from v2.4.0 to v2.4.1 (#379)
nestjs-redis - v9.0.3

Published by liaoliaots about 2 years ago

9.0.3 - 2022-10-02

Other

  • build with [email protected] LTS [email protected]
  • regenerate dependency graphs (#366)
  • use index.d.ts of jest-extended directly instead of global.d.ts file (#366)
  • bump @liaoliaots/nestjs-redis to 9.0.3 (#366)
  • bump @liaoliaots/nestjs-redis-health to 9.0.2 (#366)

Dependencies

  • chore(deps): update dependencies to latest (#349) (#365)
nestjs-redis - v9.0.2

Published by liaoliaots about 2 years ago

9.0.2 - 2022-09-02

Other

  • refactor: update messages (#347)
  • test: simplify unit/e2e tests and update configuration (#336) (#342)
  • docs: fix absolute links, update (#347)
  • chore(sample): simplify tests, update dependencies (#336) (#345)
  • chore: simplify package.json fields (#342)

Dependencies

  • chore(deps): update dependencies to latest (#333) (#341) (#342)
nestjs-redis - v9.0.1

Published by liaoliaots about 2 years ago

9.0.1 - 2022-07-20

Enhancements

  • perf: obtain providers when the onApplicationShutdown hook is invoked (#320)

Other

  • docs: fix unavailable links, add FAQs (#321)
  • test: update unit tests (#320)

Dependencies

  • chore(deps-dev): bump tsc-alias to v1.7.0 (#320)
  • chore(deps): update dependencies to latest (#320)
nestjs-redis - v9.0.0

Published by liaoliaots over 2 years ago

9.0.0 - 2022-07-17

If you depend on NestJS 7 or 8, please use version 8 of the lib.

There are two packages in this repo now:

  • @liaoliaots/nestjs-redis
  • @liaoliaots/nestjs-redis-health

BREAKING CHANGES ⚠️

  • drop support NestJS@8 and NestJS@7, minimum supported NestJS version is NestJS@9
  • the RedisHealthModule was removed from @liaoliaots/nestjs-redis, now you should install @liaoliaots/nestjs-redis-health to use it

Enhancements

  • perf(redis): remove unneeded files, functions, variables and types, reduce file size...
  • perf(redis-health): refactor indicator, simplify logic, remove unneeded conditions

Other

  • build: migrate to pnpm workspace
  • test: update & simplify unit and e2e tests
  • ci: use latest version for nodejs and pnpm
  • chore: update MIT License, .gitattributes, update documentation
  • chore(sample): upgrade to nestjs 9

Dependencies

  • bump dependencies to latest, add missing peer dependencies
nestjs-redis - v8.2.2

Published by liaoliaots over 2 years ago

8.2.2 - 2022-06-24

Bug fixes

  • fix: register event listeners immediately (#286)
  • fix: if the status of the instance is end, then quit and disconnect methods will not be invoked (#286)
  • fix(health): if the type argument is invalid, now the indicator will throw an error (#286)

Enhancements

  • perf: reduce memory usage - remove closure functions for event listeners (#286)
  • revert: remove deprecated tag from onClientCreated option as it can be used to specify custom loggers (#286)
  • refactor: remove unused utility functions, interfaces (#286)
  • refactor: enable timestamp option for logger (#286)
  • refactor: improve messages, errors, comments (#286)

Other

  • chore: change peerDependencies version ranges from x to ^ (#286)
  • chore(docker): use redis version 6.2.7 instead of latest (#286)
  • test: update unit tests (#286)
  • ci: update nodejs and npm versions (#287)
    • node: 16.15.1 LTS
    • npm: 8.13.1
  • docs: update README.md (#288)

Dependencies

  • chore(deps): bump tsc-alias to v1.6.11 (#286)
  • chore(deps): bump dependencies to latest (#286)
nestjs-redis - v8.2.1

Published by liaoliaots over 2 years ago

8.2.1 - 2022-06-08

Bug fixes

  • chore(deps): bump tsc-alias to v1.6.9 (#283)

Dependencies

  • chore(deps): update dependencies to latest (#281) (#283)

Other

  • chore: bump package version (#284)
  • ci: ensure specific versions of node&npm are always used (#282)
    • node: 16.15.0 LTS
    • npm: 8.10.0
nestjs-redis - v8.2.0

Published by liaoliaots over 2 years ago

8.2.0 - 2022-05-26

Features

  • redis
    • explicitly add path option to support unix domain socket (#256)

Enhancements

  • add tsdoc tags to classes, interfaces, methods, decorators to enhance readability (#256) (#259) (#261) (#262)
  • update code comments for classes, interfaces, methods, decorators to enhance readability (#256) (#259) (#260) (#261)

Dependencies

  • bump dependencies to latest (#247) (#249) (#257)

Other

  • recreate git hooks (#248)
  • refactor docker compose file according to latest compose specification (#250)
  • refactor template for bug report (#251) (#252) (#253)
  • refactor workflow files, upgrade to setup-node@3 (#254)
  • delete unneeded files, extract common constants (#256) (#259)
  • add .gitattributes, set endOfLine to auto, to develop on windows platform or linux (#258)
  • update docs (#263) (#264) (#266) (#268)
  • update samples (#267)
nestjs-redis - v8.1.1

Published by liaoliaots over 2 years ago

8.1.1 - 2022-04-30

Bug fixes

  • bump tsc-alias to v1.6.7 (#240)

Enhancements

  • bump tslib to v2.4.0 (#240)
  • rebuild barrel file for health module (#243)
  • simplify health check logic (#242)

Dependencies

  • update dependencies to latest (#240)

Other

  • build with [email protected] LTS
  • remove unnecessary timeout function for e2e tests (#241)
nestjs-redis - v8.1.0

Published by liaoliaots over 2 years ago

8.1.0 - 2022-04-15

Bug fixes

  • bump tsc-alias to v1.6.6 (#233)

Features

  • add errorLog option to display error logging while connecting. (Default: true) (#236)

Enhancements

  • update comments for modules/interfaces/methods (#236)
  • update messages for better readability (#236)

Other

  • update docs (#236)
  • remove old legacy eslint.validate setting (#229)
  • remove es2021 env from .eslintrc.js (#229)

Dependencies

  • (deps-dev) remove core-js-compat and compat.js (#235)
  • update dependencies to latest
nestjs-redis - v8.0.0

Published by liaoliaots over 2 years ago

8.0.0 - 2022-03-28

If you depend on ioredis@4, please use version7 of the plugin.

BREAKING CHANGES

  • compatibility with ioredis@5, which includes some breaking changes, please read (#223)
  • drop support Node.js@10, minimum supported Node.js version is [email protected] (#223)

Dependencies

  • (deps) remove promise.allsettled, @types/promise.allsettled (#223)
  • (deps-dev) remove @types/ioredis (#223)
  • update dependencies to latest (#218) (#223)

Other

  • build with Node.js@16 LTS (#219)
  • update unit and e2e tests (#223)
  • update docs (#224)
  • update ts and eslint config (#219) (#220) (#223)
nestjs-redis - v7.0.0

Published by liaoliaots over 2 years ago

7.0.0 - 2022-03-15

Bug fixes

  • update tsc-alias to v1.6.4 (#199)
  • use on to listen ready event instead of once (#208)

Features

  • health check
    • (redis) add timeout option to check if ping times out, set the default value to 1000 (#199) (#200)
    • (redis) add memoryThreshold option to check maximum amount of memory (#199) (#200)

Enhancements

  • update error messages for better readability (#199) (#200) (#204) (#206)
  • add custom errors instead of redis-errors: MissingConfigurationError, ClientNotFoundError (#201)
  • use built-in logger to show error logs while connecting (#208)
  • update comments for RedisService, ClusterService, InjectRedis, InjectCluster (#209)
  • update comments for module options interface for better readability (#202)
  • simplify decorators: InjectRedis, InjectCluster (#210)
  • use correct return type for decorators: InjectRedis, InjectCluster (#210)

Other

  • use multiple nodejs version for testing.yml (#198)
  • format workflow configuration (#198)
  • update eslint configuration (#198) (#199)
  • update scripts in package.json (#198) (#200) (#204)
  • ignore health barrel correctly for prettier (#200)
  • add compat.js to show missing API for node 10.13 (#199)
  • add forceConsistentCasingInFileNames in tsconfig.json, remove node_modules from exclude list in tsconfig.build.json (#199)
  • update unit tests (#199) (#202) (#204) (#205) (#206) (#207) (#208)
  • update docs (26f4e2d) (#211) (#215) (#216)

Dependencies

  • (deps) remove redis-errors and types (#200)
  • (deps-dev) remove eslint-plugin-promise (#198)
  • (deps-dev) add core-js-compat (#199)
  • update dependencies to latest

BREAKING CHANGES

  • health check
    • rename RedisCheckOptions to RedisCheckSettings and refactor it (#199) (#200)
    • you must specify what redis server type you use, possible values are "redis", "cluster" (#199) (#200)
    • refactor checkHealth (#199) (#200) (#206)

v7:

@Controller('app')
export class AppController {
    constructor(
        private readonly health: HealthCheckService,
        private readonly redisIndicator: RedisHealthIndicator,
        @InjectRedis() private readonly redis: Redis,
        @InjectCluster() private readonly cluster: Cluster
    ) {}

    @Get('health')
    @HealthCheck()
    async healthChecks(): Promise<HealthCheckResult> {
        return await this.health.check([
            () => this.redisIndicator.checkHealth('redis', { type: 'redis', client: this.redis }),
            () => this.redisIndicator.checkHealth('cluster', { type: 'cluster', client: this.cluster })
        ]);
    }
}

old:

@Controller('app')
export class AppController {
    constructor(
        private readonly health: HealthCheckService,
        private readonly redisIndicator: RedisHealthIndicator,
        @InjectRedis() private readonly redis: Redis,
        @InjectCluster() private readonly cluster: Cluster
    ) {}

    @Get('health')
    @HealthCheck()
    async healthChecks(): Promise<HealthCheckResult> {
        return await this.health.check([
            () => this.redisIndicator.checkHealth('redis', { client: this.redis }),
            () => this.redisIndicator.checkHealth('cluster', { client: this.cluster })
        ]);
    }
}
  • cluster
    • flat options for ClusterClientOptions (#202)

v7:

ClusterModule.forRoot({
    readyLog: true,
    config: {
        nodes: [{ host: '127.0.0.1', port: 16380 }],
        enableOfflineQueue: true,
        enableReadyCheck: true,
        scaleReads: 'all',
        redisOptions: { password: 'cluster1' }
    }
})

old:

ClusterModule.forRoot({
    readyLog: true,
    config: {
        nodes: [{ host: '127.0.0.1', port: 16380 }],
        options: {
            enableOfflineQueue: true,
            enableReadyCheck: true,
            scaleReads: 'all',
            redisOptions: { password: 'cluster1' }
        }
    }
})

Committers:

  • Jirat Ki. (@n3tr)
nestjs-redis - v7.0.0-rc.3

Published by liaoliaots over 2 years ago

7.0.0-rc.3 - 2022-03-14

Changed

  • update messages for better readability

TESTING

  • update tests for messages, utils, health
nestjs-redis - v7.0.0-rc.2

Published by liaoliaots over 2 years ago

7.0.0-rc.2 - 2022-03-12

Changed

  • update messages
  • refactor utils

TESTING

  • add tests for messages, utils, errors
nestjs-redis - v7.0.0-alpha.3

Published by liaoliaots over 2 years ago

7.0.0-alpha.3 - 2022-03-11

BREAKING CHANGES ⚠️

  • [cluster] flat options in ClusterClientOptions

v7:

ClusterModule.forRoot({
    readyLog: true,
    config: {
        nodes: [{ host: '127.0.0.1', port: 16380 }],
        enableOfflineQueue: true,
        enableReadyCheck: true,
        scaleReads: 'all',
        redisOptions: { password: 'cluster1' }
    }
})

v6:

ClusterModule.forRoot({
    readyLog: true,
    config: {
        nodes: [{ host: '127.0.0.1', port: 16380 }],
        options: {
            enableOfflineQueue: true,
            enableReadyCheck: true,
            scaleReads: 'all',
            redisOptions: { password: 'cluster1' }
        }
    }
})

Changed

  • update interface comments to be more detailed than the pre version

TESTING

  • update cluster.utils.spec.ts, e2e test