Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(icons): add deprecationReason and alias deprecation feature #1960

Merged
merged 21 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f8995ac
feat(icons): add deprecationReason and alias deprecation feature
Mar 8, 2024
b9ea801
chore(tools): run prettier. again.
Mar 8, 2024
e98b58d
Merge branch 'main' into feat/icon-alias-deprecation-reasons
Mar 8, 2024
1fedcfe
Merge branch 'main' into feat/icon-alias-deprecation-reasons
Mar 8, 2024
79989d4
Merge branch 'main' into feat/icon-alias-deprecation-reasons
Mar 8, 2024
d51aa9b
fix(scripts): overall alias as object support
Mar 8, 2024
3032134
fix(icon.schema.json): add dependentRequired on deprecated properties
Mar 8, 2024
ef86b03
fix(icon.schema.json): remove unicode for now
Mar 8, 2024
90903ce
fix(icon.schema.json): use const true for deprecated
Mar 8, 2024
d939863
fix(build): convert deprecation reason to enum
Mar 9, 2024
855861a
fix(build): fix linting of icon.schema.json
Mar 9, 2024
8a9136b
fix(build): renamed gracePeriod => toBeRemovedInVersion
Mar 9, 2024
bab4eb1
fix(build): fix aliases map in related icons generation
Mar 11, 2024
353faf4
fix(build): deprecate aliases using numbers
Mar 11, 2024
5a025ad
feat(icon-schema): separate deprecation reason enumerations, extract …
May 13, 2024
1aab12d
fix(icon-schema): fix linting
May 13, 2024
3640c35
Update tools/build-icons/utils/deprecationReasonTemplate.mjs
karsa-mistmere May 13, 2024
3d073e1
Merge branch 'main' into feat/icon-alias-deprecation-reasons
jguddas May 17, 2024
d693064
Merge branch 'main' into feat/icon-alias-deprecation-reasons
May 22, 2024
589e141
fix(icons): add deprecation reason to some more icons
May 22, 2024
2a3d796
fix(docs): fix linting issue
May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion icon.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,26 @@
"aliases": {
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"deprecated": {
"type": "boolean",
"default": false
},
"deprecationReason": {
"type": "string"
}
}
}
karsa-mistmere marked this conversation as resolved.
Show resolved Hide resolved
]
},
"uniqueItems": true
},
Expand Down Expand Up @@ -51,6 +70,12 @@
"deprecated": {
"type": "boolean",
"default": false
},
"deprecationReason": {
"type": "string"
},
karsa-mistmere marked this conversation as resolved.
Show resolved Hide resolved
"unicode": {
"type": "string"
}
},
"description": "A JSON Schema for icons defined by Lucide Icons."
Expand Down
6 changes: 5 additions & 1 deletion icons/between-horizontal-end.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"account"
],
"aliases": [
"between-horizonal-end"
{
"name": "between-horizonal-end",
"deprecated": true,
"deprecationReason": "Renamed because of typo. This export will be removed in v1.0"
karsa-mistmere marked this conversation as resolved.
Show resolved Hide resolved
}
]
}
6 changes: 5 additions & 1 deletion icons/between-horizontal-start.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"account"
],
"aliases": [
"between-horizonal-start"
{
"name": "between-horizonal-start",
"deprecated": true,
"deprecationReason": "Renamed because of typo. This export will be removed in v1.0"
}
]
}
1 change: 1 addition & 0 deletions icons/chrome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"ericfennis"
Expand Down
1 change: 1 addition & 0 deletions icons/codepen.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"ericfennis"
Expand Down
1 change: 1 addition & 0 deletions icons/codesandbox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/dribbble.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"ahtohbi4"
],
Expand Down
1 change: 1 addition & 0 deletions icons/facebook.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/figma.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/framer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/github.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/gitlab.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/instagram.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/pocket.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
6 changes: 5 additions & 1 deletion icons/send-horizontal.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"connectivity"
],
"aliases": [
"send-horizonal"
{
"name": "send-horizonal",
"deprecated": true,
"deprecationReason": "Renamed because of typo. This export will be removed in v1.0"
}
]
}
1 change: 1 addition & 0 deletions icons/slack.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"ashygee",
Expand Down
1 change: 1 addition & 0 deletions icons/trello.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"bdbch",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/twitch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"ahtohbi4",
"johnletey"
Expand Down
1 change: 1 addition & 0 deletions icons/twitter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
1 change: 1 addition & 0 deletions icons/youtube.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../icon.schema.json",
"deprecated": true,
"deprecationReason": "Brand icons have been deprecated and are due to be removed, we recommend using simpleicons.org instead, refer to https://github.com/lucide-icons/lucide/issues/670",
"contributors": [
"colebemis",
"csandman",
Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-angular/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import { LucideIconData } from './types';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {FunctionalComponent} Vue component
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName}: LucideIconData = ${JSON.stringify(children)}; //eslint-disable-line no-shadow-restricted-names

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-preact/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import createLucideIcon from '../createLucideIcon';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {JSX.Element} JSX Element
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = createLucideIcon('${componentName}', ${JSON.stringify(children)});

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-react-native/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import createLucideIcon from '../createLucideIcon';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {JSX.Element} JSX Element
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = createLucideIcon('${componentName}', ${JSON.stringify(children)});

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-react/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import createLucideIcon from '../createLucideIcon';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {JSX.Element} JSX Element
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = createLucideIcon('${componentName}', ${JSON.stringify(children)});

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-solid/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -20,7 +20,7 @@ const iconNode: IconNode = ${JSON.stringify(children)};
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {JSX.Element} JSX Element
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = (props: LucideProps) => (
<Icon {...props} name="${componentName}" iconNode={iconNode} />
Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-static/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
let svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -21,7 +21,7 @@ export default ({ componentName, iconName, children, getSvg, deprecated }) => {
* @see https://lucide.dev/guide/packages/lucide-static - Documentation
*
* @returns {String}
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName}: string = \`\
${svgContents}\
Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-svelte/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
import { getJSBanner } from './license.mjs';

export default ({ iconName, children, componentName, getSvg, deprecated }) => {
export default ({ iconName, children, componentName, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -25,7 +25,7 @@ const iconNode: IconNode = ${JSON.stringify(children)};
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {FunctionalComponent} Svelte component
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
</script>

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-vue-next/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import createLucideIcon from '../createLucideIcon';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {FunctionalComponent} Vue component
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = createLucideIcon('${componentName}Icon', ${JSON.stringify(children)});

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-vue/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import createLucideIcon from '../createLucideIcon';
*
* @param {Object} props - Lucide icons props and any valid SVG attribute
* @returns {Component} Vue Component
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName} = createLucideIcon('${componentName}Icon', ${JSON.stringify(children)});

Expand Down
4 changes: 2 additions & 2 deletions packages/lucide/scripts/exportTemplate.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';

export default ({ componentName, iconName, children, getSvg, deprecated }) => {
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
const svgContents = getSvg();
const svgBase64 = base64SVG(svgContents);

Expand All @@ -17,7 +17,7 @@ import type { IconNode } from '../types';
* @see https://lucide.dev/guide/packages/lucide - Documentation
*
* @returns {Array}
* ${deprecated ? '@deprecated' : ''}
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
*/
const ${componentName}: IconNode = [
'svg',
Expand Down
2 changes: 2 additions & 0 deletions scripts/generate/generateIcons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const iconSvgTemplate = `<svg

const iconJsonTemplate = `{
"$schema": "../icon.schema.json",
"contributors": [
],
"tags": [
],
"categories": [
Expand Down
Loading
Loading