@sit-onyx/figma-utils 1.0.1 → 1.0.2-dev-20260204112334

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,12 +20,16 @@ export const fetchFigmaComponents = async (fileKey, accessToken) => {
20
20
  };
21
21
  export const fetchFigmaSVGs = async (fileKey, componentIds, accessToken) => {
22
22
  const result = await fetchFigma(`https://api.figma.com/v1/images/${fileKey}?ids=${componentIds.join()}&format=svg`, accessToken);
23
- await Promise.all(Object.entries(result.images).map(async ([id, imageUrl]) => {
24
- const response = await fetch(imageUrl);
25
- if (!response.ok) {
26
- throw new Error(`Failed to fetch SVG content for component ${id}: ${response.statusText}`);
23
+ await Promise.allSettled(Object.entries(result.images).map(async ([id, imageUrl]) => {
24
+ try {
25
+ const response = await fetch(imageUrl);
26
+ if (!response.ok)
27
+ throw new Error(response.statusText);
28
+ result.images[id] = await response.text();
29
+ }
30
+ catch (e) {
31
+ console.error(`Failed to fetch SVG content for component ${id}: ${e}`);
27
32
  }
28
- result.images[id] = await response.text();
29
33
  }));
30
34
  return result.images;
31
35
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/figma-utils",
3
3
  "description": "Utility functions and CLI for importing data from the Figma API into different formats (e.g. CSS, SCSS etc.)",
4
- "version": "1.0.1",
4
+ "version": "1.0.2-dev-20260204112334",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
7
7
  "license": "Apache-2.0",