sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Support plugins that depend on packages from the same "workspace"

Open rrousselGit opened this issue 1 week ago • 0 comments

pubspec.yaml supports resolution: workspace, which is very useful for monorepos.

But analyzer plugins do not appear to recognise this, and attempt to fetch dependencies of a plugin from pub.dev instead of from the workspace. This makes dev and CI very tedious, as it involved having to use a path dependency ; which has to be removed in favour of a version before publishing.

Consider:

# project/pubspec.yaml
name: workspace
publish_to: none

environment:
  sdk: ^3.7.0

workspace:
  - packages/dep
  - packages/plugin
# project/packages/plugin/pubspec.yaml
name: plugin
version: 1.0.0
environment:
  sdk: ^3.7.0

resolution: workspace

dependencies:
  analysis_server_plugin: ^0.3.0
  <....>
  dep: 1.0.0
# project/packages/dep/pubspec.yaml
name: dep
version: 1.0.0
environment:
  sdk: ^3.7.0

resolution: workspace

Doing so appears to fail

rrousselGit avatar Dec 03 '25 09:12 rrousselGit