Skip to content

fix: detect the plugin file a package ships when updating an npm plugin - #1334

Merged
dsherret merged 2 commits into
mainfrom
fix_config_update_npm_plugin_kind_change
Oct 10, 2026
Merged

dsherret merged 2 commits into
mainfrom
fix_config_update_npm_plugin_kind_change

Conversation

@dsherret

Copy link
Copy Markdown
Member

Closes #1333

dprint config update on an npm entry like npm:@dprint/[email protected]/plugin.json@sha carried the /plugin.json path over to the new version, so a process plugin rewritten as wasm failed to resolve:

Error resolving plugin npm:@dprint/[email protected]/plugin.json: Could not find plugin.json in npm package @dprint/roslyn. The package contains plugin.wasm instead — reference it as `npm:@dprint/[email protected]/plugin.wasm`.

Changes:

  • An entry whose path is a conventional root plugin file (plugin.wasm / plugin.json) is set up through the plugin cache at the new version, which detects the file the package actually ships. A path chosen within the package (ex. json/plugin.wasm) is kept.
  • The checksum follows the new kind: a process plugin always gets the new tarball's checksum, a wasm plugin keeps one only if the old entry was wasm and had one pinned. A process plugin that became wasm drops it, so roslyn updates to npm:@dprint/[email protected].
  • A wasm plugin that became process still goes through the "The process plugin ... has a new url" confirmation, since that's keyed off the new entry's kind.
  • Setting the package up during the update warms the plugin cache, so the config-update pass afterwards is a hit instead of a second tarball download.
  • The missing plugin file hint omits the default /plugin.wasm (npm:@dprint/[email protected]).

A process plugin rewritten as wasm ships plugin.wasm instead of
plugin.json at its new version, but `dprint config update` carried the
entry's `/plugin.json` path over and failed to resolve it. The file is
now detected from the package at the new version (a path chosen within
the package stays), and the checksum a process plugin required is dropped
when it becomes wasm. The missing plugin file hint also leaves out the
default `/plugin.wasm`.

Closes #1333
@dsherret
dsherret merged commit 67ce7de into main Oct 10, 2026
22 checks passed
@dsherret
dsherret deleted the fix_config_update_npm_plugin_kind_change branch October 10, 2026 23:38
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.

Running dprint config update for a process plugin switching to a Wasm plugin fails

1 participant