Skip to content

Commit

Permalink
chore: 함수 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ghdtjgus76 committed May 30, 2024
1 parent 87c8894 commit 8ea29c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/scripts/generateReactComponentFromSvg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,24 @@ const generateComponentFiles = async (svgComponentMap: SvgComponentMap) => {
return components;
};

const generateEntryFile = async (components: string[]) => {
const ENTRY_FILE_PATH = "../wow-icons/src/react/index.ts";
const entryFileContent = components
const generateExportFile = async (components: string[]) => {
const EXPORT_FILE_PATH = "../wow-icons/src/react/index.ts";
const exportFileContent = components
.map(
(component) =>
`export { default as ${component} } from "./${component}.tsx";`
)
.join("\n");

await fs.writeFile(ENTRY_FILE_PATH, entryFileContent);
await fs.writeFile(EXPORT_FILE_PATH, exportFileContent);
};

(async () => {
try {
const svgComponentMap = await generateSvgComponentMap();
await deleteUnusedComponentFiles(svgComponentMap);
const components = await generateComponentFiles(svgComponentMap);
await generateEntryFile(components);
await generateExportFile(components);
} catch (error) {
console.log("Error generating components:", error);
}
Expand Down

0 comments on commit 8ea29c1

Please sign in to comment.