2nthony/vue-remix-icons

Remix icon book-mark and bookmark names collide when converted to vue component

bwiggs opened this issue ยท 5 comments

bwiggs commented

It looks like the remix bookmark and book-mark icons are named such that the generate script results in one of them being clobbered.

It seems to be only these icons currently.

To test this, I altered the genIcons function by adding a console log when outputting a vue remix icon component that already exists.

async function genIcons(icons: Icon[]) {
  loopIcons(icons, async (icon) => {

    const loc = resolveRoot("icons", `${icon.componentName}.vue`);

    if (fs.existsSync(loc)) {
      console.log(`file already exists, overwriting: ${loc}`)
    }

    await writeFile(
      loc,
      resolveVueString(icon),
      "utf8",
    );
  });
}

These were the results:

file already exists, overwriting: /Users/USER/projects/vue-remix-icons/icons/RiBookMarkFill.vue
file already exists, overwriting: /Users/USER/projects/vue-remix-icons/icons/RiBookMarkLine.vue

did you get some errors when using RiBookMark or RiBookmark ?

bookmark should renamed to Bookmark, book-mark should renamed to BookMark

btw, you can see the files exists in https://unpkg.com/browse/vue-remix-icons@2.0.3/icons/

bwiggs commented

I did not get any errors. I was trying to use the remix icon: bookmark-fill by importing RiBookmarkFill and it instead rendered out the book-mark-fill icon.

I believe this may be due to some operating systems (I'm on MacOS) treating file names as case insensitive. So outputting something like RiBookMark.vue will overwrite a file called RiBookmark.vue.

On my machine, when I go into the node_modules/vue-remix-icons/icon directory, these are the icons I have that start with ribookmark*:

$ ls | grep -i ribookmark
RiBookmark2Fill.vue
RiBookmark2Line.vue
RiBookmark3Fill.vue
RiBookmark3Line.vue
RiBookmarkFill.vue
RiBookmarkLine.vue

oh, I get your point, I think I should do a break change with file name PascalCase to kebab-case

bookmark-2-fill.vue
book-mark-fill.vue

Thanks for feedback!

๐ŸŽ‰ This issue has been resolved in version 3.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

upgrade to v3 now should work.
image