Skip to content

Commit

Permalink
build: refactor project configurations (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoliaots authored Dec 14, 2024
1 parent ba8482c commit f902b3d
Show file tree
Hide file tree
Showing 38 changed files with 1,430 additions and 1,050 deletions.
6 changes: 0 additions & 6 deletions .editorconfig

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name: Publish
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
check-latest: true
architecture: x64
registry-url: 'https://registry.npmjs.org'
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ on:
- main
jobs:
test:
name: Node.js 20
runs-on: ubuntu-22.04
name: Node.js 22 'Jod' (LTS)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
check-latest: true
architecture: x64
cache: 'pnpm'
Expand Down
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'
- 'REDIS_ARGS=--port 6380 --requirepass myredis --appendonly yes'
cluster-m1:
image: redis:latest
network_mode: host
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes'
cluster-m2:
image: redis:latest
network_mode: host
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes'
cluster-m3:
image: redis:latest
network_mode: host
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes'
35 changes: 19 additions & 16 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';
import prettierPlugin from 'eslint-plugin-prettier/recommended';
// @ts-ignore
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import jest from 'eslint-plugin-jest';

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

const jestFiles = ['**/*.e2e-spec.ts', '**/*.spec.ts'];
export default tseslint.config(
{
ignores: ['eslint.config.mjs', 'packages/*/dist/', 'packages/*/*.mjs', 'packages/global.d.ts']
ignores: ['packages/global.d.ts', '**/dist/', '**/*.mjs']
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
{
files: jestFiles,
...jest.configs['flat/recommended']
...jest.configs['flat/recommended'],
languageOptions: {
globals: globals.jest
}
},
{
files: jestFiles,
...jest.configs['flat/style']
...jest.configs['flat/style'],
languageOptions: {
globals: globals.jest
}
},
prettierPlugin,
eslintPluginPrettierRecommended,
{
linterOptions: {
reportUnusedDisableDirectives: 'error'
},
languageOptions: {
globals: {
...globals.node,
...globals.jest
...globals.node
},
parserOptions: {
ecmaVersion: 'latest',
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
linterOptions: {
reportUnusedDisableDirectives: true
}
}
);
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,36 @@
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@eslint/js": "9.11.1",
"@nestjs/common": "10.4.4",
"@nestjs/core": "10.4.4",
"@nestjs/platform-fastify": "10.4.4",
"@nestjs/testing": "10.4.4",
"@tsconfig/node20": "20.1.4",
"@commitlint/cli": "19.6.0",
"@commitlint/config-conventional": "19.6.0",
"@eslint/js": "9.17.0",
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/platform-fastify": "10.4.15",
"@nestjs/testing": "10.4.15",
"@types/eslint__js": "8.42.3",
"@types/jest": "29.5.13",
"@types/node": "20.16.7",
"concurrently": "9.0.1",
"eslint": "9.11.1",
"@types/jest": "29.5.14",
"@types/node": "22.10.2",
"concurrently": "9.1.0",
"eslint": "9.17.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jest": "28.8.3",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-prettier": "5.2.1",
"fastify": "4.28.1",
"globals": "15.9.0",
"husky": "9.1.6",
"globals": "15.13.0",
"husky": "9.1.7",
"istanbul-badges-readme": "1.9.0",
"jest": "29.7.0",
"jest-extended": "4.0.2",
"lint-staged": "15.2.10",
"prettier": "3.3.3",
"lint-staged": "15.2.11",
"prettier": "3.4.2",
"reflect-metadata": "0.2.2",
"rimraf": "6.0.1",
"rxjs": "7.8.1",
"ts-jest": "29.2.5",
"tsc-alias": "1.8.10",
"typescript": "5.6.2",
"typescript-eslint": "8.7.0"
"typescript": "5.7.2",
"typescript-eslint": "8.18.0"
},
"engines": {
"node": ">=20",
Expand Down
4 changes: 2 additions & 2 deletions packages/node-redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
"publish:rc": "npm publish --tag rc"
},
"dependencies": {
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"peerDependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"redis": "^4.1.0"
},
"engines": {
"node": ">=16.13.0"
"node": ">=16"
},
"publishConfig": {
"access": "public"
Expand Down
21 changes: 14 additions & 7 deletions packages/redis-health/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@
"keywords": [
"redis",
"ioredis",
"node-redis",
"cluster",
"nestjs",
"nest",
"nodejs",
"node",
"typescript",
"javascript",
"health",
"healthcheck",
"healthchecks",
"diagnostics"
"healthchecks"
],
"scripts": {
"prebuild": "rimraf dist",
Expand All @@ -42,7 +40,7 @@
"publish:rc": "npm publish --tag rc"
},
"dependencies": {
"tslib": "2.7.0"
"tslib": "2.8.1"
},
"devDependencies": {
"@liaoliaots/nestjs-redis": "workspace:*"
Expand All @@ -51,10 +49,19 @@
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/terminus": "^10.0.0",
"ioredis": "^5.0.0"
"ioredis": "^5.0.0",
"redis": "^4.1.0"
},
"peerDependenciesMeta": {
"ioredis": {
"optional": true
},
"redis": {
"optional": true
}
},
"engines": {
"node": ">=16.13.0"
"node": ">=16"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/redis/.lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
'*.ts': [
'prettier --write',
'eslint --ignore-pattern "test/" --ignore-pattern "**/*.spec.ts"',
() => 'tsc --project tsconfig.build.json --noEmit'
]
};
3 changes: 0 additions & 3 deletions packages/redis/.lintstagedrc.mjs__

This file was deleted.

Loading

0 comments on commit f902b3d

Please sign in to comment.