Skip to content

Commit

Permalink
Fix pub deps behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdm committed Sep 26, 2024
1 parent 23e3d4f commit 57eb39a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/src/command/deps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class DepsCommand extends PubCommand {
// before. Clients should opt to consume directDependencies and
// devDependencies separately instead.
'dependencies': (isRoot
? currentPackage.dependencies
: currentPackage.immediateDependencies)
? currentPackage.immediateDependencies
: currentPackage.dependencies)
.keys
.toList(),
'directDependencies': currentPackage.dependencies.keys.toList(),
Expand Down
4 changes: 3 additions & 1 deletion test/deps_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ void main() {
"dependencies": [
"normal",
"overridden",
"from_path"
"from_path",
"unittest",
"override_only"
],
"directDependencies": [
"normal",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ $ pub deps --json
"version": "0.0.0",
"kind": "root",
"source": "root",
"dependencies": [],
"dependencies": [
"foo"
],
"directDependencies": [],
"devDependencies": [
"foo"
Expand Down
3 changes: 2 additions & 1 deletion test/workspace_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ transitive dependencies:
"source": "root",
"dependencies": [
"myapp",
"foo"
"foo",
"both"
],
"directDependencies": [
"myapp",
Expand Down

0 comments on commit 57eb39a

Please sign in to comment.