emberjs / emberjs/ember.js

Generating components for in-repo addon uses partially incorrect path

Open
#17,460 2 comments 0 reactions 1 assignee Claimed by @locks View on GitHub
Needs Bug Verification
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

When running `ember g component --ir shared test-component` the following files are generated:
```
installing component
identical ../shared/addon/pods/components/test-component/component.js
identical ../shared/addon/pods/components/test-component/template.hbs
[...]
installing component-addon
identical lib/shared/app/pods/components/test-component/component.js
```

`component` is using the correct path as specified in `package.json`
```
"ember-addon": {
"paths": [
"../shared"
]
}
```
however `component-addon` is using a hardcoded path in `component-addon/index.js` for the `__root__` key.
```
__root__: function(options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
return 'app';
},
```

Removing the `__root__` key from the template results in `../shared/addon/[...]` so not quite correct either.

If someone could point me in the right direction how to get to the correct path I'd be happy to create a PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.