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>
This commit is contained in:
Karsa
2024-05-22 13:08:34 +02:00
committed by GitHub
parent 1b3173b17b
commit e2b46eac8e
63 changed files with 351 additions and 168 deletions

View File

@@ -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);
@@ -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)});