Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@opendesign/octopus-fig
Advanced tools
Figma HTTP API format to Octopus 3 converter.
yarn add @opendesign/octopus-fig
If missing .env
file, make a copy of .env.example
and rename it to .env
and fill correct info.
Variable | Type | Description |
---|---|---|
NODE_ENV | production / development / debug | Node environment |
LOG_LEVEL | fatal / error / warn / info / debug / trace / silent | Log level |
There are three main processing steps:
EventEmitter
instance produced by a reader)Readers used in other Octopus converters return SourceDesign
instance, which is an object with static values inside.
In case of Figma, we have slightly different approach because of it's asynchronous origin (requesting values using HTTP).
So, to provide source data as fast as possible to the converter we use EventEmitter
inside of Figma Reader's SourceDesign
instance.
This makes it possible to process data almost as fast as it's downloaded from Figma's API.
Although you can define the way of reading assets or exporting results yourself (create your own reader/exporter class), you can also choose between existing ones:
Check examples/node/convert-api-local.ts
for example usage in automated runs.
Check examples/node/convert-api-debug.ts
for example usage in custom manual runs.
Check examples/web/
for more details about usage in web browsers.
Check src/services/exporters/
for more details about exporters.
Check src/services/readers/
for more details about readers
Converts your Figma designs from API into Octopus3+ format.
Before you start you need to add your Figma API token into .env
file.
Then you need to find FIGMA_DESIGN_HASH
for the design you want to convert.
You can find it in the URL of the design: https://www.figma.com/file/__HERE__/...
ENV variables for our demo scripts which are located in /
examples/node/*`
Variable | Type | Description |
---|---|---|
API_TOKEN | string | Figma API token |
SHOULD_RENDER | boolean | if true will trigger ODE rendering when octopus3.json is ready |
ODE_RENDERER_CMD | string | path to ODE renderer command (e.g. ode-renderer-cli) |
ODE_IGNORE_VALIDATION | boolean | ignores the ODE rendering validation |
FONTS_PATH | string | path to directory with fonts |
Designed for manual runs using figma-parser.
yarn
yarn convert:api:debug FIGMA_DESIGN_HASH
Designed for running in automated runs using figma-parser.
yarn
yarn convert:api:local FIGMA_DESIGN_HASH
Designed for manual runs using Squid Figma plugin data.
yarn
yarn convert:squid:debug PATH_TO/SQUID_PLUGIN_DATA.json
Designed for running in automated runs using Squid Figma plugin data.
yarn
yarn convert:squid:local PATH_TO/SQUID_PLUGIN_DATA.json
Run yarn bundle
and then open examples/web/index.html
in live server
Look for Result:
in console output.
Command yarn typedoc
will generate TypeDoc documentation for public Classes into ./docs
folder
yarn test
Runs Unit & Integration tests.
yarn test:unit
Runs Unit tests using jest framework.
yarn test:integration
Runs Integration tests using our custom framework.
Tries to convert octopus components
+ manifest
for saved designs and compares them using jsondiffpatch
with saved expected output.
FAQs
Figma HTTP API format to Octopus 3+ converter.
The npm package @opendesign/octopus-fig receives a total of 190 weekly downloads. As such, @opendesign/octopus-fig popularity was classified as not popular.
We found that @opendesign/octopus-fig demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.