mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-14 13:58:21 +00:00
* setup icon popularity call * Adjust sort button * Adjust sorting * Adds aliases * Format code * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Add check for env variable * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Improve styling on mobile * Better icon detail page * Update detail page * feat: make edit button more visible * Fix types * Add unreleased version tag * Adjust icon detail * Added edit button * format code * Replace pencil sparkles * Revert changes * Fix types * Add docs checks * Fix types * Fix awaiting release * revert icons changes * Format code * Fix type issues * Update CarbonAdOverlay to not display Disable CarbonAdOverlay by setting drawerOpen to false. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Fix types * Fix condition for showing awaiting release icons Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Format code --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jakob Guddas <github@jguddas.de>
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { eventHandler, setResponseHeader } from 'h3';
|
|
import iconNodes from '../../data/iconNodes/index.ts';
|
|
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.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;
|
|
});
|