{"action":"created","issue":{"url":"https://api.github.com/repos/yeoman/environment/issues/5","labels_url":"https://api.github.com/repos/yeoman/environment/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/environment/issues/5/comments","events_url":"https://api.github.com/repos/yeoman/environment/issues/5/events","html_url":"https://github.com/yeoman/environment/issues/5","id":45014756,"number":5,"title":"Simplify API","user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yeoman/environment/labels/to-split","name":"to-split","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-10-06T18:05:16Z","updated_at":"2015-01-20T09:54:29Z","closed_at":null,"body":"Just some thoughts and questions on things we can do to simplify the API. I'd be happy to open separate ticket for things, but want to hear them out first.\r\n\r\n- Why does this module depend on `yeoman-generator`? And shouldn't the usage example be `var yeoman = require('yeoman-generator');` => `var env = require('yeoman-environment');`?\r\n\r\n- I think we should drop `env.createEnv()` as you can already do `new Env()`? Which is IMHO better.\r\n\r\n--\r\n\r\n```js\r\n// The #lookup() method will search the user computer for installed generators. The search\r\n// if done from the current working directory.\r\nenv.lookup(function () {\r\n  env.run('angular', { 'skip-install': true }, done);\r\n});\r\n```\r\n\r\nAny reason we have to do the lookup first? Can't just `env.run` lazy trigger the lookup on the first run?\r\n\r\nI would like to have a way to run a generator with a single method call.\r\n\r\n--\r\n\r\nThe `end` event doesn't seem to work: https://github.com/yeoman/yo/blob/8f8d16e10c13d11faf7034ca2f1e59589a6081bd/cli.js#L78-L80 How is it different from the callback to `env.run`? Can we drop it?\r\n\r\n--\r\n\r\nIs the `help` method used at all https://github.com/yeoman/environment/blob/a03a150570ca8b9a8f9de13783d2d6dadf378f0c/lib/environment.js#L87 ?\r\n\r\n--\r\n\r\n`env.getGeneratorsMeta()` is weird as it only works after `env.lookup`. Could we instead pass generator metadata in the `env.lookup` callback?\r\n\r\n--\r\n\r\nI'm not a big fan of the aliasing functionality. It complicates things a lot. Is there a way we can drop or simplify this?\r\n\r\nhttps://github.com/yeoman/yo/blob/8f8d16e10c13d11faf7034ca2f1e59589a6081bd/cli.js#L75-L76\r\n\r\n--\r\n\r\nAnything anyone else think can be improved?"},"comment":{"url":"https://api.github.com/repos/yeoman/environment/issues/comments/70629354","html_url":"https://github.com/yeoman/environment/issues/5#issuecomment-70629354","issue_url":"https://api.github.com/repos/yeoman/environment/issues/5","id":70629354,"user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T09:54:29Z","updated_at":"2015-01-20T09:54:29Z","body":"> and I feel like we should remove them all until there's an actual use case.\r\n\r\nWhich events? `start`/`end`?"}}