Skip to content

Commit 188c94d

Browse files
authored
fix(icons): prevent empty string aliases (#1876)
Noticed in #1875 that currently empty strings are saved as aliases.
1 parent b953957 commit 188c94d

File tree

3 files changed

+45
-38
lines changed

3 files changed

+45
-38
lines changed

.changeset/funny-spiders-help.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@sit-onyx/figma-utils": patch
3+
"@sit-onyx/icons": patch
4+
---
5+
6+
fix(icons): prevent empty string aliases

packages/figma-utils/src/icons/parse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export const parseComponentsToIcons = (options: ParseIconComponentsOptions): Par
2929
name: component.name,
3030
aliases: component.description
3131
.split(options.aliasSeparator ?? "|")
32-
.map((alias) => alias.trim()),
32+
.map((alias) => alias.trim())
33+
.filter((i) => i !== ""),
3334
category: component.containing_frame.name.trim(),
3435
};
3536
})

packages/icons/src/metadata.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
"arrow-small-down": {
7575
"category": "Arrows",
76-
"aliases": [""]
76+
"aliases": []
7777
},
7878
"arrow-small-down-left": {
7979
"category": "Arrows",
@@ -93,7 +93,7 @@
9393
},
9494
"arrow-small-up": {
9595
"category": "Arrows",
96-
"aliases": [""]
96+
"aliases": []
9797
},
9898
"arrow-small-up-left": {
9999
"category": "Arrows",
@@ -105,7 +105,7 @@
105105
},
106106
"arrow-small-up-right-top": {
107107
"category": "Arrows",
108-
"aliases": [""]
108+
"aliases": []
109109
},
110110
"arrow-up": {
111111
"category": "Arrows",
@@ -199,7 +199,7 @@
199199
},
200200
"box-check": {
201201
"category": "Action & Interface",
202-
"aliases": [""]
202+
"aliases": []
203203
},
204204
"bread": {
205205
"category": "Kitchen & Food",
@@ -300,7 +300,7 @@
300300
},
301301
"car-electric": {
302302
"category": "Transport & Travel",
303-
"aliases": [""]
303+
"aliases": []
304304
},
305305
"car-front-1": {
306306
"category": "Transport & Travel",
@@ -462,15 +462,15 @@
462462
},
463463
"circle-contrast": {
464464
"category": "Action & Interface",
465-
"aliases": [""]
465+
"aliases": []
466466
},
467467
"circle-crypto-bitcoin": {
468468
"category": "Finance",
469469
"aliases": ["e-money", "Kreis-Krypto-Bitcoin", "Digitale Währung"]
470470
},
471471
"circle-help": {
472472
"category": "Essentials",
473-
"aliases": [""]
473+
"aliases": []
474474
},
475475
"circle-information": {
476476
"category": "Essentials",
@@ -525,7 +525,7 @@
525525
},
526526
"clipboard-shield": {
527527
"category": "File & Type",
528-
"aliases": [""]
528+
"aliases": []
529529
},
530530
"clock": {
531531
"category": "Action & Interface",
@@ -571,15 +571,15 @@
571571
},
572572
"cloud-key": {
573573
"category": "Network & Infrastructure",
574-
"aliases": [""]
574+
"aliases": []
575575
},
576576
"cloud-lock": {
577577
"category": "Network & Infrastructure",
578578
"aliases": ["secure-cloud", "cloud-access", "Cloud-Schlüssel", "Cloud-Zugang", "Wolke"]
579579
},
580580
"cloud-setting": {
581581
"category": "Network & Infrastructure",
582-
"aliases": [""]
582+
"aliases": []
583583
},
584584
"coffee-cup": {
585585
"category": "Kitchen & Food",
@@ -634,7 +634,7 @@
634634
},
635635
"compass": {
636636
"category": "Navigation",
637-
"aliases": [""]
637+
"aliases": []
638638
},
639639
"computer": {
640640
"category": "Devices & Electronics",
@@ -746,15 +746,15 @@
746746
},
747747
"container-large": {
748748
"category": "Business & Statistics",
749-
"aliases": [""]
749+
"aliases": []
750750
},
751751
"container-small": {
752752
"category": "Business & Statistics",
753-
"aliases": [""]
753+
"aliases": []
754754
},
755755
"containers": {
756756
"category": "Business & Statistics",
757-
"aliases": [""]
757+
"aliases": []
758758
},
759759
"controller": {
760760
"category": "Gamification",
@@ -803,7 +803,7 @@
803803
},
804804
"delete": {
805805
"category": "Action & Interface",
806-
"aliases": [""]
806+
"aliases": []
807807
},
808808
"detour-1": {
809809
"category": "Navigation",
@@ -827,7 +827,7 @@
827827
},
828828
"dolphin": {
829829
"category": "Software & Services",
830-
"aliases": [""]
830+
"aliases": []
831831
},
832832
"download": {
833833
"category": "Network & Infrastructure",
@@ -907,7 +907,7 @@
907907
},
908908
"engine": {
909909
"category": "Car Parts",
910-
"aliases": [""]
910+
"aliases": []
911911
},
912912
"error-flag": {
913913
"category": "Action & Interface",
@@ -1043,7 +1043,7 @@
10431043
},
10441044
"file-lock": {
10451045
"category": "File & Type",
1046-
"aliases": [""]
1046+
"aliases": []
10471047
},
10481048
"file-pdf": {
10491049
"category": "File & Type",
@@ -1094,7 +1094,7 @@
10941094
},
10951095
"file-user": {
10961096
"category": "File & Type",
1097-
"aliases": [""]
1097+
"aliases": []
10981098
},
10991099
"file-x": {
11001100
"category": "File & Type",
@@ -1152,11 +1152,11 @@
11521152
},
11531153
"folder-plus": {
11541154
"category": "File & Type",
1155-
"aliases": [""]
1155+
"aliases": []
11561156
},
11571157
"folder-settings": {
11581158
"category": "File & Type",
1159-
"aliases": [""]
1159+
"aliases": []
11601160
},
11611161
"forklift": {
11621162
"category": "Business & Statistics",
@@ -1180,7 +1180,7 @@
11801180
},
11811181
"git": {
11821182
"category": "Network & Infrastructure",
1183-
"aliases": [""]
1183+
"aliases": []
11841184
},
11851185
"glasses": {
11861186
"category": "School & Education",
@@ -1200,11 +1200,11 @@
12001200
},
12011201
"globe-network": {
12021202
"category": "Network & Infrastructure",
1203-
"aliases": [""]
1203+
"aliases": []
12041204
},
12051205
"globe-shield": {
12061206
"category": "Network & Infrastructure",
1207-
"aliases": [""]
1207+
"aliases": []
12081208
},
12091209
"graduation-hat": {
12101210
"category": "School & Education",
@@ -1621,7 +1621,7 @@
16211621
},
16221622
"new": {
16231623
"category": "Various",
1624-
"aliases": [""]
1624+
"aliases": []
16251625
},
16261626
"newspaper": {
16271627
"category": "Business & Statistics",
@@ -1701,7 +1701,7 @@
17011701
},
17021702
"parking-search": {
17031703
"category": "Transport & Travel",
1704-
"aliases": [""]
1704+
"aliases": []
17051705
},
17061706
"passenger": {
17071707
"category": "Transport & Travel",
@@ -1812,7 +1812,7 @@
18121812
},
18131813
"plus-minus": {
18141814
"category": "Essentials",
1815-
"aliases": [""]
1815+
"aliases": []
18161816
},
18171817
"plus-small": {
18181818
"category": "Essentials",
@@ -1868,7 +1868,7 @@
18681868
},
18691869
"print-dots": {
18701870
"category": "Devices & Electronics",
1871-
"aliases": [""]
1871+
"aliases": []
18721872
},
18731873
"print-drop": {
18741874
"category": "Devices & Electronics",
@@ -1880,7 +1880,7 @@
18801880
},
18811881
"print-list": {
18821882
"category": "Devices & Electronics",
1883-
"aliases": [""]
1883+
"aliases": []
18841884
},
18851885
"print-plus": {
18861886
"category": "Devices & Electronics",
@@ -1924,7 +1924,7 @@
19241924
},
19251925
"rabbitmq": {
19261926
"category": "Software & Services",
1927-
"aliases": [""]
1927+
"aliases": []
19281928
},
19291929
"radar": {
19301930
"category": "Navigation",
@@ -1968,11 +1968,11 @@
19681968
},
19691969
"rocket-plus": {
19701970
"category": "Objects",
1971-
"aliases": [""]
1971+
"aliases": []
19721972
},
19731973
"rocket-settings": {
19741974
"category": "Objects",
1975-
"aliases": [""]
1975+
"aliases": []
19761976
},
19771977
"rotate": {
19781978
"category": "Arrows",
@@ -2008,7 +2008,7 @@
20082008
},
20092009
"search-x": {
20102010
"category": "Action & Interface",
2011-
"aliases": [""]
2011+
"aliases": []
20122012
},
20132013
"send": {
20142014
"category": "Communication",
@@ -2098,7 +2098,7 @@
20982098
},
20992099
"sidebar-arrow-left": {
21002100
"category": "Action & Interface",
2101-
"aliases": [""]
2101+
"aliases": []
21022102
},
21032103
"sidebar-arrow-right": {
21042104
"category": "Action & Interface",
@@ -2202,7 +2202,7 @@
22022202
},
22032203
"store-test": {
22042204
"category": "Commerce & Shopping",
2205-
"aliases": [""]
2205+
"aliases": []
22062206
},
22072207
"stroller": {
22082208
"category": "Objects",
@@ -2364,7 +2364,7 @@
23642364
},
23652365
"tool-pencil": {
23662366
"category": "Tools & Shapes",
2367-
"aliases": [""]
2367+
"aliases": []
23682368
},
23692369
"tool-polygon": {
23702370
"category": "Tools & Shapes",
@@ -2455,7 +2455,7 @@
24552455
},
24562456
"trash-disabled": {
24572457
"category": "Action & Interface",
2458-
"aliases": [""]
2458+
"aliases": []
24592459
},
24602460
"tree": {
24612461
"category": "Weather & Climate",

0 commit comments

Comments
 (0)