Skip to content

Commit 07bd483

Browse files
authored
Filter SDK package 'flutter' from the outdated report. (#1453)
1 parent d563dd7 commit 07bd483

9 files changed

+34
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.22.20
22

33
- Reduced minimum description length to 50 characters.
4+
- Filter SDK package `flutter` from the outdated report.
45

56
## 0.22.19
67

lib/src/sdk_env.dart

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,32 @@ class ToolEnvironment {
402402
result,
403403
);
404404
} else {
405-
return Outdated.fromJson(result.parseJson());
405+
final outdated = Outdated.fromJson(result.parseJson());
406+
final lockFile = File(p.join(packageDir, 'pubspec.lock'));
407+
final lockContent =
408+
yamlToJson(await lockFile.readAsString()) ?? const {};
409+
final lockPackages = lockContent['packages'];
410+
if (lockPackages is! Map<String, dynamic>) {
411+
throw ToolException(
412+
'`$cmdLabel pub outdated` failed to generate a valid `pubspec.lock`.');
413+
}
414+
final sdkPackages = lockPackages.entries
415+
.where((e) {
416+
final data = e.value;
417+
if (data is! Map<String, dynamic>) {
418+
return false;
419+
}
420+
return data['source'] == 'sdk';
421+
})
422+
.map((e) => e.key)
423+
.toSet();
424+
425+
return Outdated(
426+
outdated.packages
427+
// Filter SDK packages.
428+
.where((p) => !sdkPackages.contains(p.package))
429+
.toList(),
430+
);
406431
}
407432
});
408433
}

