Skip to content

Commit e2b46ea

Browse files
karsa-mistmereKarsajguddas
authored
feat(icons): add deprecationReason and alias deprecation feature (#1960)
* feat(icons): add deprecationReason and alias deprecation feature * chore(tools): run prettier. again. * fix(scripts): overall alias as object support * fix(icon.schema.json): add dependentRequired on deprecated properties * fix(icon.schema.json): remove unicode for now * fix(icon.schema.json): use const true for deprecated * fix(build): convert deprecation reason to enum * fix(build): fix linting of icon.schema.json * fix(build): renamed gracePeriod => toBeRemovedInVersion * fix(build): fix aliases map in related icons generation * fix(build): deprecate aliases using numbers * feat(icon-schema): separate deprecation reason enumerations, extract removal notice * fix(icon-schema): fix linting * Update tools/build-icons/utils/deprecationReasonTemplate.mjs * fix(icons): add deprecation reason to some more icons * fix(docs): fix linting issue --------- Co-authored-by: Karsa <karsa@sztaki.hu> Co-authored-by: Jakob Guddas <github@jguddas.de>
1 parent 1b3173b commit e2b46ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+352
-169
lines changed

docs/scripts/writeCategoriesMetadata.mjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function getAllCategoryFiles() {
2323

2424
const categoriesFile = path.resolve(dataDirectory, `categoriesData.json`);
2525

26-
const categoriesData = getAllCategoryFiles()
26+
const categoriesData = getAllCategoryFiles();
2727

2828
fs.promises
2929
.writeFile(categoriesFile, JSON.stringify(categoriesData, null, 2), 'utf-8')
@@ -33,4 +33,3 @@ fs.promises
3333
.catch((error) => {
3434
throw new Error(`Something went wrong generating the categoriesData.json file,\n ${error}`);
3535
});
36-

icon.schema.json

+51-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,32 @@
2121
"aliases": {
2222
"type": "array",
2323
"items": {
24-
"type": "string"
24+
"oneOf": [
25+
{
26+
"type": "string"
27+
},
28+
{
29+
"type": "object",
30+
"properties": {
31+
"name": {
32+
"type": "string"
33+
},
34+
"deprecated": {
35+
"const": true
36+
},
37+
"deprecationReason": {
38+
"$ref": "#/$defs/aliasDeprecationReasons"
39+
},
40+
"toBeRemovedInVersion": {
41+
"$ref": "#/$defs/versionNumber",
42+
"description": "The version this icon will be removed in."
43+
}
44+
},
45+
"dependentRequired": {
46+
"deprecated": ["deprecationReason", "toBeRemovedInVersion"]
47+
}
48+
}
49+
]
2550
},
2651
"uniqueItems": true
2752
},
@@ -49,8 +74,31 @@
4974
"uniqueItems": true
5075
},
5176
"deprecated": {
52-
"type": "boolean",
53-
"default": false
77+
"const": true
78+
},
79+
"deprecationReason": {
80+
"$ref": "#/$defs/iconDeprecationReasons"
81+
},
82+
"toBeRemovedInVersion": {
83+
"$ref": "#/$defs/versionNumber",
84+
"description": "The version this icon will be removed in."
85+
}
86+
},
87+
"dependentRequired": {
88+
"deprecated": ["deprecationReason", "toBeRemovedInVersion"]
89+
},
90+
"$defs": {
91+
"iconDeprecationReasons": {
92+
"type": "string",
93+
"enum": ["icon.brand"]
94+
},
95+
"aliasDeprecationReasons": {
96+
"type": "string",
97+
"enum": ["alias.typo", "alias.name"]
98+
},
99+
"versionNumber": {
100+
"type": "string",
101+
"pattern": "v[0-9]+(\\.[0-9]+)+"
54102
}
55103
},
56104
"description": "A JSON Schema for icons defined by Lucide Icons."

icons/between-horizontal-end.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"account"
3434
],
3535
"aliases": [
36-
"between-horizonal-end"
36+
{
37+
"name": "between-horizonal-end",
38+
"deprecated": true,
39+
"deprecationReason": "alias.typo",
40+
"toBeRemovedInVersion": "v1.0"
41+
}
3742
]
3843
}

icons/between-horizontal-start.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"account"
3434
],
3535
"aliases": [
36-
"between-horizonal-start"
36+
{
37+
"name": "between-horizonal-start",
38+
"deprecated": true,
39+
"deprecationReason": "alias.typo",
40+
"toBeRemovedInVersion": "v1.0"
41+
}
3742
]
3843
}

icons/chrome.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"ericfennis"

icons/circle-user-round.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"shapes"
1414
],
1515
"aliases": [
16-
"user-circle-2"
16+
{
17+
"name": "user-circle-2",
18+
"deprecated": true,
19+
"deprecationReason": "alias.name",
20+
"toBeRemovedInVersion": "v1.0"
21+
}
1722
]
1823
}

