mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 19:37:41 +01:00
Compare commits
4 Commits
fix/fixed-
...
icons-pack
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be94febe4e | ||
|
|
6b618cd030 | ||
|
|
884bf6fb10 | ||
|
|
d2426203c9 |
10
packages/icons/.npmignore
Normal file
10
packages/icons/.npmignore
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
stats
|
||||||
|
node_modules
|
||||||
|
tests
|
||||||
|
scripts
|
||||||
|
build
|
||||||
|
src
|
||||||
|
babel.config.js
|
||||||
|
jest.config.js
|
||||||
|
rollup.config.js
|
||||||
|
yarn.error.log
|
||||||
46
packages/icons/package.json
Normal file
46
packages/icons/package.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"name": "@lucide/icons",
|
||||||
|
"description": "Lucide is a community-run fork of Feather Icons, open for anyone to contribute icons.",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "ISC",
|
||||||
|
"homepage": "https://lucide.dev",
|
||||||
|
"bugs": "https://github.com/lucide-icons/lucide/issues",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/lucide-icons/lucide.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Lucide",
|
||||||
|
"Feather",
|
||||||
|
"Icons",
|
||||||
|
"Icon",
|
||||||
|
"SVG",
|
||||||
|
"Feather Icons",
|
||||||
|
"Fontawesome",
|
||||||
|
"Font Awesome"
|
||||||
|
],
|
||||||
|
"source": "src/lucide-icons.js",
|
||||||
|
"main": "dist/cjs/lucide-icons.js",
|
||||||
|
"module": "dist/esm/lucide-icons.js",
|
||||||
|
"typings": "dist/lucide-icons.d.ts",
|
||||||
|
"sideEffects": false,
|
||||||
|
"scripts": {
|
||||||
|
"copy:license": "cp ../../LICENSE ./LICENSE",
|
||||||
|
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:bundles",
|
||||||
|
"build:tags": "node ../../scripts/migrateIconsToTags.mjs",
|
||||||
|
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts",
|
||||||
|
"build:lib": "node ./scripts/buildLib.mjs",
|
||||||
|
"build:bundles": "rollup -c rollup.config.mjs",
|
||||||
|
"clean": "rm -rf lib && rm -rf build && rm -rf icons && rm -f sprite.svg",
|
||||||
|
"version": "pnpm version --git-tag-version=false"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@lucide/build-icons": "workspace:*",
|
||||||
|
"@lucide/helpers": "workspace:*",
|
||||||
|
"@lucide/rollup-plugins": "workspace:*",
|
||||||
|
"prettier": "^2.3.2",
|
||||||
|
"rollup": "^4.22.4",
|
||||||
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
|
"svgson": "^5.2.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
59
packages/icons/rollup.config.mjs
Normal file
59
packages/icons/rollup.config.mjs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import plugins from '@lucide/rollup-plugins';
|
||||||
|
import dts from 'rollup-plugin-dts';
|
||||||
|
import pkg from './package.json' assert { type: 'json' };
|
||||||
|
|
||||||
|
const outputFileName = pkg.name;
|
||||||
|
const outputDir = 'dist';
|
||||||
|
const inputs = ['src/lucide-icons.ts'];
|
||||||
|
const bundles = [
|
||||||
|
{
|
||||||
|
format: 'cjs',
|
||||||
|
inputs,
|
||||||
|
outputDir,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
format: 'esm',
|
||||||
|
inputs,
|
||||||
|
outputDir,
|
||||||
|
preserveModules: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const configs = bundles
|
||||||
|
.map(({ inputs, outputDir, format, minify, preserveModules }) =>
|
||||||
|
inputs.map((input) => ({
|
||||||
|
input,
|
||||||
|
plugins: plugins({ pkg, minify }),
|
||||||
|
output: {
|
||||||
|
name: outputFileName,
|
||||||
|
...(preserveModules
|
||||||
|
? {
|
||||||
|
dir: `${outputDir}/${format}`,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
|
||||||
|
}),
|
||||||
|
format,
|
||||||
|
sourcemap: true,
|
||||||
|
preserveModules,
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.flat();
|
||||||
|
|
||||||
|
const typesFileConfig = {
|
||||||
|
input: inputs[0],
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: `${outputDir}/${outputFileName}.d.ts`,
|
||||||
|
format: 'esm',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
dts({
|
||||||
|
include: ['src'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default [...configs, typesFileConfig];
|
||||||
25
packages/icons/scripts/exportTemplate.mjs
Normal file
25
packages/icons/scripts/exportTemplate.mjs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
import { toCamelCase } from '@lucide/helpers';
|
||||||
|
|
||||||
|
export default ({ iconName, children, getSvg, deprecated, deprecationReason }) => {
|
||||||
|
const svgContents = getSvg();
|
||||||
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
const exportName = toCamelCase(iconName)
|
||||||
|
|
||||||
|
return `
|
||||||
|
import { IconNode } from '../types';
|
||||||
|
/**
|
||||||
|
* @name ${iconName}
|
||||||
|
* @description Lucide SVG string.
|
||||||
|
*
|
||||||
|
* @preview  - https://lucide.dev/icons/${iconName}
|
||||||
|
*
|
||||||
|
* @returns {IconNode}
|
||||||
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
||||||
|
*/
|
||||||
|
const _${exportName}: IconNode = ${JSON.stringify(children)}
|
||||||
|
|
||||||
|
export default _${exportName};
|
||||||
|
`;
|
||||||
|
};
|
||||||
1
packages/icons/src/aliases/index.ts
Normal file
1
packages/icons/src/aliases/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './aliases';
|
||||||
1
packages/icons/src/icons/.gitkeep
Normal file
1
packages/icons/src/icons/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Folder for generated icons
|
||||||
2
packages/icons/src/lucide-icons.ts
Normal file
2
packages/icons/src/lucide-icons.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './icons';
|
||||||
|
export * from './aliases';
|
||||||
3
packages/icons/src/types.ts
Normal file
3
packages/icons/src/types.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export type SVGProps = Record<string, string | number>;
|
||||||
|
export type IconNode = readonly [tag: string, attrs: SVGProps][];
|
||||||
|
export type Icons = { [key: string]: IconNode };
|
||||||
17
packages/icons/tsconfig.json
Normal file
17
packages/icons/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true,
|
||||||
|
"declaration": true,
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"module": "ESNext",
|
||||||
|
"target": "ESNext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowJs": true,
|
||||||
|
"lib": ["esnext", "dom"],
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"outDir": "./dist",
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --separateIconFileExport --separateIconFileExportExtension=.ts --withAliases --aliasesFileExtension=.ts --separateAliasesFile --separateAliasesFileExtension=.ts --aliasImportFileExtension=.js --pretty=false",
|
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --separateIconFileExport --separateIconFileExportExtension=.ts --withAliases --aliasesFileExtension=.ts --separateAliasesFile --separateAliasesFileExtension=.ts --aliasImportFileExtension=.js --pretty=false",
|
||||||
"build:package": "svelte-package --input ./src",
|
"build:package": "svelte-package --input ./src",
|
||||||
"build:license": "node ./scripts/appendBlockComments.mjs",
|
"build:license": "node ./scripts/appendBlockComments.mjs",
|
||||||
"test": "pnpm build:icons && vitest run",
|
"test": "pnpm copy:license && pnpm build:icons && vitest run",
|
||||||
"test:watch": "vitest watch",
|
"test:watch": "vitest watch",
|
||||||
"version": "pnpm version --git-tag-version=false"
|
"version": "pnpm version --git-tag-version=false"
|
||||||
},
|
},
|
||||||
|
|||||||
36
pnpm-lock.yaml
generated
36
pnpm-lock.yaml
generated
@@ -183,6 +183,30 @@ importers:
|
|||||||
specifier: ^1.3.1
|
specifier: ^1.3.1
|
||||||
version: 1.3.3(@algolia/client-search@4.19.1)(@types/node@20.4.5)(@types/react@18.2.55)(axios@1.7.4)(fuse.js@6.6.2)(less@4.2.0)(postcss@8.4.49)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.77.8)(search-insights@2.8.2)(stylus@0.56.0)(terser@5.31.6)(typescript@5.3.3)
|
version: 1.3.3(@algolia/client-search@4.19.1)(@types/node@20.4.5)(@types/react@18.2.55)(axios@1.7.4)(fuse.js@6.6.2)(less@4.2.0)(postcss@8.4.49)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.77.8)(search-insights@2.8.2)(stylus@0.56.0)(terser@5.31.6)(typescript@5.3.3)
|
||||||
|
|
||||||
|
packages/icons:
|
||||||
|
devDependencies:
|
||||||
|
'@lucide/build-icons':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../tools/build-icons
|
||||||
|
'@lucide/helpers':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../tools/build-helpers
|
||||||
|
'@lucide/rollup-plugins':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../tools/rollup-plugins
|
||||||
|
prettier:
|
||||||
|
specifier: ^2.3.2
|
||||||
|
version: 2.8.8
|
||||||
|
rollup:
|
||||||
|
specifier: ^4.22.4
|
||||||
|
version: 4.22.4
|
||||||
|
rollup-plugin-dts:
|
||||||
|
specifier: ^6.1.0
|
||||||
|
version: 6.1.0(rollup@4.22.4)(typescript@5.3.3)
|
||||||
|
svgson:
|
||||||
|
specifier: ^5.2.1
|
||||||
|
version: 5.3.1
|
||||||
|
|
||||||
packages/lucide:
|
packages/lucide:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@lucide/build-icons':
|
'@lucide/build-icons':
|
||||||
@@ -17591,18 +17615,6 @@ snapshots:
|
|||||||
postcss: 8.4.49
|
postcss: 8.4.49
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
|
|
||||||
'@vue/compiler-sfc@3.4.18':
|
|
||||||
dependencies:
|
|
||||||
'@babel/parser': 7.23.9
|
|
||||||
'@vue/compiler-core': 3.4.18
|
|
||||||
'@vue/compiler-dom': 3.4.18
|
|
||||||
'@vue/compiler-ssr': 3.4.18
|
|
||||||
'@vue/shared': 3.4.18
|
|
||||||
estree-walker: 2.0.2
|
|
||||||
magic-string: 0.30.11
|
|
||||||
postcss: 8.4.41
|
|
||||||
source-map-js: 1.2.1
|
|
||||||
|
|
||||||
'@vue/compiler-sfc@3.4.21':
|
'@vue/compiler-sfc@3.4.21':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/parser': 7.26.1
|
'@babel/parser': 7.26.1
|
||||||
|
|||||||
Reference in New Issue
Block a user