{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/7899","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/7899/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/7899/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/7899/events","html_url":"https://github.com/facebook/react-native/pull/7899","id":158230970,"number":7899,"title":"Merge `rnpm cli` into react-native","user":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"},{"url":"https://api.github.com/repos/facebook/react-native/labels/Size/L","name":"Size/L","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"Kureev","id":2273613,"avatar_url":"https://avatars.githubusercontent.com/u/2273613?v=3","gravatar_id":"","url":"https://api.github.com/users/Kureev","html_url":"https://github.com/Kureev","followers_url":"https://api.github.com/users/Kureev/followers","following_url":"https://api.github.com/users/Kureev/following{/other_user}","gists_url":"https://api.github.com/users/Kureev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kureev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kureev/subscriptions","organizations_url":"https://api.github.com/users/Kureev/orgs","repos_url":"https://api.github.com/users/Kureev/repos","events_url":"https://api.github.com/users/Kureev/events{/privacy}","received_events_url":"https://api.github.com/users/Kureev/received_events","type":"User","site_admin":false},"assignees":[{"login":"Kureev","id":2273613,"avatar_url":"https://avatars.githubusercontent.com/u/2273613?v=3","gravatar_id":"","url":"https://api.github.com/users/Kureev","html_url":"https://github.com/Kureev","followers_url":"https://api.github.com/users/Kureev/followers","following_url":"https://api.github.com/users/Kureev/following{/other_user}","gists_url":"https://api.github.com/users/Kureev/gists{/gist_id}","starred_url":"https://api.github.com/users/Kureev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kureev/subscriptions","organizations_url":"https://api.github.com/users/Kureev/orgs","repos_url":"https://api.github.com/users/Kureev/repos","events_url":"https://api.github.com/users/Kureev/events{/privacy}","received_events_url":"https://api.github.com/users/Kureev/received_events","type":"User","site_admin":false},{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false}],"milestone":null,"comments":67,"created_at":"2016-06-02T20:22:32Z","updated_at":"2016-07-22T11:26:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/7899","html_url":"https://github.com/facebook/react-native/pull/7899","diff_url":"https://github.com/facebook/react-native/pull/7899.diff","patch_url":"https://github.com/facebook/react-native/pull/7899.patch"},"body":"This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.). \r\n\r\nIt's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box.\r\n\r\nThis is still WIP <s>and some of the commands are left commented out.</s>\r\n\r\nFor the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/default.config.js#L33), so they are available on the `new Config()` [instance](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/cliEntry.js#L59) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/runIOS/runIOS.js#L17)).\r\n\r\nRoadmap:\r\n- [x] Unit test all the things ( @Kureev is working on that )\r\n- [x] Bring back plugins\r\n- [x] Port missing commands\r\n\r\nTest plan:\r\n1. Clone the project\r\n2. `npm install`\r\n3. `node ./local-cli/cli.js --help`\r\n4. View the diff with `?w=0` to ignore indents \r\n\r\nBreaking changes for current `rnpm` developers:\r\n- the interface for a `command` did change to align with what is currently in React Native (partially to reduce the diff). See the flow definition for a final list of options allowed,\r\n- the `default` option for a flag can now be a function that receives an instance of a Config. I found it a common pattern, e.g. [here](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/server/server.js#L85-L88). If we decide to merge rnpm config into `Config`, then e.g. [here](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e70adb69675786/local-cli/runIOS/runIOS.js#L91) we can just swap default value from `ios` to `(config) => config.getProjectConfig().ios.sourceDir`\r\n- the order of arguments did change a bit (reasoning the same + some of the commands are plain no-config ones), the first one is now `argv`, the 2nd one is `config`, which means they are swapped.\r\n\r\nThere's plenty of stuff yet to be done, but we are trying to keep the diff small. We still have to post new docs and developers guide. @bestander @vjeux since the local-cli is now extensible and supports custom configs (either through rn-cli or via package.json), can we think of an extra section on the website to describe it?"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/234520432","html_url":"https://github.com/facebook/react-native/pull/7899#issuecomment-234520432","issue_url":"https://api.github.com/repos/facebook/react-native/issues/7899","id":234520432,"user":{"login":"grabbou","id":2464966,"avatar_url":"https://avatars.githubusercontent.com/u/2464966?v=3","gravatar_id":"","url":"https://api.github.com/users/grabbou","html_url":"https://github.com/grabbou","followers_url":"https://api.github.com/users/grabbou/followers","following_url":"https://api.github.com/users/grabbou/following{/other_user}","gists_url":"https://api.github.com/users/grabbou/gists{/gist_id}","starred_url":"https://api.github.com/users/grabbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grabbou/subscriptions","organizations_url":"https://api.github.com/users/grabbou/orgs","repos_url":"https://api.github.com/users/grabbou/repos","events_url":"https://api.github.com/users/grabbou/events{/privacy}","received_events_url":"https://api.github.com/users/grabbou/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T11:26:25Z","updated_at":"2016-07-22T11:26:25Z","body":"Let's bump, rebase and merge. I am assuming two likes for my Q means there's some sort of agreement that it can be cherry-picked (all in all it was meant to be part of 0.31-rc anyway). "}}
{"actor":{"display_login":"grabbou"}}