[bugfix] Ensure TS blueprints are always used #253
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be a quick 1.4.2 fix on the heels of 1.4.1 that just went out, which doesn't consistently emit
.ts
files fromember generate
. It turns outinit
is not a safe place to do ourproject.addons
munging, and ember-cli really isn't set up to make it simple to expose blueprints from another addon while also having your own.Essentially:
init
, because the project's ownaddons
array is set after all its addons have been initializedblueprintsPath
value because we need to also include our own, and every addon is allowed to return at most oneincludedCommands
hook is a convenient (if unfortunate) spot for us to use, as we know the addons will already have been initialized (soproject.addons
is populated) but it has to execute before blueprint paths are actually resolved (available commands are all loaded before any one is executed)I've also added a test case to ensure this continues working with future releases of the CLI (though the codepaths involved have been pretty stable for some time). This isn't a beautiful solution, but I'm hoping to focus efforts on moving to 2.0 where we won't need to do this at all.