Skip to content

fix: resolve executable of process plugin in node_modules from node_modules - #1494

Merged
dsherret merged 3 commits into
mainfrom
node-modules-process-plugin-executable
Nov 30, 2026
Merged

dsherret merged 3 commits into
mainfrom
node-modules-process-plugin-executable

Conversation

@dsherret

@dsherret dsherret commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

When a process plugin is resolved from node_modules (ex. npm:@dprint/exec/plugin.json), dprint only used node_modules for the plugin.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_modules the same way Node.js does (starting at the real path of the plugin.json, so it works with pnpm) and runs the executable from there.

  • How the package manager set up node_modules is trusted, so the version and checksum of the reference in the plugin.json aren't used. This also means editors don't ask for approval again when only the executable changes.
  • When the per-platform package isn't in node_modules (ex. --omit=optional), it falls back to the npm registry and verifies the checksum, the same as before. DPRINT_AUTO_INSTALL applies to this download, so it may need dprint install.
  • DPRINT_AUTO_INSTALL no longer prevents using a process plugin whose executable is in node_modules.

Plugins with a version (ex. npm:@dprint/[email protected]/plugin.json@<checksum>) still use the npm registry and verify the checksum.

@dsherret
dsherret merged commit 86c5001 into main Nov 30, 2026
6 checks passed
@dsherret
dsherret deleted the node-modules-process-plugin-executable branch November 30, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant