From e2a02b77f5f7dd2db57e6c6ea1990b1fa2239096 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 13 Sep 2023 16:14:45 -0700 Subject: [PATCH] Move to latest pkg:dart_flutter_team_lints, bump min sdk to Dart 3 (#378) --- .github/workflows/dart.yml | 151 ++++++------------ analysis_options.yaml | 5 +- pkgs/shelf/CHANGELOG.md | 2 +- pkgs/shelf/pubspec.yaml | 4 +- .../shelf/test/add_chunked_encoding_test.dart | 20 +-- pkgs/shelf/test/message_test.dart | 5 +- pkgs/shelf/test/shelf_io_test.dart | 14 +- pkgs/shelf/test/test_util.dart | 2 +- pkgs/shelf_packages_handler/CHANGELOG.md | 4 +- pkgs/shelf_packages_handler/pubspec.yaml | 6 +- pkgs/shelf_proxy/CHANGELOG.md | 4 + pkgs/shelf_proxy/pubspec.yaml | 6 +- pkgs/shelf_router/CHANGELOG.md | 4 +- pkgs/shelf_router/example/main.dart | 2 +- pkgs/shelf_router/pubspec.yaml | 6 +- pkgs/shelf_router/test/router_test.dart | 2 +- pkgs/shelf_router_generator/pubspec.yaml | 2 +- pkgs/shelf_static/CHANGELOG.md | 4 +- pkgs/shelf_static/pubspec.yaml | 6 +- pkgs/shelf_test_handler/CHANGELOG.md | 4 +- pkgs/shelf_test_handler/pubspec.yaml | 6 +- .../shelf_test_handler/test/handler_test.dart | 2 +- pkgs/shelf_web_socket/CHANGELOG.md | 4 +- pkgs/shelf_web_socket/pubspec.yaml | 6 +- 24 files changed, 108 insertions(+), 163 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 4a06dae1..b831fdf7 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -40,23 +40,23 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`" + name: "analyze_and_format; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 @@ -96,6 +96,15 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.pkgs_shelf_router_pub_upgrade.conclusion == 'success'" working-directory: pkgs/shelf_router + - id: pkgs_shelf_router_generator_pub_upgrade + name: pkgs/shelf_router_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/shelf_router_generator + - name: "pkgs/shelf_router_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/shelf_router_generator - id: pkgs_shelf_static_pub_upgrade name: pkgs/shelf_static; dart pub upgrade run: dart pub upgrade @@ -124,36 +133,6 @@ jobs: if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'" working-directory: pkgs/shelf_web_socket job_003: - name: "analyze_and_format; linux; Dart 3.0.0; PKG: pkgs/shelf_router_generator; `dart analyze --fatal-infos .`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator;commands:analyze" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f - with: - sdk: "3.0.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - id: pkgs_shelf_router_generator_pub_upgrade - name: pkgs/shelf_router_generator; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/shelf_router_generator - - name: "pkgs/shelf_router_generator; dart analyze --fatal-infos ." - run: dart analyze --fatal-infos . - if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/shelf_router_generator - job_004: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: @@ -246,7 +225,7 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'" working-directory: pkgs/shelf_web_socket - job_005: + job_004: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -339,24 +318,24 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_shelf_web_socket_pub_upgrade.conclusion == 'success'" working-directory: pkgs/shelf_web_socket - job_006: - name: "unit_test; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" + job_005: + name: "unit_test; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_test_handler;commands:test_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_test_handler;commands:test_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_test_handler - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_test_handler + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 @@ -383,25 +362,24 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_007: - name: "unit_test; linux; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" + job_006: + name: "unit_test; linux; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:test_0" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket;commands:test_0" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket - os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf-pkgs/shelf_packages_handler-pkgs/shelf_proxy-pkgs/shelf_router-pkgs/shelf_router_generator-pkgs/shelf_static-pkgs/shelf_test_handler-pkgs/shelf_web_socket + os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 @@ -441,6 +419,15 @@ jobs: run: "dart test --test-randomize-ordering-seed=random" if: "always() && steps.pkgs_shelf_router_pub_upgrade.conclusion == 'success'" working-directory: pkgs/shelf_router + - id: pkgs_shelf_router_generator_pub_upgrade + name: pkgs/shelf_router_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/shelf_router_generator + - name: "pkgs/shelf_router_generator; dart test --test-randomize-ordering-seed=random" + run: "dart test --test-randomize-ordering-seed=random" + if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/shelf_router_generator - id: pkgs_shelf_static_pub_upgrade name: pkgs/shelf_static; dart pub upgrade run: dart pub upgrade @@ -473,44 +460,7 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_008: - name: "unit_test; linux; Dart 3.0.0; PKG: pkgs/shelf_router_generator; `dart test --test-randomize-ordering-seed=random`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator;commands:test_0" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:pkgs/shelf_router_generator - os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f - with: - sdk: "3.0.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 - - id: pkgs_shelf_router_generator_pub_upgrade - name: pkgs/shelf_router_generator; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/shelf_router_generator - - name: "pkgs/shelf_router_generator; dart test --test-randomize-ordering-seed=random" - run: "dart test --test-randomize-ordering-seed=random" - if: "always() && steps.pkgs_shelf_router_generator_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/shelf_router_generator - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - job_009: + job_007: name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" runs-on: ubuntu-latest steps: @@ -554,8 +504,7 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_010: + job_008: name: "unit_test; linux; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_packages_handler, pkgs/shelf_proxy, pkgs/shelf_router, pkgs/shelf_router_generator, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" runs-on: ubuntu-latest steps: @@ -653,8 +602,7 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_011: + job_009: name: "unit_test; linux; Dart dev; PKG: pkgs/shelf_router_generator; `dart test --run-skipped -t presubmit-only`" runs-on: ubuntu-latest steps: @@ -689,15 +637,14 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_012: - name: "unit_test; windows; Dart 2.19.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" + job_010: + name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" runs-on: windows-latest steps: - name: Setup Dart SDK uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 @@ -724,15 +671,14 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_013: - name: "unit_test; windows; Dart 2.19.0; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" + job_011: + name: "unit_test; windows; Dart 3.0.0; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" runs-on: windows-latest steps: - name: Setup Dart SDK uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f with: - sdk: "2.19.0" + sdk: "3.0.0" - id: checkout name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 @@ -777,8 +723,7 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_014: + job_012: name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf, pkgs/shelf_test_handler; `dart test --test-randomize-ordering-seed=random -p chrome`" runs-on: windows-latest steps: @@ -812,8 +757,7 @@ jobs: - job_002 - job_003 - job_004 - - job_005 - job_015: + job_013: name: "unit_test; windows; Dart dev; PKGS: pkgs/shelf_packages_handler, pkgs/shelf_static, pkgs/shelf_test_handler, pkgs/shelf_web_socket; `dart test --test-randomize-ordering-seed=random`" runs-on: windows-latest steps: @@ -865,4 +809,3 @@ jobs: - job_002 - job_003 - job_004 - - job_005 diff --git a/analysis_options.yaml b/analysis_options.yaml index 5cdf33c7..11122447 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -6,6 +6,8 @@ analyzer: strict-casts: true strict-inference: true strict-raw-types: true + errors: + comment_references: ignore # too many false positives linter: rules: @@ -16,7 +18,4 @@ linter: - no_adjacent_strings_in_list - no_runtimeType_toString - package_api_docs - - prefer_relative_imports - - test_types_in_equals - unnecessary_await_in_return - - use_super_parameters diff --git a/pkgs/shelf/CHANGELOG.md b/pkgs/shelf/CHANGELOG.md index e13bc1ab..fb569db7 100644 --- a/pkgs/shelf/CHANGELOG.md +++ b/pkgs/shelf/CHANGELOG.md @@ -1,6 +1,6 @@ ## 1.4.2-dev -* Require Dart >= 2.19 +* Require Dart ^3.0.0 ## 1.4.1 diff --git a/pkgs/shelf/pubspec.yaml b/pkgs/shelf/pubspec.yaml index 33b591b8..4f9eb26d 100644 --- a/pkgs/shelf/pubspec.yaml +++ b/pkgs/shelf/pubspec.yaml @@ -9,7 +9,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: async: ^2.5.0 @@ -20,6 +20,6 @@ dependencies: stream_channel: ^2.1.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http: '>=0.13.0 <2.0.0' test: ^1.16.0 diff --git a/pkgs/shelf/test/add_chunked_encoding_test.dart b/pkgs/shelf/test/add_chunked_encoding_test.dart index 0f2eba75..75ba8174 100644 --- a/pkgs/shelf/test/add_chunked_encoding_test.dart +++ b/pkgs/shelf/test/add_chunked_encoding_test.dart @@ -30,36 +30,36 @@ void main() { }); test("doesn't add chunked encoding with status 1xx", () async { - var response = - await _chunkResponse(Response(123, body: Stream>.empty())); + var response = await _chunkResponse( + Response(123, body: const Stream>.empty())); expect(response.headers, isNot(contains('transfer-encoding'))); expect(response.read().toList(), completion(isEmpty)); }); test("doesn't add chunked encoding with status 204", () async { - var response = - await _chunkResponse(Response(204, body: Stream>.empty())); + var response = await _chunkResponse( + Response(204, body: const Stream>.empty())); expect(response.headers, isNot(contains('transfer-encoding'))); expect(response.read().toList(), completion(isEmpty)); }); test("doesn't add chunked encoding with status 304", () async { - var response = - await _chunkResponse(Response(204, body: Stream>.empty())); + var response = await _chunkResponse( + Response(204, body: const Stream>.empty())); expect(response.headers, isNot(contains('transfer-encoding'))); expect(response.read().toList(), completion(isEmpty)); }); test("doesn't add chunked encoding with status 204", () async { - var response = - await _chunkResponse(Response(204, body: Stream>.empty())); + var response = await _chunkResponse( + Response(204, body: const Stream>.empty())); expect(response.headers, isNot(contains('transfer-encoding'))); expect(response.read().toList(), completion(isEmpty)); }); test("doesn't add chunked encoding with status 204", () async { - var response = - await _chunkResponse(Response(204, body: Stream>.empty())); + var response = await _chunkResponse( + Response(204, body: const Stream>.empty())); expect(response.headers, isNot(contains('transfer-encoding'))); expect(response.read().toList(), completion(isEmpty)); }); diff --git a/pkgs/shelf/test/message_test.dart b/pkgs/shelf/test/message_test.dart index aa134658..5e1a0004 100644 --- a/pkgs/shelf/test/message_test.dart +++ b/pkgs/shelf/test/message_test.dart @@ -222,13 +222,14 @@ void main() { }); test('is null for a stream body', () { - var request = _createMessage(body: Stream>.empty()); + var request = _createMessage(body: const Stream>.empty()); expect(request.contentLength, isNull); }); test('uses the content-length header for a stream body', () { var request = _createMessage( - body: Stream>.empty(), headers: {'content-length': '42'}); + body: const Stream>.empty(), + headers: {'content-length': '42'}); expect(request.contentLength, 42); }); diff --git a/pkgs/shelf/test/shelf_io_test.dart b/pkgs/shelf/test/shelf_io_test.dart index 4adf34c8..61b62476 100644 --- a/pkgs/shelf/test/shelf_io_test.dart +++ b/pkgs/shelf/test/shelf_io_test.dart @@ -332,7 +332,7 @@ void main() { // Update beforeRequest to be one second earlier. HTTP dates only have // second-level granularity and the request will likely take less than a // second. - var beforeRequest = DateTime.now().subtract(Duration(seconds: 1)); + var beforeRequest = DateTime.now().subtract(const Duration(seconds: 1)); var response = await _get(); expect(response.headers, contains('date')); @@ -484,7 +484,7 @@ void main() { test('status code is 1xx', () async { await _scheduleServer((request) { - return Response(123, body: Stream>.empty()); + return Response(123, body: const Stream>.empty()); }); var response = await _get(); @@ -495,7 +495,7 @@ void main() { test('status code is 204', () async { await _scheduleServer((request) { - return Response(204, body: Stream>.empty()); + return Response(204, body: const Stream>.empty()); }); var response = await _get(); @@ -506,7 +506,7 @@ void main() { test('status code is 304', () async { await _scheduleServer((request) { - return Response(304, body: Stream>.empty()); + return Response(304, body: const Stream>.empty()); }); var response = await _get(); @@ -543,10 +543,8 @@ void main() { test('includes the dart:io HttpConnectionInfo in request context', () async { await _scheduleServer((request) { - expect( - request.context, - containsPair( - 'shelf.io.connection_info', TypeMatcher())); + expect(request.context, + containsPair('shelf.io.connection_info', isA())); var connectionInfo = request.context['shelf.io.connection_info'] as HttpConnectionInfo; diff --git a/pkgs/shelf/test/test_util.dart b/pkgs/shelf/test/test_util.dart index a1cb7ea7..57106c49 100644 --- a/pkgs/shelf/test/test_util.dart +++ b/pkgs/shelf/test/test_util.dart @@ -13,7 +13,7 @@ const helloBytes = [104, 101, 108, 108, 111, 44]; // " world" const worldBytes = [32, 119, 111, 114, 108, 100]; -final Matcher throwsHijackException = throwsA(TypeMatcher()); +final Matcher throwsHijackException = throwsA(isA()); /// A simple, synchronous handler for [Request]. /// diff --git a/pkgs/shelf_packages_handler/CHANGELOG.md b/pkgs/shelf_packages_handler/CHANGELOG.md index c5802f3e..2f6ce796 100644 --- a/pkgs/shelf_packages_handler/CHANGELOG.md +++ b/pkgs/shelf_packages_handler/CHANGELOG.md @@ -1,6 +1,6 @@ -## 3.0.3-dev +## 3.0.3-wip -* Require Dart `2.19`. +* Require Dart `^3.0.0` ## 3.0.2 diff --git a/pkgs/shelf_packages_handler/pubspec.yaml b/pkgs/shelf_packages_handler/pubspec.yaml index 5db84da6..3c04d3f7 100644 --- a/pkgs/shelf_packages_handler/pubspec.yaml +++ b/pkgs/shelf_packages_handler/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_packages_handler -version: 3.0.3-dev +version: 3.0.3-wip description: A shelf handler for serving a `packages/` directory. repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_packages_handler @@ -8,7 +8,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: path: ^1.8.0 @@ -16,5 +16,5 @@ dependencies: shelf_static: ^1.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 diff --git a/pkgs/shelf_proxy/CHANGELOG.md b/pkgs/shelf_proxy/CHANGELOG.md index 133fb213..07041940 100644 --- a/pkgs/shelf_proxy/CHANGELOG.md +++ b/pkgs/shelf_proxy/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5-wip + +* Require Dart `^3.0.0` + ## 1.0.4 * Require Dart `2.19`. diff --git a/pkgs/shelf_proxy/pubspec.yaml b/pkgs/shelf_proxy/pubspec.yaml index a83e47b2..e8c3c2aa 100644 --- a/pkgs/shelf_proxy/pubspec.yaml +++ b/pkgs/shelf_proxy/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_proxy -version: 1.0.4 +version: 1.0.5-wip description: A shelf handler for proxying HTTP requests to another server. repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_proxy @@ -8,7 +8,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: http: '>=0.13.0 <2.0.0' @@ -16,5 +16,5 @@ dependencies: shelf: ^1.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.6.0 diff --git a/pkgs/shelf_router/CHANGELOG.md b/pkgs/shelf_router/CHANGELOG.md index 4bd59ec4..c3dbf816 100644 --- a/pkgs/shelf_router/CHANGELOG.md +++ b/pkgs/shelf_router/CHANGELOG.md @@ -1,6 +1,6 @@ -## 1.1.5-dev +## 1.1.5-wip -* Require Dart `2.19`. +* Require Dart `^3.0.0`. ## 1.1.4 diff --git a/pkgs/shelf_router/example/main.dart b/pkgs/shelf_router/example/main.dart index 61b9303b..fb57d61f 100644 --- a/pkgs/shelf_router/example/main.dart +++ b/pkgs/shelf_router/example/main.dart @@ -40,7 +40,7 @@ class Service { // Handlers can be asynchronous (returning `FutureOr` is also allowed). router.get('/wave', (Request request) async { - await Future.delayed(Duration(milliseconds: 100)); + await Future.delayed(const Duration(milliseconds: 100)); return Response.ok('_o/'); }); diff --git a/pkgs/shelf_router/pubspec.yaml b/pkgs/shelf_router/pubspec.yaml index 0a7db233..b2eed2c5 100644 --- a/pkgs/shelf_router/pubspec.yaml +++ b/pkgs/shelf_router/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_router -version: 1.1.5-dev +version: 1.1.5-wip description: > A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. @@ -10,7 +10,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: http_methods: ^1.1.0 @@ -18,6 +18,6 @@ dependencies: shelf: ^1.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http: '>=0.13.0 <2.0.0' test: ^1.16.0 diff --git a/pkgs/shelf_router/test/router_test.dart b/pkgs/shelf_router/test/router_test.dart index 6f31620a..fdffa51a 100644 --- a/pkgs/shelf_router/test/router_test.dart +++ b/pkgs/shelf_router/test/router_test.dart @@ -141,7 +141,7 @@ void main() { var app = Router(); app.mount( '/api/', - Pipeline().addMiddleware(middleware).addHandler(api.call), + middleware.addHandler(api.call), ); server.mount(app.call); diff --git a/pkgs/shelf_router_generator/pubspec.yaml b/pkgs/shelf_router_generator/pubspec.yaml index 7f008133..303e7e5e 100644 --- a/pkgs/shelf_router_generator/pubspec.yaml +++ b/pkgs/shelf_router_generator/pubspec.yaml @@ -25,6 +25,6 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 build_verify: ^3.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http: '>=0.13.0 <2.0.0' test: ^1.5.3 diff --git a/pkgs/shelf_static/CHANGELOG.md b/pkgs/shelf_static/CHANGELOG.md index 827a2bfb..496c589b 100644 --- a/pkgs/shelf_static/CHANGELOG.md +++ b/pkgs/shelf_static/CHANGELOG.md @@ -1,6 +1,6 @@ -## 1.1.3-dev +## 1.1.3-wip -* Require Dart `2.19`. +* Require Dart `^3.0.0`. ## 1.1.2 diff --git a/pkgs/shelf_static/pubspec.yaml b/pkgs/shelf_static/pubspec.yaml index e929a01b..14b15dc9 100644 --- a/pkgs/shelf_static/pubspec.yaml +++ b/pkgs/shelf_static/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_static -version: 1.1.3-dev +version: 1.1.3-wip description: Static file server support for the shelf package and ecosystem. repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_static @@ -8,7 +8,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: convert: ^3.0.0 @@ -20,6 +20,6 @@ dependencies: dev_dependencies: args: ^2.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 test_descriptor: ^2.0.0 diff --git a/pkgs/shelf_test_handler/CHANGELOG.md b/pkgs/shelf_test_handler/CHANGELOG.md index 0af07fd7..56b4e792 100644 --- a/pkgs/shelf_test_handler/CHANGELOG.md +++ b/pkgs/shelf_test_handler/CHANGELOG.md @@ -1,6 +1,6 @@ -## 2.0.3-dev +## 2.0.3-wip -* Require Dart `2.19`. +* Require Dart `^3.0.0`. ## 2.0.2 diff --git a/pkgs/shelf_test_handler/pubspec.yaml b/pkgs/shelf_test_handler/pubspec.yaml index 4c6eb731..0b77af4c 100644 --- a/pkgs/shelf_test_handler/pubspec.yaml +++ b/pkgs/shelf_test_handler/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_test_handler -version: 2.0.3-dev +version: 2.0.3-wip description: A Shelf handler that makes it easy to test HTTP interactions. repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_test_handler @@ -8,7 +8,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: http_multi_server: ^3.0.0 @@ -16,7 +16,7 @@ dependencies: test: ^1.16.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http: '>=0.13.0 <2.0.0' shelf_web_socket: ^1.0.0 web_socket_channel: ^2.0.0 diff --git a/pkgs/shelf_test_handler/test/handler_test.dart b/pkgs/shelf_test_handler/test/handler_test.dart index fc72abe9..5b91119e 100644 --- a/pkgs/shelf_test_handler/test/handler_test.dart +++ b/pkgs/shelf_test_handler/test/handler_test.dart @@ -115,7 +115,7 @@ void main() { void _expectZoneFailure(Future Function() callback) { runZonedGuarded(callback, expectAsync2((error, stack) { - expect(error, TypeMatcher()); + expect(error, isA()); })); } diff --git a/pkgs/shelf_web_socket/CHANGELOG.md b/pkgs/shelf_web_socket/CHANGELOG.md index b9fd8a89..d3596cef 100644 --- a/pkgs/shelf_web_socket/CHANGELOG.md +++ b/pkgs/shelf_web_socket/CHANGELOG.md @@ -1,6 +1,6 @@ -## 1.0.5-dev +## 1.0.5-wip -* Require Dart `2.19`. +* Require Dart `^3.0.0`. ## 1.0.4 diff --git a/pkgs/shelf_web_socket/pubspec.yaml b/pkgs/shelf_web_socket/pubspec.yaml index 45da866d..9c3fd945 100644 --- a/pkgs/shelf_web_socket/pubspec.yaml +++ b/pkgs/shelf_web_socket/pubspec.yaml @@ -1,5 +1,5 @@ name: shelf_web_socket -version: 1.0.5-dev +version: 1.0.5-wip description: > A shelf handler that wires up a listener for every connection. repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_web_socket @@ -9,7 +9,7 @@ topics: - shelf environment: - sdk: '>=2.19.0 <3.0.0' + sdk: ^3.0.0 dependencies: shelf: ^1.1.0 @@ -17,6 +17,6 @@ dependencies: web_socket_channel: ^2.0.0 dev_dependencies: - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 http: '>=0.13.0 <2.0.0' test: ^1.16.0