-
Notifications
You must be signed in to change notification settings - Fork 2
Chore(client): Swagger 인증 적용에 따른 openapi-typescript 타입 생성 스크립트 수정 #260
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
Open
jogpfls
wants to merge
2
commits into
develop
Choose a base branch
from
chore/script-openapi/259
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,10 @@ | ||
| VITE_BASE_URL= 'API 기본 URL' | ||
| VITE_SENTRY_DSN='센트리DSN' | ||
| # API | ||
| VITE_API_BASE_URL= | ||
|
|
||
| # Sentry | ||
| VITE_SENTRY_DSN= | ||
| VITE_SENTRY_RELEASE= | ||
|
|
||
| # Swagger 인증 | ||
| SWAGGER_USERNAME= | ||
| SWAGGER_PASSWORD= |
This file contains hidden or 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 contains hidden or 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,28 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| # 필수 환경변수 검증 | ||
| : "${SWAGGER_USERNAME:?SWAGGER_USERNAME이 .env에 필요합니다}" | ||
| : "${SWAGGER_PASSWORD:?SWAGGER_PASSWORD가 .env에 필요합니다}" | ||
| : "${VITE_API_BASE_URL:?VITE_API_BASE_URL이 .env에 필요합니다}" | ||
|
|
||
| DOCS_URL="${VITE_API_BASE_URL%/}/v3/api-docs" | ||
| OUTPUT="src/shared/apis/schema.d.ts" | ||
|
|
||
| #종료 시 임시 파일 삭제 | ||
| TMP_FILE=$(mktemp) | ||
| trap 'rm -f "$TMP_FILE"' EXIT | ||
|
|
||
| # curl 설정 전체를 stdin으로 전달 — URL/자격증명의 ps 노출 방지 | ||
| curl --config - <<EOF | ||
| url = "$DOCS_URL" | ||
| user = "$SWAGGER_USERNAME:$SWAGGER_PASSWORD" | ||
| output = "$TMP_FILE" | ||
| fail | ||
| silent | ||
| show-error | ||
| EOF | ||
|
|
||
| pnpm exec openapi-typescript "$TMP_FILE" -o "$OUTPUT" | ||
|
|
||
| echo "✅ 타입 생성 완료: $OUTPUT" | ||
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.
이 스크립트를 실행하면 schema.d.ts 파일이 위의 경로에 설치되는데,
develop 브랜치에서는 schema.d.ts의 경로가
apps/client/src/shared/types/schema.d.ts에 있어요.기존
apis/types에서는 모두apps/client/src/shared/types/schema.d.ts이 경로를 참조하고 있어서import 경로를 다시 수정해주면 좋아보이네요 :D