Skip to content

Commit

Permalink
build: some improvements (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoliaots authored Sep 20, 2024
1 parent 470f6dc commit c783bbe
Show file tree
Hide file tree
Showing 37 changed files with 82 additions and 8,519 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ root = true

[*]
indent_style = space
indent_size = 2
indent_size = 2
charset = utf-8
48 changes: 0 additions & 48 deletions .github/ISSUE_TEMPLATE/1-bug.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "Bug report \U0001F41E"
about: Create a bug report
labels: bug
---

## Describe the bug

A clear and concise description of what the bug is.

### Steps to reproduce

Steps to reproduce the behavior.

### Expected behavior

A clear and concise description of what you expected to happen.

### Environment

- OS: [e.g. Arch Linux]
- Other details that you think may affect.

### Additional context

Add any other context about the problem here.
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

52 changes: 23 additions & 29 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
name: testing
name: Testing
on:
pull_request:
branches:
- main
jobs:
test:
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
node_version:
- 14
- 16
- 18
architecture:
- x64
name: Node.js 20
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v3
version: 9
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
node-version: 20
check-latest: true
architecture: ${{ matrix.architecture }}
- run: docker compose up -d
- run: docker compose exec -T cluster-1_master-1 redis-cli --cluster create 127.0.0.1:16380 127.0.0.1:16381 127.0.0.1:16382 --cluster-yes
- run: docker compose exec -T cluster-2_master-1 redis-cli --cluster create 127.0.0.1:16480 127.0.0.1:16481 127.0.0.1:16482 --cluster-yes
architecture: x64
cache: 'pnpm'
- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: './compose.yaml'
up-flags: '-d'
down-flags: '-v'
- run: docker compose exec cluster-m1 redis-cli -a mycluster --cluster create 127.0.0.1:7380 127.0.0.1:7381 127.0.0.1:7382 --cluster-yes
- run: pnpm install --frozen-lockfile
- run: pnpm -F "@liaoliaots/nestjs-redis" lint
- run: pnpm -F "@liaoliaots/nestjs-redis" test
- run: pnpm -F "@liaoliaots/nestjs-redis" test:e2e
- run: pnpm -F "@liaoliaots/nestjs-redis-health" lint
- run: pnpm -F "@liaoliaots/nestjs-redis-health" test
- run: pnpm -F "@liaoliaots/nestjs-redis-health" test:e2e
- run: docker compose down -v
- run: pnpm run -F "@liaoliaots/nestjs-redis" lint
- run: pnpm run -F "@liaoliaots/nestjs-redis" test
- run: pnpm run -F "@liaoliaots/nestjs-redis" test:e2e
11 changes: 0 additions & 11 deletions .prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printWidth: 120
tabWidth: 2
singleQuote: true
trailingComma: none
arrowParens: avoid
endOfLine: auto
8 changes: 4 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ services:
image: redis/redis-stack-server:latest
network_mode: host
environment:
- 'REDIS_ARGS=--port 6380 --requirepass myredis --appendonly yes'
- 'REDIS_ARGS=--port 6380 --requirepass myredis'
cluster-m1:
image: redis:latest
network_mode: host
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
cluster-m2:
image: redis:latest
network_mode: host
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
cluster-m3:
image: redis:latest
network_mode: host
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
15 changes: 8 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ import prettier from 'eslint-plugin-prettier/recommended';
// @ts-ignore
import jest from 'eslint-plugin-jest';

const jestFiles = ['packages/*/test/**/*', 'packages/**/*.spec.ts'];

export default tseslint.config(
{
ignores: ['.prettierrc.js', 'eslint.config.js', 'sample', '**/dist', 'packages/*/*.js']
ignores: ['eslint.config.js', 'packages/*/dist/', 'packages/*/*.js']
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
files: ['packages/**/test/**', 'packages/**/*.spec.ts'],
files: jestFiles,
...jest.configs['flat/recommended']
},
{
files: ['packages/**/test/**', 'packages/**/*.spec.ts'],
files: jestFiles,
...jest.configs['flat/style']
},
prettier,
Expand All @@ -28,12 +30,11 @@ export default tseslint.config(
...globals.jest
},
parserOptions: {
project: ['./packages/*/tsconfig.json'],
ecmaVersion: 'latest',
projectService: true,
tsconfigRootDir: import.meta.dirname
}
}
},
{
},
linterOptions: {
reportUnusedDisableDirectives: true
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@nestjs/common": "10.4.3",
"@nestjs/core": "10.4.3",
"@nestjs/platform-fastify": "10.4.3",
"@nestjs/terminus": "10.2.3",
"@nestjs/testing": "10.4.3",
"@tsconfig/node20": "20.1.4",
"@types/eslint__js": "8.42.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/redis/test/cluster/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { ManagerController } from './controllers/manager.controller';
return {
config: [
{
nodes: [{ host: '127.0.0.1', port: 16380 }],
redisOptions: { password: 'cluster1' }
nodes: [{ host: '127.0.0.1', port: 7380 }],
redisOptions: { password: 'mycluster' }
},
{
namespace: 'client1',
nodes: [{ host: '127.0.0.1', port: 16480 }],
redisOptions: { password: 'cluster2' }
nodes: [{ host: '127.0.0.1', port: 7380 }],
redisOptions: { password: 'mycluster' }
}
]
};
Expand Down
5 changes: 4 additions & 1 deletion packages/redis/test/redis/src/redis-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export class RedisConfigService implements RedisOptionsFactory {
commonOptions: {
host: '127.0.0.1'
},
config: [{ port: 6380 }, { namespace: 'client1', port: 6381 }]
config: [
{ port: 6380, password: 'myredis' },
{ namespace: 'client1', port: 6380, password: 'myredis' }
]
};
}
}
11 changes: 4 additions & 7 deletions pnpm-lock.yaml

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

26 changes: 0 additions & 26 deletions sample/01-testing-inject/.eslintrc.js

This file was deleted.

10 changes: 0 additions & 10 deletions sample/01-testing-inject/.prettierrc.js

This file was deleted.

4 changes: 0 additions & 4 deletions sample/01-testing-inject/.vscode/cspell.json

This file was deleted.

3 changes: 0 additions & 3 deletions sample/01-testing-inject/.vscode/settings.json

This file was deleted.

12 changes: 0 additions & 12 deletions sample/01-testing-inject/compose.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions sample/01-testing-inject/nest-cli.json

This file was deleted.

Loading

0 comments on commit c783bbe

Please sign in to comment.