ubie-oss / ubie-icons

https://ubie-oss.github.io/ubie-icons/storybook-static/
MIT License
27 stars 3 forks source link

add figma.ts with bun #36

Open takanorip opened 4 months ago

takanorip commented 4 months ago

I have rewritten the script for downloading SVGs from Figma in TypeScript, and made it runnable on Bun. https://bun.sh/

While Bun has some problems of making it difficult to check differences in the lock file, there are means provided to check differences on Git, and since this repository only contains small scripts, I consider it not to be a problem. https://bun.sh/docs/install/lockfile

motivation

Although the values are obtained from Figma's API, I feel that maintainability is low because we have to read the documentation to find out what structure of data is returned from the API. Figma has published typescript types for its REST API, which will allow API responses to be typed, making them easier to develop. https://github.com/figma/rest-api-spec

The reasons for adopting Bun are the following 3 points:

jmblog commented 4 months ago

@takanorip Can you please share the motivations behind rewriting the script in TypeScript?

takanorip commented 4 months ago

@jmblog Sorry, I forgot to mention why I wanted to rewrite it in Typescript. The main reason is that I wanted to type the API response, as I added in the description.