Skip to content

Commit 5c89093

Browse files
authored
refactor(dart_frog): upgrade to Dart 2.19 and Very Good Analysis 4.0.0 (#535)
1 parent fa73490 commit 5c89093

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:very_good_analysis/analysis_options.3.1.0.yaml
1+
include: package:very_good_analysis/analysis_options.4.0.0.yaml

packages/dart_frog/lib/dart_frog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export 'src/create_static_file_handler.dart' show createStaticFileHandler;
1717
export 'src/handler.dart' show Handler;
1818
export 'src/hot_reload.dart' show hotReload;
1919
export 'src/http_method.dart' show HttpMethod;
20-
export 'src/middleware.dart' show Middleware, HandlerUse;
20+
export 'src/middleware.dart' show HandlerUse, Middleware;
2121
export 'src/provider.dart' show provider;

packages/dart_frog/lib/src/hot_reload.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:async';
22
import 'dart:io';
33

4-
import 'package:shelf_hotreload/shelf_hotreload.dart' show withHotreload, Level;
4+
import 'package:shelf_hotreload/shelf_hotreload.dart' show Level, withHotreload;
55

66
/// Hot reload support for the server returned by the [initializer].
77
void hotReload(FutureOr<HttpServer> Function() initializer) {

packages/dart_frog/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ issue_tracker: https://github.com/VeryGoodOpenSource/dart_frog/issues
77
documentation: https://dartfrog.vgv.dev/docs/overview
88

99
environment:
10-
sdk: ">=2.18.0 <3.0.0"
10+
sdk: ">=2.19.0 <3.0.0"
1111

1212
dependencies:
1313
http_methods: ^1.1.0
@@ -20,4 +20,4 @@ dev_dependencies:
2020
mocktail: ^0.3.0
2121
path: ^1.8.2
2222
test: ^1.19.2
23-
very_good_analysis: ^3.1.0
23+
very_good_analysis: ^4.0.0

packages/dart_frog/test/src/router_test.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// limitations under the License.
1515

1616
@TestOn('vm')
17+
library;
18+
1719
import 'dart:convert';
1820
import 'dart:io';
1921

@@ -291,7 +293,7 @@ void main() {
291293

292294
final app = Router()
293295
..all('/hello', (RequestContext context) => Response(body: 'hello-world'))
294-
..mount('/api/', api)
296+
..mount('/api/', api.call)
295297
..all(
296298
'/<_|[^]*>',
297299
(RequestContext context) => Response(body: 'catch-all-handler'),
@@ -339,7 +341,7 @@ void main() {
339341
final app = Router()
340342
..mount(
341343
'/api/',
342-
const Pipeline().addMiddleware(middleware).addHandler(api),
344+
const Pipeline().addMiddleware(middleware).addHandler(api.call),
343345
);
344346

345347
server.mount((request) async {
@@ -370,7 +372,7 @@ void main() {
370372
..all('/hello', (RequestContext context) {
371373
return Response(body: 'hello-world');
372374
})
373-
..mount('/api', api)
375+
..mount('/api', api.call)
374376
..all('/<_|[^]*>', (RequestContext context) {
375377
return Response(body: 'catch-all-handler');
376378
});
@@ -491,7 +493,7 @@ void main() {
491493
return Response(body: '$user to $other: $action');
492494
});
493495

494-
return router;
496+
return router.call;
495497
}
496498

497499
// Routes for a specific <user>.
@@ -508,7 +510,7 @@ void main() {
508510
..get('/', (RequestContext context) {
509511
return Response(body: '$user root');
510512
});
511-
return router;
513+
return router.call;
512514
}
513515

514516
final app = Router()

packages/dart_frog/test/src/serve_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void main() {
1515
});
1616

1717
test('can return multiple 404s', () async {
18-
final server = await serve(Router(), 'localhost', 3001);
18+
final server = await serve(Router().call, 'localhost', 3001);
1919
final client = HttpClient();
2020
var request = await client.getUrl(Uri.parse('http://localhost:3001'));
2121
var response = await request.close();

0 commit comments

Comments
 (0)