Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a codemod to colocate CSS modules with their components? #228

Open
nelstrom opened this issue Apr 20, 2021 · 2 comments
Open

Is there a codemod to colocate CSS modules with their components? #228

nelstrom opened this issue Apr 20, 2021 · 2 comments
Labels

Comments

@nelstrom
Copy link

We use ember-css-modules in our Ember app, and it's a great addon. Thanks for making it!

I tried running the ember-component-template-colocation-migrator on our codebase. The codemod moved our .hbs files from app/templates/components to app/components as intended. However, our CSS module files are still in the app/styles directory. Ideally we'd have these colocated in app/components alongside the .js and .hbs files.

Has anyone encountered this problem before? I'm wondering if there is a codemod that I could use to move our .css files into app/components? If not, I may have to write one myself.

@dfreeman
Copy link
Member

I don't know of one, but agreed it would be helpful!

Hopefully doing it for styles would be a bit simpler than the template migrator, since the latter has to account for potential cases where things that look like component templates are also used as partials and other odd cases like that.

@nelstrom
Copy link
Author

nelstrom commented Aug 27, 2021

To answer my own question: Yes! There is (now) a codemod to colocate CSS modules with their components. We used this at Phorest for our Ember app, and successfully moved 400+ CSS files.

I hope this proves useful for someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants