Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanHazel authored Nov 15, 2024
2 parents 7359ae1 + d939a70 commit 6951b0a
Show file tree
Hide file tree
Showing 17 changed files with 146 additions and 15 deletions.
23 changes: 23 additions & 0 deletions icons/cloud-alert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"csandman",
"ericfennis",
"karsa-mistmere",
"lscheibel"
],
"tags": [
"weather",
"danger",
"warning",
"alert",
"error",
"sync",
"network",
"exclamation"
],
"categories": [
"development"
]
}
15 changes: 15 additions & 0 deletions icons/cloud-alert.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/drill.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"power",
Expand Down
7 changes: 3 additions & 4 deletions icons/drill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions icons/equal-approximately.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"ksk3110"
],
"tags": [
"about",
"calculate",
"maths",
"operater"
],
"categories": [
"maths"
]
}
14 changes: 14 additions & 0 deletions icons/equal-approximately.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions icons/laptop-minimal-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"ericfennis",
"jguddas"
],
"tags": [
"computer",
"screen",
"remote",
"success",
"done",
"todo",
"tick",
"complete",
"task"
],
"categories": [
"devices",
"notifications"
]
}
15 changes: 15 additions & 0 deletions icons/laptop-minimal-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions packages/lucide-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
},
"./icons/*": {
"types": "./dist/icons/*.svelte.d.ts",
"svelte": "./dist/icons/*.svelte"
"svelte": "./dist/icons/*.js",
"default": "./dist/icons/*.js"
}
},
"typings": "dist/lucide-svelte.d.ts",
Expand All @@ -48,7 +49,7 @@
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm build:package && pnpm build:license",
"copy:license": "cp ../../LICENSE ./LICENSE",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.svelte && rm -f index.js",
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --withAliases --aliasesFileExtension=.ts --aliasImportFileExtension=.svelte --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=.ts --pretty=false",
"build:package": "svelte-package --input ./src",
"build:license": "node ./scripts/appendBlockComments.mjs",
"test": "pnpm build:icons && vitest run",
Expand Down
2 changes: 1 addition & 1 deletion packages/lucide-svelte/scripts/license.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pkg from '../package.json' assert { type: 'json' };
import pkg from '../package.json' with { type: 'json' };

export function getJSBanner() {
return `/**
Expand Down
2 changes: 1 addition & 1 deletion packages/lucide/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import plugins from '@lucide/rollup-plugins';
import replace from '@rollup/plugin-replace';
import dts from 'rollup-plugin-dts';
import pkg from './package.json' assert { type: 'json' };
import pkg from './package.json' with { type: 'json' };

const outputFileName = pkg.name;
const outputDir = 'dist';
Expand Down
5 changes: 3 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions tools/build-icons/building/aliases/generateAliasesFiles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default async function generateAliasesFiles({
aliasImportFileExtension,
aliasNamesOnly = false,
separateAliasesFile = false,
separateAliasesFileExtension,
showLog = true,
}) {
const iconsDistDirectory = path.join(outputDirectory, `icons`);
Expand Down Expand Up @@ -96,8 +97,13 @@ export default async function generateAliasesFiles({
: '';

if (separateAliasesFile) {
const output = `export { default } from "./${iconName}"`;
const location = path.join(iconsDistDirectory, `${alias.name}${iconFileExtension}`);
const output = `export { default } from "./${iconName}${
separateAliasesFileExtension ? iconFileExtension : ''
}";\n`;
const location = path.join(
iconsDistDirectory,
`${alias.name}${separateAliasesFileExtension ?? iconFileExtension}`,
);

await fs.promises.writeFile(location, output, 'utf-8');
}
Expand Down
13 changes: 13 additions & 0 deletions tools/build-icons/building/generateIconFiles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default ({
template,
showLog = true,
iconFileExtension = '.js',
separateIconFileExport = false,
separateIconFileExportExtension,
pretty = true,
iconsDir,
iconMetaData,
Expand Down Expand Up @@ -46,6 +48,7 @@ export default ({
deprecated,
deprecationReason,
});

const output = pretty
? prettier.format(elementTemplate, {
singleQuote: true,
Expand All @@ -56,6 +59,16 @@ export default ({
: elementTemplate;

await fs.promises.writeFile(location, output, 'utf-8');

if (separateIconFileExport) {
const output = `export { default } from "./${iconName}${iconFileExtension}";\n`;
const location = path.join(
iconsDistDirectory,
`${iconName}${separateIconFileExportExtension ?? iconFileExtension}`,
);

await fs.promises.writeFile(location, output, 'utf-8');
}
});

Promise.all(writeIconFiles)
Expand Down
6 changes: 6 additions & 0 deletions tools/build-icons/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const {
aliasNamesOnly = false,
withDynamicImports = false,
separateAliasesFile = false,
separateAliasesFileExtension = undefined,
separateIconFileExport = false,
separateIconFileExportExtension = undefined,
aliasesFileExtension = '.js',
aliasImportFileExtension = '',
pretty = true,
Expand All @@ -59,6 +62,8 @@ async function buildIcons() {
template: iconFileTemplate,
showLog: !silent,
iconFileExtension,
separateIconFileExport,
separateIconFileExportExtension,
pretty: JSON.parse(pretty),
iconsDir: ICONS_DIR,
iconMetaData,
Expand All @@ -75,6 +80,7 @@ async function buildIcons() {
exportModuleNameCasing,
aliasImportFileExtension,
separateAliasesFile,
separateAliasesFileExtension,
showLog: !silent,
});
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build-icons/utils/getAliases.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ async function getAliases(iconDirectory) {
const iconJsons = readSvgDirectory(iconDirectory, '.json');
const aliasesEntries = await Promise.all(
iconJsons.map(async (jsonFile) => {
const file = await import(path.join(iconDirectory, jsonFile), { assert: { type: 'json' } });
const file = await import(path.join(iconDirectory, jsonFile), { with: { type: 'json' } });
return [path.basename(jsonFile, '.json'), file.default];
}),
);
Expand Down
2 changes: 1 addition & 1 deletion tools/build-icons/utils/getIconMetaData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function getIconMetaData(iconDirectory) {
const aliasesEntries = await Promise.all(
iconJsons.map(async (jsonFile) => {
/** eslint-disable */
const file = await import(path.join(iconDirectory, jsonFile), { assert: { type: 'json' } });
const file = await import(path.join(iconDirectory, jsonFile), { with: { type: 'json' } });
return [path.basename(jsonFile, '.json'), file.default];
}),
);
Expand Down

0 comments on commit 6951b0a

Please sign in to comment.