Skip to content

Commit cd3fd6a

Browse files
Merge pull request #372 from florianstahr/feature/ionicons-5
ADD: Ionicons 5
2 parents 50e6a91 + 356e139 commit cd3fd6a

8 files changed

Lines changed: 158 additions & 5 deletions

File tree

.yarn/install-state.gz

-5.7 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ Icon Library|License|Version|Count
6262
[Font Awesome](https://fontawesome.com/)|[CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)|5.12.1
6363
0d1f27efb836eb2ab994ba37221849ed64a73e5c|1560
6464
[Ionicons](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|4.6.3|696
65+
[Ionicons 5](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|5.2.3|1300
6566
[Material Design icons](http://google.github.io/material-design-icons/)|[Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)|3.0.1|960
6667
[Typicons](http://s-ings.com/typicons/)|[CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)|2.0.9|336
6768
[Github Octicons icons](https://octicons.github.com/)|[MIT](https://github.com/primer/octicons/blob/master/LICENSE)|8.5.0|184
6869
[Feather](https://feathericons.com/)|[MIT](https://github.com/feathericons/feather/blob/master/LICENSE)|4.28.0|286
69-
[Game Icons](https://game-icons.net/)|[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)|a53463d41d4f055fa71097ae74da4c508c9bb09d|3391
70+
[Game Icons](https://game-icons.net/)|[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)|e510027a83a79e44673022a25e93b306a9165a21|3786
7071
[Weather Icons](https://erikflowers.github.io/weather-icons/)|[SIL OFL 1.1](http://scripts.sil.org/OFL)|2.0.10|219
7172
[Devicons](https://vorillaz.github.io/devicons/)|[MIT](https://opensource.org/licenses/MIT)|1.8.0|192
7273
[Ant Design Icons](https://github.com/ant-design/ant-design-icons)|[MIT](https://opensource.org/licenses/MIT)|4.0.0|788

packages/react-icons/VERSIONS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Icon Library|License|Version|Count
33
[Font Awesome](https://fontawesome.com/)|[CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)|5.12.1
44
0d1f27efb836eb2ab994ba37221849ed64a73e5c|1560
55
[Ionicons](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|4.6.3|696
6+
[Ionicons 5](https://ionicons.com/)|[MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE)|5.2.3|1300
67
[Material Design icons](http://google.github.io/material-design-icons/)|[Apache License Version 2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)|3.0.1|960
78
[Typicons](http://s-ings.com/typicons/)|[CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)|2.0.9|336
89
[Github Octicons icons](https://octicons.github.com/)|[MIT](https://github.com/primer/octicons/blob/master/LICENSE)|8.5.0|184
910
[Feather](https://feathericons.com/)|[MIT](https://github.com/feathericons/feather/blob/master/LICENSE)|4.28.0|286
10-
[Game Icons](https://game-icons.net/)|[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)|a53463d41d4f055fa71097ae74da4c508c9bb09d|3391
11+
[Game Icons](https://game-icons.net/)|[CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)|e510027a83a79e44673022a25e93b306a9165a21|3786
1112
[Weather Icons](https://erikflowers.github.io/weather-icons/)|[SIL OFL 1.1](http://scripts.sil.org/OFL)|2.0.10|219
1213
[Devicons](https://vorillaz.github.io/devicons/)|[MIT](https://opensource.org/licenses/MIT)|1.8.0|192
1314
[Ant Design Icons](https://github.com/ant-design/ant-design-icons)|[MIT](https://opensource.org/licenses/MIT)|4.0.0|788

packages/react-icons/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@
3333
"glob": "^7.1.6",
3434
"glob-promise": "^3.4.0",
3535
"ionicons": "^4.4.4",
36+
"ionicons-5": "npm:ionicons@5",
3637
"lerna": "^3.20.2",
3738
"octicons": "^8.1.0",
3839
"prettier": "^1.19.1",
40+
"renamer": "^1.0.0",
41+
"rimraf": "^2.6.2",
42+
"svgo": "^1.3.2",
3943
"typescript": "^3.4.5"
4044
},
4145
"scripts": {
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
const SVGO = require("svgo");
2+
3+
const svgo = new SVGO({
4+
plugins: [
5+
{
6+
cleanupAttrs: true,
7+
},
8+
{
9+
removeDoctype: true,
10+
},
11+
{
12+
removeXMLProcInst: true,
13+
},
14+
{
15+
removeComments: true,
16+
},
17+
{
18+
removeMetadata: true,
19+
},
20+
{
21+
removeTitle: true,
22+
},
23+
{
24+
removeDesc: true,
25+
},
26+
{
27+
removeUselessDefs: true,
28+
},
29+
{
30+
removeEditorsNSData: true,
31+
},
32+
{
33+
removeEmptyAttrs: true,
34+
},
35+
{
36+
removeHiddenElems: true,
37+
},
38+
{
39+
removeEmptyText: true,
40+
},
41+
{
42+
removeEmptyContainers: true,
43+
},
44+
{
45+
removeViewBox: false,
46+
},
47+
{
48+
cleanupEnableBackground: true,
49+
},
50+
{
51+
convertStyleToAttrs: true,
52+
},
53+
{
54+
convertColors: {
55+
currentColor: true,
56+
},
57+
},
58+
{
59+
convertPathData: true,
60+
},
61+
{
62+
convertTransform: true,
63+
},
64+
{
65+
removeUnknownsAndDefaults: true,
66+
},
67+
{
68+
removeNonInheritableGroupAttrs: true,
69+
},
70+
{
71+
removeUselessStrokeAndFill: true,
72+
},
73+
{
74+
removeUnusedNS: true,
75+
},
76+
{
77+
cleanupIDs: true,
78+
},
79+
{
80+
cleanupNumericValues: true,
81+
},
82+
{
83+
moveElemsAttrsToGroup: true,
84+
},
85+
{
86+
moveGroupAttrsToElems: true,
87+
},
88+
{
89+
collapseGroups: true,
90+
},
91+
{
92+
removeRasterImages: false,
93+
},
94+
{
95+
mergePaths: true,
96+
},
97+
{
98+
convertShapeToPath: true,
99+
},
100+
{
101+
sortAttrs: true,
102+
},
103+
{
104+
removeDimensions: true,
105+
},
106+
{
107+
removeAttributesBySelector: {
108+
selector: "*:not(svg)",
109+
attributes: ["stroke"],
110+
},
111+
},
112+
{
113+
removeAttrs: { attrs: "data.*" },
114+
},
115+
],
116+
});
117+
118+
module.exports = {
119+
svgo,
120+
};

packages/react-icons/scripts/task_all.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const { icons } = require("../src/icons");
66

77
const { iconRowTemplate, iconsEntryTemplate } = require("./templates");
88
const { getIconFiles, convertIconData, rmDirRecursive } = require("./logics");
9+
const { svgo } = require("./svgo");
910

1011
async function dirInit({ DIST, LIB, rootDir }) {
1112
const ignore = (err) => {
@@ -73,7 +74,11 @@ async function writeIconModule(icon, { DIST, LIB, rootDir }) {
7374
const files = await getIconFiles(content);
7475

7576
for (const file of files) {
76-
const svgStr = await fs.readFile(file, "utf8");
77+
const svgStrRaw = await fs.readFile(file, "utf8");
78+
const svgStr = content.processWithSVGO
79+
? await svgo.optimize(svgStrRaw).then((result) => result.data)
80+
: svgStrRaw;
81+
7782
const iconData = await convertIconData(svgStr, content.multiColor);
7883

7984
const rawName = path.basename(file, path.extname(file));

packages/react-icons/scripts/task_files.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const { icons } = require("../src/icons");
66

77
const { iconRowTemplate } = require("./templates");
88
const { getIconFiles, convertIconData, rmDirRecursive } = require("./logics");
9+
const { svgo } = require("./svgo");
910

1011
async function dirInit({ DIST, LIB, rootDir }) {
1112
const ignore = (err) => {
@@ -42,7 +43,11 @@ async function writeIconModuleFiles(icon, { DIST, LIB, rootDir }) {
4243
const files = await getIconFiles(content);
4344

4445
for (const file of files) {
45-
const svgStr = await fs.readFile(file, "utf8");
46+
const svgStrRaw = await fs.readFile(file, "utf8");
47+
const svgStr = content.processWithSVGO
48+
? await svgo.optimize(svgStrRaw).then((result) => result.data)
49+
: svgStrRaw;
50+
4651
const iconData = await convertIconData(svgStr, content.multiColor);
4752

4853
const rawName = path.basename(file, path.extname(file));

packages/react-icons/src/icons/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
},
2525
{
2626
id: "io",
27-
name: "Ionicons",
27+
name: "Ionicons 4",
2828
contents: [
2929
{
3030
files: path.resolve(
@@ -38,6 +38,23 @@ module.exports = {
3838
license: "MIT",
3939
licenseUrl: "https://github.com/ionic-team/ionicons/blob/master/LICENSE",
4040
},
41+
{
42+
id: "io5",
43+
name: "Ionicons 5",
44+
contents: [
45+
{
46+
files: path.resolve(
47+
__dirname,
48+
"../../../../node_modules/ionicons-5/dist/svg/*.svg"
49+
),
50+
formatter: (name) => `Io${name}`,
51+
processWithSVGO: true,
52+
},
53+
],
54+
projectUrl: "https://ionicons.com/",
55+
license: "MIT",
56+
licenseUrl: "https://github.com/ionic-team/ionicons/blob/master/LICENSE",
57+
},
4158
{
4259
id: "md",
4360
name: "Material Design icons",

0 commit comments

Comments
 (0)