Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1a141c7
Bump the github-actions group with 2 updates (#454)
dependabot[bot] Nov 1, 2024
0bb44cb
add direct links to the package issues (#455)
devoncarew Nov 12, 2024
a2708cd
shorten the issue badges (#456)
devoncarew Nov 21, 2024
7f26ebd
rev shelf_web_socket in prep for publishing (#458)
devoncarew Nov 22, 2024
657ebd3
Bump dart-lang/setup-dart in the github-actions group (#462)
dependabot[bot] Dec 1, 2024
2b5b683
move analysis_options.yaml into packages (#460)
devoncarew Dec 2, 2024
e3975a8
add more type information to the 'webSocketHandler' method (#463)
devoncarew Dec 9, 2024
6b8b338
shelf_router_generator: bump dependencies (#464)
kevmoo Dec 18, 2024
8ea524b
Bump actions/cache from 4.1.2 to 4.2.0 in the github-actions group (#…
dependabot[bot] Jan 1, 2025
bf79951
Publish shelf_router_generator 1.1.1 (#467)
johnpryan Jan 7, 2025
2a7442f
rev shelf_web_socket to 3.0 in prep for publishing (#469)
devoncarew Jan 21, 2025
b39e611
Bump actions/stale from 9.0.0 to 9.1.0 in the github-actions group (#…
dependabot[bot] Feb 11, 2025
f5ae797
Bump the github-actions group with 2 updates (#471)
dependabot[bot] Mar 1, 2025
2af8529
Update publish.yaml (#473)
devoncarew Mar 4, 2025
082d3ac
Bump actions/cache from 4.2.2 to 4.2.3 in the github-actions group (#…
dependabot[bot] Apr 1, 2025
2a46b4f
Update dependencies across 3 packages (#479)
kevmoo Aug 5, 2025
400fc39
[shelf_router_generator] latest deps, prepare release (#480)
kevmoo Aug 12, 2025
de91a5b
Bump the github-actions group with 2 updates (#481)
dependabot[bot] Sep 1, 2025
f30d650
Bump the github-actions group with 3 updates (#483)
dependabot[bot] Oct 1, 2025
710b8ce
shelf_router_generator: update dependencies, SDK (#484)
kevmoo Oct 9, 2025
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
22 changes: 11 additions & 11 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# Configuration for .github/workflows/pull_request_label.yml.
# Configuration for .github/workflows/pull_request_label.yml.

'infra':
'type-infra':
- changed-files:
- any-glob-to-any-file: '.github/**'
- any-glob-to-any-file: '.github/**'

'package:shelf':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf/**'
- any-glob-to-any-file: 'pkgs/shelf/**'

'package:shelf_packages_handler':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_packages_handler/**'
- any-glob-to-any-file: 'pkgs/shelf_packages_handler/**'

'package:shelf_proxy':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_proxy/**'
- any-glob-to-any-file: 'pkgs/shelf_proxy/**'

'package:shelf_router':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_router/**'
- any-glob-to-any-file: 'pkgs/shelf_router/**'

'package:shelf_router_generator':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_router_generator/**'
- any-glob-to-any-file: 'pkgs/shelf_router_generator/**'

'package:shelf_static':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_static/**'
- any-glob-to-any-file: 'pkgs/shelf_static/**'

'package:shelf_test_handler':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_test_handler/**'
- any-glob-to-any-file: 'pkgs/shelf_test_handler/**'

'package:shelf_web_socket':
- changed-files:
- any-glob-to-any-file: 'pkgs/shelf_web_socket/**'
- any-glob-to-any-file: 'pkgs/shelf_web_socket/**'
487 changes: 316 additions & 171 deletions .github/workflows/dart.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'dart-lang' }}
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f
with:
days-before-stale: -1
days-before-close: 14
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ jobs:
publish:
if: ${{ github.repository_owner == 'dart-lang' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
permissions:
id-token: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ See the [package:shelf readme](pkgs/shelf/) for more information.

## Packages

| Package | Description | Version |
| --- | --- | --- |
| [shelf](pkgs/shelf/) | A model for web server middleware that encourages composition and easy reuse. | [![pub package](https://img.shields.io/pub/v/shelf.svg)](https://pub.dev/packages/shelf) |
| [shelf_packages_handler](pkgs/shelf_packages_handler/) | A shelf handler for serving a `packages/` directory. | [![pub package](https://img.shields.io/pub/v/shelf_packages_handler.svg)](https://pub.dev/packages/shelf_packages_handler) |
| [shelf_proxy](pkgs/shelf_proxy/) | A shelf handler for proxying HTTP requests to another server. | [![pub package](https://img.shields.io/pub/v/shelf_proxy.svg)](https://pub.dev/packages/shelf_proxy) |
| [shelf_router](pkgs/shelf_router/) | A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. | [![pub package](https://img.shields.io/pub/v/shelf_router.svg)](https://pub.dev/packages/shelf_router) |
| [shelf_router_generator](pkgs/shelf_router_generator/) | A package:build-compatible builder for generating request routers for the shelf web-framework based on source annotations. | [![pub package](https://img.shields.io/pub/v/shelf_router_generator.svg)](https://pub.dev/packages/shelf_router_generator) |
| [shelf_static](pkgs/shelf_static/) | Static file server support for the shelf package and ecosystem. | [![pub package](https://img.shields.io/pub/v/shelf_static.svg)](https://pub.dev/packages/shelf_static) |
| [shelf_test_handler](pkgs/shelf_test_handler/) | A Shelf handler that makes it easy to test HTTP interactions. | [![pub package](https://img.shields.io/pub/v/shelf_test_handler.svg)](https://pub.dev/packages/shelf_test_handler) |
| [shelf_web_socket](pkgs/shelf_web_socket/) | A shelf handler that wires up a listener for every connection. | [![pub package](https://img.shields.io/pub/v/shelf_web_socket.svg)](https://pub.dev/packages/shelf_web_socket) |
| Package | Description | Issues | Version |
| --- | --- | --- | --- |
| [shelf](pkgs/shelf/) | A model for web server middleware that encourages composition and easy reuse. | [![issues](https://img.shields.io/badge/shelf-4774bc)][shelf_issues] | [![pub package](https://img.shields.io/pub/v/shelf.svg)](https://pub.dev/packages/shelf) |
| [shelf_packages_handler](pkgs/shelf_packages_handler/) | A shelf handler for serving a `packages/` directory. | [![issues](https://img.shields.io/badge/shelf__packages__handler-4774bc)][shelf_packages_handler_issues] | [![pub package](https://img.shields.io/pub/v/shelf_packages_handler.svg)](https://pub.dev/packages/shelf_packages_handler) |
| [shelf_proxy](pkgs/shelf_proxy/) | A shelf handler for proxying HTTP requests to another server. | [![issues](https://img.shields.io/badge/shelf__proxy-4774bc)][shelf_proxy_issues] | [![pub package](https://img.shields.io/pub/v/shelf_proxy.svg)](https://pub.dev/packages/shelf_proxy) |
| [shelf_router](pkgs/shelf_router/) | A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. | [![issues](https://img.shields.io/badge/shelf__router-4774bc)][shelf_router_issues] | [![pub package](https://img.shields.io/pub/v/shelf_router.svg)](https://pub.dev/packages/shelf_router) |
| [shelf_router_generator](pkgs/shelf_router_generator/) | A package:build-compatible builder for generating request routers for the shelf web-framework based on source annotations. | [![issues](https://img.shields.io/badge/shelf__router__generator-4774bc)][shelf_router_generator_issues] | [![pub package](https://img.shields.io/pub/v/shelf_router_generator.svg)](https://pub.dev/packages/shelf_router_generator) |
| [shelf_static](pkgs/shelf_static/) | Static file server support for the shelf package and ecosystem. | [![issues](https://img.shields.io/badge/shelf__static-4774bc)][shelf_static_issues] | [![pub package](https://img.shields.io/pub/v/shelf_static.svg)](https://pub.dev/packages/shelf_static) |
| [shelf_test_handler](pkgs/shelf_test_handler/) | A Shelf handler that makes it easy to test HTTP interactions. | [![issues](https://img.shields.io/badge/shelf__test__handler-4774bc)][shelf_test_handler_issues] | [![pub package](https://img.shields.io/pub/v/shelf_test_handler.svg)](https://pub.dev/packages/shelf_test_handler) |
| [shelf_web_socket](pkgs/shelf_web_socket/) | A shelf handler that wires up a listener for every connection. | [![issues](https://img.shields.io/badge/shelf__web__socket-4774bc)][shelf_web_socket_issues] | [![pub package](https://img.shields.io/pub/v/shelf_web_socket.svg)](https://pub.dev/packages/shelf_web_socket) |

[shelf_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf
[shelf_packages_handler_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_packages_handler
[shelf_proxy_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_proxy
[shelf_router_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_router
[shelf_router_generator_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_router_generator
[shelf_static_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_static
[shelf_test_handler_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_test_handler
[shelf_web_socket_issues]: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_web_socket

## Publishing automation

Expand Down
2 changes: 1 addition & 1 deletion pkgs/shelf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions analysis_options.yaml → pkgs/shelf/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
2 changes: 2 additions & 0 deletions pkgs/shelf/lib/src/body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions pkgs/shelf/lib/src/hijack_exception.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion pkgs/shelf/lib/src/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -171,7 +174,7 @@ abstract class Message {
{Map<String, String> headers, Map<String, Object> context, Object? body});
}

/// Adds information about [encoding] to [headers].
/// Adds information about encoding to [headers].
///
/// Returns a new map without modifying [headers].
Map<String, List<String>> _adjustHeaders(
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf/lib/src/middleware_extensions.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'handler.dart';
import 'middleware.dart';
import 'pipeline.dart';

/// Extensions on [Middleware] to aid in composing [Middleware] and [Handler]s.
///
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf/lib/src/pipeline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf/lib/src/response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:convert';

import 'package:http_parser/http_parser.dart';

import 'handler.dart';
import 'message.dart';
import 'util.dart';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/shelf/lib/src/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: 1.4.3-wip
description: >
A model for web server middleware that encourages composition and easy reuse.
repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf
issue_tracker: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf

topics:
- server
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf_packages_handler/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:dart_flutter_team_lints/analysis_options.yaml
1 change: 1 addition & 0 deletions pkgs/shelf_packages_handler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: shelf_packages_handler
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
issue_tracker: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_packages_handler

topics:
- server
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf_proxy/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:dart_flutter_team_lints/analysis_options.yaml
1 change: 1 addition & 0 deletions pkgs/shelf_proxy/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: shelf_proxy
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
issue_tracker: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_proxy

topics:
- server
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf_router/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:dart_flutter_team_lints/analysis_options.yaml
1 change: 1 addition & 0 deletions pkgs/shelf_router/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: >
A convenient request router for the shelf web-framework, with support for
URL-parameters, nested routers and routers generated from source annotations.
repository: https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_router
issue_tracker: https://github.com/dart-lang/shelf/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ashelf_router

topics:
- server
Expand Down
19 changes: 18 additions & 1 deletion pkgs/shelf_router_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
## 1.1.1-wip
## 1.1.3-wip

* Require `analyzer: ^8.1.1`
* Require `build: ^4.0.0`
* Require `build_config: ^1.2.0`
* Require `source_gen: ^4.0.1`
* Require `sdk: ^3.9.0`

## 1.1.2

* Require `analyzer: '>=7.4.0 <9.0.0'`
* Require `build: ^3.0.0`
* Require `build_config: ^1.1.0`
* Require `source_gen: ^3.0.0`
* Require `sdk: ^3.7.0`

## 1.1.1

* Support the latest `package:analyzer` and `package:source_gen`
* Require `sdk: ^3.3.0`

## 1.1.0
Expand Down
1 change: 1 addition & 0 deletions pkgs/shelf_router_generator/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:dart_flutter_team_lints/analysis_options.yaml
45 changes: 8 additions & 37 deletions pkgs/shelf_router_generator/example/main.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pkgs/shelf_router_generator/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ import 'src/shelf_router_generator.dart';
/// A [Builder] that generates a `_$<className>Router(<className> service)`
/// function for each class `<className>` containing a member annotated with
/// [shelf_router.Route].
Builder shelfRouter(BuilderOptions _) => SharedPartBuilder(
[ShelfRouterGenerator()],
'shelf_router',
);
Builder shelfRouter(BuilderOptions _) =>
SharedPartBuilder([ShelfRouterGenerator()], 'shelf_router');
Loading