diff --git a/packages/lucide-solid/package.json b/packages/lucide-solid/package.json index 34f27357deb..f4541ae4b58 100644 --- a/packages/lucide-solid/package.json +++ b/packages/lucide-solid/package.json @@ -46,8 +46,6 @@ "copy:license": "cp ../../LICENSE ./LICENSE", "clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js", "build:bundle": "rollup -c rollup.config.mjs", - "build:types": "tsc --emitDeclarationOnly --noEmit false --root ./src --outDir ./dist/types", - "build:source": "esbuild ./src/** --outdir=./dist/source --loader:.js=jsx --jsx=preserve --bundle --format=esm --sourcemap --target=esnext --external:solid-js", "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" diff --git a/packages/lucide-solid/rollup.config.mjs b/packages/lucide-solid/rollup.config.mjs index d63abb040d9..d676c46c1d5 100644 --- a/packages/lucide-solid/rollup.config.mjs +++ b/packages/lucide-solid/rollup.config.mjs @@ -41,7 +41,7 @@ const configs = bundles ["@babel/preset-env", { bugfixes: true, targets: 'last 2 years' }], ], }), - resolve({ extensions: ['.js', '.ts', '.jsx' ]}), + resolve({ extensions: [".js", ".ts", ".jsx", ".tsx"]}), ...plugins({ pkg, withEsbuild: false, @@ -61,6 +61,14 @@ const configs = bundles 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) { diff --git a/packages/lucide-solid/scripts/buildTypes.mjs b/packages/lucide-solid/scripts/buildTypes.mjs deleted file mode 100644 index 4bc32bc163c..00000000000 --- a/packages/lucide-solid/scripts/buildTypes.mjs +++ /dev/null @@ -1,88 +0,0 @@ -import path from 'path'; -// eslint-disable-next-line import/no-extraneous-dependencies -import { getAliases } from '@lucide/build-icons'; -import { - writeFile, - readSvgDirectory, - resetFile, - toPascalCase, - getCurrentDirPath, -} from '../../../scripts/helpers.mjs'; - -const currentDir = getCurrentDirPath(import.meta.url); -const srcDirectory = path.join(currentDir, '../dist'); - -const writeDeclarationFile = (typesFile, directory, content) => { - resetFile(typesFile, directory); - writeFile(content, typesFile, directory); -}; - -const ICONS_DIR = path.resolve(currentDir, '../../../icons'); -const TYPES_FILE = 'lucide-solid.d.ts'; - -// Declare type definitions -let declarationFileContent = `\ -/// -import { JSX } from 'solid-js' - -interface LucideProps extends Partial> { - key?: string | number; - color?: string - size?: string | number - strokeWidth?: string | number - absoluteStrokeWidth?: boolean - class?: string -} - -export type LucideIcon = (props: LucideProps) => JSX.Element; - -// Generated icons -`; - -const svgFiles = readSvgDirectory(ICONS_DIR); - -svgFiles.forEach((svgFile) => { - const iconName = path.basename(svgFile, '.svg'); - const componentName = toPascalCase(iconName); - - declarationFileContent += `export declare const ${componentName}: LucideIcon;\n`; -}); - -const aliases = await getAliases(ICONS_DIR); - -declarationFileContent += `\n - -// Generated icon aliases -`; - -let aliasesCount = 0; - -svgFiles.forEach((svgFile) => { - const iconName = path.basename(svgFile, '.svg'); - const componentName = toPascalCase(iconName); - const iconAliases = aliases[iconName]?.aliases; - - declarationFileContent += `// ${componentName} aliases\n`; - declarationFileContent += `export declare const ${componentName}Icon: LucideIcon;\n`; - declarationFileContent += `export declare const Lucide${componentName}: LucideIcon;\n`; - aliasesCount += 1; - if (iconAliases != null && Array.isArray(iconAliases)) { - iconAliases.forEach((alias) => { - const componentNameAlias = toPascalCase(alias); - declarationFileContent += `export declare const ${componentNameAlias}: LucideIcon;\n`; - - aliasesCount += 1; - }); - } - - declarationFileContent += '\n'; -}); - -writeDeclarationFile(TYPES_FILE, srcDirectory, declarationFileContent); -console.log( - `Generated ${TYPES_FILE} file with`, - svgFiles.length, - 'icons and with', - aliasesCount, - 'aliases', -); diff --git a/packages/lucide-solid/scripts/replaceVersion.mjs b/packages/lucide-solid/scripts/replaceVersion.mjs deleted file mode 100644 index 01fad2a8e72..00000000000 --- a/packages/lucide-solid/scripts/replaceVersion.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import fs from 'fs'; -import path from 'path'; - -import pkg from '../package.json' assert { type: 'json' }; - -const files = ['dist/source/lucide-solid.js', 'dist/types/lucide-solid.d.ts']; - -files.forEach((file) => { - const fileContents = fs.readFileSync(path.resolve(file), 'utf-8'); - const newFileContents = fileContents.replace('{{version}}', pkg.version); - - fs.writeFileSync(path.resolve(file), newFileContents, 'utf-8'); -}); diff --git a/packages/lucide-solid/src/lucide-solid.ts b/packages/lucide-solid/src/lucide-solid.ts index f5d8e914bf6..2e28382436f 100644 --- a/packages/lucide-solid/src/lucide-solid.ts +++ b/packages/lucide-solid/src/lucide-solid.ts @@ -1,7 +1,3 @@ -/** - * lucide-solid {{version}} - ISC - */ - export * from './icons'; export * as icons from './icons'; export * from './aliases'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8135ee80a88..227e7c26fd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -780,9 +780,6 @@ importers: '@atomico/rollup-plugin-sizes': specifier: ^1.1.4 version: 1.1.4(rollup@4.9.6) - '@rollup/plugin-node-resolve': - specifier: ^15.2.3 - version: 15.2.3(rollup@4.9.6) '@rollup/plugin-replace': specifier: ^5.0.5 version: 5.0.5(rollup@4.9.6) @@ -7156,6 +7153,7 @@ packages: is-module: 1.0.0 resolve: 1.22.8 rollup: 4.9.6 + dev: true /@rollup/plugin-replace@5.0.2: resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==} @@ -7319,6 +7317,7 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 rollup: 4.9.6 + dev: true /@rollup/rollup-android-arm-eabi@4.9.6: resolution: {integrity: sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==} @@ -8123,6 +8122,7 @@ packages: /@types/resolve@1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + dev: true /@types/retry@0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -10253,6 +10253,7 @@ packages: /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} + dev: true /builtins@1.0.3: resolution: {integrity: sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==} @@ -11497,6 +11498,7 @@ packages: /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + dev: true /default-gateway@6.0.3: resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} @@ -13918,6 +13920,7 @@ packages: /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -14427,6 +14430,7 @@ packages: engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 + dev: true /hast-util-from-parse5@8.0.1: resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==} @@ -15080,6 +15084,7 @@ packages: engines: {node: '>=6'} dependencies: builtin-modules: 3.3.0 + dev: true /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} @@ -15096,6 +15101,7 @@ packages: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: hasown: 2.0.0 + dev: true /is-data-descriptor@0.1.4: resolution: {integrity: sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==} @@ -15199,6 +15205,7 @@ packages: /is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + dev: true /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} @@ -18332,6 +18339,7 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true /path-scurry@1.10.1: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} @@ -20034,6 +20042,7 @@ packages: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + dev: true /restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} @@ -21557,6 +21566,7 @@ packages: /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + dev: true /svelte-check@3.4.6(svelte@4.1.2): resolution: {integrity: sha512-OBlY8866Zh1zHQTkBMPS6psPi7o2umTUyj6JWm4SacnIHXpWFm658pG32m3dKvKFL49V4ntAkfFHKo4ztH07og==} diff --git a/tools/rollup-plugins/package.json b/tools/rollup-plugins/package.json index a86e398036b..63e7d40a397 100644 --- a/tools/rollup-plugins/package.json +++ b/tools/rollup-plugins/package.json @@ -10,7 +10,6 @@ "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", diff --git a/tools/rollup-plugins/plugins.js b/tools/rollup-plugins/plugins.js index afc7ba531e5..79646de4806 100644 --- a/tools/rollup-plugins/plugins.js +++ b/tools/rollup-plugins/plugins.js @@ -4,7 +4,6 @@ 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 = false, withEsbuild = true, esbuildOptions = {} }) => [ @@ -12,10 +11,6 @@ const plugins = ({ pkg, minify = false, withEsbuild = true, esbuildOptions = {} minify, ...esbuildOptions, }) : null, - nodeResolve({ - extensions: [".js", ".ts", ".jsx", ".tsx"], - resolveOnly: [/^@lucide\/.*$/], - }), license({ banner: `@license ${pkg.name} v${pkg.version} - ${pkg.license}