-
Notifications
You must be signed in to change notification settings - Fork 47
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
Writing code to convert common mixin interpolation to CSS Variable #1778
Labels
bezier-codemod
Issue or PR related to bezier-codemod
enhancement
Issues or PR related to making existing features better
Comments
sungik-choi
added
the
enhancement
Issues or PR related to making existing features better
label
Dec 6, 2023
6 tasks
yangwooseong
added a commit
that referenced
this issue
Dec 13, 2023
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> <!-- Fixes #0000 --> - FIxes #1778 ## Summary <!-- Please brief explanation of the changes made --> - Mixin interpolation 을 css variable 을 사용한 스타일 코드로 변환하는 codemod 를 추가합니다. - As-is ```typescript import { styled, inputWrapperStyle, focusedInputWrapperStyle, erroredInputWrapperStyle, } from '@channel.io/bezier-react' const Wrapper = styled.div` position: relative; background-color: ${({ foundation }) => foundation?.theme?.['bg-grey-lightest']}; border-radius: 12px; ${inputWrapperStyle}; ${({ focus }) => focus && focusedInputWrapperStyle}; ${({ focus, whisper }) => focus && whisper && erroredInputWrapperStyle}; ` ``` - To-be ```typescript import { styled, css } from '@channel.io/bezier-react' const Wrapper = styled.div` position: relative; background-color: ${({ foundation }) => foundation?.theme?.['bg-grey-lightest']}; border-radius: 12px; box-shadow: var(--input-box-shadow); ${({ focus }) => focus && css` box-shadow: var(--input-box-shadow-focused); `}; ${({ focus, whisper }) => focus && whisper && css` box-shadow: var(--input-box-shadow-invalid); `}; ` ``` ## Details <!-- Please elaborate description of the changes --> - import 관련 유틸을 추가합니다. - 여러 줄에 걸친 코드로 변경할 때 인덴트까지 잘 유지하면서 변경하는 것이 쉽지 않아서, 이 부분은 사용처의 포매팅을 기대해야 할 것 같네요. ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> - No ## References <!-- Please list any other resources or points the reviewer should be aware of --> - [Ts-morph](https://ts-morph.com/) - [AST Viewer](https://ts-ast-viewer.com/#code/JYWwDg9gTgLgBAbzgKDnAzjAngGwKYAmANCmsAHZgCuMA6lAIZhh5QDK2+JqcAZhAGMq6QgElKNekxbtOebmlZRoYiXUbNWHXPOQBfPspBwA5AAEBACwblyeHADpgEAPQAjPAC9grALRQ8BgEYE2RkAQhyTDgpTSg4AF4MOQIHAmAANwADHkh0YBhncgAuOACcBkKMvABuHjcggGsAc2UqcgJfCJxoUoASBAAKJH52gkqiuD0ASkSAPh40UY6JyIB+BxhLPBA8DYBtEzdm31a8LF8cYGbLGDxMEwBdPTq0N2gCP0Z04VKARgATGAAB6vOADCjUdTSLRyF48AbDPiCYRTWYJObIoToOAAMlxWOEqihsRk2nw8LQiJGKPQJAA7pZgOgZGj5oScfi4IzmayuUoVARxCSNGS4XUskA)
github-project-automation
bot
moved this from 🏃♀️ In progress
to ✅ Done
in Bezier React
Dec 13, 2023
Closed
6 tasks
yangwooseong
added a commit
that referenced
this issue
Jan 18, 2024
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> - #1778 ## Summary <!-- Please brief explanation of the changes made --> - `inputPlaceholderStyle` mixin 에 대한 변환 로직을 codemod 에 추가하고 README를 업데이트 했습니다. ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> - No ## References <!-- Please list any other resources or points the reviewer should be aware of --> - None
6 tasks
yangwooseong
added a commit
that referenced
this issue
Jan 19, 2024
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> <!-- Fixes #0000 --> - #1778 ## Summary <!-- Please brief explanation of the changes made --> - 사용처가 매우 적긴 하지만, `${Rounding.round12}` 와 같은 경우가 interpolation 변환 codemod 에서 누락되어서 이를 추가합니다. ## Details <!-- Please elaborate description of the changes --> - Foundation 의 경우 theme, border, elevation 등을 한번에 묶어서 변환하는 codemod가 있습니다. 이것처럼 interpolation 역시 한번에 묶어서 변환하는 codemod 를 추가하고, 다음과 같이 naming 을 변경합니다. - `v2-typography-interpolation-to-css-variable` -> `v2-interpolation-to-css-variable-typography` - `v2-input-interpolation-to-css-variable` -> `v2-interpolation-to-css-variable-input` - `v2-z-index-interpolation-to-css-variable` -> `v2-interpolation-to-css-variable-z-index` - `v2-interpolation-to-css-variable`: 위 transform 들을 모두 실행 ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> - No ## References <!-- Please list any other resources or points the reviewer should be aware of --> - None
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bezier-codemod
Issue or PR related to bezier-codemod
enhancement
Issues or PR related to making existing features better
Description
styled backtick 내부의 공용 mixin interpolation을 매칭되는 CSS Variable로 변환하는 codemod 스크립트를 작성합니다.
Reasons for suggestion
styled-components를 제거하면서 더 이상 bezier-react 공용 mixin interpolation을 export 하지 않도록 바뀝니다. 이제 기존 Mixin은 CSS Variable/컴포넌트를 통해 사용해야합니다. 이를 사용처에서 쉽게 마이그레이션할 수 있도록 변환 코드 작성이 필요합니다.
Proposed solution
References
The text was updated successfully, but these errors were encountered: