{"action":"created","issue":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/4979","repository_url":"https://api.github.com/repos/yarnpkg/yarn","labels_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4979/labels{/name}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4979/comments","events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4979/events","html_url":"https://github.com/yarnpkg/yarn/pull/4979","id":275940579,"number":4979,"title":"nohoist baseline implementation","user":{"login":"connectdotz","id":891093,"avatar_url":"https://avatars2.githubusercontent.com/u/891093?v=4","gravatar_id":"","url":"https://api.github.com/users/connectdotz","html_url":"https://github.com/connectdotz","followers_url":"https://api.github.com/users/connectdotz/followers","following_url":"https://api.github.com/users/connectdotz/following{/other_user}","gists_url":"https://api.github.com/users/connectdotz/gists{/gist_id}","starred_url":"https://api.github.com/users/connectdotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connectdotz/subscriptions","organizations_url":"https://api.github.com/users/connectdotz/orgs","repos_url":"https://api.github.com/users/connectdotz/repos","events_url":"https://api.github.com/users/connectdotz/events{/privacy}","received_events_url":"https://api.github.com/users/connectdotz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"arcanis","id":1037931,"avatar_url":"https://avatars2.githubusercontent.com/u/1037931?v=4","gravatar_id":"","url":"https://api.github.com/users/arcanis","html_url":"https://github.com/arcanis","followers_url":"https://api.github.com/users/arcanis/followers","following_url":"https://api.github.com/users/arcanis/following{/other_user}","gists_url":"https://api.github.com/users/arcanis/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanis/subscriptions","organizations_url":"https://api.github.com/users/arcanis/orgs","repos_url":"https://api.github.com/users/arcanis/repos","events_url":"https://api.github.com/users/arcanis/events{/privacy}","received_events_url":"https://api.github.com/users/arcanis/received_events","type":"User","site_admin":false},"assignees":[{"login":"arcanis","id":1037931,"avatar_url":"https://avatars2.githubusercontent.com/u/1037931?v=4","gravatar_id":"","url":"https://api.github.com/users/arcanis","html_url":"https://github.com/arcanis","followers_url":"https://api.github.com/users/arcanis/followers","following_url":"https://api.github.com/users/arcanis/following{/other_user}","gists_url":"https://api.github.com/users/arcanis/gists{/gist_id}","starred_url":"https://api.github.com/users/arcanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcanis/subscriptions","organizations_url":"https://api.github.com/users/arcanis/orgs","repos_url":"https://api.github.com/users/arcanis/repos","events_url":"https://api.github.com/users/arcanis/events{/privacy}","received_events_url":"https://api.github.com/users/arcanis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":31,"created_at":"2017-11-22T04:21:20Z","updated_at":"2018-02-16T10:16:23Z","closed_at":"2018-01-28T16:35:59Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/yarnpkg/yarn/pulls/4979","html_url":"https://github.com/yarnpkg/yarn/pull/4979","diff_url":"https://github.com/yarnpkg/yarn/pull/4979.diff","patch_url":"https://github.com/yarnpkg/yarn/pull/4979.patch"},"body":"<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->\r\n\r\n**Summary**\r\n\r\n<!-- Is the feature a substantial feature request? Please use https://github.com/yarnpkg/rfcs -->\r\n\r\nthis is the implementation of [RFC #86](https://github.com/yarnpkg/rfcs/pull/86) for #3882.\r\n\r\nTo prevent scope creep, this PR addressed only the issues directly impacting \"install and run react-native in yarn workspaces with nohoist\", which included:\r\n\r\n- `install`: including nohoist config, matching and flat tree generation. Many commands utilize the same tree generation, if there is no conflicting assumption, hopefully they _should_ just work...\r\n- `why`: bug fixes and nohoist enhancement, it will now report all locations of the packages with the full dependency tree in one go. this can help self-diagnosis if nohoist went wrong.\r\n- `add`: replaced manual seeding with Manifest update and let install do the rest.  The code change is not ideal as I tried not to change too much in this PR. Suggest later to refactor to make it cleaner, more like _remove.js_ ... \r\n- also added many tests and fixtures\r\n\r\nfor more details please reference the [RFC](https://github.com/yarnpkg/rfcs/pull/86).\r\n\r\nnote: \r\n- lots of files in this PR, most of them are tests and fixtures.\r\n- I was not able to get a clean test run on my machine due to timeouts. Running the failed tests in isolation all passed, hopefully, CI will be fine... \r\n- nohoist did introduce a fundamental assumption shift in the system, which I've seen yarn commands yield unexpected results when operating in the nohoist workspace. I've only fixed those mentioned above, many might still exist. I would anticipate more follow-up PRs to address these issues as they come... maybe consider keeping nohoist in a separate branch or a beta channel to let it bake for a while...?\r\n\r\n<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->\r\n\r\n**Test plan**\r\n\r\n**for \"react-native init\"**\r\n\r\ncreate a yarn workspaces and add the following config to the root package.json\r\n```\r\n// project root package.json\r\n\r\n\"workspaces\": {\r\n   \"packages\": [\"packages/*\"],\r\n    \"nohoist\": [\"**/react-native\", \"**/react-native/**\"]\r\n}\r\n```\r\nthen install react-native following the react-native instruction. It should just work....\r\n\r\nyou can also move the nohoist config to the workspace's package.json, if it is a private package:\r\n```\r\n// workspace package.json\r\n\r\n\"workspaces\": {\r\n    \"nohoist\": [\"react-native\", \"react-native/**\"]\r\n}\r\n```\r\nit should produce the same result\r\n\r\n**for \"create-react-native-app\"**\r\n\r\nadditional issues for this scenario:\r\n\r\n1. create-react-native-app does not use yarn consistently in the workspaces setting, I submitted a PR ([create-react-native-app/pull/503](https://github.com/react-community/create-react-native-app/pull/503)) to address this, hopefully, it will be merged in soon. \r\n1. the react-native-scripts and Expo don't play well in workspaces, therefore, I had to add them to the nohoist list as well: \r\n```\r\n// project root package.json\r\n\r\n\"workspaces\": {\r\n    \"packages\": [\"packages/*\"],\r\n    \"nohoist\": [\r\n        \"**/react-native\", \"**/react-native/**\",\r\n        \"**/react-native-scripts\", \"**/react-native-scripts/**\",\r\n        \"**/expo\", \"**/expo/**\"\r\n    ]\r\n```\r\nthen you should be able to create and run the default expo app as documented. \r\n"},"comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments/366195806","html_url":"https://github.com/yarnpkg/yarn/pull/4979#issuecomment-366195806","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/4979","id":366195806,"user":{"login":"connectdotz","id":891093,"avatar_url":"https://avatars2.githubusercontent.com/u/891093?v=4","gravatar_id":"","url":"https://api.github.com/users/connectdotz","html_url":"https://github.com/connectdotz","followers_url":"https://api.github.com/users/connectdotz/followers","following_url":"https://api.github.com/users/connectdotz/following{/other_user}","gists_url":"https://api.github.com/users/connectdotz/gists{/gist_id}","starred_url":"https://api.github.com/users/connectdotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connectdotz/subscriptions","organizations_url":"https://api.github.com/users/connectdotz/orgs","repos_url":"https://api.github.com/users/connectdotz/repos","events_url":"https://api.github.com/users/connectdotz/events{/privacy}","received_events_url":"https://api.github.com/users/connectdotz/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T10:16:23Z","updated_at":"2018-02-16T10:16:23Z","author_association":"CONTRIBUTOR","body":"Glad people are trying nohoist. My bad that I should have published the examples and a more comprehensive introduction earlier (was waiting for 1.4.2 official release...), I think they would have spared some of your troubles... Here they are:\r\n\r\n- [yarn-nohoist-examples](https://github.com/connectdotz/yarn-nohoist-examples), you should be able to run these with the nightly build or compare with your own projects. Many of your use cases should be covered there. \r\n- [nohoist introduction](https://github.com/connectdotz/yarn-nohoist-examples/blob/master/nohoist.md), it needs a little bit of polish before submitting to yarn blog, but you can preview it here for now. "}}
{"actor":{"display_login":"connectdotz"}}