-
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
Parsing Figma text nodes and sending to the mocked API #2
Open
Samesma
wants to merge
37
commits into
toyota-connected:main
Choose a base branch
from
Samesma:saeid-figma-challenge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Samesma
changed the title
The app for parsing Figma text nodes and sending data to a mocked API
The app for parsing Figma text nodes
Sep 25, 2024
Samesma
changed the title
The app for parsing Figma text nodes
The app for parsing Figma text nodes and sending to the mocked API
Sep 25, 2024
Samesma
changed the title
The app for parsing Figma text nodes and sending to the mocked API
Parsing Figma text nodes and sending to the mocked API
Sep 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the requirements for parsing text nodes from a Figma design and sending the collected data to a mocked API endpoint. The script retrieves information such as text content, font size, font family, font weight, line height, and text box dimensions for all text nodes in the Figma file.
Features Implemented
FIGMA_API_TOKEN
.http://test-url.com/translations/text-parts
.Instructions
To run the script and observe its outputs, follow the steps below:
FIGMA_API_TOKEN=your_figma_api_token_here
Run the build script:
Start the server in development mode:
Make a request to fetch text node data from the default Figma file:
The response will be returned in JSON format and additionally, the result will be saved to a JSON file at ./json-files/figma_response.json and a CSV report will be generated at ./csv-files/operation_statistics.csv.
Testing
Unit, integration, and end-to-end tests have been added to ensure the correctness of the functionality.
To run the tests, execute the following command:
npm run test
Additional Notes
This PR also includes improvements to logging and error handling for better traceability and debugging.
All major code sections have been documented and are written to adhere to TypeScript best practices.
Please read the README file for more details and review the changes and let me know if further adjustments are needed.