jschilli / ember-cli-file-creator

Add files to ember build trees
MIT License
3 stars 6 forks source link

Allow specifying tree name for each file #9

Closed lolmaus closed 7 years ago

lolmaus commented 7 years ago

I needed to generate some files into the public folder, but this addon only worked with app.

Now an optional tree property can be passed with every file. It defaults to app, so it should be reverse-compatible.

No tests, sorry! I don't have a slightest idea what's going on there. :scream_cat:

jschilli commented 7 years ago

@lolmaus - I'm peeking @ the test failures - not sure what's going on - will get to this as soon as I can

lolmaus commented 7 years ago

I've found out that I'm not the one who went this exact path: https://github.com/cogniteev/ember-cli-file-creator/commit/9de0356a6c4770e88be88a1eea537be81e24b927

I can't help with tests. :(

First, Ember CLI API is poorly documented. The treeFor methods family, for example, are described as methods that return trees, but in truth they are hooks that generate trees. By reading the docs, you can't figure out how to use the API.

Second, Broccoli API documentation is almost non-existent. Your test file totally beats me. I tried porting your code into a fresh 2.10.0 boilerplate I wasn't able to make the tests work.

I'm ready to do some work if you guide me.

lolmaus commented 7 years ago

I've fixed the tests. Turns out that, despite new EmberApp(), app state was persisting between tests.

jschilli commented 7 years ago

thanks @lolmaus - I'll do a new drop soon