-
Notifications
You must be signed in to change notification settings - Fork 64
Conversation
4a3608c
to
4224a20
Compare
1428d6b
to
e8d9497
Compare
713e7e8
to
71d88a3
Compare
Introduces support to workspaces; adding ability to build an ideal tree that links defined workspaces, storing and reading lockfiles that contains workspaces info and also reifying installation trees properly symlinking nested workspaces into place. Handling of the config definitions is done via @npmcli/map-workspaces module added. refs: - https://github.com/npm/rfcs/blob/ea2d3024e6e149cd8c6366ed18373c9a566b1124/accepted/0026-workspaces.md - https://www.npmjs.com/package/@npmcli/map-workspaces - npm/rfcs#103
718ba67
to
ac9f4d8
Compare
@@ -15,6 +16,7 @@ const resolveLinks = Symbol('resolveLinks') | |||
const assignParentage = Symbol('assignParentage') | |||
const loadNode = Symbol('loadVirtualNode') | |||
const loadLink = Symbol('loadVirtualLink') | |||
const loadWorkspaces = Symbol('loadWorkspaces') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just noticing this now, not relevant to this PR, but we should make loadVirtual underscore its symbols like the other mixin classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor nit that I'm pretty sure the hasWorkspaces
option to the Node class in buildIdealTree isn't relevant. (Tests pass without that line?)
Other than that, this is great! For such a significant feature, it's impressive how little code actually needed to be changed or added to make it happen.
LGTM!
@@ -234,9 +237,19 @@ module.exports = cls => class IdealTreeBuilder extends Tracker(Virtual(Actual(cl | |||
optional: false, | |||
global: this[_global], | |||
legacyPeerDeps: this.legacyPeerDeps, | |||
hasWorkspaces: !!pkg.workspaces, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where this field is used, is it a leftover from something that changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah def a leftover, will clean it up 😊
Overview
Introduces support to workspaces; adding ability to build an ideal tree that links defined
workspaces
, storing and reading lockfiles that containsworkspaces
info and also reifying installation trees properly symlinking nestedworkspaces
into place.✏️ Changes
lib/arborist/build-ideal-tree.js
Creates trees that take into accountworkspaces
definitionslib/arborist/load-virtual.js
Added ability to readworkspaces
definitionslib/edge.js
Added check that aworkspace
edges are symlinkslib/node.js
Addedworkspaces
setter that will properly create theedgesOut
pointing to nested workspaceslib/shrinkwrap.js
Addworkspaces
info to lockfile🔗 References