{"action":"created","issue":{"url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/2104","repository_url":"https://api.github.com/repos/SharePoint/sp-dev-docs","labels_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/2104/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/2104/comments","events_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/2104/events","html_url":"https://github.com/SharePoint/sp-dev-docs/issues/2104","id":335178851,"node_id":"MDU6SXNzdWUzMzUxNzg4NTE=","number":2104,"title":"Yeoman Generator: options.componentType is ignored if options.environment is undefined","user":{"login":"AJIXuMuK","id":17036219,"node_id":"MDQ6VXNlcjE3MDM2MjE5","avatar_url":"https://avatars3.githubusercontent.com/u/17036219?v=4","gravatar_id":"","url":"https://api.github.com/users/AJIXuMuK","html_url":"https://github.com/AJIXuMuK","followers_url":"https://api.github.com/users/AJIXuMuK/followers","following_url":"https://api.github.com/users/AJIXuMuK/following{/other_user}","gists_url":"https://api.github.com/users/AJIXuMuK/gists{/gist_id}","starred_url":"https://api.github.com/users/AJIXuMuK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AJIXuMuK/subscriptions","organizations_url":"https://api.github.com/users/AJIXuMuK/orgs","repos_url":"https://api.github.com/users/AJIXuMuK/repos","events_url":"https://api.github.com/users/AJIXuMuK/events{/privacy}","received_events_url":"https://api.github.com/users/AJIXuMuK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-24T13:19:47Z","updated_at":"2018-06-26T17:16:25Z","closed_at":null,"author_association":"NONE","body":"#### Category\r\n- [ ] Question\r\n- [ ] Typo\r\n- [x] Bug\r\n- [ ] Additional article idea\r\n\r\n#### Expected or Desired Behavior\r\n\r\nIn custom generator we can provide specific `componentType` without providing `environment`.\r\n\r\nExample: we want to create custom generator for web parts. In that case we want to provide `componentType` but not `environment`. Like that:\r\n\r\n```javascript\r\nthis.composeWith(require.resolve('@microsoft/generator-sharepoint/lib/generators/app'), {\r\ncomponentType: 'webpart'\r\n});\r\n```\r\n\r\nThe issue exists because of app generator code:\r\n```javascript\r\nif (this.options.environment !== undefined) {\r\n            this.config.set('componentType', this.options.environment === 'onprem' ? 'webpart' : this.options.componentType);\r\n        }\r\n```\r\n#### Observed Behavior\r\n\r\n`componentType` option is not used if `environment` option is not set.\r\n#### Steps to Reproduce\r\n\r\n- create custom Yeoman generator\r\n- `this.composeWith(require.resolve('@microsoft/generator-sharepoint/lib/generators/app'), { componentType: 'webpart' })`"},"comment":{"url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/comments/400394293","html_url":"https://github.com/SharePoint/sp-dev-docs/issues/2104#issuecomment-400394293","issue_url":"https://api.github.com/repos/SharePoint/sp-dev-docs/issues/2104","id":400394293,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDM5NDI5Mw==","user":{"login":"VesaJuvonen","id":7446437,"node_id":"MDQ6VXNlcjc0NDY0Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/7446437?v=4","gravatar_id":"","url":"https://api.github.com/users/VesaJuvonen","html_url":"https://github.com/VesaJuvonen","followers_url":"https://api.github.com/users/VesaJuvonen/followers","following_url":"https://api.github.com/users/VesaJuvonen/following{/other_user}","gists_url":"https://api.github.com/users/VesaJuvonen/gists{/gist_id}","starred_url":"https://api.github.com/users/VesaJuvonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VesaJuvonen/subscriptions","organizations_url":"https://api.github.com/users/VesaJuvonen/orgs","repos_url":"https://api.github.com/users/VesaJuvonen/repos","events_url":"https://api.github.com/users/VesaJuvonen/events{/privacy}","received_events_url":"https://api.github.com/users/VesaJuvonen/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T17:16:25Z","updated_at":"2018-06-26T17:16:25Z","author_association":"CONTRIBUTOR","body":"Let's keep this open until we get a confirmation that 1.5.1 will actually fix this."}}
{"actor":{"display_login":"VesaJuvonen"}}