Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lucide-icons/lucide
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.348.0
Choose a base ref
...
head repository: lucide-icons/lucide
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.349.0
Choose a head ref
  • 7 commits
  • 57 files changed
  • 3 contributors

Commits on Mar 6, 2024

  1. fix: readded gap between x-ray preview comment icons. (#1915)

    * fix: readded gap between x-ray preview comment icons.
    
    * feat: keep size 400px
    
    ---------
    
    Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
    jguddas and ericfennis authored Mar 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d255c6a View commit details
  2. refactor: Adds repo shared package @lucide/shared (#1904)

    * Fixed import of toKebabCase helper function
    
    * Added utils package
    
    * utils
    
    * Make utils package work in build
    
    * Add lucide-shared
    
    * Transpile solid with esbuild
    
    * Fix resolve modules
    
    * Cleanup
    
    * Format files
    
    * Fix properties plugins function
    
    * Fix properties plugins in lucide package
    
    * Revert remove resolve plugin and cleanup
    
    * Update snapshots
    
    * Revert icon changes
    
    ---------
    
    Co-authored-by: Rohan <rohancrrm@gmail.com>
    ericfennis and SamstyleGhost authored Mar 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ad1accb View commit details
  3. workflow: Update stale workflow

    ericfennis committed Mar 6, 2024
    Copy the full SHA
    b16f709 View commit details
  4. Update metadata (#1943)

    ericfennis authored Mar 6, 2024
    Copy the full SHA
    38142f2 View commit details
  5. fix(icons): added round corner to file-search icon (#1941)

    * Updated icons/file-search.svg
    
    * Updated icons/file-search.json
    
    ---------
    
    Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
    jguddas and ericfennis authored Mar 6, 2024
    Copy the full SHA
    ae35ca2 View commit details
  6. fix(icons): added round corner to file-volume icon (#1940)

    * Updated icons/file-volume.svg
    
    * Updated icons/file-volume.json
    
    ---------
    
    Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
    jguddas and ericfennis authored Mar 6, 2024
    Copy the full SHA
    41dde6b View commit details
  7. fix(icons): optimized and closed gaps in file-pie-chart icon (#1939)

    * Updated icons/file-pie-chart.svg
    
    * Updated icons/file-pie-chart.json
    
    * Updated icons/file-pie-chart.svg
    
    ---------
    
    Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
    jguddas and ericfennis authored Mar 6, 2024
    Copy the full SHA
    a8b8dfc View commit details
Showing with 11,319 additions and 3,181 deletions.
  1. +3 −0 .github/workflows/close-stale-prs.yml
  2. +1 −0 icons/area-chart.json
  3. +2 −1 icons/arrow-up-right-from-square.json
  4. +1 −0 icons/bar-chart-2.json
  5. +1 −0 icons/bar-chart-3.json
  6. +1 −0 icons/bar-chart-4.json
  7. +1 −0 icons/bar-chart-big.json
  8. +1 −0 icons/bar-chart-horizontal-big.json
  9. +1 −0 icons/bar-chart-horizontal.json
  10. +1 −0 icons/bar-chart.json
  11. +1 −0 icons/candlestick-chart.json
  12. +1 −0 icons/file-bar-chart-2.json
  13. +1 −0 icons/file-bar-chart.json
  14. +1 −0 icons/file-line-chart.json
  15. +3 −1 icons/file-pie-chart.json
  16. +3 −3 icons/file-pie-chart.svg
  17. +2 −1 icons/file-search.json
  18. +2 −2 icons/file-search.svg
  19. +2 −1 icons/file-volume.json
  20. +3 −3 icons/file-volume.svg
  21. +1 −0 icons/line-chart.json
  22. +1 −0 icons/pie-chart.json
  23. +1 −0 icons/scatter-chart.json
  24. +7,557 −0 package-lock.json
  25. +1 −0 packages/lucide-figma/package.json
  26. +1 −11 packages/lucide-figma/src/helpers/createIconComponent.ts
  27. +1 −0 packages/lucide-preact/package.json
  28. +3 −2 packages/lucide-preact/rollup.config.mjs
  29. +5 −9 packages/lucide-preact/src/createLucideIcon.ts
  30. +1 −1 packages/lucide-react-native/rollup.config.mjs
  31. +1 −0 packages/lucide-react/package.json
  32. +3 −2 packages/lucide-react/rollup.config.mjs
  33. +1 −13 packages/lucide-react/src/createLucideIcon.ts
  34. +13 −11 packages/lucide-solid/package.json
  35. +121 −14 packages/lucide-solid/rollup.config.mjs
  36. +0 −88 packages/lucide-solid/scripts/buildTypes.mjs
  37. +0 −13 packages/lucide-solid/scripts/replaceVersion.mjs
  38. +2 −12 packages/lucide-solid/src/Icon.tsx
  39. +0 −4 packages/lucide-solid/src/lucide-solid.ts
  40. +18 −18 packages/lucide-solid/tests/__snapshots__/lucide-solid.spec.tsx.snap
  41. +3 −1 packages/lucide-solid/tsconfig.json
  42. +1 −1 packages/lucide-static/rollup.config.mjs
  43. +1 −0 packages/lucide-vue-next/package.json
  44. +2 −1 packages/lucide-vue-next/rollup.config.mjs
  45. +7 −10 packages/lucide-vue-next/src/createLucideIcon.ts
  46. +1 −0 packages/lucide-vue/package.json
  47. +2 −1 packages/lucide-vue/rollup.config.mjs
  48. +1 −12 packages/lucide-vue/src/createLucideIcon.ts
  49. +1 −1 packages/lucide/rollup.config.mjs
  50. +3 −0 packages/shared/README.md
  51. +11 −0 packages/shared/package.json
  52. +1 −0 packages/shared/src/index.ts
  53. +8 −0 packages/shared/src/utils.ts
  54. +3,483 −2,922 pnpm-lock.yaml
  55. +19 −18 scripts/generateChangedIconsCommentMarkup.mjs
  56. +1 −0 tools/rollup-plugins/package.json
  57. +11 −4 tools/rollup-plugins/plugins.js
3 changes: 3 additions & 0 deletions .github/workflows/close-stale-prs.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
@@ -14,4 +16,5 @@ jobs:
close-pr-message: This PR was closed because it has been stalled for 5 days with no activity.
close-pr-label: 🧶 stale
days-before-stale: 30
days-before-issue-stale: -1
days-before-close: -1
1 change: 1 addition & 0 deletions icons/area-chart.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph",
"area"
3 changes: 2 additions & 1 deletion icons/arrow-up-right-from-square.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@
"diagonal",
"share",
"open",
"external"
"external",
"link"
],
"categories": [
"arrows",
1 change: 1 addition & 0 deletions icons/bar-chart-2.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart-3.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart-4.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart-big.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart-horizontal-big.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart-horizontal.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/bar-chart.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/candlestick-chart.json
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
"exchange",
"hedge fund",
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/file-bar-chart-2.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph",
"presentation"
1 change: 1 addition & 0 deletions icons/file-bar-chart.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph",
"presentation"
1 change: 1 addition & 0 deletions icons/file-line-chart.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph",
"presentation"
4 changes: 3 additions & 1 deletion icons/file-pie-chart.json
Original file line number Diff line number Diff line change
@@ -2,10 +2,12 @@
"$schema": "../icon.schema.json",
"contributors": [
"karsa-mistmere",
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph",
"presentation"
6 changes: 3 additions & 3 deletions icons/file-pie-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion icons/file-search.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
"contributors": [
"ericfennis",
"karsa-mistmere",
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"lost",
4 changes: 2 additions & 2 deletions icons/file-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion icons/file-volume.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@
"$schema": "../icon.schema.json",
"contributors": [
"karsa-mistmere",
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"audio",
6 changes: 3 additions & 3 deletions icons/file-volume.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/line-chart.json
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
1 change: 1 addition & 0 deletions icons/pie-chart.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"presentation"
],
1 change: 1 addition & 0 deletions icons/scatter-chart.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
],
"tags": [
"statistics",
"analytics",
"diagram",
"graph"
],
7,557 changes: 7,557 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/lucide-figma/package.json
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
},
"devDependencies": {
"@figma/plugin-typings": "^1.36.0",
"@lucide/shared": "workspace:*",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@vitejs/plugin-react": "^1.0.0",
12 changes: 1 addition & 11 deletions packages/lucide-figma/src/helpers/createIconComponent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { forwardRef, createElement, SVGProps } from 'react';
import { IconNode } from '../api/fetchIcons';
import { toKebabCase } from '@lucide/shared';

const defaultAttributes = {
xmlns: 'http://www.w3.org/2000/svg',
@@ -17,17 +18,6 @@ export interface LucideProps extends Partial<SVGProps<SVGSVGElement>> {
size?: string | number;
}

/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();

const createIconComponent = (iconName: string, iconNode: IconNode) => {
const Component = forwardRef<SVGSVGElement, LucideProps>(
({ color = 'currentColor', size = 24, strokeWidth = 2, children, ...rest }, ref) =>
1 change: 1 addition & 0 deletions packages/lucide-preact/package.json
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
"devDependencies": {
"@lucide/build-icons": "workspace:*",
"@lucide/rollup-plugins": "workspace:*",
"@lucide/shared": "workspace:*",
"@preact/preset-vite": "^2.7.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/preact": "^3.2.3",
5 changes: 3 additions & 2 deletions packages/lucide-preact/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import plugins, { replace } from '@lucide/rollup-plugins';
import plugins from '@lucide/rollup-plugins';
import dts from 'rollup-plugin-dts';
import pkg from './package.json' assert { type: 'json' };

@@ -35,7 +35,7 @@ const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
external: ['preact'],
output: {
name: packageName,
@@ -49,6 +49,7 @@ const configs = bundles
preserveModules,
format,
sourcemap: true,
preserveModulesRoot: 'src',
globals: {
preact: 'preact',
},
14 changes: 5 additions & 9 deletions packages/lucide-preact/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type FunctionComponent, h, type JSX, toChildArray } from 'preact';
import defaultAttributes from './defaultAttributes';
import { toKebabCase } from '@lucide/shared';

export type IconNode = [elementName: keyof JSX.IntrinsicElements, attrs: Record<string, string>][];

@@ -13,16 +14,11 @@ export interface LucideProps extends Partial<Omit<JSX.SVGAttributes, 'ref' | 'si
export type LucideIcon = FunctionComponent<LucideProps>;

/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
* Create a Lucide icon component
* @param {string} iconName
* @param {array} iconNode
* @returns {FunctionComponent} LucideIcon
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();

const createLucideIcon = (iconName: string, iconNode: IconNode): LucideIcon => {
const Component = ({
color = 'currentColor',
2 changes: 1 addition & 1 deletion packages/lucide-react-native/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
external: ['react', 'react-native-svg'],
output: {
name: packageName,
1 change: 1 addition & 0 deletions packages/lucide-react/package.json
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@
"devDependencies": {
"@lucide/build-icons": "workspace:*",
"@lucide/rollup-plugins": "workspace:*",
"@lucide/shared": "workspace:*",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.37",
5 changes: 3 additions & 2 deletions packages/lucide-react/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import plugins, { replace } from '@lucide/rollup-plugins';
import plugins from '@lucide/rollup-plugins';
import pkg from './package.json' assert { type: 'json' };
import dts from 'rollup-plugin-dts';
import getAliasesEntryNames from './scripts/getAliasesEntryNames.mjs';
@@ -62,7 +62,7 @@ const configs = bundles
}) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
external: ['react', 'prop-types', ...external],
output: {
name: packageName,
@@ -80,6 +80,7 @@ const configs = bundles
format,
sourcemap: true,
preserveModules,
preserveModulesRoot: 'src',
globals: {
react: 'react',
'prop-types': 'PropTypes',
14 changes: 1 addition & 13 deletions packages/lucide-react/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import {
RefAttributes,
} from 'react';
import defaultAttributes from './defaultAttributes';
import { toKebabCase } from '@lucide/shared';

export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];

@@ -19,19 +20,6 @@ export interface LucideProps extends ComponentAttributes {
}

export type LucideIcon = ForwardRefExoticComponent<LucideProps>;
/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = (string: string) =>
string
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
.toLowerCase()
.trim();

const createLucideIcon = (iconName: string, iconNode: IconNode): LucideIcon => {
const Component = forwardRef<SVGSVGElement, LucideProps>(
24 changes: 13 additions & 11 deletions packages/lucide-solid/package.json
Original file line number Diff line number Diff line change
@@ -42,31 +42,33 @@
},
"sideEffects": false,
"scripts": {
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:bundle && pnpm build:version",
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:bundle",
"copy:license": "cp ../../LICENSE ./LICENSE",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js",
"build:transpile": "tsc --jsx preserve -t es2020 --rootDir src --outDir dist --noEmit false",
"build:version": "node ./scripts/replaceVersion.mjs",
"build:bundle": "rollup -c rollup.config.mjs",
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --withAliases --aliasesFileExtension=.ts --iconFileExtension=.tsx --exportFileName=index.ts",
"test": "vitest run",
"version": "pnpm version --git-tag-version=false"
},
"devDependencies": {
"@atomico/rollup-plugin-sizes": "^1.1.4",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-typescript": "^7.23.3",
"@lucide/build-icons": "workspace:*",
"@solidjs/testing-library": "^0.8.5",
"@testing-library/jest-dom": "^6.1.4",
"@lucide/rollup-plugins": "workspace:*",
"@lucide/shared": "workspace:*",
"@rollup/plugin-babel": "^6.0.4",
"@solidjs/testing-library": "^0.8.6",
"@testing-library/jest-dom": "^6.4.2",
"babel-preset-solid": "^1.8.12",
"jest-serializer-html": "^7.1.0",
"jsdom": "^23.0.1",
"rollup": "^4.9.2",
"rollup-plugin-license": "^3.0.1",
"rollup-preset-solid": "^2.0.1",
"solid-js": "^1.8.7",
"typescript": "^4.9.4",
"vite": "5.0.12",
"vite-plugin-solid": "^2.8.0",
"vitest": "0.34.2"
"vite-plugin-solid": "^2.10.1",
"vitest": "^1.1.1",
"esbuild": "^0.19.11"
},
"peerDependencies": {
"solid-js": "^1.4.7"
135 changes: 121 additions & 14 deletions packages/lucide-solid/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,127 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import withSolid from 'rollup-preset-solid';
import bundleSize from '@atomico/rollup-plugin-sizes';
import license from 'rollup-plugin-license';
import path from 'path';
import { babel } from '@rollup/plugin-babel';
import esbuild from 'esbuild';
import plugins from '@lucide/rollup-plugins';
import ts from 'typescript';

import pkg from './package.json' assert { type: 'json' };

const config = withSolid({
targets: ['esm', 'cjs'],
});
const packageName = 'LucideSolid';
const outputFileName = 'lucide-solid';
const outputDir = 'dist';
const inputs = ['src/lucide-solid.ts'];

config.plugins = [
...config.plugins,
license({
banner: `${pkg.name} v${pkg.version} - ${pkg.license}`,
}),
bundleSize(),
const bundles = [
{
format: 'cjs',
inputs,
outputDir,
},
{
format: 'esm',
inputs,
outputDir,
},
];

export default config;
const configs = bundles
.map(({ inputs, outputDir, format, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: [
babel({
extensions: ['.ts', '.tsx', '.js'],
babelHelpers: 'bundled',
presets: [
'babel-preset-solid',
'@babel/preset-typescript',
['@babel/preset-env', { bugfixes: true, targets: 'last 2 years' }],
],
}),
...plugins({
pkg,
withEsbuild: false,
}),
format === 'esm'
? {
name: 'ts',
buildEnd() {
// Transpile typescript to './dist/source'
esbuild.build({
entryPoints: ['./src/**/*.tsx', './src/**/*.ts'],
outdir: './dist/source',
loader: {
'.js': 'jsx',
},
jsx: 'preserve',
bundle: true,
format: 'esm',
sourcemap: true,
target: ['esnext'],
banner: {
js: `/**
* @license ${pkg.name} v${pkg.version} - ${pkg.license}
*
* This source code is licensed under the ${pkg.license} license.
* See the LICENSE file in the root directory of this source tree.
*/`,
},
plugins: [
{
name: 'externalize-everything-except-own-dependencies',
setup(build) {
build.onResolve({ filter: /(.*)/ }, (args) => {
const modulePath = path.join(args.resolveDir, args.path);
if (
args.kind === 'import-statement' &&
args.path !== '@lucide/shared' &&
!modulePath.includes('packages/shared')
) {
return { path: args.path, external: true };
}
});
},
},
],
external: ['solid-js'],
});

// Generate types
const program = ts.createProgram([pkg.source], {
target: ts.ScriptTarget.ESNext,
module: ts.ModuleKind.ESNext,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
jsx: ts.JsxEmit.Preserve,
jsxImportSource: 'solid-js',
allowSyntheticDefaultImports: true,
esModuleInterop: true,
declarationDir: `dist/types`,
declaration: true,
emitDeclarationOnly: true,
});
program.emit();
},
}
: null,
],
external: ['solid-js', 'solid-js/web', 'solid-js/store'],
output: {
name: packageName,
...(preserveModules
? {
dir: `${outputDir}/${format}`,
exports: 'auto',
}
: {
file: `${outputDir}/${format}/${outputFileName}.js`,
}),
format: format === 'source' ? 'esm' : format,
preserveModules,
preserveModulesRoot: 'src',
sourcemap: true,
},
})),
)
.flat();

export default configs;
88 changes: 0 additions & 88 deletions packages/lucide-solid/scripts/buildTypes.mjs

This file was deleted.

13 changes: 0 additions & 13 deletions packages/lucide-solid/scripts/replaceVersion.mjs

This file was deleted.

14 changes: 2 additions & 12 deletions packages/lucide-solid/src/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { For, JSX, splitProps } from 'solid-js';
import { For, splitProps } from 'solid-js';
import { Dynamic } from 'solid-js/web';
import defaultAttributes from './defaultAttributes';
import { IconNode, LucideProps } from './types';

/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
import { toKebabCase } from '@lucide/shared';

interface IconProps {
name: string;
4 changes: 0 additions & 4 deletions packages/lucide-solid/src/lucide-solid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* lucide-solid {{version}} - ISC
*/

export * from './icons';
export * as icons from './icons';
export * from './aliases';
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Using lucide icon components > should adjust the size, stroke color and stroke width 1`] = `
<svg data-testid="grid-icon"
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
width="48"
height="48"
stroke="red"
stroke-width="4"
class="lucide lucide-grid3x3 "
xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
data-testid="grid-icon"
>
<rect width="18"
height="18"
@@ -41,17 +41,17 @@ exports[`Using lucide icon components > should adjust the size, stroke color and
`;

exports[`Using lucide icon components > should not scale the strokeWidth when absoluteStrokeWidth is set 1`] = `
<svg data-testid="grid-icon"
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
width="48"
height="48"
stroke="red"
stroke-width="1"
class="lucide lucide-grid3x3 "
xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
data-testid="grid-icon"
>
<rect width="18"
height="18"
@@ -81,16 +81,16 @@ exports[`Using lucide icon components > should not scale the strokeWidth when ab
`;

exports[`Using lucide icon components > should render a component 1`] = `
<svg width="24"
height="24"
stroke="currentColor"
stroke-width="2"
class="lucide lucide-grid3x3 "
xmlns="http://www.w3.org/2000/svg"
<svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 24 24"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
width="24"
height="24"
stroke="currentColor"
stroke-width="2"
class="lucide lucide-grid3x3 "
>
<rect width="18"
height="18"
4 changes: 3 additions & 1 deletion packages/lucide-solid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@
"types": ["vite/client", "@testing-library/jest-dom"],
"noEmit": true,
"isolatedModules": true,
"outDir": "dist",
"outDir": "./dist",
"declarationDir": "./dist",
"declaration": true,
},
}
2 changes: 1 addition & 1 deletion packages/lucide-static/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
output: {
name: outputFileName,
...(preserveModules
1 change: 1 addition & 0 deletions packages/lucide-vue-next/package.json
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
"devDependencies": {
"@lucide/build-icons": "workspace:*",
"@lucide/rollup-plugins": "workspace:*",
"@lucide/shared": "workspace:*",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/vue": "^8.0.1",
"@vitejs/plugin-vue": "^4.6.2",
3 changes: 2 additions & 1 deletion packages/lucide-vue-next/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
external: ['vue'],
output: {
name: packageName,
@@ -48,6 +48,7 @@ const configs = bundles
}),
format,
preserveModules,
preserveModulesRoot: 'src',
sourcemap: true,
globals: {
vue: 'vue',
17 changes: 7 additions & 10 deletions packages/lucide-vue-next/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { h } from 'vue';
import type { SVGAttributes, FunctionalComponent, DefineComponent } from 'vue';
import type { SVGAttributes, FunctionalComponent } from 'vue';
import defaultAttributes from './defaultAttributes';
import { toKebabCase } from '@lucide/shared';

// Create interface extending SVGAttributes
export interface SVGProps extends Partial<SVGAttributes> {
@@ -11,17 +12,13 @@ export interface SVGProps extends Partial<SVGAttributes> {

export type IconNode = [elementName: string, attrs: Record<string, string>][];
export type Icon = FunctionalComponent<SVGProps>;

/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
* Create a Lucide icon component
* @param {string} iconName
* @param {array} iconNode
* @returns {FunctionalComponent} LucideIcon
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();

const createLucideIcon =
(iconName: string, iconNode: IconNode): Icon =>
(
1 change: 1 addition & 0 deletions packages/lucide-vue/package.json
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
"devDependencies": {
"@lucide/build-icons": "workspace:*",
"@lucide/rollup-plugins": "workspace:*",
"@lucide/shared": "workspace:*",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/vue": "^5.9.0",
"@vitejs/plugin-vue2": "2.2.0",
3 changes: 2 additions & 1 deletion packages/lucide-vue/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ const configs = bundles
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
inputs.map((input) => ({
input,
plugins: plugins(pkg, minify),
plugins: plugins({ pkg, minify }),
external: ['vue'],
output: {
name: packageName,
@@ -47,6 +47,7 @@ const configs = bundles
}),
format,
preserveModules,
preserveModulesRoot: 'src',
sourcemap: true,
globals: {
vue: 'vue',
13 changes: 1 addition & 12 deletions packages/lucide-vue/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import { Component } from 'vue';
import { Vue, VueConfiguration } from 'vue/types/vue';
import defaultAttributes from './defaultAttributes';
import { toKebabCase } from '@lucide/shared';

var showDeprecationWarning = true;

type IconNode = [elementName: string, attrs: Record<string, string>][];

/**
* Converts string to KebabCase
* Copied from scripts/helper. If anyone knows how to properly import it here
* then please fix it.
*
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();

export default (iconName: string, iconNode: IconNode): Component => ({
name: iconName,
functional: true,
2 changes: 1 addition & 1 deletion packages/lucide/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ const configs = bundles
}),
]
: []),
...plugins(pkg, minify),
...plugins({ pkg, minify }),
],
output: {
name: outputFileName,
3 changes: 3 additions & 0 deletions packages/shared/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @lucide/shared

A collection of shared internal utilities for Lucide.
11 changes: 11 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@lucide/shared",
"version": "1.0.0",
"private": true,
"description": "",
"main": "src/index.ts",
"types": "src/index.ts",
"type": "module",
"author": "",
"license": "ISC"
}
1 change: 1 addition & 0 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './utils';
8 changes: 8 additions & 0 deletions packages/shared/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Converts string to KebabCase
*
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = (string: string) =>
string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
6,405 changes: 3,483 additions & 2,922 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

37 changes: 19 additions & 18 deletions scripts/generateChangedIconsCommentMarkup.mjs
Original file line number Diff line number Diff line change
@@ -14,19 +14,17 @@ const changedFiles = changedFilesPathString
.filter((file, idx, arr) => arr.indexOf(file) === idx);

const getImageTagsByFiles = (files, getBaseUrl, width) =>
files
.map((file) => {
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');
const strippedAttrsSVG = svgContent.replace(/<svg[^>]*>/, '<svg>');
const minifiedSvg = minifySvg(strippedAttrsSVG);
files.map((file) => {
const svgContent = fs.readFileSync(path.join(process.cwd(), file), 'utf-8');
const strippedAttrsSVG = svgContent.replace(/<svg[^>]*>/, '<svg>');
const minifiedSvg = minifySvg(strippedAttrsSVG);

const base64 = Buffer.from(minifiedSvg).toString('base64');
const url = getBaseUrl(file);
const widthAttr = width ? `width="${width}"` : '';
const base64 = Buffer.from(minifiedSvg).toString('base64');
const url = getBaseUrl(file);
const widthAttr = width ? `width="${width}"` : '';

return `<img title="${file}" alt="${file}" ${widthAttr} src="${url}/${base64}.svg"/>`;
})
.join('');
return `<img title="${file}" alt="${file}" ${widthAttr} src="${url}/${base64}.svg"/>`;
});

const svgFiles = readSvgDirectory(ICONS_DIR).map((file) => `icons/${file}`);

@@ -35,29 +33,32 @@ const iconsFilteredByName = (search) => svgFiles.filter((file) => file.includes(
const cohesionRandomImageTags = getImageTagsByFiles(
shuffle(svgFiles).slice(0, changedFiles.length),
() => `${BASE_URL}/stroke-width/2`,
);
).join('');

const cohesionSquaresImageTags = getImageTagsByFiles(
shuffle(iconsFilteredByName('square')).slice(0, changedFiles.length),
() => `${BASE_URL}/stroke-width/2`,
);
).join('');

const changeFiles1pxStrokeImageTags = getImageTagsByFiles(
changedFiles,
() => `${BASE_URL}/stroke-width/1`,
);
).join('');

const changeFiles2pxStrokeImageTags = getImageTagsByFiles(
changedFiles,
() => `${BASE_URL}/stroke-width/2`,
);
).join('');

const changeFiles3pxStrokeImageTags = getImageTagsByFiles(
changedFiles,
() => `${BASE_URL}/stroke-width/3`,
);
).join('');

const changeFilesLowDPIImageTags = getImageTagsByFiles(changedFiles, () => `${BASE_URL}/dpi/24`);
const changeFilesLowDPIImageTags = getImageTagsByFiles(
changedFiles,
() => `${BASE_URL}/dpi/24`,
).join(' ');

const changeFilesXRayImageTags = getImageTagsByFiles(
changedFiles,
@@ -67,7 +68,7 @@ const changeFilesXRayImageTags = getImageTagsByFiles(
return `${BASE_URL}/${iconName}`;
},
400,
);
).join(' ');

const commentMarkup = `\
### Added or changed icons
1 change: 1 addition & 0 deletions tools/rollup-plugins/package.json
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
"type": "module",
"dependencies": {
"@atomico/rollup-plugin-sizes": "^1.1.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"esbuild": "^0.19.11",
"rollup": "^4.9.2",
15 changes: 11 additions & 4 deletions tools/rollup-plugins/plugins.js
Original file line number Diff line number Diff line change
@@ -4,12 +4,19 @@ import bundleSize from '@atomico/rollup-plugin-sizes';
import replace from '@rollup/plugin-replace';
import license from 'rollup-plugin-license';
import esbuild from 'rollup-plugin-esbuild';
import { nodeResolve } from '@rollup/plugin-node-resolve';

const plugins = (pkg, minify, esbuildOptions = {}) =>
const plugins = ({ pkg, minify = false, withEsbuild = true, esbuildOptions = {} }) =>
[
esbuild({
minify,
...esbuildOptions,
withEsbuild
? esbuild({
minify,
...esbuildOptions,
})
: null,
nodeResolve({
extensions: ['.js', '.ts', '.jsx', '.tsx'],
resolveOnly: [/^@lucide\/.*$/],
}),
license({
banner: `@license ${pkg.name} v${pkg.version} - ${pkg.license}