-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
While writing the PR description for the ember-cli feature, I started to reconsider how micro-addons should work.
How it works now
Currently, the files are copied from a flat file structure in such a way that the following happens:
- components are accessible via
import MyComponent from 'app-name/components/my-component'; - libraries are accessible via
import MyLibrary from 'app-name/lib/my-library'; - helpers are accessible via
import MyHelper from 'app-name/helpers/my-helper';
There are 3 addon hooks we use to make this work:
treeForAppcopies and renamescomponent.js,helper.js,library.jstreeForAddoncopies style.css (for components)treeForTemplatescopiestemplate.hbs
I think this might not be 100% according to convention and where they're accessible from fells a bit illogical.
How I think it should work
treeForAddonshould copy all of them intoaddon/[type]/addon-name.[extension]treeForAppshould create the standard import-export modules for components and helpers, so they are also directly accessible from the app. Libraries should be importable from the addon only, so they do not require import-export modules.treeForAppmight be able to create a template, but if that is impossible, thentreeForTemplatesshould still be used for that
I think this would follow convention more closely.