Repository navigation
Fix two minor Rush issues - #571
Conversation
…ying deduplication that made diffs harder to read
| noCompatMode: true, | ||
| noRefs: true, | ||
| sortKeys: true | ||
| }; |
There was a problem hiding this comment.
Zoltan Kochan (@zkochan) do you think this configuration should be exported by the pnpm-shrinkwrap library? Could that library help with the operations in this file?
There was a problem hiding this comment.
can't you just use one of the write functions from pnpm-shrinkwrap?
There was a problem hiding this comment.
nickpape-msft said that he looked at this library, but the API was unclear. For example, you have:
write(pkgPath, wantedShrinkwrap, currentShrinkwrap) => Promise
Writes the wanted/current shrinkwrap files. When they are empty, removes them.
What are the "wanted" and "current" files? The data type for wantedShrinkwrap is a Shrinkwrap interface, which seems useful, but it appears to be a forgotten export for this API.
This one looks useful:
writeCurrentOnly(pkgPath, currentShrinkwrap) => Promise
Writes the current shrinkwrap file only. Fails if there is no node_modules directory in the pkgPath
...but it says that it expects a node_modules folder for some reason. Why? Seems like an arbitrary requirement.
Lastly, it might be nice to have non-async versions of these functions. We often avoid async in our tools because it makes the control follow more difficult to follow and debug. And the single-threaded parallelism tends not to provide much speed improvement, because (1) NodeJS makes it difficult to bound the parallelism, and too many async operations can actually slow things down by causing too much context switching or disk thrashing, and (2) Rush already launches a separate node.exe process for each CPU core, which is perhaps a better behaved form of parallelism.
There was a problem hiding this comment.
The wanted shrinkwrap is in the root of your project. In the same directory where the package.json is. The current shrinkwrap.yaml is the one in node_modules/.shrinkwrap.yaml. I don't know which one you need but pnpm writes both.
I don't have objections having sync versions or exporting the configs passed to YAML
Uh oh!
There was an error while loading. Please reload this page.