Skip to content

Commit

Permalink
[Refactor] OpenAPI를 이용하여 api interface 추출하기 (#472)
Browse files Browse the repository at this point in the history
* feat: openapi spec을 이용한 api interface 생성

* feat: api interface를 가지는 fetcher 생성

* feat: 각 api에 맞는 interface 추출하기 위한 명령어 작성

* chore: 명령어 실행

* feat: gitattributes 설정

* fix: 명령어 폴더명 수정

* fix: 빌드 에러 수정
  • Loading branch information
eonseok-jeon authored Jan 27, 2025
1 parent 4729fde commit 780a1bc
Show file tree
Hide file tree
Showing 17 changed files with 6,727 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/__generated__/* linguist-generated=true
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"preview": "vite preview",
"test": "vitest",
"supportedBrowsers": "echo \"export default $(browserslist-useragent-regexp --allowHigherVersions);\" > ./src/views/UnsupportedPage/supportedBrowsers.ts",
"postinstall": "patch-package"
"postinstall": "patch-package",
"openapi-typescript": "npx openapi-typescript ./src/__generated__/api-spec.yml -o ./src/__generated__/api.d.ts",
"swagger-typescript-api": "swagger-typescript-api -p ./src/__generated__/api-spec.yml -r -o ./src/__generated__/api-types --modular -d --extract-request-body --extract-response-body --extract-response-error",
"api-spec": "yarn openapi-typescript && yarn swagger-typescript-api"
},
"browserslist": [
"> 0.3%",
Expand All @@ -43,6 +46,7 @@
"firebase": "^10.12.4",
"lottie-react": "^2.4.0",
"nanoid": "^5.0.7",
"openapi-fetch": "^0.13.0",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"react": "^18.2.0",
Expand All @@ -51,7 +55,8 @@
"react-helmet-async": "^2.0.5",
"react-hook-form": "^7.51.5",
"react-responsive": "^10.0.0",
"react-router-dom": "^6.23.1"
"react-router-dom": "^6.23.1",
"swagger-typescript-api": "^13.0.23"
},
"devDependencies": {
"@hookform/devtools": "^4.3.1",
Expand Down Expand Up @@ -80,6 +85,7 @@
"eslint-plugin-vitest": "^0.5.4",
"jsdom": "^25.0.0",
"msw": "^2.4.9",
"openapi-typescript": "^7.4.3",
"prettier": "^3.2.5",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.2.2",
Expand Down
Loading

0 comments on commit 780a1bc

Please sign in to comment.