From d31a07bbabdbe47ad80ca2aaafbff9751660e5c7 Mon Sep 17 00:00:00 2001 From: Thomas Hii Date: Sun, 23 Jun 2024 17:45:28 +0800 Subject: [PATCH 1/3] Updated shelf --- packages/shelf/CHANGELOG.md | 2 +- packages/shelf/pubspec.yaml | 8 ++++---- packages/shelf/test/embed_shelf_test.dart | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/shelf/CHANGELOG.md b/packages/shelf/CHANGELOG.md index 824708d9..6cf2a892 100644 --- a/packages/shelf/CHANGELOG.md +++ b/packages/shelf/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## 8.0.0 +## 8.0.0-beta.1 * Require Dart >= 3.3 * Updated `lints` to 4.0.0 diff --git a/packages/shelf/pubspec.yaml b/packages/shelf/pubspec.yaml index 14f1de84..6da5f797 100644 --- a/packages/shelf/pubspec.yaml +++ b/packages/shelf/pubspec.yaml @@ -1,5 +1,5 @@ name: angel3_shelf -version: 8.0.0 +version: 8.0.0-beta.1 description: Shelf interop with Angel3. Use this to wrap existing server code. homepage: https://angel3-framework.web.app/ repository: https://github.com/dart-backend/angel/tree/master/packages/shelf @@ -7,9 +7,9 @@ environment: sdk: '>=3.3.0 <4.0.0' publish_to: none dependencies: - angel3_framework: ^8.0.0 - angel3_container: ^8.0.0 - angel3_mock_request: ^8.0.0 + angel3_framework: ^8.4.0 + angel3_container: ^8.2.0 + angel3_mock_request: ^8.2.0 path: ^1.9.0 shelf: ^1.3.0 stream_channel: ^2.1.0 diff --git a/packages/shelf/test/embed_shelf_test.dart b/packages/shelf/test/embed_shelf_test.dart index f3afe998..79df042d 100644 --- a/packages/shelf/test/embed_shelf_test.dart +++ b/packages/shelf/test/embed_shelf_test.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:io'; +import 'package:angel3_container/mirrors.dart'; import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/http.dart'; import 'package:angel3_shelf/angel3_shelf.dart'; @@ -51,7 +52,7 @@ void main() { }); var logger = Logger.detached('angel3_shelf')..onRecord.listen(prettyLog); - var app = Angel(logger: logger); + var app = Angel(logger: logger, reflector: MirrorsReflector()); var httpDriver = AngelHttp(app); app.get('/angel', (req, res) => 'Angel'); app.fallback(embedShelf(handler, throwOnNullResponse: true)); From 0b109cadfea10d62bd5759cf789a6f8819bd942f Mon Sep 17 00:00:00 2001 From: Thomas Hii Date: Sun, 23 Jun 2024 18:02:36 +0800 Subject: [PATCH 2/3] Fixed dependencies --- packages/orm/angel_orm_service/CHANGELOG.md | 5 +++++ .../orm/angel_orm_service/example/connect.dart | 14 ++++++++++---- .../orm/angel_orm_service/example/migrate.dart | 4 +++- packages/orm/angel_orm_service/pubspec.yaml | 2 +- packages/orm/angel_orm_service/test/all_test.dart | 11 +++++++---- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/packages/orm/angel_orm_service/CHANGELOG.md b/packages/orm/angel_orm_service/CHANGELOG.md index 5e4a43ad..2b383d67 100644 --- a/packages/orm/angel_orm_service/CHANGELOG.md +++ b/packages/orm/angel_orm_service/CHANGELOG.md @@ -1,8 +1,13 @@ # Change Log +## 8.2.2 + +* Fixed examples and test cases + ## 8.2.1 * Updated dependencies +* Updated `popstgres` to 3.0.0 ## 8.2.0 diff --git a/packages/orm/angel_orm_service/example/connect.dart b/packages/orm/angel_orm_service/example/connect.dart index f10f3967..abe59baf 100644 --- a/packages/orm/angel_orm_service/example/connect.dart +++ b/packages/orm/angel_orm_service/example/connect.dart @@ -3,12 +3,18 @@ import 'dart:io'; import 'package:angel3_orm_postgres/angel3_orm_postgres.dart'; import 'package:postgres/postgres.dart'; -final conn = PostgreSQLConnection('localhost', 5432, 'angel_orm_service_test', - username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', - password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'); +Future dbConnection() async { + return Connection.open(Endpoint( + host: 'localhost', + port: 5432, + database: 'angel_orm_service_test', + username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', + password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password')); +} Future connect() async { + final conn = await dbConnection(); + var executor = PostgreSqlExecutor(conn); - await conn.open(); return executor; } diff --git a/packages/orm/angel_orm_service/example/migrate.dart b/packages/orm/angel_orm_service/example/migrate.dart index 9422c555..ba7ee8a0 100644 --- a/packages/orm/angel_orm_service/example/migrate.dart +++ b/packages/orm/angel_orm_service/example/migrate.dart @@ -3,7 +3,9 @@ import 'package:angel3_migration_runner/postgres.dart'; import 'connect.dart'; import 'todo.dart'; -Future main(List args) { +Future main(List args) async { + final conn = await dbConnection(); + var runner = PostgresMigrationRunner(conn, migrations: [ TodoMigration(), ]); diff --git a/packages/orm/angel_orm_service/pubspec.yaml b/packages/orm/angel_orm_service/pubspec.yaml index ca490d8b..688fc070 100644 --- a/packages/orm/angel_orm_service/pubspec.yaml +++ b/packages/orm/angel_orm_service/pubspec.yaml @@ -1,5 +1,5 @@ name: angel3_orm_service -version: 8.2.1 +version: 8.2.2 description: Service implementation that wraps over Angel3 ORM Query classes. homepage: https://angel3-framework.web.app/ repository: https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service diff --git a/packages/orm/angel_orm_service/test/all_test.dart b/packages/orm/angel_orm_service/test/all_test.dart index 8557d17c..833d35f2 100644 --- a/packages/orm/angel_orm_service/test/all_test.dart +++ b/packages/orm/angel_orm_service/test/all_test.dart @@ -14,16 +14,19 @@ void main() { late Service pokemonService; setUp(() async { - var conn = PostgreSQLConnection('localhost', 5432, 'angel_orm_service_test', + var conn = await Connection.open(Endpoint( + host: 'localhost', + port: 5432, + database: 'angel_orm_service_test', username: Platform.environment['POSTGRES_USERNAME'] ?? 'postgres', - password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password'); + password: Platform.environment['POSTGRES_PASSWORD'] ?? 'password')); hierarchicalLoggingEnabled = true; logger = Logger.detached('orm_service'); logger.level = Level.ALL; if (Platform.environment['log'] == '1') logger.onRecord.listen(print); executor = PostgreSqlExecutor(conn, logger: logger); - await conn.open(); - await conn.query(''' + + await conn.execute(''' CREATE TEMPORARY TABLE pokemons ( id serial, species varchar, From 7e6dc485e9329e39c3f7811d9cb89d41cb4fdac9 Mon Sep 17 00:00:00 2001 From: Thomas Hii Date: Sun, 23 Jun 2024 18:08:12 +0800 Subject: [PATCH 3/3] Updated README --- packages/orm/angel_orm_service/CHANGELOG.md | 3 ++- packages/orm/angel_orm_service/README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/orm/angel_orm_service/CHANGELOG.md b/packages/orm/angel_orm_service/CHANGELOG.md index 2b383d67..c50c1c63 100644 --- a/packages/orm/angel_orm_service/CHANGELOG.md +++ b/packages/orm/angel_orm_service/CHANGELOG.md @@ -2,7 +2,8 @@ ## 8.2.2 -* Fixed examples and test cases +* Updated examples and test cases +* Updated README ## 8.2.1 diff --git a/packages/orm/angel_orm_service/README.md b/packages/orm/angel_orm_service/README.md index c08ca53e..1d18ba92 100644 --- a/packages/orm/angel_orm_service/README.md +++ b/packages/orm/angel_orm_service/README.md @@ -1,6 +1,6 @@ # Angel3 ORM Service -![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm_servie?include_prereleases) +![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm_service?include_prereleases) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![License](https://img.shields.io/github/license/dart-backend/angel)](https://github.com/dart-backend/angel/tree/master/packages/orm/angel_orm_service/LICENSE)