Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Nov 5, 2024
1 parent cb07a39 commit d083799
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
23 changes: 14 additions & 9 deletions tools/build-icons/building/generateAliasesFile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const getImportString = (
iconName,
aliasImportFileExtension,
deprecated,
deprecationReason = '',
deprecationReason = ''
) =>
deprecated
? `export {\n` +
Expand Down Expand Up @@ -66,7 +66,7 @@ export default async function generateAliasesFile({
importString += getImportString(
`Lucide${componentName}`,
iconName,
aliasImportFileExtension,
aliasImportFileExtension
);
}

Expand All @@ -83,8 +83,13 @@ export default async function generateAliasesFile({
: '';

if (separateAliasesFile) {
const output = `export { default } from "./${iconName}${separateAliasesFileExtension ? iconFileExtension : ''}";\n`;
const location = path.join(iconsDistDirectory, `${alias.name}${separateAliasesFileExtension ?? 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 All @@ -101,7 +106,7 @@ export default async function generateAliasesFile({
exportFileIcon,
aliasImportFileExtension,
alias.deprecated,
deprecationReason,
deprecationReason
);

if (!aliasNamesOnly) {
Expand All @@ -110,23 +115,23 @@ export default async function generateAliasesFile({
exportFileIcon,
aliasImportFileExtension,
alias.deprecated,
deprecationReason,
deprecationReason
);

importString += getImportString(
`Lucide${componentNameAlias}`,
exportFileIcon,
aliasImportFileExtension,
alias.deprecated,
deprecationReason,
deprecationReason
);
}
}),
})
);
}

appendFile(importString, fileName, outputDirectory);
}),
})
);

appendFile('\n', fileName, outputDirectory);
Expand Down
5 changes: 4 additions & 1 deletion tools/build-icons/building/generateIconFiles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export default ({

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

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

0 comments on commit d083799

Please sign in to comment.