Repository navigation
fix: resolve executable of process plugin in node_modules from node_modules - #1494
Merged
Merged
Conversation
…ot in node_modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a process plugin is resolved from
node_modules(ex.npm:@dprint/exec/plugin.json), dprint only usednode_modulesfor theplugin.json. It downloaded the per-platform package with the executable from the npm registry into its own cache, even though the package manager already installed it.This resolves the per-platform package from
node_modulesthe same way Node.js does (starting at the real path of theplugin.json, so it works with pnpm) and runs the executable from there.node_modulesis trusted, so the version and checksum of the reference in theplugin.jsonaren't used. This also means editors don't ask for approval again when only the executable changes.node_modules(ex.--omit=optional), it falls back to the npm registry and verifies the checksum, the same as before.DPRINT_AUTO_INSTALLapplies to this download, so it may needdprint install.DPRINT_AUTO_INSTALLno longer prevents using a process plugin whose executable is innode_modules.Plugins with a version (ex.
npm:@dprint/[email protected]/plugin.json@<checksum>) still use the npm registry and verify the checksum.