komposable / komponent

An opinionated way of organizing front-end code in Ruby on Rails, based on components

Home Page:http://komponent.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make component generator idempotent

Spone opened this issue · comments

I should be able to run the rails generate component button command several times with the same result. Currently, it duplicates the import in frontend/components/index.js

I think we just need to deduplicate the imports when we sort them here: https://github.com/komposable/komponent/blob/master/lib/generators/component/component_generator.rb#L173

Yes, remove duplicates before rewriting it to file seems the only thing to do to make this possible.