-
Notifications
You must be signed in to change notification settings - Fork 64
Add {complete:true} buildIdealTree option to load sw/bundles #73
Conversation
Needed for implementing 'npm install --package-lock-only'
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 more question:
- Where did arborist landed with regards to
bundledDependencies
name variation? is it not supported? or is it just converted in some abstraction i might have missed?
@@ -34,7 +35,9 @@ class Arborist extends Auditor(require('events')) { | |||
nodeVersion: process.version, | |||
...options, | |||
path: options.path || '.', | |||
cache: options.cache || `${homedir()}/.npm/_cacache`, |
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.
looks like it would be nicer to have a cacache API that returns the default location instead here 🤔
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.
Hmm... really depends if we want that to be a "cacache default" vs an "npm default". It's kind of nice for cacache to just be agnostic about any npm-specific stuff, and ~/.npm/_cacache
definitely feels npm-specific.
@@ -8,6 +8,7 @@ | |||
"@npmcli/name-from-folder": "^1.0.1", | |||
"@npmcli/run-script": "^1.3.1", | |||
"bin-links": "^2.1.2", | |||
"cacache": "^15.0.3", |
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.
question: why cacache is only getting added now?
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.
Until now, Arborist didn't use cacache directly! But cracking open tarballs requires a temp directory to extract into, and it just makes sense to use the temp directory that cacache provides, since the rest of npm does.
|
||
if (hasShrinkwrap) | ||
await new Arborist({ ...this.options, path }) | ||
.loadVirtual({ root: node }) |
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.
wow are these composing install trees? 🤩 is it that easy? it gives me some workspaces ideas...
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.
Yep! #72 is an open issue to add a similar facility to loadActual()
, which will make the loading of bundle deps a bit easier.
The canonical name is |
Needed for implementing 'npm install --package-lock-only'