mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-10 13:18:25 +00:00
7ebbb6abc3
* chore(deps-dev): bump the solid-deps group across 1 directory with 6 updates Bumps the solid-deps group with 6 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) | `7.29.7` | `8.0.10` | | [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) | `7.29.7` | `8.0.7` | | [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript) | `7.29.7` | `8.0.7` | | [@rollup/plugin-babel](https://github.com/rollup/plugins/tree/HEAD/packages/babel) | `6.1.0` | `7.1.0` | | [@solidjs/testing-library](https://github.com/solidjs/solid-testing-library) | `0.8.10` | `1.0.0-rc.2` | | [vite-plugin-solid](https://github.com/solidjs/solid-vite-plugin) | `2.11.14` | `2.11.15` | Updates `@babel/core` from 7.29.7 to 8.0.10 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.10/packages/babel-core) Updates `@babel/preset-env` from 7.29.7 to 8.0.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.7/packages/babel-preset-env) Updates `@babel/preset-typescript` from 7.29.7 to 8.0.7 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.7/packages/babel-preset-typescript) Updates `@rollup/plugin-babel` from 6.1.0 to 7.1.0 - [Changelog](https://github.com/rollup/plugins/blob/master/packages/babel/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/babel-v7.1.0/packages/babel) Updates `@solidjs/testing-library` from 0.8.10 to 1.0.0-rc.2 - [Commits](https://github.com/solidjs/solid-testing-library/commits) Updates `vite-plugin-solid` from 2.11.14 to 2.11.15 - [Release notes](https://github.com/solidjs/solid-vite-plugin/releases) - [Changelog](https://github.com/solidjs/solid-vite-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/solidjs/solid-vite-plugin/compare/vite-plugin-solid@2.11.14...vite-plugin-solid@2.11.15) --- updated-dependencies: - dependency-name: "@babel/core" dependency-version: 8.0.10 dependency-type: direct:development update-type: version-update:semver-major dependency-group: solid-deps - dependency-name: "@babel/preset-env" dependency-version: 8.0.7 dependency-type: direct:development update-type: version-update:semver-major dependency-group: solid-deps - dependency-name: "@babel/preset-typescript" dependency-version: 8.0.7 dependency-type: direct:development update-type: version-update:semver-major dependency-group: solid-deps - dependency-name: "@rollup/plugin-babel" dependency-version: 7.1.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: solid-deps - dependency-name: "@solidjs/testing-library" dependency-version: 1.0.0-rc.2 dependency-type: direct:development update-type: version-update:semver-major dependency-group: solid-deps - dependency-name: vite-plugin-solid dependency-version: 2.11.15 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: solid-deps ... Signed-off-by: dependabot[bot] <support@github.com> * fix(solid): make Solid builds work with Babel 8 - Drop the `bugfixes` option from `@babel/preset-env`; it was removed in Babel 8 because bugfix plugins are now always enabled. - Enable the `jsx` parser plugin for `.jsx`/`.tsx` files. Babel 8's `@babel/preset-typescript` no longer does this, and babel-preset-solid's Babel 7 `@babel/plugin-syntax-jsx` skips it when TypeScript is enabled. - Keep `@solidjs/testing-library` at `^0.8.10` for lucide-solid. The 1.x line targets Solid 2 (peer `solid-js >=2`) and breaks the Solid 1 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G9u8FhrFFoA9JwQHtymeAf --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
141 lines
4.1 KiB
JavaScript
141 lines
4.1 KiB
JavaScript
import path from 'path';
|
|
import { babel } from '@rollup/plugin-babel';
|
|
import esbuild from 'esbuild';
|
|
import plugins from '@lucide/rollup-plugins';
|
|
import dts from 'rollup-plugin-dts';
|
|
|
|
import pkg from './package.json' with { type: 'json' };
|
|
|
|
const dtsOptions = {
|
|
includeExternal: ['@lucide/shared/types'],
|
|
tsconfig: './tsconfig.json',
|
|
};
|
|
|
|
const packageName = '@lucide/solid';
|
|
const outputFileName = 'lucide-solid';
|
|
const outputDir = 'dist';
|
|
const inputs = ['src/lucide-solid.ts'];
|
|
|
|
const bundles = [
|
|
{
|
|
format: 'cjs',
|
|
inputs,
|
|
outputDir,
|
|
preserveModules: true,
|
|
},
|
|
{
|
|
format: 'esm',
|
|
inputs,
|
|
outputDir,
|
|
preserveModules: true,
|
|
extension: 'mjs',
|
|
},
|
|
];
|
|
|
|
const configs = bundles
|
|
.map(({ inputs, outputDir, format, preserveModules, extension = 'js' }) =>
|
|
inputs.map((input) => ({
|
|
input,
|
|
plugins: [
|
|
babel({
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
babelHelpers: 'bundled',
|
|
presets: [
|
|
'babel-preset-solid',
|
|
'@babel/preset-typescript',
|
|
['@babel/preset-env', { targets: 'last 2 years' }],
|
|
],
|
|
// Babel 8's @babel/preset-typescript no longer enables JSX parsing for .tsx files,
|
|
// and babel-preset-solid's Babel 7 JSX syntax plugin skips it when TypeScript is enabled.
|
|
overrides: [{ test: /\.[jt]sx$/, parserOpts: { plugins: ['jsx'] } }],
|
|
}),
|
|
...plugins({
|
|
pkg,
|
|
withEsbuild: false,
|
|
}),
|
|
format === 'esm'
|
|
? {
|
|
name: 'ts',
|
|
buildEnd() {
|
|
// Transpile typescript to './dist/source'
|
|
esbuild.build({
|
|
entryPoints: ['./src/**/*.tsx', './src/**/*.ts'],
|
|
outdir: './dist/source',
|
|
outExtension: {
|
|
'.js': '.jsx',
|
|
},
|
|
loader: {
|
|
'.js': 'jsx',
|
|
},
|
|
jsx: 'preserve',
|
|
jsxImportSource: '@solidjs/web',
|
|
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', '@solidjs/web'],
|
|
});
|
|
},
|
|
}
|
|
: null,
|
|
],
|
|
external: ['solid-js', '@solidjs/web'],
|
|
output: {
|
|
name: packageName,
|
|
...(preserveModules
|
|
? {
|
|
dir: `${outputDir}/${format}`,
|
|
exports: 'auto',
|
|
entryFileNames: `[name].${extension}`,
|
|
}
|
|
: {
|
|
file: `${outputDir}/${format}/${outputFileName}.${extension}`,
|
|
}),
|
|
format: format === 'source' ? 'esm' : format,
|
|
preserveModules,
|
|
preserveModulesRoot: 'src',
|
|
sourcemap: true,
|
|
},
|
|
})),
|
|
)
|
|
.flat();
|
|
|
|
const typesConfig = {
|
|
input: inputs[0],
|
|
output: {
|
|
dir: `${outputDir}/types`,
|
|
format: 'es',
|
|
preserveModules: true,
|
|
preserveModulesRoot: 'src',
|
|
entryFileNames: '[name].d.ts',
|
|
},
|
|
plugins: [dts(dtsOptions)],
|
|
};
|
|
|
|
export default [...configs, typesConfig];
|