From 3de25000a495e50de617552d8807000be5ef468d Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 8 Sep 2017 13:56:55 +0800 Subject: [PATCH] yarn: update for 1.0 --- yarn.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/yarn.md b/yarn.md index 62303097f..8b25f05da 100644 --- a/yarn.md +++ b/yarn.md @@ -3,6 +3,7 @@ title: Yarn category: JavaScript libraries layout: 2017/sheet weight: -3 +updated: 2017-09-08 --- ### npm equivalents @@ -27,3 +28,35 @@ weight: -3 ``` These options are available for `yarn add`. + +### Workspaces + +```json +/* package.json */ +"workspaces": [ + "packages/*" +] +``` + +``` +jest/ +├─ package.json +└─ packages/ + ├─ jest-matcher-utils/ + │ └─ package.json + └─ jest-diff/ + └─ package.json +``` + +(New in 1.0) Allows monorepos to share packages with each other. See: [Introducing workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/) + +### Selective version resolution + +```json +/* package.json */ +"resolutions": { + "**/sass-brunch/node-sass": "4.5.2" +} +``` + +(New in 1.0) Allows you to specify versions for sub-dependencies. See: [Selective version resolutions](https://github.com/yarnpkg/yarn/pull/4105)