Skip to content
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

TypeScript 지원 #159

Closed
2 of 12 tasks
withSang opened this issue Oct 22, 2022 · 1 comment · Fixed by #430
Closed
2 of 12 tasks

TypeScript 지원 #159

withSang opened this issue Oct 22, 2022 · 1 comment · Fixed by #430
Assignees
Labels
d-needed (Discussion Needed) 의논 필요 ⚒ enhancement New feature or request

Comments

@withSang
Copy link
Member

withSang commented Oct 22, 2022

Summary

타입스크립트 지원을 추가합니다.
낮은 이슈 번호에서 볼 수 있듯이 만들어진 지 조금 된 이슈입니다. 아자아자!
#322 #404 가 닫힌 이후에 완료되어야 합니다.

Tasks

  • 타입스크립트 레포 설정
    • 타입스크립트 & ESLint 설정
    • CommonJS 대신 ES module 도입 Apply ES module import/export #32
    • Path alias 설정
      • ESLint를 사용한 Path alias 사용 강제는 다음 이슈에서 해결하려고 합니다.
    • Type Coverage 설정
  • 기존 로직 일부 TypeScript로 이전
    • 테스트 코드
  • Mongoose 스키마에 타입스크립트 적용
    • projection, populate 등 쿼리에 타입 적용
  • API 타입 taxi-front와 공유
    • (논의 필요) API 타입 공유 방식 결정(모노레포? 패키지 publish? submodule?)
    • API 타입 공유 구현

이 체크리스트에 명시되지 않은 태스크는 레포지토리 타입스크립트 도입에 핵심적이지 않다고 판단된 것들입니다. 별도로 이슈를 개설해 차차 작업해 나가려고 합니다.

Notes

@UrWrstNightmare 님의 조언들 (감사합니다... 감사합니다...)

  1. taxi-front, taxi-back 간 API 규격을 공유하는 방법은 여러가지가 있다고 하십니다.
    1. 공통적으로 사용되는 타입을 package로 게시하기
      • npmjs(sparcs-kaist 계정)를 사용할 수도 있고, nexus와 같이 패키지 레포지토리를 직접 운영할 수도 있습니다. 인터페이스 버전을 package.json으로 관리할 수 있어 장점이라고 합니다.
    2. git submodule 형태로 공통된 패키지 관리
      • 이 경우 인터페이스 버전 관리는 힘들어 보입니다.
    3. swagger를 이용한 type generation
      • openapi-typescript 패키지 등을 사용해 이미 만들어진 swagger spec으로부터 타입을 생성합니다. 프론트엔드와 백엔드가 다른 언어를 사용하는 경우(TypeScript/Java 등)에 유용합니다. 둘 다 TypeScript를 사용하면 이런 도구까지는 필요가 없다고 합니다.
  2. 인터페이스가 바뀔 때에는, 인터페이스 패키지를 먼저 업데이트하고, 새로운 인터페이스 규격에 맞게 프론트엔드와 백엔드를 각각 작업하는 게 좋습니다.
    • 인터페이스 업데이트의 담당이 어느 한 쪽으로 정해지면, 두 레포에서 공통적으로 사용하는 인터페이스의 버전을 올리는 것이 힘들어집니다.
@withSang withSang added the ⚒ enhancement New feature or request label Oct 22, 2022
@withSang withSang self-assigned this Oct 22, 2022
@withSang
Copy link
Member Author

withSang commented Oct 6, 2023

Mongoose typescript 문서 따르면 Mongoose 쪽은 금방 될 수도,...

@withSang withSang added the d-needed (Discussion Needed) 의논 필요 label Oct 7, 2023
@withSang withSang linked a pull request Nov 7, 2023 that will close this issue
@withSang withSang changed the title Add typescript support TypeScript 지원 Nov 7, 2023
kmc7468 added a commit that referenced this issue Nov 12, 2024
Compile errors will be fixed later
kmc7468 added a commit that referenced this issue Nov 12, 2024
Compile errors will be fixed later
kmc7468 added a commit that referenced this issue Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d-needed (Discussion Needed) 의논 필요 ⚒ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants