Skip to content

Commit c5b155e

Browse files
committed
2 parents 5720278 + 0a2312d commit c5b155e

110 files changed

Lines changed: 2411 additions & 1570 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ permissions:
1717
id-token: write # Required for OIDC
1818
contents: write
1919

20+
# This is added to make sure we wait until last release is done, this is needed for the font-build process
21+
concurrency:
22+
group: continuous-integration
23+
2024
jobs:
2125
create-release:
2226
if: github.repository == 'lucide-icons/lucide' && startsWith(github.event.head_commit.message, 'feat(icons)') && github.event_name != 'workflow_dispatch'
2327
runs-on: ubuntu-latest
2428
outputs:
2529
VERSION: ${{ steps.new-version.outputs.NEW_VERSION }}
2630
steps:
27-
2831
- uses: actions/checkout@v6
2932
- uses: pnpm/action-setup@v4
3033
- uses: actions/setup-node@v6

.github/workflows/lucide-font.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
- name: Install dependencies
2424
run: pnpm install --frozen-lockfile
2525

26-
- name: Outline svg Icons
27-
run: pnpm build:outline-icons
28-
2926
- name: Create font in ./lucide-font
3027
run: pnpm build:font
3128

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ permissions:
1616
id-token: write # Required for OIDC
1717
contents: write
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
1922
jobs:
2023
pre-release:
2124
if: github.repository == 'lucide-icons/lucide' && contains('["ericfennis", "karsa-mistmere", "jguddas"]', github.actor)
@@ -130,11 +133,8 @@ jobs:
130133
- name: Install dependencies
131134
run: pnpm install --frozen-lockfile
132135

133-
- name: Outline svg Icons
134-
run: pnpm build:outline-icons
135-
136136
- name: Create font in ./lucide-font
137-
run: pnpm build:font
137+
run: pnpm build:font --saveCodePoints
138138

