diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e9c74708328..0f91c5c0402 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -74,6 +74,16 @@ jobs: # input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A # output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A + lint-aliases: + name: Check Uniqueness of Aliases + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - name: Check Uniqueness of Aliases + run: ! cat <(printf "%s\\n" icons/*.json | while read -r name; do basename "$name" .json; done) <(jq -cr 'select(.aliases) | .aliases[] | if type=="string" then . else .name end' icons/*.json) | sort | uniq -c | grep -ve '^ 1 ' + generate-changed-icons-comment: runs-on: ubuntu-latest permissions: diff --git a/.gitignore b/.gitignore index 78203532558..a8a38a8959f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ docs/.vitepress/data/iconNodes docs/.vitepress/data/iconMetaData.ts docs/.vitepress/data/releaseMetaData.json docs/.vitepress/data/releaseMetaData +docs/.vitepress/data/categoriesData.json docs/.vitepress/data/iconDetails docs/.vitepress/data/relatedIcons.json docs/.vercel diff --git a/docs/.vitepress/api/categories/index.get.ts b/docs/.vitepress/api/categories/index.get.ts index 0ac20a3e51d..76e1f95def7 100644 --- a/docs/.vitepress/api/categories/index.get.ts +++ b/docs/.vitepress/api/categories/index.get.ts @@ -1,4 +1,3 @@ -import { eventHandler, setResponseHeader } from 'h3'; import iconMetaData from '../../data/iconMetaData'; export default eventHandler((event) => { diff --git a/docs/.vitepress/api/figma/data.ts b/docs/.vitepress/api/figma/data.ts new file mode 100644 index 00000000000..1c938c998a5 --- /dev/null +++ b/docs/.vitepress/api/figma/data.ts @@ -0,0 +1,40 @@ +import iconNodes from '../../data/iconNodes/index.ts'; +import { IconNodeWithKeys } from '../../theme/types'; +import iconMetaData from '../../data/iconMetaData'; +import releaseMeta from '../../data/releaseMetaData.json'; +import categories from '../../data/categoriesData.json'; + +const dataResponse = { + icons: Object.entries(iconNodes).reduce((acc, [name, iconNode]) => { + const newIconNode = (iconNode as IconNodeWithKeys).map(([name, { key, ...attrs }]) => { + return [name, attrs]; + }); + + acc[name] = { + iconNode: newIconNode, + aliases: (iconMetaData[name]?.aliases ?? []).map((alias) => + typeof alias === 'string' ? alias : alias.name, + ), + tags: iconMetaData[name].tags ?? [], + categories: iconMetaData[name].categories ?? [], + ...releaseMeta[name], + }; + + return acc; + }, {}), + aliases: Object.entries(iconNodes).reduce((acc, [name]) => { + for (const alias of iconMetaData[name]?.aliases ?? []) { + acc[typeof alias === 'string' ? alias : alias.name] = name; + } + + return acc; + }, {}), + categories, +}; + +export default eventHandler((event) => { + setResponseHeader(event, 'Cache-Control', 'public, max-age=86400'); + setResponseHeader(event, 'Access-Control-Allow-Origin', '*'); + + return dataResponse; +}); diff --git a/docs/.vitepress/api/tags/index.get.ts b/docs/.vitepress/api/tags/index.get.ts index b2314c4f45f..2ffccbdc028 100644 --- a/docs/.vitepress/api/tags/index.get.ts +++ b/docs/.vitepress/api/tags/index.get.ts @@ -1,4 +1,3 @@ -import { eventHandler, setResponseHeader } from 'h3'; import iconMetaData from '../../data/iconMetaData'; export default eventHandler((event) => { diff --git a/docs/.vitepress/data/teamData.json b/docs/.vitepress/data/teamData.json index ac71685fa26..3e5504aee33 100644 --- a/docs/.vitepress/data/teamData.json +++ b/docs/.vitepress/data/teamData.json @@ -31,8 +31,8 @@ ] }, { - "name": "jguddas", - "title": "Maintainer of Lucide & Software engineer @lego", + "name": "Jakob Guddas", + "title": "Maintainer of Lucide & Software engineer @LEGO", "image": "https://github.com/jguddas.png?size=192", "socialLinks": [ { diff --git a/docs/.vitepress/sidebar.ts b/docs/.vitepress/sidebar.ts index 5bb38717646..bab0dbbef01 100644 --- a/docs/.vitepress/sidebar.ts +++ b/docs/.vitepress/sidebar.ts @@ -31,10 +31,10 @@ const sidebar: UserConfig['themeConfig']['sidebar'] = { { text: 'Advanced', items: [ - // { - // text: 'Accessibility', - // link: '/guide/advanced/accessibility' - // }, + { + text: 'Accessibility', + link: '/guide/advanced/accessibility', + }, { text: 'Global styling', link: '/guide/advanced/global-styling', diff --git a/docs/.vitepress/theme/components/home/HomeSponsorCard.vue b/docs/.vitepress/theme/components/home/HomeSponsorCard.vue index 3c3fd726a7d..9a680b41116 100644 --- a/docs/.vitepress/theme/components/home/HomeSponsorCard.vue +++ b/docs/.vitepress/theme/components/home/HomeSponsorCard.vue @@ -1,17 +1,23 @@