test/goldens/end2end/audio_service-0.18.17.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
"platform",
111111
"plugin_platform_interface",
112112
"rxdart",
113-
"sky_engine",
114113
"source_span",
115114
"sprintf",
116115
"sqflite",
@@ -183,7 +182,7 @@
183182
"grantedPoints": 30,
184183
"maxPoints": 40,
185184
"status": "failed",
186-
"summary": "### [x] 0/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`audio_service_platform_interface`]|`^0.1.3`|0.1.3|0.1.3||\n|[`audio_service_web`]|`^0.1.4`|0.1.4|0.1.4||\n|[`audio_session`]|`^0.1.25`|0.1.25|0.1.25||\n|[`clock`]|`^1.1.0`|1.1.2|1.1.2||\n|[`flutter`]|`flutter`|0.0.0|0.0.0||\n|[`flutter_cache_manager`]|`^3.3.1`|3.4.1|3.4.1||\n|[`flutter_web_plugins`]|`flutter`|0.0.0|0.0.0||\n|[`js`]|`>=0.6.3 <0.8.0`|0.7.2|0.7.2|**Discontinued**|\n|[`rxdart`]|`>=0.26.0 <0.29.0`|0.28.0|0.28.0||\n\n<details><summary>Transitive dependencies</summary>\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`async`]|-|2.13.0|2.13.0||\n|[`characters`]|-|1.4.0|1.4.0||\n|[`collection`]|-|1.19.1|1.19.1||\n|[`crypto`]|-|3.0.6|3.0.6||\n|[`ffi`]|-|2.1.3|2.1.3||\n|[`file`]|-|7.0.1|7.0.1||\n|[`fixnum`]|-|1.1.1|1.1.1||\n|[`http`]|-|1.3.0|1.3.0||\n|[`http_parser`]|-|4.1.2|4.1.2||\n|[`material_color_utilities`]|-|0.11.1|0.12.0||\n|[`meta`]|-|1.16.0|1.16.0||\n|[`path`]|-|1.9.1|1.9.1||\n|[`path_provider`]|-|2.1.5|2.1.5||\n|[`path_provider_android`]|-|2.2.15|2.2.15||\n|[`path_provider_foundation`]|-|2.4.1|2.4.1||\n|[`path_provider_linux`]|-|2.2.1|2.2.1||\n|[`path_provider_platform_interface`]|-|2.1.2|2.1.2||\n|[`path_provider_windows`]|-|2.3.0|2.3.0||\n|[`platform`]|-|3.1.6|3.1.6||\n|[`plugin_platform_interface`]|-|2.1.8|2.1.8||\n|[`sky_engine`]|-|0.0.0|0.0.0||\n|[`source_span`]|-|1.10.1|1.10.1||\n|[`sprintf`]|-|7.0.0|7.0.0||\n|[`sqflite`]|-|2.4.2|2.4.2||\n|[`sqflite_android`]|-|2.4.1|2.4.1||\n|[`sqflite_common`]|-|2.5.5|2.5.5||\n|[`sqflite_darwin`]|-|2.4.2|2.4.2||\n|[`sqflite_platform_interface`]|-|2.4.0|2.4.0||\n|[`string_scanner`]|-|1.4.1|1.4.1||\n|[`synchronized`]|-|3.3.1|3.3.1||\n|[`term_glyph`]|-|1.2.2|1.2.2||\n|[`typed_data`]|-|1.4.0|1.4.0||\n|[`uuid`]|-|4.5.1|4.5.1||\n|[`vector_math`]|-|2.1.4|2.1.4||\n|[`web`]|-|1.1.0|1.1.0||\n|[`xdg_directories`]|-|1.1.0|1.1.0||\n</details>\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`audio_service_platform_interface`]: https://pub.dev/packages/audio_service_platform_interface\n[`audio_service_web`]: https://pub.dev/packages/audio_service_web\n[`audio_session`]: https://pub.dev/packages/audio_session\n[`clock`]: https://pub.dev/packages/clock\n[`flutter`]: https://pub.dev/packages/flutter\n[`flutter_cache_manager`]: https://pub.dev/packages/flutter_cache_manager\n[`flutter_web_plugins`]: https://pub.dev/packages/flutter_web_plugins\n[`js`]: https://pub.dev/packages/js\n[`rxdart`]: https://pub.dev/packages/rxdart\n[`async`]: https://pub.dev/packages/async\n[`characters`]: https://pub.dev/packages/characters\n[`collection`]: https://pub.dev/packages/collection\n[`crypto`]: https://pub.dev/packages/crypto\n[`ffi`]: https://pub.dev/packages/ffi\n[`file`]: https://pub.dev/packages/file\n[`fixnum`]: https://pub.dev/packages/fixnum\n[`http`]: https://pub.dev/packages/http\n[`http_parser`]: https://pub.dev/packages/http_parser\n[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities\n[`meta`]: https://pub.dev/packages/meta\n[`path`]: https://pub.dev/packages/path\n[`path_provider`]: https://pub.dev/packages/path_provider\n[`path_provider_android`]: https://pub.dev/packages/path_provider_android\n[`path_provider_foundation`]: https://pub.dev/packages/path_provider_foundation\n[`path_provider_linux`]: https://pub.dev/packages/path_provider_linux\n[`path_provider_platform_interface`]: https://pub.dev/packages/path_provider_platform_interface\n[`path_provider_windows`]: https://pub.dev/packages/path_provider_windows\n[`platform`]: https://pub.dev/packages/platform\n[`plugin_platform_interface`]: https://pub.dev/packages/plugin_platform_interface\n[`sky_engine`]: https://pub.dev/packages/sky_engine\n[`source_span`]: https://pub.dev/packages/source_span\n[`sprintf`]: https://pub.dev/packages/sprintf\n[`sqflite`]: https://pub.dev/packages/sqflite\n[`sqflite_android`]: https://pub.dev/packages/sqflite_android\n[`sqflite_common`]: https://pub.dev/packages/sqflite_common\n[`sqflite_darwin`]: https://pub.dev/packages/sqflite_darwin\n[`sqflite_platform_interface`]: https://pub.dev/packages/sqflite_platform_interface\n[`string_scanner`]: https://pub.dev/packages/string_scanner\n[`synchronized`]: https://pub.dev/packages/synchronized\n[`term_glyph`]: https://pub.dev/packages/term_glyph\n[`typed_data`]: https://pub.dev/packages/typed_data\n[`uuid`]: https://pub.dev/packages/uuid\n[`vector_math`]: https://pub.dev/packages/vector_math\n[`web`]: https://pub.dev/packages/web\n[`xdg_directories`]: https://pub.dev/packages/xdg_directories\n\n<details>\n<summary>\nThe package has one or more discontinued direct dependencies.\n\nDiscontinued packages are no longer maintained, and can end up being a\nliability.\n\n</summary>\n\nConsider migrating away from these dependencies: \n\n* js.\n\n</details>\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
185+
"summary": "### [x] 0/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`audio_service_platform_interface`]|`^0.1.3`|0.1.3|0.1.3||\n|[`audio_service_web`]|`^0.1.4`|0.1.4|0.1.4||\n|[`audio_session`]|`^0.1.25`|0.1.25|0.1.25||\n|[`clock`]|`^1.1.0`|1.1.2|1.1.2||\n|[`flutter_cache_manager`]|`^3.3.1`|3.4.1|3.4.1||\n|[`js`]|`>=0.6.3 <0.8.0`|0.7.2|0.7.2|**Discontinued**|\n|[`rxdart`]|`>=0.26.0 <0.29.0`|0.28.0|0.28.0||\n\n<details><summary>Transitive dependencies</summary>\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`async`]|-|2.13.0|2.13.0||\n|[`characters`]|-|1.4.0|1.4.0||\n|[`collection`]|-|1.19.1|1.19.1||\n|[`crypto`]|-|3.0.6|3.0.6||\n|[`ffi`]|-|2.1.3|2.1.3||\n|[`file`]|-|7.0.1|7.0.1||\n|[`fixnum`]|-|1.1.1|1.1.1||\n|[`http`]|-|1.3.0|1.3.0||\n|[`http_parser`]|-|4.1.2|4.1.2||\n|[`material_color_utilities`]|-|0.11.1|0.12.0||\n|[`meta`]|-|1.16.0|1.16.0||\n|[`path`]|-|1.9.1|1.9.1||\n|[`path_provider`]|-|2.1.5|2.1.5||\n|[`path_provider_android`]|-|2.2.15|2.2.15||\n|[`path_provider_foundation`]|-|2.4.1|2.4.1||\n|[`path_provider_linux`]|-|2.2.1|2.2.1||\n|[`path_provider_platform_interface`]|-|2.1.2|2.1.2||\n|[`path_provider_windows`]|-|2.3.0|2.3.0||\n|[`platform`]|-|3.1.6|3.1.6||\n|[`plugin_platform_interface`]|-|2.1.8|2.1.8||\n|[`source_span`]|-|1.10.1|1.10.1||\n|[`sprintf`]|-|7.0.0|7.0.0||\n|[`sqflite`]|-|2.4.2|2.4.2||\n|[`sqflite_android`]|-|2.4.1|2.4.1||\n|[`sqflite_common`]|-|2.5.5|2.5.5||\n|[`sqflite_darwin`]|-|2.4.2|2.4.2||\n|[`sqflite_platform_interface`]|-|2.4.0|2.4.0||\n|[`string_scanner`]|-|1.4.1|1.4.1||\n|[`synchronized`]|-|3.3.1|3.3.1||\n|[`term_glyph`]|-|1.2.2|1.2.2||\n|[`typed_data`]|-|1.4.0|1.4.0||\n|[`uuid`]|-|4.5.1|4.5.1||\n|[`vector_math`]|-|2.1.4|2.1.4||\n|[`web`]|-|1.1.0|1.1.0||\n|[`xdg_directories`]|-|1.1.0|1.1.0||\n</details>\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`audio_service_platform_interface`]: https://pub.dev/packages/audio_service_platform_interface\n[`audio_service_web`]: https://pub.dev/packages/audio_service_web\n[`audio_session`]: https://pub.dev/packages/audio_session\n[`clock`]: https://pub.dev/packages/clock\n[`flutter_cache_manager`]: https://pub.dev/packages/flutter_cache_manager\n[`js`]: https://pub.dev/packages/js\n[`rxdart`]: https://pub.dev/packages/rxdart\n[`async`]: https://pub.dev/packages/async\n[`characters`]: https://pub.dev/packages/characters\n[`collection`]: https://pub.dev/packages/collection\n[`crypto`]: https://pub.dev/packages/crypto\n[`ffi`]: https://pub.dev/packages/ffi\n[`file`]: https://pub.dev/packages/file\n[`fixnum`]: https://pub.dev/packages/fixnum\n[`http`]: https://pub.dev/packages/http\n[`http_parser`]: https://pub.dev/packages/http_parser\n[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities\n[`meta`]: https://pub.dev/packages/meta\n[`path`]: https://pub.dev/packages/path\n[`path_provider`]: https://pub.dev/packages/path_provider\n[`path_provider_android`]: https://pub.dev/packages/path_provider_android\n[`path_provider_foundation`]: https://pub.dev/packages/path_provider_foundation\n[`path_provider_linux`]: https://pub.dev/packages/path_provider_linux\n[`path_provider_platform_interface`]: https://pub.dev/packages/path_provider_platform_interface\n[`path_provider_windows`]: https://pub.dev/packages/path_provider_windows\n[`platform`]: https://pub.dev/packages/platform\n[`plugin_platform_interface`]: https://pub.dev/packages/plugin_platform_interface\n[`source_span`]: https://pub.dev/packages/source_span\n[`sprintf`]: https://pub.dev/packages/sprintf\n[`sqflite`]: https://pub.dev/packages/sqflite\n[`sqflite_android`]: https://pub.dev/packages/sqflite_android\n[`sqflite_common`]: https://pub.dev/packages/sqflite_common\n[`sqflite_darwin`]: https://pub.dev/packages/sqflite_darwin\n[`sqflite_platform_interface`]: https://pub.dev/packages/sqflite_platform_interface\n[`string_scanner`]: https://pub.dev/packages/string_scanner\n[`synchronized`]: https://pub.dev/packages/synchronized\n[`term_glyph`]: https://pub.dev/packages/term_glyph\n[`typed_data`]: https://pub.dev/packages/typed_data\n[`uuid`]: https://pub.dev/packages/uuid\n[`vector_math`]: https://pub.dev/packages/vector_math\n[`web`]: https://pub.dev/packages/web\n[`xdg_directories`]: https://pub.dev/packages/xdg_directories\n\n<details>\n<summary>\nThe package has one or more discontinued direct dependencies.\n\nDiscontinued packages are no longer maintained, and can end up being a\nliability.\n\n</summary>\n\nConsider migrating away from these dependencies: \n\n* js.\n\n</details>\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
187186
}
188187
]
189188
},

