very_good_cli
very_good_cli copied to clipboard
feat: Support `packages check licenses` with workspaces
Description
When setting up a mono-repo with Pub workspaces your project will look this this:
- app/
pubspec.yaml
- packages/
- packageA/
pubspec.yaml
- packageB/
pubspec.yaml
- packageA/
pubspec.yamlpubspec.lock
Meaning you can't run very_good_cli packages check licenses in the individual projects/packages (there is no pubspec.lock file anymore).
And you can't run very_good_cli packages check licenses in the workspace root, as it will look something like:
name: _
publish_to: none
environment:
sdk: ^3.6.0
workspace:
- app
- packages/packageA
- packages/packageB
# No direct dependencies
# dependencies:
dev_dependencies:
build_runner: ^2.4.14
freezed: ^2.5.7
json_serializable: ^6.9.0
And as the dependencies are not installed in the pubspec.yaml file next to the pubspec.lock file, the output will be something like:
very_good packages check licenses No hosted dependencies found in /Users/steve/flutter_monorepo of type: direct-main.
Requirements
- [ ] Dependencies are also checked in downstream workspaces
(e.g. when a pubspec.yaml file has aworkspacesproperties, go through the list of directories and read the dependencies there as if they were in the root file). - [ ] Multiple nested workspaces also work
(if the root-pubspec.yaml links to the app-pubspec.yaml and the app-pubspec.yaml links to an internal-package-pubspec.yaml, also the dependencies of the internal-package-pubspec.yaml should be considered) - [ ] All CI/CD checks are passing.
- [ ] There is no drop in the test coverage percentage.
Additional Context
No response