Skip to content

Commit

Permalink
feat(icons): add deprecationReason and alias deprecation feature (#1960)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Jakob Guddas <[email protected]>
  • Loading branch information
3 people authored May 22, 2024
1 parent 1b3173b commit e2b46ea
Show file tree
Hide file tree
Showing 63 changed files with 352 additions and 169 deletions.
3 changes: 1 addition & 2 deletions docs/scripts/writeCategoriesMetadata.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getAllCategoryFiles() {

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

const categoriesData = getAllCategoryFiles()
const categoriesData = getAllCategoryFiles();

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

54 changes: 51 additions & 3 deletions icon.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,32 @@
"aliases": {
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"deprecated": {
"const": true
},
"deprecationReason": {
"$ref": "#/$defs/aliasDeprecationReasons"
},
"toBeRemovedInVersion": {
"$ref": "#/$defs/versionNumber",
"description": "The version this icon will be removed in."
}
},
"dependentRequired": {
"deprecated": ["deprecationReason", "toBeRemovedInVersion"]
}
}
]
},
"uniqueItems": true
},
Expand Down Expand Up @@ -49,8 +74,31 @@
"uniqueItems": true
},
"deprecated": {
"type": "boolean",
"default": false
"const": true
},
"deprecationReason": {
"$ref": "#/$defs/iconDeprecationReasons"
},
"toBeRemovedInVersion": {
"$ref": "#/$defs/versionNumber",
"description": "The version this icon will be removed in."
}
},
"dependentRequired": {
"deprecated": ["deprecationReason", "toBeRemovedInVersion"]
},
"$defs": {
"iconDeprecationReasons": {
"type": "string",
"enum": ["icon.brand"]
},
"aliasDeprecationReasons": {
"type": "string",
"enum": ["alias.typo", "alias.name"]
},
"versionNumber": {
"type": "string",
"pattern": "v[0-9]+(\\.[0-9]+)+"
}
},
"description": "A JSON Schema for icons defined by Lucide Icons."
Expand Down
7 changes: 6 additions & 1 deletion icons/between-horizontal-end.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"account"
],
"aliases": [
"between-horizonal-end"
{
"name": "between-horizonal-end",
"deprecated": true,
"deprecationReason": "alias.typo",
"toBeRemovedInVersion": "v1.0"
}
]
}
7 changes: 6 additions & 1 deletion icons/between-horizontal-start.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"account"
],
"aliases": [
"between-horizonal-start"
{
"name": "between-horizonal-start",
"deprecated": true,
"deprecationReason": "alias.typo",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/chrome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"ericfennis"
Expand Down
7 changes: 6 additions & 1 deletion icons/circle-user-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"shapes"
],
"aliases": [
"user-circle-2"
{
"name": "user-circle-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
7 changes: 6 additions & 1 deletion icons/code-xml.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"development"
],
"aliases": [
"code-2"
{
"name": "code-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/codepen.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"ericfennis"
Expand Down
2 changes: 2 additions & 0 deletions icons/codesandbox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
7 changes: 6 additions & 1 deletion icons/contact-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"social"
],
"aliases": [
"contact-2"
{
"name": "contact-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/dribbble.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"ahtohbi4"
],
Expand Down
7 changes: 6 additions & 1 deletion icons/earth.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"navigation"
],
"aliases": [
"globe-2"
{
"name": "globe-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/facebook.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
2 changes: 2 additions & 0 deletions icons/figma.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
7 changes: 6 additions & 1 deletion icons/file-cog.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"files"
],
"aliases": [
"file-cog-2"
{
"name": "file-cog-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
11 changes: 8 additions & 3 deletions icons/folder-cog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"$schema": "../icon.schema.json",
"aliases": [
"folder-cog-2"
],
"contributors": [
"karsa-mistmere"
],
Expand All @@ -17,5 +14,13 @@
],
"categories": [
"files"
],
"aliases": [
{
"name": "folder-cog-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/framer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
2 changes: 2 additions & 0 deletions icons/github.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
2 changes: 2 additions & 0 deletions icons/gitlab.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
7 changes: 6 additions & 1 deletion icons/ice-cream-bowl.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"food-beverage"
],
"aliases": [
"ice-cream-2"
{
"name": "ice-cream-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/instagram.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
7 changes: 6 additions & 1 deletion icons/laptop-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"devices"
],
"aliases": [
"laptop-2"
{
"name": "laptop-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
7 changes: 6 additions & 1 deletion icons/mic-vocal.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"multimedia"
],
"aliases": [
"mic-2"
{
"name": "mic-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
7 changes: 6 additions & 1 deletion icons/pen-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"tools"
],
"aliases": [
"edit-3"
{
"name": "edit-3",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
7 changes: 6 additions & 1 deletion icons/pen.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"tools"
],
"aliases": [
"edit-2"
{
"name": "edit-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/pocket.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"csandman",
Expand Down
7 changes: 6 additions & 1 deletion icons/send-horizontal.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"connectivity"
],
"aliases": [
"send-horizonal"
{
"name": "send-horizonal",
"deprecated": true,
"deprecationReason": "alias.typo",
"toBeRemovedInVersion": "v1.0"
}
]
}
2 changes: 2 additions & 0 deletions icons/slack.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "icon.brand",
"toBeRemovedInVersion": "v1.0",
"contributors": [
"colebemis",
"ashygee",
Expand Down
7 changes: 6 additions & 1 deletion icons/square-user-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"shapes"
],
"aliases": [
"user-square-2"
{
"name": "user-square-2",
"deprecated": true,
"deprecationReason": "alias.name",
"toBeRemovedInVersion": "v1.0"
}
]
}
Loading

0 comments on commit e2b46ea

Please sign in to comment.