test/goldens/end2end/audio_service-0.18.17.json_report.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ See https://docs.flutter.dev/to/spm for details.
106106
|[`audio_service_web`]|`^0.1.4`|0.1.4|0.1.4||
107107
|[`audio_session`]|`^0.1.25`|0.1.25|0.1.25||
108108
|[`clock`]|`^1.1.0`|1.1.2|1.1.2||
109-
|[`flutter`]|`flutter`|0.0.0|0.0.0||
110109
|[`flutter_cache_manager`]|`^3.3.1`|3.4.1|3.4.1||
111-
|[`flutter_web_plugins`]|`flutter`|0.0.0|0.0.0||
112110
|[`js`]|`>=0.6.3 <0.8.0`|0.7.2|0.7.2|**Discontinued**|
113111
|[`rxdart`]|`>=0.26.0 <0.29.0`|0.28.0|0.28.0||
114112

@@ -136,7 +134,6 @@ See https://docs.flutter.dev/to/spm for details.
136134
|[`path_provider_windows`]|-|2.3.0|2.3.0||
137135
|[`platform`]|-|3.1.6|3.1.6||
138136
|[`plugin_platform_interface`]|-|2.1.8|2.1.8||
139-
|[`sky_engine`]|-|0.0.0|0.0.0||
140137
|[`source_span`]|-|1.10.1|1.10.1||
141138
|[`sprintf`]|-|7.0.0|7.0.0||
142139
|[`sqflite`]|-|2.4.2|2.4.2||
@@ -160,9 +157,7 @@ To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-depe
160157
[`audio_service_web`]: https://pub.dev/packages/audio_service_web
161158
[`audio_session`]: https://pub.dev/packages/audio_session
162159
[`clock`]: https://pub.dev/packages/clock
163-
[`flutter`]: https://pub.dev/packages/flutter
164160
[`flutter_cache_manager`]: https://pub.dev/packages/flutter_cache_manager
165-
[`flutter_web_plugins`]: https://pub.dev/packages/flutter_web_plugins
166161
[`js`]: https://pub.dev/packages/js
167162
[`rxdart`]: https://pub.dev/packages/rxdart
168163
[`async`]: https://pub.dev/packages/async
@@ -185,7 +180,6 @@ To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-depe
185180
[`path_provider_windows`]: https://pub.dev/packages/path_provider_windows
186181
[`platform`]: https://pub.dev/packages/platform
187182
[`plugin_platform_interface`]: https://pub.dev/packages/plugin_platform_interface
188-
[`sky_engine`]: https://pub.dev/packages/sky_engine
189183
[`source_span`]: https://pub.dev/packages/source_span
190184
[`sprintf`]: https://pub.dev/packages/sprintf
191185
[`sqflite`]: https://pub.dev/packages/sqflite

