ubie-icons
ubie-icons copied to clipboard
add figma.ts with bun
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:
- TypeScript can run as is.
- .env files can be used without any flags.
- Environment variables and Node.js built-in modules can be used in the same way as in Node.js.