-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#159 TypeScript 마이그레이션 #430
Changes from 41 commits
c15495f
ae339d2
07f181a
387aee7
318bb33
b054052
cf5da43
9723665
5dfb074
f8cbff8
e1155ab
052d144
d3bc2f0
7624238
f5ece38
5deedf9
ea89f43
db8ce7e
b6cdd88
94daf70
2a7c55f
3a2ab65
7795c73
8d58a79
a5e5739
73fc564
4af19ff
2fc3a0e
86f8b4a
2a32d96
9cfa9dc
da9de88
decef9b
9f72dc7
8804b00
21ea160
87eaf2e
a6db7d9
dd6e851
226435b
1c8dac4
7e17d5f
3ce5406
0d61e46
d90f28c
63d0891
6b6670b
9fa30bf
68ea4b6
4fea34d
c29b428
97487fb
b14e48e
1c396a2
327ba68
2f60fd9
b3b17b5
99430cd
e93d89b
84a732e
e0e99c6
d8c6919
378add6
8bf1599
5172ea5
7e5b85c
8d8bac8
be4159d
5b32009
74ba7d2
94261d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
/node_modules | ||
/dist | ||
.env | ||
.env.test | ||
.env.production | ||
.env.development | ||
.DS_store | ||
*.code-workspace | ||
*.swp | ||
/logs/*.log | ||
.vscode | ||
|
||
# AdminJS 관련 디렉토리 | ||
.adminjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules/ | ||
dist/ | ||
package.json | ||
tsconfig.json | ||
.prettierrc.json | ||
.eslintrc.cjs | ||
nodemon.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
module.exports = { | ||
env: { | ||
es2021: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"airbnb-base", | ||
"airbnb-typescript/base", | ||
"plugin:mocha/recommended", | ||
"prettier", | ||
], | ||
overrides: [ | ||
{ | ||
env: { | ||
node: true, | ||
mocha: true, | ||
}, | ||
files: [".eslintrc.{js,cjs}"], | ||
parserOptions: { | ||
sourceType: "script", | ||
}, | ||
}, | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
project: "./tsconfig.json", | ||
}, | ||
plugins: ["import", "@typescript-eslint", "mocha"], | ||
rules: { | ||
"import/extensions": [ | ||
"error", | ||
"ignorePackages", | ||
{ | ||
js: "never", // temporary fix for #159 | ||
ts: "never", | ||
}, | ||
], | ||
"import/named": "error", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
packageDir: "./", | ||
}, | ||
], | ||
"mocha/no-mocha-arrows": "off", | ||
"no-console": "error", | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
patterns: [ | ||
{ | ||
group: ["../*"], | ||
message: | ||
"Usage of relative parent imports is not allowed. Use path alias instead.", | ||
}, | ||
], | ||
}, | ||
], | ||
radix: ["error", "as-needed"], | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ | ||
prefer: "type-imports", | ||
}, | ||
], | ||
}, | ||
settings: { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts"], | ||
}, | ||
"import/resolver": { | ||
typescript: { | ||
project: ["./tsconfig.json"], | ||
}, | ||
}, | ||
}, | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
/node_modules | ||
/dist | ||
/dump | ||
.env | ||
.env.test | ||
.env.production | ||
.env.development | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
node_modules | ||
build | ||
node_modules/ | ||
dist/ | ||
package.json | ||
tsconfig.json | ||
nodemon.json |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,17 @@ | |
"main": "app.js", | ||
"scripts": { | ||
"preinstall": "npx only-allow pnpm", | ||
"start": "cross-env TZ='Asia/Seoul' npx nodemon app.js", | ||
"start": "npx tsc && tsc-alias && npx nodemon", | ||
kmc7468 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"mocha": "cross-env TZ='Asia/Seoul' NODE_ENV=test mocha --require ts-node/register --require tsconfig-paths/register --recursive --reporter spec --exit", | ||
"test": "npm run sample && cross-env TZ='Asia/Seoul' npm run mocha", | ||
"mocha": "cross-env TZ='Asia/Seoul' NODE_ENV=test mocha --recursive --reporter spec --exit", | ||
"serve": "cross-env TZ='Asia/Seoul' NODE_ENV=production node app.js", | ||
"build": "tsc && tsc-alias", | ||
"clean": "rimraf dist/", | ||
"serve": "cross-env TZ='Asia/Seoul' NODE_ENV=production node dist/index.js", | ||
"lint": "pnpm eslint .", | ||
"runscript": "cross-env TZ='Asia/Seoul' NODE_ENV=production node", | ||
"lint": "npx eslint --fix .", | ||
"sample": "cd src/sampleGenerator && npm start && cd .." | ||
"sample": "cross-env NODE_ENV=test ts-node --require tsconfig-paths/register src/sampleGenerator/index.js", | ||
"dumpDB": "cross-env NODE_ENV=test ts-node --require tsconfig-paths/register src/sampleGenerator/tools/dump.js", | ||
"restoreDB": "cross-env NODE_ENV=test ts-node --require tsconfig-paths/register src/sampleGenerator/tools/restore.js" | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 타입스크립트로 옮기는 김에 ENV를 한 폴더에 묶어놓는것을 기본 세팅으로 하고 local,dev 환경에 대한 명령어를 script에 적용하는건 어떨까요?
|
||
"engines": { | ||
"node": ">=18.0.0", | ||
|
@@ -27,12 +31,11 @@ | |
"axios": "^0.27.2", | ||
"ci": "^2.2.0", | ||
"connect-mongo": "^4.6.0", | ||
"connect-redis": "^6.1.3", | ||
"connect-redis": "^7.1.1", | ||
"cookie-parser": "^1.4.5", | ||
"cors": "^2.8.5", | ||
"cross-env": "^7.0.3", | ||
"dotenv": "^16.0.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"express": "^4.17.1", | ||
"express-formidable": "^1.2.0", | ||
"express-rate-limit": "^7.1.0", | ||
|
@@ -56,12 +59,31 @@ | |
"zod-to-json-schema": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@types/cookie-parser": "^1.4.6", | ||
"@types/cors": "^2.8.16", | ||
"@types/express": "^4.17.21", | ||
"@types/express-session": "^1.17.10", | ||
"@types/jsonwebtoken": "^9.0.5", | ||
"@types/node": "^20.9.0", | ||
"@types/node-cron": "^3.0.11", | ||
"@types/response-time": "^2.3.8", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
"@typescript-eslint/parser": "^6.13.1", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.22.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-airbnb-typescript": "^17.1.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-mocha": "^10.1.0", | ||
"mocha": "^10.2.0", | ||
"mongodb": "^4.1.0", | ||
"nodemon": "^3.0.1", | ||
"supertest": "^6.2.4" | ||
"rimraf": "^5.0.5", | ||
"supertest": "^6.2.4", | ||
"ts-node": "^10.9.2", | ||
"tsc-alias": "^1.8.8", | ||
"typescript": "^5.2.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dockerfile에서 2 Stage Build 같은거 써봐도 재밌을 것 같네요! |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 blame하니까 저네요.. 미안합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아.. lint 생각을 못하고 있었네요. CI에 lint도 같이 넣어버려야겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후 별도의 이슈/PR을 통해 작업하기로 결정하였습니다.