diff --git a/.github/actions/dart_package/action.yaml b/.github/actions/dart_package/action.yaml index e1210848fe8..416db1401d7 100644 --- a/.github/actions/dart_package/action.yaml +++ b/.github/actions/dart_package/action.yaml @@ -5,6 +5,14 @@ inputs: codecov_token: required: true description: The Codecov token used to upload coverage + collect_coverage: + required: false + default: "true" + description: Whether to collect code coverage + collect_score: + required: false + default: "true" + description: Whether to collect the pana score concurrency: required: false default: "4" @@ -69,6 +77,7 @@ runs: dart test -j ${{inputs.concurrency}} --coverage=coverage && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=${{inputs.report_on}} --check-ignore - name: 📦 Detect Package Name + if: inputs.collect_coverage == 'true' env: PACKAGE_PATH: ${{ inputs.working_directory}} id: package @@ -76,6 +85,7 @@ runs: run: echo "name=${PACKAGE_PATH##*/}" >> $GITHUB_OUTPUT - name: ⬆️ Upload Coverage + if: inputs.collect_coverage == 'true' uses: codecov/codecov-action@v4 env: PACKAGE_PATH: ${{ inputs.working_directory}} @@ -84,6 +94,7 @@ runs: token: ${{ inputs.codecov_token }} - name: 📊 Verify Coverage + if: inputs.collect_coverage == 'true' uses: VeryGoodOpenSource/very_good_coverage@v3 with: path: ${{inputs.working_directory}}/coverage/lcov.info @@ -91,6 +102,7 @@ runs: min_coverage: ${{inputs.min_coverage}} - name: 💯 Verify Pub Score + if: inputs.collect_score == 'true' working-directory: ${{ inputs.working_directory }} shell: ${{ inputs.shell }} run: | diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9482171c5de..916c0d35234 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -214,6 +214,9 @@ jobs: codecov_token: ${{ secrets.CODECOV_TOKEN }} working_directory: packages/${{ matrix.package }} min_coverage: 100 + # TODO: remove once bloc v9 is published + # https://github.com/dart-lang/pana/issues/1254 + collect_score: false flutter_package_checks: needs: changes @@ -238,6 +241,9 @@ jobs: codecov_token: ${{ secrets.CODECOV_TOKEN }} working_directory: packages/${{ matrix.package }} min_coverage: 100 + # TODO: remove once bloc v9 is published + # https://github.com/dart-lang/pana/issues/1254 + collect_score: false angular_dart_example_checks: needs: changes diff --git a/packages/bloc/lib/src/bloc_base.dart b/packages/bloc/lib/src/bloc_base.dart index 5b9d87a3574..51e374ce500 100644 --- a/packages/bloc/lib/src/bloc_base.dart +++ b/packages/bloc/lib/src/bloc_base.dart @@ -45,12 +45,16 @@ abstract class ErrorSink implements Closable { void addError(Object error, [StackTrace? stackTrace]); } +/// A [StateStreamableSource] that can emit new states. +abstract class EmittableStateStreamableSource + implements StateStreamableSource, Emittable {} + /// {@template bloc_base} /// An interface for the core functionality implemented by /// both [Bloc] and [Cubit]. /// {@endtemplate} abstract class BlocBase - implements StateStreamableSource, Emittable, ErrorSink { + implements EmittableStateStreamableSource, ErrorSink { /// {@macro bloc_base} BlocBase(this._state) { // ignore: invalid_use_of_protected_member diff --git a/packages/bloc_test/lib/src/bloc_test.dart b/packages/bloc_test/lib/src/bloc_test.dart index ca3275f9944..9c7c5481741 100644 --- a/packages/bloc_test/lib/src/bloc_test.dart +++ b/packages/bloc_test/lib/src/bloc_test.dart @@ -136,7 +136,7 @@ import 'package:test/test.dart' as test; /// /// [configuring tags]: https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md#configuring-tags @isTest -void blocTest, State>( +void blocTest, State>( String description, { required B Function() build, FutureOr Function()? setUp, @@ -173,7 +173,7 @@ void blocTest, State>( /// Internal [blocTest] runner which is only visible for testing. /// This should never be used directly -- please use [blocTest] instead. @visibleForTesting -Future testBloc, State>({ +Future testBloc, State>({ required B Function() build, FutureOr Function()? setUp, State Function()? seed, diff --git a/packages/bloc_test/pubspec.yaml b/packages/bloc_test/pubspec.yaml index 33117ab496f..bab8d7f0ff0 100644 --- a/packages/bloc_test/pubspec.yaml +++ b/packages/bloc_test/pubspec.yaml @@ -9,17 +9,17 @@ topics: [bloc, state-management, test] funding: [https://github.com/sponsors/felangel] environment: - sdk: ">=2.12.0 <4.0.0" + sdk: ">=2.14.0 <4.0.0" dependencies: bloc: ^8.1.1 diff_match_patch: ^0.4.1 meta: ^1.3.0 - mocktail: ">=0.2.0 <2.0.0" + mocktail: ^1.0.0 test: ^1.16.0 dev_dependencies: - rxdart: ^0.27.2 + rxdart: ^0.28.0 screenshots: - description: The bloc test package logo.