Skip to content

Commit 8669aa7

Browse files
Merge remote-tracking branch 'origin/main'
# Conflicts: # package.json # src/consumer/redis-messaging.consumer.ts
2 parents f508cb3 + d7465a0 commit 8669aa7

File tree

9 files changed

+55
-41
lines changed

9 files changed

+55
-41
lines changed

.github/workflows/ci.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
permissions:
8+
pull-requests: read
9+
contents: read
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 23
23+
24+
- name: Install dependencies
25+
run: yarn
26+
27+
- name: Build project
28+
run: yarn build
29+
30+
- name: Run CI
31+
run: yarn ci

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/node_modules
55
/build
66

7+
yarn.lock
8+
package-lock.json
79
# Logs
810
logs
911
*.log

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@
3535
],
3636
"scripts": {
3737
"build": "nest build",
38-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
38+
"prettier": "prettier --check \"src/**/*.ts\"",
39+
"prettier:fix": "prettier --write \"src/**/*.ts\"",
3940
"start": "nest start",
4041
"start:dev": "nest start --watch",
4142
"start:debug": "nest start --debug --watch",
4243
"start:prod": "node dist/main",
4344
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
45+
"ci": "yarn prettier",
4446
"test": "jest",
4547
"test:watch": "jest --watch",
4648
"test:cov": "jest --coverage",
4749
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
4850
"test:e2e": "jest --config ./test/jest-e2e.json"
4951
},
5052
"dependencies": {
51-
"@semantic-release/github": "^11.0.3",
52-
"bullmq": "^5.52.2",
53-
"semantic-release": "^24.2.5"
53+
"bullmq": "^5.52.2"
5454
},
5555
"peerDependencies": {
5656
"@nestjs/common": "^10.x||^11.x",
@@ -60,11 +60,15 @@
6060
"rxjs": "^7.x"
6161
},
6262
"devDependencies": {
63+
"reflect-metadata": "^0.2.0",
64+
"rxjs": "^7.x",
65+
"@nestjs/common": "^10.0.0",
66+
"@nestjs/core": "^10.0.0",
67+
"semantic-release": "^24.2.5",
68+
"@semantic-release/github": "^11.0.3",
6369
"@nestjs/cli": "^10.0.0",
6470
"@nestjs/schematics": "^10.0.0",
6571
"@nestjs/testing": "^10.0.0",
66-
"@nestjs/core": "^10.0.0",
67-
"@nestjs/common": "^10.0.0",
6872
"@nestjstools/messaging": "^3.0.0",
6973
"@types/express": "^5.0.0",
7074
"@types/jest": "^29.5.2",

src/channel/redis.channel-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { ChannelConfig } from '@nestjstools/messaging';
33
export class RedisChannelConfig extends ChannelConfig {
44
public readonly connection: Connection;
55
public readonly queue: string;
6+
/**
7+
* @description
8+
* This prefix is not used as RedisOptions keyPrefix, it is used as prefix for BullMQ
9+
* Read more: https://github.com/taskforcesh/bullmq/issues/1219#issuecomment-1113903785
10+
*/
611
public readonly keyPrefix?: string;
712

813
constructor({

src/consumer/redis-messaging.consumer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export class RedisMessagingConsumer
3838
errored: ConsumerDispatchedMessageError,
3939
channel: RedisChannel,
4040
): Promise<void> {
41+
void errored;
42+
void channel;
4143
return Promise.resolve();
4244
}
4345

src/message-bus/redis-message.bus.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export class RedisMessageBus implements IMessageBus {
88
constructor(private readonly redisChannel: RedisChannel) {}
99

1010
async dispatch(message: RoutingMessage): Promise<void> {
11-
await this.redisChannel.queue.add(message.messageRoutingKey, message.message);
11+
await this.redisChannel.queue.add(
12+
message.messageRoutingKey,
13+
message.message,
14+
);
1215
}
1316
}

test/app.e2e-spec.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/jest-e2e.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"module": "commonjs",
44
"declaration": true,
5-
"removeComments": true,
5+
"removeComments": false,
66
"emitDecoratorMetadata": true,
77
"experimentalDecorators": true,
88
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)