icons/code-xml.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"development"
1616
],
1717
"aliases": [
18-
"code-2"
18+
{
19+
"name": "code-2",
20+
"deprecated": true,
21+
"deprecationReason": "alias.name",
22+
"toBeRemovedInVersion": "v1.0"
23+
}
1924
]
2025
}

icons/codepen.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"ericfennis"

icons/codesandbox.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/contact-round.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"social"
2020
],
2121
"aliases": [
22-
"contact-2"
22+
{
23+
"name": "contact-2",
24+
"deprecated": true,
25+
"deprecationReason": "alias.name",
26+
"toBeRemovedInVersion": "v1.0"
27+
}
2328
]
2429
}

icons/dribbble.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"ahtohbi4"
68
],

icons/earth.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"navigation"
1818
],
1919
"aliases": [
20-
"globe-2"
20+
{
21+
"name": "globe-2",
22+
"deprecated": true,
23+
"deprecationReason": "alias.name",
24+
"toBeRemovedInVersion": "v1.0"
25+
}
2126
]
2227
}

icons/facebook.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/figma.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/file-cog.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"files"
1616
],
1717
"aliases": [
18-
"file-cog-2"
18+
{
19+
"name": "file-cog-2",
20+
"deprecated": true,
21+
"deprecationReason": "alias.name",
22+
"toBeRemovedInVersion": "v1.0"
23+
}
1924
]
2025
}

icons/folder-cog.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"$schema": "../icon.schema.json",
3-
"aliases": [
4-
"folder-cog-2"
5-
],
63
"contributors": [
74
"karsa-mistmere"
85
],
@@ -17,5 +14,13 @@
1714
],
1815
"categories": [
1916
"files"
17+
],
18+
"aliases": [
19+
{
20+
"name": "folder-cog-2",
21+
"deprecated": true,
22+
"deprecationReason": "alias.name",
23+
"toBeRemovedInVersion": "v1.0"
24+
}
2025
]
2126
}

icons/framer.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/github.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/gitlab.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/ice-cream-bowl.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"food-beverage"
2020
],
2121
"aliases": [
22-
"ice-cream-2"
22+
{
23+
"name": "ice-cream-2",
24+
"deprecated": true,
25+
"deprecationReason": "alias.name",
26+
"toBeRemovedInVersion": "v1.0"
27+
}
2328
]
2429
}

icons/instagram.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/laptop-minimal.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
"devices"
1313
],
1414
"aliases": [
15-
"laptop-2"
15+
{
16+
"name": "laptop-2",
17+
"deprecated": true,
18+
"deprecationReason": "alias.name",
19+
"toBeRemovedInVersion": "v1.0"
20+
}
1621
]
1722
}

icons/mic-vocal.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"multimedia"
2323
],
2424
"aliases": [
25-
"mic-2"
25+
{
26+
"name": "mic-2",
27+
"deprecated": true,
28+
"deprecationReason": "alias.name",
29+
"toBeRemovedInVersion": "v1.0"
30+
}
2631
]
2732
}

icons/pen-line.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"tools"
2727
],
2828
"aliases": [
29-
"edit-3"
29+
{
30+
"name": "edit-3",
31+
"deprecated": true,
32+
"deprecationReason": "alias.name",
33+
"toBeRemovedInVersion": "v1.0"
34+
}
3035
]
3136
}

icons/pen.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"tools"
2727
],
2828
"aliases": [
29-
"edit-2"
29+
{
30+
"name": "edit-2",
31+
"deprecated": true,
32+
"deprecationReason": "alias.name",
33+
"toBeRemovedInVersion": "v1.0"
34+
}
3035
]
3136
}

icons/pocket.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"csandman",

icons/send-horizontal.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"connectivity"
1818
],
1919
"aliases": [
20-
"send-horizonal"
20+
{
21+
"name": "send-horizonal",
22+
"deprecated": true,
23+
"deprecationReason": "alias.typo",
24+
"toBeRemovedInVersion": "v1.0"
25+
}
2126
]
2227
}

icons/slack.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"$schema": "../icon.schema.json",
33
"deprecated": true,
4+
"deprecationReason": "icon.brand",
5+
"toBeRemovedInVersion": "v1.0",
46
"contributors": [
57
"colebemis",
68
"ashygee",

icons/square-user-round.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"shapes"
1414
],
1515
"aliases": [
16-
"user-square-2"
16+
{
17+
"name": "user-square-2",
18+
"deprecated": true,
19+
"deprecationReason": "alias.name",
20+
"toBeRemovedInVersion": "v1.0"
21+
}
1722
]
1823
}

0 commit comments

Comments
 (0)