139139
- name: 'Upload to Artifacts'
140140
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ coverage
1414
stats
1515
*.log
1616
outlined
17+
lucide-font
1718
packages/**/src/icons/*.js
1819
packages/**/src/icons/*.ts
1920
packages/**/src/icons/*.tsx
@@ -42,7 +43,7 @@ docs/.vitepress/.temp
4243
docs/.vitepress/data/iconNodes
4344
docs/.vitepress/data/iconMetaData.ts
4445
docs/.vitepress/data/releaseMetaData.json
45-
docs/.vitepress/data/releaseMetaData
46+
docs/.vitepress/data/releaseMetadata
4647
docs/.vitepress/data/categoriesData.json
4748
docs/.vitepress/data/iconDetails
4849
docs/.vitepress/data/relatedIcons.json

docs/.vitepress/api/categories/index.get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { eventHandler, setResponseHeader } from 'h3';
12
import iconMetaData from '../../data/iconMetaData';
23

34
export default eventHandler((event) => {

docs/.vitepress/api/figma/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { eventHandler, setResponseHeader } from 'h3';
12
import iconNodes from '../../data/iconNodes/index.ts';
23
import { IconNodeWithKeys } from '../../theme/types';
34
import iconMetaData from '../../data/iconMetaData';

docs/.vitepress/api/gh-icon/[...data].get.ts renamed to docs/.vitepress/api/gh-icon/[...data].get.tsx

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
22
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
3-
import { createElement } from 'react';
3+
import React from 'react';
44
import SvgPreview from '../../lib/SvgPreview/index.tsx';
55
import iconNodes from '../../data/iconNodes';
66
import createLucideIcon from 'lucide-react/src/createLucideIcon';
@@ -34,36 +34,29 @@ export default eventHandler((event) => {
3434
const iconNode = iconNodes[backdropName];
3535

3636
const LucideIcon = createLucideIcon(backdropName, iconNode);
37-
const svg = renderToStaticMarkup(createElement(LucideIcon));
37+
const svg = renderToStaticMarkup(<LucideIcon />);
3838
const backdropString = svg.replaceAll('\n', '').replace(/<svg[^>]*>|<\/svg>/g, '');
3939

4040
children.push(
41-
createElement(Backdrop, {
42-
backdropString,
43-
src: src.replace(/<svg[^>]*>|<\/svg>/g, ''),
44-
color: '#777',
45-
}),
41+
<Backdrop
42+
backdropString={backdropString}
43+
src={src.replace(/<svg[^>]*>|<\/svg>/g, '')}
44+
color="#777"
45+
/>,
4646
);
4747
}
4848

49-
const svg = Buffer.from(
50-
// We can't use jsx here, is not supported here by nitro.
51-
renderToString(
52-
createElement(
53-
SvgPreview,
54-
{
55-
src: src.replace(/<svg[^>]*>|<\/svg>/g, ''),
56-
height,
57-
width,
58-
showGrid: true,
59-
},
60-
children,
61-
),
62-
),
63-
).toString('utf8');
64-
6549
defaultContentType(event, 'image/svg+xml');
6650
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
6751

68-
return svg;
52+
return renderToString(
53+
<SvgPreview
54+
src={src.replace(/<svg[^>]*>|<\/svg>/g, '')}
55+
showGrid
56+
height={height}
57+
width={width}
58+
>
59+
{children}
60+
</SvgPreview>,
61+
);
6962
});

docs/.vitepress/api/gh-icon/diff/[...data].get.ts renamed to docs/.vitepress/api/gh-icon/diff/[...data].get.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
22
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
3-
import { createElement } from 'react';
3+
import React from 'react';
44
import Diff from '../../../lib/SvgPreview/Diff.tsx';
55
import iconNodes from '../../../data/iconNodes';
66
import createLucideIcon from 'lucide-react/src/createLucideIcon';
@@ -26,21 +26,26 @@ export default eventHandler((event) => {
2626

2727
const children = [];
2828

29+
const Icon = createLucideIcon(name, iconNodes[name]);
30+
2931
const oldSrc = iconNodes[name]
30-
? renderToStaticMarkup(createElement(createLucideIcon(name, iconNodes[name])))
32+
? renderToStaticMarkup(<Icon />)
3133
.replaceAll('\n', '')
3234
.replace(/<svg[^>]*>|<\/svg>/g, '')
3335
: '';
3436

35-
const svg = Buffer.from(
36-
// We can't use jsx here, is not supported here by nitro.
37-
renderToString(
38-
createElement(Diff, { oldSrc, newSrc, showGrid: true, height, width }, children),
39-
),
40-
).toString('utf8');
41-
4237
defaultContentType(event, 'image/svg+xml');
4338
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
4439

45-
return svg;
40+
return renderToString(
41+
<Diff
42+
oldSrc={oldSrc}
43+
newSrc={newSrc}
44+
showGrid
45+
height={height}
46+
width={width}
47+
>
48+
{children}
49+
</Diff>,
50+
);
4651
});

docs/.vitepress/api/gh-icon/dpi/[...data].get.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
2-
import { Resvg, initWasm } from '@resvg/resvg-wasm';
32
import iconNodes from '../../../data/iconNodes';
4-
import wasm from './loadWasm';
53
import { createElement } from 'react';
64
import { renderToStaticMarkup } from 'react-dom/server';
75
import createLucideIcon from 'lucide-react/src/createLucideIcon';
8-
9-
var initializedResvg = initWasm(wasm);
6+
import sharp from 'sharp';
107

118
export default eventHandler(async (event) => {
129
const { params = {} } = event.context;
13-
await initializedResvg;
14-
1510
const imageSize = 96;
1611
const name = params.data.split('/').at(-3);
1712
const iconSizeString = params.data.split('/').at(-2);
@@ -45,9 +40,7 @@ export default eventHandler(async (event) => {
4540
)
4641
.replace(/<\/svg>/, '</g></svg>');
4742

48-
const resvg = new Resvg(svg, { background: '#000' });
49-
const pngData = resvg.render();
50-
const pngBuffer = Buffer.from(pngData.asPng());
43+
const pngBuffer = await sharp(Buffer.from(svg)).png().toBuffer();
5144

5245
defaultContentType(event, 'image/svg+xml');
5346
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
@@ -67,7 +60,7 @@ export default eventHandler(async (event) => {
6760
<image
6861
width="${imageSize}"
6962
height="${prevSvg ? imageSize * 2 : imageSize}"
70-
href="data:image/png;base64,${pngBuffer.toString('base64')}"
63+
href="data:image/png;base64,${pngBuffer.toString('base64')}"
7164
image-rendering="pixelated"
7265
/>
7366
</mask>

docs/.vitepress/api/gh-icon/dpi/loadWasm.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)