You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: accepted/0000-isolated-workspaces.md
+7-21
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ relevant yarn commands should be able to be run with an `--isolated` flag.
32
32
33
33
Relevant commands (based on current functionality) include
34
34
- install
35
+
- add
35
36
- upgrade
36
37
- upgrade-interactive
37
38
- outdated
@@ -46,37 +47,30 @@ If you run a command with the isolated flag and are in a workspaceDir, it will r
46
47
47
48
If you run a command with the isolated flag but you are at the rootDir (or any other directory not underneath a workspaceDir), it will give an error saying that the isolated flag can only be used inside an individual workspace.
48
49
49
-
## Command behavior
50
+
## Command behavior with isolated flag
50
51
### install
51
-
#### With isolated flag
52
52
Install only that package's dependencies, and do not hoist them to the rootDir. Install dependencies on other
53
53
workspaces from registry instead of using the local version.
54
54
55
55
It should still use the rootDir's lockfile since adding lockfiles for each workspace will cause conflicts
56
56
across workspaces. Since other workspaces will not be in the lockfile, it should determine their versions as if it was
57
57
installing without a lockfile (by taking the newest version that matches their semver).
58
58
59
-
#### Changes to current (non-isolated) behavior
60
-
If a dependency was previously installed in a workspaceDir (from an isolated installation) and will be hoisted, delete it from the workspaceDir. This should not be a breaking change since the end result would be the same as if the isolated flag did not exist or if you were installing from scratch.
59
+
Since install will not take into account other workspaces, it would change the lockfile if allowed to. To avoid this, it should prevent lockfile changes as if `--pure-lockfile` was passed. This behavior should be documented clearly with the option.
60
+
61
+
### add
62
+
Add the dependency to the workspace's package.json and add update yarn.lock (at the root) to take this new dependency into account. Install the dependency (and any new transitive dependencies) in the workspace's node_modules folder.
61
63
62
64
### upgrade
63
-
#### With isolated flag
64
65
Upgrade all dependencies of the workspace in the root yarn.lock, respecting semvers of the current workspace and also
65
66
every other workspaces. Install all dependencies for the current workspace in its node_modules, not hoisting anything
66
-
to the root. Take the latest matching versions from the registry for all dependencies on other workspaces.
67
-
68
-
#### Changes to current behavior.
69
-
Deleting modules installed at an individual workspaceDir if they are going to be hoisted (similar to changes for `install`).
67
+
to the root. Take the latest matching versions from the registry for all dependencies on other workspaces. Do not install dependencies for other workspaces that are not needed for the current one.
70
68
71
69
### upgrade-interactive
72
-
#### With isolated flag
73
70
Interactive version of an isolated upgrade. Bring up the interactive prompt, only showing the workspace's dependencies.
74
71
Record upgrades in the root yarn.lock. Install all dependencies for the current workspace in its node_modules, not hoisting anything
75
72
to the root. Take the latest matching versions from the registry for all dependencies on other workspaces.
76
73
77
-
#### Changes to current behavior.
78
-
None except the changes to `upgrade`. Still just an interactive version of `upgrade`.
79
-
80
74
### outdated
81
75
#### With isolated flag
82
76
Should show the list of packages that upgrade-interactive would show with isolated flag.
@@ -85,20 +79,12 @@ Should show the list of packages that upgrade-interactive would show with isolat
85
79
None.
86
80
87
81
### check
88
-
#### With isolated flag
89
82
Verify the workspace's package.json against the root yarn.lock file. Use the workspace node_modules (not hoisted) when looking
90
83
at actual package contents.
91
84
92
-
#### Changes to current behavior.
93
-
None.
94
-
95
85
### list
96
-
#### With isolated flag
97
86
List only dependencies needed by the current workspace.
98
87
99
-
#### Changes to current behavior.
100
-
None.
101
-
102
88
# How We Teach This
103
89
104
90
*What names and terminology work best for these concepts and why?*
0 commit comments