-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow addons to have public trees. #1930
Conversation
This concept was previously discussed, at the time it was thought it might be best if the addon copies its |
Yes, I completely agree with you that it would definitely be a best practice to namespace, but I still find it important to have the ability for an addon to generate files in the root of a project. A few examples:
|
@rwjblue I think that is OK but the default tree should probably be to namespace then in the event of those usecases (or others) the tree can can be overridden |
I'm pretty sure if the addon's |
@bcardarella - Sounds reasonable. Will update. |
34d9af9
to
3aeba49
Compare
Updated to namespace as discussed. Also added a default method lookup mechanism that allows for easier customization (without resorting to overriding all of |
f15f198
to
fda7c84
Compare
* Public is namespaced by default under the addons package name. * Add simple easy to override method lookup pattern for customizing treeFor on a type by type basis.
fda7c84
to
ffefa4b
Compare
And now, finally with passing tests. Those stupid |
@bcardarella - Ready for review, when you have a minute. |
👍 LGTM Also appreciate the |
Allow addons to have public trees.
@rwjblue In my addon, the module.exports = {
name: 'Test Addon',
init: function (project) {
this.project = project;
},
treeForPublic: function() {
console.log('treeForPublic invoked');
}
}; "treeForPublic invoked" is not logged. Any ideas? |
|
Closes #1625.