ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Generating components for in-repo addon uses partially incorrect path

Open dguettler opened this issue 7 years ago • 2 comments

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.

dguettler avatar Jan 09 '19 15:01 dguettler

@dguettler did you ask in the discord #dev-ember-js or perhaps in #dev-ember-cli (generators used to live in ember-cli) chat already? https://emberjs.com/community/

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

pixelhandler avatar Jan 25 '19 17:01 pixelhandler

@pixelhandler I brought it up originally in #general (1/9/2019 - is there no way to link to messages in Discord?) channel and had a brief discussion with @Turbo87 but he didn't have time at this point to look further into it.

dguettler avatar Jan 25 '19 23:01 dguettler