Skip to content

Commit 88190f1

Browse files
committed
[add] TypeORM models of COVID-19 Pandemic Data
[optimize] upgrade to Node.js 20, PNPM 9, ESLint 8, Husky 9 & other latest Upstream packages
1 parent 3939abd commit 88190f1

File tree

11 files changed

+4867
-99
lines changed

11 files changed

+4867
-99
lines changed

.eslintrc.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
"rules": {
1414
"no-ex-assign": "warn",
1515
"require-atomic-updates": "warn",
16-
"@typescript-eslint/camelcase": "warn",
17-
"@typescript-eslint/explicit-function-return-type": "off",
18-
"@typescript-eslint/ban-ts-ignore": "warn"
16+
"@typescript-eslint/explicit-function-return-type": "off"
1917
}
2018
}

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

.husky/pre-push

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run build

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
registry=https://registry.npm.taobao.org
1+
auto-install-peers = false

package.json

+28-35
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
22
"name": "@wuhan2020/rest-api",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Node.js Back-end project scaffold based on Koa, TypeScript & LeanCloud",
55
"author": "shiy2008@gmail.com",
66
"private": true,
77
"main": "dist/index.js",
88
"engines": {
9-
"node": "^12.0.0"
9+
"node": ">=20"
1010
},
1111
"dependencies": {
12-
"class-transformer": "^0.2.3",
13-
"class-validator": "0.11.0",
14-
"kcors": "^2.2.2",
15-
"koa": "^2.11.0",
16-
"koa-bodyparser": "^4.2.1",
12+
"@koa/cors": "^5.0.0",
13+
"@koa/multer": "^3.0.2",
14+
"@koa/router": "^13.0.0",
15+
"class-transformer": "^0.5.1",
16+
"class-validator": "0.14.1",
17+
"koa": "^2.15.3",
18+
"koa-bodyparser": "^4.4.1",
1719
"koa-logger": "^3.2.1",
18-
"koa-multer": "^1.0.2",
19-
"koa-router": "^8.0.6",
2020
"leancloud-storage": "^3.15.0",
21-
"leanengine": "^3.5.0",
22-
"reflect-metadata": "^0.1.13",
23-
"routing-controllers": "^0.8.0"
21+
"leanengine": "^3.8.0",
22+
"reflect-metadata": "^0.2.2",
23+
"routing-controllers": "^0.10.4",
24+
"typeorm": "^0.3.20"
2425
},
2526
"devDependencies": {
26-
"@types/koa": "^2.11.0",
27-
"@types/koa-bodyparser": "^4.3.0",
28-
"@types/koa-logger": "^3.1.1",
29-
"@types/koa-multer": "^1.0.0",
30-
"@types/koa-router": "^7.4.0",
31-
"@typescript-eslint/eslint-plugin": "^2.19.0",
32-
"@typescript-eslint/parser": "^2.19.0",
33-
"eslint": "^6.8.0",
34-
"husky": "^4.2.1",
35-
"lint-staged": "^10.0.7",
36-
"nodemon": "^2.0.2",
37-
"prettier": "^1.19.1",
38-
"ts-node": "^8.6.2",
39-
"typescript": "^3.7.5"
27+
"@types/koa": "^2.15.0",
28+
"@types/koa-bodyparser": "^4.3.12",
29+
"@types/koa-logger": "^3.1.5",
30+
"@types/koa__multer": "^2.0.7",
31+
"@typescript-eslint/eslint-plugin": "^8.5.0",
32+
"@typescript-eslint/parser": "^8.5.0",
33+
"eslint": "^8.57.0",
34+
"husky": "^9.1.5",
35+
"lint-staged": "^15.2.10",
36+
"nodemon": "^3.1.4",
37+
"prettier": "^3.3.3",
38+
"ts-node": "^10.9.2",
39+
"typescript": "~5.6.2"
4040
},
4141
"prettier": {
4242
"singleQuote": true,
@@ -51,25 +51,18 @@
5151
]
5252
},
5353
"lint-staged": {
54-
"*.{md,json,yml}": [
55-
"prettier --write"
56-
],
54+
"*.{md,json,yml}": "prettier --write",
5755
"*.ts": [
5856
"prettier --write",
5957
"eslint --fix"
6058
]
6159
},
6260
"scripts": {
61+
"prepare": "husky",
6362
"test": "lint-staged",
6463
"dev": "nodemon --inspect --watch source/**/* -e ts --exec node -r ts-node/register source/",
6564
"build": "tsc",
6665
"deploy": "lint-staged && tsc && lean deploy",
6766
"start": "node dist/"
68-
},
69-
"husky": {
70-
"hooks": {
71-
"pre-commit": "npm test",
72-
"pre-push": "npm run build"
73-
}
7467
}
7568
}

0 commit comments

Comments
 (0)