test/goldens/end2end/nsd_android-2.1.2.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"flutter",
5050
"material_color_utilities",
5151
"meta",
52-
"sky_engine",
5352
"vector_math"
5453
],
5554
"tags": [
@@ -103,7 +102,7 @@
103102
"grantedPoints": 40,
104103
"maxPoints": 40,
105104
"status": "passed",
106-
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`flutter`]|`flutter`|0.0.0|0.0.0||\n\n<details><summary>Transitive dependencies</summary>\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`characters`]|-|1.4.0|1.4.0||\n|[`collection`]|-|1.19.1|1.19.1||\n|[`material_color_utilities`]|-|0.11.1|0.12.0||\n|[`meta`]|-|1.16.0|1.16.0||\n|[`sky_engine`]|-|0.0.0|0.0.0||\n|[`vector_math`]|-|2.1.4|2.1.4||\n</details>\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`flutter`]: https://pub.dev/packages/flutter\n[`characters`]: https://pub.dev/packages/characters\n[`collection`]: https://pub.dev/packages/collection\n[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities\n[`meta`]: https://pub.dev/packages/meta\n[`sky_engine`]: https://pub.dev/packages/sky_engine\n[`vector_math`]: https://pub.dev/packages/vector_math\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
105+
"summary": "### [*] 10/10 points: All of the package dependencies are supported in the latest version\n\nNo dependencies.\n\n<details><summary>Transitive dependencies</summary>\n\n|Package|Constraint|Compatible|Latest|Notes|\n|:-|:-|:-|:-|:-|\n|[`characters`]|-|1.4.0|1.4.0||\n|[`collection`]|-|1.19.1|1.19.1||\n|[`material_color_utilities`]|-|0.11.1|0.12.0||\n|[`meta`]|-|1.16.0|1.16.0||\n|[`vector_math`]|-|2.1.4|2.1.4||\n</details>\n\nTo reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.\n\n[`characters`]: https://pub.dev/packages/characters\n[`collection`]: https://pub.dev/packages/collection\n[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities\n[`meta`]: https://pub.dev/packages/meta\n[`vector_math`]: https://pub.dev/packages/vector_math\n\n### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs\n\n### [*] 20/20 points: Compatible with dependency constraint lower bounds\n\n`pub downgrade` does not expose any static analysis error.\n"
107106
}
108107
]
109108
},

