From 315ce21367dd81645cd47d63f2f3c6c728e44059 Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Tue, 28 Nov 2023 15:26:42 +0100 Subject: [PATCH] fix: Use barrel file --- packages/app_center/lib/main.dart | 2 +- .../app_center/lib/src/ratings/ratings_l10n.dart | 2 +- .../lib/src/ratings/ratings_model.dart | 2 +- .../lib/src/ratings/ratings_service.dart | 2 +- packages/app_center/test/app_card_test.dart | 2 +- packages/app_center/test/ratings_model_test.dart | 2 +- .../app_center/test/ratings_service_test.dart | 2 +- packages/app_center/test/search_page_test.dart | 2 +- packages/app_center/test/snap_page_test.dart | 2 +- packages/app_center/test/test_utils.dart | 2 +- packages/app_center/test/test_utils.mocks.dart | 3 ++- .../lib/app_center_ratings_client.dart | 2 ++ .../lib/{ => src}/ratings_client.dart | 16 +++++++--------- .../test/ratings_client_test.dart | 2 +- 14 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 packages/app_center_ratings_client/lib/app_center_ratings_client.dart rename packages/app_center_ratings_client/lib/{ => src}/ratings_client.dart (89%) diff --git a/packages/app_center/lib/main.dart b/packages/app_center/lib/main.dart index 61d46a3b8..46f0eddab 100644 --- a/packages/app_center/lib/main.dart +++ b/packages/app_center/lib/main.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:io'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:github/github.dart'; diff --git a/packages/app_center/lib/src/ratings/ratings_l10n.dart b/packages/app_center/lib/src/ratings/ratings_l10n.dart index 2f200a0d1..62be0fb9c 100644 --- a/packages/app_center/lib/src/ratings/ratings_l10n.dart +++ b/packages/app_center/lib/src/ratings/ratings_l10n.dart @@ -1,4 +1,4 @@ -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter/material.dart'; import '../../l10n.dart'; diff --git a/packages/app_center/lib/src/ratings/ratings_model.dart b/packages/app_center/lib/src/ratings/ratings_model.dart index c9c898aa0..daf993210 100644 --- a/packages/app_center/lib/src/ratings/ratings_model.dart +++ b/packages/app_center/lib/src/ratings/ratings_model.dart @@ -1,4 +1,4 @@ -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:clock/clock.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/packages/app_center/lib/src/ratings/ratings_service.dart b/packages/app_center/lib/src/ratings/ratings_service.dart index c8ee71ef9..a770945c0 100644 --- a/packages/app_center/lib/src/ratings/ratings_service.dart +++ b/packages/app_center/lib/src/ratings/ratings_service.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'dart:io'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter/material.dart'; import 'package:glib/glib.dart'; diff --git a/packages/app_center/test/app_card_test.dart b/packages/app_center/test/app_card_test.dart index e5f04e82a..446bf10ff 100644 --- a/packages/app_center/test/app_card_test.dart +++ b/packages/app_center/test/app_card_test.dart @@ -1,6 +1,6 @@ import 'package:app_center/ratings.dart'; import 'package:app_center/widgets.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:snapd/snapd.dart'; diff --git a/packages/app_center/test/ratings_model_test.dart b/packages/app_center/test/ratings_model_test.dart index 0a6672ee5..a80c820e3 100644 --- a/packages/app_center/test/ratings_model_test.dart +++ b/packages/app_center/test/ratings_model_test.dart @@ -1,5 +1,5 @@ import 'package:app_center/ratings.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:clock/clock.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/packages/app_center/test/ratings_service_test.dart b/packages/app_center/test/ratings_service_test.dart index 81a655945..8929754db 100644 --- a/packages/app_center/test/ratings_service_test.dart +++ b/packages/app_center/test/ratings_service_test.dart @@ -1,6 +1,6 @@ import 'package:app_center/src/ratings/exports.dart'; import 'package:app_center/src/ratings/ratings_service.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; diff --git a/packages/app_center/test/search_page_test.dart b/packages/app_center/test/search_page_test.dart index 655a1acb1..948155cde 100644 --- a/packages/app_center/test/search_page_test.dart +++ b/packages/app_center/test/search_page_test.dart @@ -2,7 +2,7 @@ import 'package:app_center/ratings.dart'; import 'package:app_center/search.dart'; import 'package:app_center/snapd.dart'; import 'package:app_center/widgets.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:snapd/snapd.dart'; diff --git a/packages/app_center/test/snap_page_test.dart b/packages/app_center/test/snap_page_test.dart index 2e3e0f825..276f8e091 100644 --- a/packages/app_center/test/snap_page_test.dart +++ b/packages/app_center/test/snap_page_test.dart @@ -2,7 +2,7 @@ import 'package:app_center/l10n.dart'; import 'package:app_center/ratings.dart'; import 'package:app_center/snapd.dart'; import 'package:app_center/widgets.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/app_center/test/test_utils.dart b/packages/app_center/test/test_utils.dart index 78584c80c..18ba948cb 100644 --- a/packages/app_center/test/test_utils.dart +++ b/packages/app_center/test/test_utils.dart @@ -8,7 +8,7 @@ import 'package:app_center/ratings.dart'; import 'package:app_center/snapd.dart'; import 'package:app_center/src/deb/deb_model.dart'; import 'package:app_center/src/manage/manage_model.dart'; -import 'package:app_center_ratings_client/ratings_client.dart'; +import 'package:app_center_ratings_client/app_center_ratings_client.dart'; import 'package:appstream/appstream.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; diff --git a/packages/app_center/test/test_utils.mocks.dart b/packages/app_center/test/test_utils.mocks.dart index 7d0cdaaa2..f6e4024ad 100644 --- a/packages/app_center/test/test_utils.mocks.dart +++ b/packages/app_center/test/test_utils.mocks.dart @@ -14,7 +14,8 @@ import 'package:app_center/src/manage/manage_model.dart' as _i17; import 'package:app_center/src/ratings/exports.dart' as _i21; import 'package:app_center/src/ratings/ratings_model.dart' as _i12; import 'package:app_center/src/ratings/ratings_service.dart' as _i4; -import 'package:app_center_ratings_client/ratings_client.dart' as _i11; +import 'package:app_center_ratings_client/app_center_ratings_client.dart' + as _i11; import 'package:app_center_ratings_client/src/chart.dart' as _i22; import 'package:appstream/appstream.dart' as _i9; import 'package:dbus/dbus.dart' as _i20; diff --git a/packages/app_center_ratings_client/lib/app_center_ratings_client.dart b/packages/app_center_ratings_client/lib/app_center_ratings_client.dart new file mode 100644 index 000000000..61db672ed --- /dev/null +++ b/packages/app_center_ratings_client/lib/app_center_ratings_client.dart @@ -0,0 +1,2 @@ +export 'src/ratings.dart'; +export 'src/ratings_client.dart'; diff --git a/packages/app_center_ratings_client/lib/ratings_client.dart b/packages/app_center_ratings_client/lib/src/ratings_client.dart similarity index 89% rename from packages/app_center_ratings_client/lib/ratings_client.dart rename to packages/app_center_ratings_client/lib/src/ratings_client.dart index 5431c1e6c..c4d235d47 100644 --- a/packages/app_center_ratings_client/lib/ratings_client.dart +++ b/packages/app_center_ratings_client/lib/src/ratings_client.dart @@ -3,15 +3,13 @@ import 'dart:async'; import 'package:grpc/grpc.dart'; import 'package:meta/meta.dart'; -import 'src/chart.dart'; -import 'src/generated/google/protobuf/empty.pb.dart'; -import 'src/generated/ratings_features_app.pbgrpc.dart' as appPb; -import 'src/generated/ratings_features_chart.pbgrpc.dart' as chartPb; -import 'src/generated/ratings_features_user.pbgrpc.dart' as userPb; -import 'src/ratings.dart'; -import 'src/user.dart'; - -export 'src/ratings.dart'; +import 'chart.dart'; +import 'generated/google/protobuf/empty.pb.dart'; +import 'generated/ratings_features_app.pbgrpc.dart' as appPb; +import 'generated/ratings_features_chart.pbgrpc.dart' as chartPb; +import 'generated/ratings_features_user.pbgrpc.dart' as userPb; +import 'ratings.dart'; +import 'user.dart'; class RatingsClient { late appPb.AppClient _appClient; diff --git a/packages/app_center_ratings_client/test/ratings_client_test.dart b/packages/app_center_ratings_client/test/ratings_client_test.dart index 7fef403cc..3232c2da6 100644 --- a/packages/app_center_ratings_client/test/ratings_client_test.dart +++ b/packages/app_center_ratings_client/test/ratings_client_test.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:app_center_ratings_client/ratings_client.dart' +import 'package:app_center_ratings_client/app_center_ratings_client.dart' hide Rating, RatingsBand; import 'package:app_center_ratings_client/src/chart.dart' as chart; import 'package:app_center_ratings_client/src/generated/google/protobuf/empty.pb.dart';