-
Notifications
You must be signed in to change notification settings - Fork 3
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
Combinations import done #1
base: master
Are you sure you want to change the base?
Conversation
Чтобы протестировать аддон, нужно запустить с ним локальный Сторибук Это делается в пакете
|
packages/storybook-addon/src/components/CombinePanel/CombinePanel.tsx
Outdated
Show resolved
Hide resolved
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.
Было бы неплохо, если бы в README было описано как это подключить, типо:
npm install storybook-to-figma-addon
// .storybook/main.js
module.exports = {
// ...
addons: ["storybook-to-figma-addon"],
};
Хотя бы самый минимум. Ну из мелочей - было бы здорово запустить prettier
, чтобы привести код к единообразному виду. В целом есть еще места, где можно было бы типы получше описать, но это мелочи
btw, а чего ты не conventional commits используешь? |
packages/figma-plugin/src/modules/importFunctions/importVariants.ts
Outdated
Show resolved
Hide resolved
packages/figma-plugin/src/modules/importFunctions/importVariants.ts
Outdated
Show resolved
Hide resolved
packages/storybook-addon/src/components/DragWrapper/DragWrapper.tsx
Outdated
Show resolved
Hide resolved
@axaxaman подскажи у нас тут есть автоматика для |
Тут у нас нет никаких роботов, руками только |
type : RequestType.GET, | ||
timestamp: Date.now(), | ||
payload: key, | ||
} as FigmaStorageGetRequest; |
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.
А здесь и ниже точно нужен каст? Тут тайпскрипт без проблем должен типы резолвить
} | ||
} | ||
|
||
async function sendRequestAndExpectResult(request : FigmaRequest) : Promise<any | undefined> { | ||
async function sendRequestAndExpectResult(request: FigmaStorageRequest): Promise<unknown | undefined> { |
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.
А это по идее можно сделать женериком тогда каст на 26 строчке можно будет убрать
window.parent.postMessage({ pluginMessage: request }, "https://www.figma.com"); | ||
} | ||
|
||
function createPromiseForRequestResult(request: FigmaRequest): Promise<any> { | ||
function createPromiseForRequestResult(request: FigmaStorageRequest): Promise<any> { | ||
return new Promise((resolve, reject) => { | ||
window.addEventListener('message', (e) => { |
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.
А тут кажется есть проблема с тем что ивент листенеры не удаляются. Вообще я бы подумал над тем чтоб ивентлистенер создавался только один раз
P.S responce -> response
this.storybooks = await this.figmaStorage.getItem("storybooks") as Storybook[]; | ||
this.selectedId = await this.figmaStorage.getItem("selectedId") as string; |
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.
По идее тут тоже можно сделать дженерик чтоб не кастить, как по мне так красивее
No description provided.