{"action":"opened","issue":{"url":"https://api.github.com/repos/yeoman/generator/issues/1093","repository_url":"https://api.github.com/repos/yeoman/generator","labels_url":"https://api.github.com/repos/yeoman/generator/issues/1093/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/generator/issues/1093/comments","events_url":"https://api.github.com/repos/yeoman/generator/issues/1093/events","html_url":"https://github.com/yeoman/generator/issues/1093","id":364108825,"node_id":"MDU6SXNzdWUzNjQxMDg4MjU=","number":1093,"title":"Unable to inherit on multiple levels","user":{"login":"garyvh2","id":21265830,"node_id":"MDQ6VXNlcjIxMjY1ODMw","avatar_url":"https://avatars1.githubusercontent.com/u/21265830?v=4","gravatar_id":"","url":"https://api.github.com/users/garyvh2","html_url":"https://github.com/garyvh2","followers_url":"https://api.github.com/users/garyvh2/followers","following_url":"https://api.github.com/users/garyvh2/following{/other_user}","gists_url":"https://api.github.com/users/garyvh2/gists{/gist_id}","starred_url":"https://api.github.com/users/garyvh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyvh2/subscriptions","organizations_url":"https://api.github.com/users/garyvh2/orgs","repos_url":"https://api.github.com/users/garyvh2/repos","events_url":"https://api.github.com/users/garyvh2/events{/privacy}","received_events_url":"https://api.github.com/users/garyvh2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-26T16:14:49Z","updated_at":"2018-09-26T16:14:49Z","closed_at":null,"author_association":"NONE","body":"When extending a generator there might be cases where you have the same logic for certain functions, I.E: `end`, `constructor`, `rootGeneratorName`, `initializing` and so.\r\n\r\n```\r\nclass GeneratorBase extends Generator {\r\n  ...\r\n\r\n  initializing() {\r\n    this.appname = this.appname.replace(/\\s+/g, '-');\r\n  }\r\n\r\n  end() {\r\n    this.log(chalk.bold('\\nSetup Complete!'));\r\n  }\r\n\r\n  ...\r\n}\r\nclass ElementGenerator extends GeneratorBase {\r\n  ...\r\n\r\n  writing() {\r\n    // Some specific writting logic\r\n  }\r\n\r\n  ...\r\n}\r\n```\r\n\r\nWhen you extend a class that already extends Generator, the implementation of the `run` for `yeoman-generator` breaks as the methods reading works only on 1 level, as you can see here https://github.com/yeoman/generator/blob/1cd1031eb1cc2ed0288265dd15ddc6cfbcffabb7/lib/index.js#L398 so in this case the `methods` const will only contain the method `writting`\r\n\r\nPlease tell me if you require further info."}}
{"actor":{"display_login":"garyvh2"}}