Skip to content

Commit 4e63ae4

Browse files
committed
fix: Update CI/CD and dependencies
- Add GitHub Actions workflow for Node.js CI - Move express to peerDependencies - Add prepare script for build - Add engine requirements - Fix dependency organization
1 parent 93b1515 commit 4e63ae4

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

.github/workflows/node.js.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
security:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Use Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
cache: 'npm'
19+
- run: npm ci
20+
- run: npm audit
21+
22+
test:
23+
needs: security
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
node-version: [16.x, 18.x, 20.x]
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
cache: 'npm'
35+
- run: npm ci
36+
- run: npm run build --if-present
37+
- run: npm test

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
"test": "vitest run",
3434
"test:watch": "vitest",
3535
"test:coverage": "vitest run --coverage",
36-
"clean": "rimraf dist"
36+
"clean": "rimraf dist",
37+
"prepare": "npm run build"
38+
},
39+
"peerDependencies": {
40+
"express": "^4.18.2",
41+
"@types/express": "^4.17.21"
3742
},
3843
"dependencies": {
3944
"@noble/curves": "^1.8.1",
@@ -43,7 +48,6 @@
4348
"@types/jsonwebtoken": "^9.0.8",
4449
"cors": "^2.8.5",
4550
"dotenv": "^16.3.1",
46-
"express": "^4.18.2",
4751
"express-rate-limit": "^7.5.0",
4852
"helmet": "^8.0.0",
4953
"jsonwebtoken": "^9.0.2",
@@ -52,12 +56,12 @@
5256
},
5357
"devDependencies": {
5458
"@types/cors": "^2.8.17",
55-
"@types/express": "^4.17.21",
5659
"@types/node": "^20.11.0",
5760
"@typescript-eslint/eslint-plugin": "^8.23.0",
5861
"@typescript-eslint/parser": "^8.23.0",
5962
"@vitest/coverage-v8": "^3.0.5",
6063
"eslint": "^9.19.0",
64+
"express": "^4.18.2",
6165
"rimraf": "^5.0.5",
6266
"ts-loader": "^9.5.1",
6367
"tsx": "^4.19.2",
@@ -66,5 +70,8 @@
6670
"vitest": "^3.0.5",
6771
"webpack": "^5.89.0",
6872
"webpack-cli": "^6.0.1"
73+
},
74+
"engines": {
75+
"node": ">=16.0.0"
6976
}
7077
}

0 commit comments

Comments
 (0)