Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter SDK package 'flutter' from the outdated report. #1453

Merged
merged 4 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.22.20

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

## 0.22.19

Expand Down
27 changes: 26 additions & 1 deletion lib/src/sdk_env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,32 @@ class ToolEnvironment {
result,
);
} else {
return Outdated.fromJson(result.parseJson());
final outdated = Outdated.fromJson(result.parseJson());
final lockFile = File(p.join(packageDir, 'pubspec.lock'));
final lockContent =
yamlToJson(await lockFile.readAsString()) ?? const {};
final lockPackages = lockContent['packages'];
if (lockPackages is! Map<String, dynamic>) {
throw ToolException(
'`$cmdLabel pub outdated` failed to generate a valid `pubspec.lock`.');
}
final sdkPackages = lockPackages.entries
.where((e) {
final data = e.value;
if (data is! Map<String, dynamic>) {
return false;
}
return data['source'] == 'sdk';
})
.map((e) => e.key)
.toSet();

return Outdated(
outdated.packages
// Filter SDK packages.
.where((p) => !sdkPackages.contains(p.package))
.toList(),
);
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions test/goldens/end2end/audio_service-0.18.17.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
"platform",
"plugin_platform_interface",
"rxdart",
"sky_engine",
"source_span",
"sprintf",
"sqflite",
Expand Down Expand Up @@ -183,7 +182,7 @@
"grantedPoints": 30,
"maxPoints": 40,
"status": "failed",
"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"
"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"
}
]
},
Expand Down
6 changes: 0 additions & 6 deletions test/goldens/end2end/audio_service-0.18.17.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ See https://docs.flutter.dev/to/spm for details.
|[`audio_service_web`]|`^0.1.4`|0.1.4|0.1.4||
|[`audio_session`]|`^0.1.25`|0.1.25|0.1.25||
|[`clock`]|`^1.1.0`|1.1.2|1.1.2||
|[`flutter`]|`flutter`|0.0.0|0.0.0||
|[`flutter_cache_manager`]|`^3.3.1`|3.4.1|3.4.1||
|[`flutter_web_plugins`]|`flutter`|0.0.0|0.0.0||
|[`js`]|`>=0.6.3 <0.8.0`|0.7.2|0.7.2|**Discontinued**|
|[`rxdart`]|`>=0.26.0 <0.29.0`|0.28.0|0.28.0||

Expand Down Expand Up @@ -136,7 +134,6 @@ See https://docs.flutter.dev/to/spm for details.
|[`path_provider_windows`]|-|2.3.0|2.3.0||
|[`platform`]|-|3.1.6|3.1.6||
|[`plugin_platform_interface`]|-|2.1.8|2.1.8||
|[`sky_engine`]|-|0.0.0|0.0.0||
|[`source_span`]|-|1.10.1|1.10.1||
|[`sprintf`]|-|7.0.0|7.0.0||
|[`sqflite`]|-|2.4.2|2.4.2||
Expand All @@ -160,9 +157,7 @@ To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-depe
[`audio_service_web`]: https://pub.dev/packages/audio_service_web
[`audio_session`]: https://pub.dev/packages/audio_session
[`clock`]: https://pub.dev/packages/clock
[`flutter`]: https://pub.dev/packages/flutter
[`flutter_cache_manager`]: https://pub.dev/packages/flutter_cache_manager
[`flutter_web_plugins`]: https://pub.dev/packages/flutter_web_plugins
[`js`]: https://pub.dev/packages/js
[`rxdart`]: https://pub.dev/packages/rxdart
[`async`]: https://pub.dev/packages/async
Expand All @@ -185,7 +180,6 @@ To reproduce run `dart pub outdated --no-dev-dependencies --up-to-date --no-depe
[`path_provider_windows`]: https://pub.dev/packages/path_provider_windows
[`platform`]: https://pub.dev/packages/platform
[`plugin_platform_interface`]: https://pub.dev/packages/plugin_platform_interface
[`sky_engine`]: https://pub.dev/packages/sky_engine
[`source_span`]: https://pub.dev/packages/source_span
[`sprintf`]: https://pub.dev/packages/sprintf
[`sqflite`]: https://pub.dev/packages/sqflite
Expand Down
3 changes: 1 addition & 2 deletions test/goldens/end2end/nsd_android-2.1.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"flutter",
"material_color_utilities",
"meta",
"sky_engine",
"vector_math"
],
"tags": [
Expand Down Expand Up @@ -103,7 +102,7 @@
"grantedPoints": 40,
"maxPoints": 40,
"status": "passed",
"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"
"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"
}
]
},
Expand Down
7 changes: 1 addition & 6 deletions test/goldens/end2end/nsd_android-2.1.2.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ See https://dart.dev/web/wasm for details.

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

|Package|Constraint|Compatible|Latest|Notes|
|:-|:-|:-|:-|:-|
|[`flutter`]|`flutter`|0.0.0|0.0.0||
No dependencies.

<details><summary>Transitive dependencies</summary>

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

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

[`flutter`]: https://pub.dev/packages/flutter
[`characters`]: https://pub.dev/packages/characters
[`collection`]: https://pub.dev/packages/collection
[`material_color_utilities`]: https://pub.dev/packages/material_color_utilities
[`meta`]: https://pub.dev/packages/meta
[`sky_engine`]: https://pub.dev/packages/sky_engine
[`vector_math`]: https://pub.dev/packages/vector_math

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