-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
c15495f
Fix: skip validation for trust proxy setting in rate-limit middleware
withSang ae339d2
Merge remote-tracking branch 'origin/dev' into #159-add-typescript-su…
withSang 07f181a
Merge branch 'origin/main'
withSang 387aee7
Fix: validate proxy in rateLimit middleware
withSang 318bb33
Merge remote-tracking branch 'origin/dev' into #159-add-typescript-su…
withSang b054052
fix(github): disable unit test
withSang cf5da43
feat(typescript): init typescript project
withSang 9723665
feat(typescript): type index.ts
withSang 5dfb074
Refactor: add path alias
withSang f8cbff8
Add: add rules for typescript-eslint
withSang e1155ab
Add: type definitions for some middlewares
withSang 052d144
Add: type definitions for templates
withSang d3bc2f0
Merge branch 'dev' into #159-add-typescript-support
kmc7468 7624238
Fix: compile error
kmc7468 f5ece38
Refactor: migrate middlewares/ajv to TS
kmc7468 5deedf9
Refactor: migrate modules/stores/mongo to TS
kmc7468 ea89f43
Refactor: mongo.ts
kmc7468 db8ce7e
Refactor: migrate modules/stores/aws to TS
kmc7468 b6cdd88
Refactor: migrate modules/stores/sessionStore to TS
kmc7468 94daf70
Refactor: migrate some files in modules directory to TS
kmc7468 2a7c55f
Refactor: move types directory into src directory
kmc7468 3a2ab65
Refactor: update tsconfig.json
kmc7468 7795c73
Refactor: migrate modules/fcm to TS
kmc7468 8d58a79
Refactor: migrate populate directory to TS
kmc7468 a5e5739
Merge branch 'dev' into #159-add-typescript-support
kmc7468 73fc564
Fix: prettier TypeScript parsing error
kmc7468 4af19ff
Refactor: apply prettier
kmc7468 2fc3a0e
Merge branch 'dev' into #159-add-typescript-support
kmc7468 86f8b4a
Remove: all references to lottery module from outside lottery module
kmc7468 2a32d96
Fix: runtime errors
kmc7468 9cfa9dc
Merge branch 'dev' into #159-add-typescript-support
kmc7468 da9de88
Refactor: merge two package.json files into one file
kmc7468 decef9b
Fix: dumpDB and restoreDB scripts
kmc7468 9f72dc7
Add: ts-node dev dependency
kmc7468 8804b00
Fix: test script
kmc7468 21ea160
Fix: test error in TypeScript environment
kmc7468 87eaf2e
Refactor: migrate routes/users and services/users to ts
MinjaeKimmm a6db7d9
Fix: Updated one import in users
MinjaeKimmm dd6e851
Merge branch 'dev' into #159-add-typescript-support
kmc7468 226435b
Fix: merge conflicts
kmc7468 1c8dac4
Refactor: enable CI
kmc7468 7e17d5f
Fix: loadenv 를 As-Is에서 사용하던 Nested object로 변경하였습니다
cokia 3ce5406
Refactor: middlewares
kmc7468 0d61e46
Merge branch '#159-add-typescript-support' of https://github.com/spar…
kmc7468 d90f28c
Revert "Fix: loadenv 를 As-Is에서 사용하던 Nested object로 변경하였습니다"
kmc7468 63d0891
Refactor: use ts-node for local development
kmc7468 6b6670b
Refactor: ts conversion
TaehyeonPark 9fa30bf
Merge branch '#159-add-typescript-support' of https://github.com/spar…
TaehyeonPark 68ea4b6
Refactor: ts conversion
TaehyeonPark 4fea34d
Refactor: apply new coding conventions on loadenv.ts
kmc7468 c29b428
Refactor: convention
kmc7468 97487fb
Refactor: import convention
TaehyeonPark b14e48e
Refactor: convention 2
kmc7468 1c396a2
Refactor: convention 3
kmc7468 327ba68
Refactor: esm convention
TaehyeonPark 2f60fd9
Refactor: tsconfig.json
kmc7468 b3b17b5
Refactor: convention 4
kmc7468 99430cd
Refactor: @ convention
TaehyeonPark e93d89b
Fix: redis undefined error
kmc7468 84a732e
Fix: jwt undefiend error
kmc7468 e0e99c6
Fix: minor bugs
kmc7468 d8c6919
Refactor: type
TaehyeonPark 378add6
Merge branch '#159-add-typescript-support' of https://github.com/spar…
TaehyeonPark 8bf1599
Refactor: es6
TaehyeonPark 5172ea5
Fix: scripts
kmc7468 7e5b85c
Refactor: unused fs
TaehyeonPark 8d8bac8
fix: user null
MinjaeKimmm be4159d
fix: change 500 to 400
MinjaeKimmm 5b32009
fix: matched response to test case
MinjaeKimmm 74ba7d2
fix: add space
MinjaeKimmm 94261d5
fix: minor stuff
MinjaeKimmm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
{ | ||
"ignore": ["node_modules/*"], | ||
"env": { | ||
"TZ": "Asia/Seoul", | ||
"NODE_ENV": "development" | ||
} | ||
} | ||
"ignore": ["node_modules"], | ||
"watch": ["src", ".env.development"], | ||
"ext": "js,json,ts", | ||
"exec": "ts-node --require tsconfig-paths/register src", | ||
"env": { | ||
"TZ": "Asia/Seoul", | ||
"NODE_ENV": "development" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
"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", | ||
"runscript": "cross-env TZ='Asia/Seoul' NODE_ENV=production node", | ||
"lint": "npx eslint --fix .", | ||
"sample": "cd src/sampleGenerator && npm start && cd .." | ||
"start": "nodemon", | ||
"mocha": "cross-env TZ='Asia/Seoul' NODE_ENV=test mocha --require ts-node/register --require tsconfig-paths/register --recursive --reporter spec --exit", | ||
"test": "pnpm run sample && cross-env TZ='Asia/Seoul' pnpm run mocha", | ||
"build": "tsc --project tsconfig.build.json && 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 ts-node --require tsconfig-paths/register", | ||
"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" | ||
}, | ||
"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 같은거 써봐도 재밌을 것 같네요! |
||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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을 통해 작업하기로 결정하였습니다.