-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiconList.mjs
59 lines (52 loc) · 1.88 KB
/
iconList.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import fs from "fs";
import YAML from "yaml";
const documentation =
"Add icon from [Fontawesome 6 Free](https://fontawesome.com/search)";
const settingsFile = fs.readFileSync(
"Configuration/Settings.Garagist.yaml",
"utf8",
);
const { Garagist } = YAML.parse(settingsFile);
const styles = Garagist.Fontawesome.styles.join(",");
let settingsFileLocation = Garagist.Fontawesome.settingsLocation.split("/");
settingsFileLocation[0] = "Resources";
const iconFile = fs.readFileSync(settingsFileLocation.join("/"), "utf8");
const icons = YAML.parse(iconFile);
const list = [];
for (const key in icons) {
list.push(key);
}
const setting = YAML.stringify(
{
Neos: {
Neos: {
Ui: {
frontendConfiguration: {
"Carbon.CodePen": {
afx: {
fusionObjects: {
"Garagist.Fontawesome:Component.Icon": {
documentation,
snippet:
'<Garagist.Fontawesome:Component.Icon style="${1|' +
styles +
'|}"${3: size="${4|2xs,xs,sm,lg,xl,2xl,1x,2x,3x,4x,5x,6x,7x,8x,9x,10x|}"} icon="${2|' +
list.join(",") +
'|}" />',
},
},
},
},
},
},
},
},
},
{
collectionStyle: "block",
indent: 2,
lineWidth: 0,
},
);
fs.writeFileSync("Configuration/Settings.ContentBox.yaml", setting);
console.log(`\nWrote ${list.length} icons to ContentBox settings file.\n`);