Skip to content

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Apr 29, 2024

Fixes #4250

@sigurdm sigurdm requested review from jonasfj and szakarias April 29, 2024 11:31
@sigurdm sigurdm changed the title Outdated workspaces outdated support for workspaces Apr 29, 2024
Comment on lines +1106 to +1124
/// Whether the package [name] is overridden anywhere in the workspace rooted at
/// [workspaceRoot].
bool hasOverride(Package workspaceRoot, String name) {
return workspaceRoot.allOverridesInWorkspace.containsKey(name);
}

/// Whether the package [name] is depended on directly anywhere in the workspace
/// rooted at [workspaceRoot].
bool hasDependency(Package workspaceRoot, String name) {
return workspaceRoot.transitiveWorkspace
.any((p) => p.dependencies.containsKey(name));
}

/// Whether the package [name] is dev-depended on directly anywhere in the workspace
/// rooted at [workspaceRoot].
bool hasDevDependency(Package workspaceRoot, String name) {
return workspaceRoot.transitiveWorkspace
.any((p) => p.devDependencies.containsKey(name));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these would be neat as extension methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll refactor these in a follow-up

@sigurdm sigurdm merged commit 738a726 into dart-lang:master Apr 29, 2024
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.

pub outdated support for showing outdated dependencies for whole workspace

2 participants