ember-cli-migrator icon indicating copy to clipboard operation
ember-cli-migrator copied to clipboard

why does the migrator flatten the folder structures?

Open mattmarcum opened this issue 9 years ago • 5 comments

After migrating an old ember-rails project all my nicely nested routes ended up at the top level app/routes folder, but with dasherized names from the old file paths. What's the purpose of that? I've been using folders to keep my other ember-cli apps nicely organized, seems to work just fine. Is there a way to turn this feature off and keep my folder structure?

mattmarcum avatar Oct 20 '15 21:10 mattmarcum

Just realized that while my routes and controllers get their paths flattened and converted to long filenames, my templates do not. So controllers/some/path/foo.js gets converted to controllers/some-path-foo.js but my templates just get moved over to templates/some/path/foo.hbs

mattmarcum avatar Oct 21 '15 17:10 mattmarcum

This definitely seems like a bug. We should consider the file path when renaming. Our algorithm has evolved over time; initially it would just look at the content of the file and generate names based off that. HBS don't use that algorithm because there's nothing to go off of, so we use the file name. We should allow JS files to opt in to a mixed algorithm.

fivetanley avatar Nov 09 '15 17:11 fivetanley

@fivetanley I'm running into the same issue, where should I look to see if I can solve this issue ?

Techbrunch avatar Aug 19 '16 12:08 Techbrunch

@fivetanley I managed to solve my problem by updating the filePathForClassname function in typed-export.js.

Could you take a look at the pull request and tell me how I can improve it. Thanks.

Techbrunch avatar Aug 31 '16 08:08 Techbrunch

Ran this once, it appears to be working in preserving folder structure (I'm not to point where have a working migrated ember build)

hefox avatar Jan 16 '18 21:01 hefox