Skip to content

Commit

Permalink
refactor: use icon name
Browse files Browse the repository at this point in the history
  • Loading branch information
calvo-jp committed Mar 1, 2024
1 parent 5fdbe16 commit e701f1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/icons/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./*": {
"./*.svelte": {
"types": "./dist/*.d.ts",
"import": "./dist/*.js"
"import": "./dist/*"
},
"./package.json": {
"default": "./package.json"
Expand Down
4 changes: 2 additions & 2 deletions scripts/src/icons/generate-icons-react.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export async function generate_icons_react() {
const items = await Promise.all(
icons.map(async (icon) => {
const Component = await to_react_component(icon);
const destination = path.join(outdir, `${icon.filename}.tsx`);
const destination = path.join(outdir, `${Component.name}.tsx`);

await fs.writeFile(destination, await format_ts(Component.content), {encoding: 'utf-8'});

/**
* @type {import('./create-barrel-file.mjs').BarrelItem}
*/
const item = {
path: `./${icon.filename}`,
path: `./${Component.name}.tsx`,
modules: [
{
name: 'default',
Expand Down
4 changes: 2 additions & 2 deletions scripts/src/icons/generate-icons-svelte.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export async function generate_icons_svelte() {
const items = await Promise.all(
icons.map(async (icon) => {
const Component = await to_svelte_component(icon);
const destination = path.join(outdir, `${icon.filename}.svelte`);
const destination = path.join(outdir, `${Component.name}.svelte`);

await fs.writeFile(destination, await format_html(Component.content), {encoding: 'utf-8'});

/**
* @type {import('./create-barrel-file.mjs').BarrelItem}
*/
const item = {
path: `./${icon.filename}.svelte`,
path: `./${Component.name}.svelte`,
modules: [
{
name: 'default',
Expand Down

0 comments on commit e701f1a

Please sign in to comment.