Skip to content

fix #51: support Dart workspaces with multiple pubspec files#57

Open
BIOMAS-Devel wants to merge 1 commit intobluefireteam:masterfrom
BIOMAS-Devel:fix/dart-workspaces-multiple-pubspec
Open

fix #51: support Dart workspaces with multiple pubspec files#57
BIOMAS-Devel wants to merge 1 commit intobluefireteam:masterfrom
BIOMAS-Devel:fix/dart-workspaces-multiple-pubspec

Conversation

@BIOMAS-Devel
Copy link
Copy Markdown

Summary

This fixes support for Dart/Flutter workspaces where multiple pubspec.yaml files may exist above a file.

Problem

The extension currently expects to find exactly one pubspec.yaml above a Dart file.
In Dart workspaces / monorepos, this is not always valid because both the workspace root and the package root may contain a pubspec.yaml.

This causes errors such as:

Expected to find a single pubspec.yaml file above ..., 2 found.

Fix

Instead of throwing when multiple pubspec.yaml files are found, the extension now selects the nearest matching pubspec.yaml for the file when 1 or 2 files are found (3 or more is still considered an error).

This preserves the expected behavior for single-package projects and allows the extension to work correctly in monorepos/workspaces.

Notes

I was able to verify the fix locally against the workspace scenario that triggered the bug.

I also hit some unrelated test/repo setup issues while trying to run the full test flow, so I’m documenting that here in case it helps review:

  • comments in tsconfig.json where not parsed correctly
  • had to "npm uninstall tsc" and then "npm install" to be able to run "npm run package" and generate the vsix

Should close #51.

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.

Melos project with multiple pubspec.yaml files

2 participants