feat(licenses): add workspace support - #1657
Conversation
…ce/very_good_cli into feat/licenses-workspace
The FileSystemException catch in _expandMembers is only reachable on Unix; on Windows glob swallows the ENOTDIR internally, leaving the catch clause line uncovered. Wrap it in coverage:ignore-start/end so coverage is 100% on both platforms. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@vgvbot merge main into this PR and fix the conflicts that might show up |
Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
|
hey @brianegan @samitsv we will be moving forward with this PR to address the support for workspaces in the licenses command, please test your projects against this branch to see if it solves the issues you were experimenting, let me know how it goes, thanks! |
|
@vgvbot merge main into this branch and address the conflicts |
Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
| // the lock's own classification. | ||
| if (!rootPubspecFile.existsSync()) return null; | ||
|
|
||
| final rootPubspec = tryParsePubspec(rootPubspecFile); |
There was a problem hiding this comment.
[P1] Apply pubspec_overrides.yaml before resolving the workspace
The resolver reads only pubspec.yaml, but Pub allows pubspec_overrides.yaml to replace workspace, resolution, and dependency_overrides. A workspace declared only through the override file therefore returns null here and falls back to the lockfile, where member dependencies are transitive. The default direct-main license check can consequently report success without checking any member dependencies. Please parse and overlay both files using Pub’s override semantics, including for every nested member and declaresWorkspaceResolution.
| final memberPubspec = tryParsePubspec( | ||
| File(path.join(memberDirectory.path, _pubspecBasename)), | ||
| ); | ||
| if (memberPubspec == null) { |
There was a problem hiding this comment.
[P3] Do not warn for non-package directories matched by globs
Pub workspace globs include matching directories that contain a pubspec.yaml. This implementation returns every matching directory and then warns for ordinary non-package directories, so a common packages/* workspace can emit misleading warnings for documentation, fixtures, or other folders. Please filter glob matches by pubspec existence without warning; retain the warning for explicit literal members or genuinely unparseable matched pubspecs.
Status
IN DEVELOPMENT
Description
Closes #1273
Type of Change