Skip to content

feat: add workspace support for packages check licenses#1444

Closed
realmeylisdev wants to merge 7 commits intoVeryGoodOpenSource:mainfrom
realmeylisdev:feat/workspace-license-support
Closed

feat: add workspace support for packages check licenses#1444
realmeylisdev wants to merge 7 commits intoVeryGoodOpenSource:mainfrom
realmeylisdev:feat/workspace-license-support

Conversation

@realmeylisdev
Copy link
Contributor

Summary

This PR adds workspace support to the packages check licenses command, enabling license checking in monorepo projects that use Dart's pub workspace feature.

Closes #1273

Changes

New Files

  • lib/src/pubspec/pubspec.dart - Pubspec parser for detecting workspace configurations
  • test/src/pubspec/pubspec_test.dart - 19 tests for the Pubspec parser

Modified Files

  • lib/src/commands/packages/commands/check/commands/licenses.dart - Added workspace detection and dependency collection
  • test/src/commands/packages/commands/check/commands/licenses_test.dart - Added 3 workspace support tests

How It Works

  1. Auto-detection: When pubspec.yaml contains a workspace property, it's detected as a workspace root
  2. Dependency collection: Dependencies are collected from all workspace members' pubspec.yaml files
  3. Glob pattern support: Workspace paths like packages/* are supported (Dart 3.11+)
  4. Nested workspaces: Recursively handles nested workspaces
  5. Backwards compatible: Non-workspace projects work exactly as before

Test plan

  • All existing license tests pass (42 tests)
  • New workspace support tests pass (3 tests)
  • New Pubspec parser tests pass (19 tests)
  • Static analysis passes with no issues

When a pubspec.yaml declares a workspace property, the command now
recursively collects dependencies from all workspace members and
checks their licenses using the root pubspec.lock.

This enables license checking in monorepo projects that use Dart's
pub workspace feature.

Closes #1273
@realmeylisdev realmeylisdev requested a review from a team as a code owner December 29, 2025 19:24
@realmeylisdev
Copy link
Contributor Author

Hey @marcossevilla , would you mind reviewing this please?

@realmeylisdev
Copy link
Contributor Author

Hey @marcossevilla let's review this as well

@marcossevilla marcossevilla added this to the v1.0.0 milestone Feb 2, 2026
@marcossevilla marcossevilla moved this from Needs Triage to In Review in VGV Open Source 🦄 🧙🌟 Feb 2, 2026
@marcossevilla marcossevilla moved this from In Review to Community in VGV Open Source 🦄 🧙🌟 Feb 5, 2026
@marcossevilla marcossevilla removed this from the v1.0.0 milestone Feb 20, 2026
@realmeylisdev realmeylisdev closed this by deleting the head repository Mar 4, 2026
@samitsv
Copy link

samitsv commented Mar 18, 2026

@realmeylisdev @marcossevilla was there a reason why this got removed from v1.0.0 ? We use the cli tool for checking licenses and wanted to utilize this change.

@marcossevilla
Copy link
Member

hi @samitsv, we de-prioritized this because we didn't have time to review it and had a deadline for v1. we could review it now but @realmeylisdev seems to have deleted the head repository so the PR closed.

@samitsv
Copy link

samitsv commented Mar 18, 2026

is there any chance the branch could be brought back up @realmeylisdev ?

@realmeylisdev
Copy link
Contributor Author

Branch has been restored @samitsv

@realmeylisdev
Copy link
Contributor Author

#1540

Hey @samitsv , please check this PR, newly opened now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

feat: Support packages check licenses with workspaces

3 participants