-
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
Refactor/yarn berry migration: Yarn PnP 마이그레이션 #125
base: main
Are you sure you want to change the base?
Conversation
@@ -7,8 +7,9 @@ export interface SelectedOption { | |||
|
|||
const useSelect = (id: string, setValue?: Dispatch<SetStateAction<string>>) => { | |||
const selectRef = useRef<HTMLSelectElement>(null); | |||
const [selectedOption, setSelectedOption] = | |||
useState<SelectedOption | null>(null); | |||
const [selectedOption, setSelectedOption] = useState<SelectedOption | null>( |
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.
여기는 왜인지 모르겠지만 prettier 룰이 바뀐 것 같네요. husky는 터미널 커맨드로 되어있어서 상관없을 것 같은데 .. vscode 상에서 저장할 때 달라지는건지 ..? 이전이 잘못됐던건가 ..ㅎㅎ 한번 확인 부탁드려요!
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.
확인해 봤는데 prettier 룰은 제대로 적용되고 있어요. 그런데 왜 이런 변화가 생겼는지는 확인해봐야겠어요 ㅋㅋ..
다만 기존에는 prettier가 레포 내에 설치되지 않고 각자의 IDE에 설치된 prettier + 익스텐션에 의존하고 있었어서 각자의 버전에 따라 prettier가 다르게 동작했거나 아니면 또 pnp에서 prettier가 다르게 동작하고 있거나.. 그런 가능성도 있을 것 같아요.
다만 yarn pnp의 경우에는 workspace에 Typescript + ESLint + Prettier 파일 자체를 가지고 있기 때문에 더 이상 작업 환경에 따른 차이는 없을 것으로 생각돼요.
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.
다른 분들도 workspace의 Typescript 기준(PR 본문 참고)으로 해당 파일을 prettier가 어떻게 판단하나 확인해 주세요!
확인 결과 다른 파일들은 변경이 생기지 않았고 해당 부분만 괜찮으면 이대로 유지할게요.
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.
너 무 고 생 하 셨 습 니 다 👍🏻
@@ -0,0 +1,3 @@ | |||
import { Properties } from 'csstype'; |
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.
export type { CSSProperties } from 'react';
package.json에 csstype
명시하지 않아도 이렇게 가져와서 사용할 수 있을 것 같아요! 빌드까지 문제 없는거 확인했어요.
@@ -1,4 +1,4 @@ | |||
import { CSSProperties } from 'react'; | |||
import type { CSSProperties } from '@utils'; |
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.
그리고 여기만 import type으로 명시되어있는데 통일하는게 좋지 않을까요?
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.
import { css } from '@emotion/react';
import type { FlexContainerProps } from '@utils';
export const flexboxStyle = ({
flexDirection = 'row',
flexWrap = 'nowrap',
alignContent = 'normal',
alignItems = 'center',
justifyContent = 'center',
gap = '1rem',
}: FlexContainerProps = {}) => {
return css({
display: 'flex',
flexDirection,
flexWrap,
alignContent,
alignItems,
justifyContent,
gap,
});
};
그리고 이렇게 수정하는게 더 좋을 것 같아요. 중복해서 정의된 타입을 제거하고 반환값 타입이 SerializedStyle로 추론되도록 하는 코드에요. 수정이 좀 있지만 빌드 이슈랑 관련이 있어서 이 PR에 들어가도 괜찮지 않을까 ..ㅎㅎ
🤠 개요
💫 설명
확인해야 할 사항
Typescript: Select Typescript Version
을 선택하고 아래와 같은 workspace version이 보이는지 확인해 주세요!.vscode/settings.json
에 아래 옵션 추가의존성 패키지 관련
react-icons
를 재설치했어요. 이유는 기존 설치되어 있던@react-icons/all-files
를 실제 사용하는 코드에서react-icons
라는 이름으로 import하고 있기 때문이에요. 이때문에 yarn pnp 환경에서 제대로 resolve되지 않아요.크로마틱 관련
그 외
CSSProperties
타입을 cds 내에 포함했어요. 이 코멘트에 자세한 이유가 있어요.이 PR을 머지하기 전에 아래 프로세스가 제대로 동작하는지 확인해야해요.
이 작업이 머지되면 아래 이슈를 해결해야 해요.