From 89e26f3b7b15c5eb21bf172b236673391d6037a0 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 22 Nov 2024 12:25:20 -0800 Subject: [PATCH 1/2] move analysis_options.yaml into packages --- pkgs/shelf/CHANGELOG.md | 2 +- analysis_options.yaml => pkgs/shelf/analysis_options.yaml | 6 +----- pkgs/shelf/lib/src/body.dart | 2 ++ pkgs/shelf/lib/src/hijack_exception.dart | 2 ++ pkgs/shelf/lib/src/message.dart | 5 ++++- pkgs/shelf/lib/src/middleware_extensions.dart | 1 + pkgs/shelf/lib/src/pipeline.dart | 1 + pkgs/shelf/lib/src/response.dart | 1 + pkgs/shelf/lib/src/server.dart | 4 ++-- pkgs/shelf_packages_handler/analysis_options.yaml | 1 + pkgs/shelf_proxy/analysis_options.yaml | 1 + pkgs/shelf_router/analysis_options.yaml | 1 + pkgs/shelf_router_generator/analysis_options.yaml | 1 + pkgs/shelf_static/analysis_options.yaml | 1 + pkgs/shelf_test_handler/analysis_options.yaml | 1 + pkgs/shelf_test_handler/lib/src/expectation.dart | 2 ++ pkgs/shelf_test_handler/lib/src/server.dart | 1 + pkgs/shelf_web_socket/analysis_options.yaml | 1 + 18 files changed, 25 insertions(+), 9 deletions(-) rename analysis_options.yaml => pkgs/shelf/analysis_options.yaml (75%) create mode 100644 pkgs/shelf_packages_handler/analysis_options.yaml create mode 100644 pkgs/shelf_proxy/analysis_options.yaml create mode 100644 pkgs/shelf_router/analysis_options.yaml create mode 100644 pkgs/shelf_router_generator/analysis_options.yaml create mode 100644 pkgs/shelf_static/analysis_options.yaml create mode 100644 pkgs/shelf_test_handler/analysis_options.yaml create mode 100644 pkgs/shelf_web_socket/analysis_options.yaml diff --git a/pkgs/shelf/CHANGELOG.md b/pkgs/shelf/CHANGELOG.md index daff6c4f..c08105fb 100644 --- a/pkgs/shelf/CHANGELOG.md +++ b/pkgs/shelf/CHANGELOG.md @@ -280,7 +280,7 @@ ## 0.6.1+2 -* `logRequests` outputs a better message a request has a query string. +* `logRequests` outputs a better message if a request has a query string. ## 0.6.1+1 diff --git a/analysis_options.yaml b/pkgs/shelf/analysis_options.yaml similarity index 75% rename from analysis_options.yaml rename to pkgs/shelf/analysis_options.yaml index 11122447..75fcb402 100644 --- a/analysis_options.yaml +++ b/pkgs/shelf/analysis_options.yaml @@ -1,13 +1,10 @@ # https://dart.dev/guides/language/analysis-options + include: package:dart_flutter_team_lints/analysis_options.yaml analyzer: language: - strict-casts: true - strict-inference: true strict-raw-types: true - errors: - comment_references: ignore # too many false positives linter: rules: @@ -17,5 +14,4 @@ linter: - missing_whitespace_between_adjacent_strings - no_adjacent_strings_in_list - no_runtimeType_toString - - package_api_docs - unnecessary_await_in_return diff --git a/pkgs/shelf/lib/src/body.dart b/pkgs/shelf/lib/src/body.dart index 57f9fa4e..c80cc483 100644 --- a/pkgs/shelf/lib/src/body.dart +++ b/pkgs/shelf/lib/src/body.dart @@ -5,6 +5,8 @@ import 'dart:async'; import 'dart:convert'; +import 'message.dart'; + /// The body of a request or response. /// /// This tracks whether the body has been read. It's separate from [Message] diff --git a/pkgs/shelf/lib/src/hijack_exception.dart b/pkgs/shelf/lib/src/hijack_exception.dart index 4a3d84e4..41156495 100644 --- a/pkgs/shelf/lib/src/hijack_exception.dart +++ b/pkgs/shelf/lib/src/hijack_exception.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'request.dart'; + /// An exception used to indicate that a request has been hijacked. /// /// This shouldn't be captured by any code other than the Shelf adapter that diff --git a/pkgs/shelf/lib/src/message.dart b/pkgs/shelf/lib/src/message.dart index 8b28bb8e..c270d187 100644 --- a/pkgs/shelf/lib/src/message.dart +++ b/pkgs/shelf/lib/src/message.dart @@ -10,6 +10,9 @@ import 'package:http_parser/http_parser.dart'; import 'body.dart'; import 'headers.dart'; +import 'middleware/logger.dart'; +import 'request.dart'; +import 'response.dart'; import 'shelf_unmodifiable_map.dart'; import 'util.dart'; @@ -171,7 +174,7 @@ abstract class Message { {Map headers, Map context, Object? body}); } -/// Adds information about [encoding] to [headers]. +/// Adds information about encoding to [headers]. /// /// Returns a new map without modifying [headers]. Map> _adjustHeaders( diff --git a/pkgs/shelf/lib/src/middleware_extensions.dart b/pkgs/shelf/lib/src/middleware_extensions.dart index 8c707dfe..521710ae 100644 --- a/pkgs/shelf/lib/src/middleware_extensions.dart +++ b/pkgs/shelf/lib/src/middleware_extensions.dart @@ -1,5 +1,6 @@ import 'handler.dart'; import 'middleware.dart'; +import 'pipeline.dart'; /// Extensions on [Middleware] to aid in composing [Middleware] and [Handler]s. /// diff --git a/pkgs/shelf/lib/src/pipeline.dart b/pkgs/shelf/lib/src/pipeline.dart index d931a309..1d079350 100644 --- a/pkgs/shelf/lib/src/pipeline.dart +++ b/pkgs/shelf/lib/src/pipeline.dart @@ -4,6 +4,7 @@ import 'handler.dart'; import 'middleware.dart'; +import 'request.dart'; /// A helper that makes it easy to compose a set of [Middleware] and a /// [Handler]. diff --git a/pkgs/shelf/lib/src/response.dart b/pkgs/shelf/lib/src/response.dart index 1938a631..2cd40e48 100644 --- a/pkgs/shelf/lib/src/response.dart +++ b/pkgs/shelf/lib/src/response.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'package:http_parser/http_parser.dart'; +import 'handler.dart'; import 'message.dart'; import 'util.dart'; diff --git a/pkgs/shelf/lib/src/server.dart b/pkgs/shelf/lib/src/server.dart index 8a20f0e2..72564e7e 100644 --- a/pkgs/shelf/lib/src/server.dart +++ b/pkgs/shelf/lib/src/server.dart @@ -20,8 +20,8 @@ import 'handler.dart'; /// code to a single server implementation. /// /// There are two built-in implementations of this interface. You can create a -/// server backed by `dart:io` using [IOServer], or you can create a server -/// that's backed by a normal [Handler] using [ServerHandler]. +/// server backed by `dart:io` using `IOServer`, or you can create a server +/// that's backed by a normal [Handler] using `ServerHandler`. /// /// Implementations of this interface are responsible for ensuring that the /// members work as documented. diff --git a/pkgs/shelf_packages_handler/analysis_options.yaml b/pkgs/shelf_packages_handler/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_packages_handler/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_proxy/analysis_options.yaml b/pkgs/shelf_proxy/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_proxy/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_router/analysis_options.yaml b/pkgs/shelf_router/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_router/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_router_generator/analysis_options.yaml b/pkgs/shelf_router_generator/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_router_generator/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_static/analysis_options.yaml b/pkgs/shelf_static/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_static/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_test_handler/analysis_options.yaml b/pkgs/shelf_test_handler/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_test_handler/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml diff --git a/pkgs/shelf_test_handler/lib/src/expectation.dart b/pkgs/shelf_test_handler/lib/src/expectation.dart index ef189900..c08808bb 100644 --- a/pkgs/shelf_test_handler/lib/src/expectation.dart +++ b/pkgs/shelf_test_handler/lib/src/expectation.dart @@ -4,6 +4,8 @@ import 'package:shelf/shelf.dart'; +import 'handler.dart'; + /// A single expectation for an HTTP request sent to a [ShelfTestHandler]. class Expectation { /// The expected request method, or `null` if this allows any requests. diff --git a/pkgs/shelf_test_handler/lib/src/server.dart b/pkgs/shelf_test_handler/lib/src/server.dart index 32af56bd..d784ae41 100644 --- a/pkgs/shelf_test_handler/lib/src/server.dart +++ b/pkgs/shelf_test_handler/lib/src/server.dart @@ -7,6 +7,7 @@ import 'dart:io'; import 'package:http_multi_server/http_multi_server.dart'; import 'package:shelf/shelf_io.dart'; +import 'package:test/test.dart'; import 'handler.dart'; diff --git a/pkgs/shelf_web_socket/analysis_options.yaml b/pkgs/shelf_web_socket/analysis_options.yaml new file mode 100644 index 00000000..d978f811 --- /dev/null +++ b/pkgs/shelf_web_socket/analysis_options.yaml @@ -0,0 +1 @@ +include: package:dart_flutter_team_lints/analysis_options.yaml From 12270333cebf58d5144ad60340110128ef78cc7f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 22 Nov 2024 12:26:24 -0800 Subject: [PATCH 2/2] regenerate mono_repo files --- .github/workflows/dart.yml | 4 ++-- tool/ci.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 41febb1e..d0877165 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 name: Dart CI on: push: @@ -36,7 +36,7 @@ jobs: name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.1 + run: dart pub global activate mono_repo 6.6.2 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: diff --git a/tool/ci.sh b/tool/ci.sh index c7b4cd76..d576ee0e 100644 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 # Support built in commands on windows out of the box.