test/goldens/end2end/nsd_android-2.1.2.json_report.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ See https://dart.dev/web/wasm for details.
9494

9595
### [*] 10/10 points: All of the package dependencies are supported in the latest version
9696

97-
|Package|Constraint|Compatible|Latest|Notes|
98-
|:-|:-|:-|:-|:-|
99-
|[`flutter`]|`flutter`|0.0.0|0.0.0||
97+
No dependencies.
10098

10199
<details><summary>Transitive dependencies</summary>
102100

@@ -106,18 +104,15 @@ See https://dart.dev/web/wasm for details.
106104
|[`collection`]|-|1.19.1|1.19.1||
107105
|[`material_color_utilities`]|-|0.11.1|0.12.0||
108106
|[`meta`]|-|1.16.0|1.16.0||
109-
|[`sky_engine`]|-|0.0.0|0.0.0||
110107
|[`vector_math`]|-|2.1.4|2.1.4||
111108
</details>
112109

113110
To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides`.
114111

115-
[`flutter`]: https://pub.dev/packages/flutter
116112
[`characters`]: https://pub.dev/packages/characters
117113
[`collection`]: https://pub.dev/packages/collection
118114
[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities
119115
[`meta`]: https://pub.dev/packages/meta
120-
[`sky_engine`]: https://pub.dev/packages/sky_engine
121116
[`vector_math`]: https://pub.dev/packages/vector_math
122117

123118
### [*] 10/10 points: Package supports latest stable Dart and Flutter SDKs

0 commit comments

Comments
 (0)