From 8facd65c14bf5b9510913ac8d9aa4f0e6d188598 Mon Sep 17 00:00:00 2001 From: thomashii Date: Fri, 18 Mar 2022 09:20:40 +0800 Subject: [PATCH 1/3] Updated packages --- pubspec.yaml | 162 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 149 insertions(+), 13 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index d7b0d19..acb81f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,23 +2,159 @@ name: angel description: A graphql starter application for Angel3 framework publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.0 <3.0.0' dependencies: - angel3_auth: ^4.0.0 - angel3_configuration: ^4.1.0 - angel3_framework: ^4.2.0 - angel3_graphql: ^2.0.0 - angel3_jael: ^4.2.0 - angel3_production: ^3.1.0 - angel3_static: ^4.1.0 - angel3_validate: ^4.0.0 + angel3_auth: ^6.0.0 + angel3_configuration: ^6.0.0 + angel3_framework: ^6.0.0 + angel3_graphql: ^6.0.0 + angel3_jael: ^6.0.0 + angel3_production: ^6.0.0 + angel3_static: ^6.0.0 + angel3_validate: ^6.0.0 dev_dependencies: - angel3_hot: ^4.2.0 - angel3_serialize_generator: ^4.2.0 - angel3_test: ^4.0.0 - graphql_generator2: ^2.1.0 + angel3_hot: ^6.0.0 + angel3_serialize_generator: ^6.0.0 + angel3_test: ^6.0.0 + graphql_generator2: ^3.0.0 belatuk_pretty_logging: ^4.0.0 build_runner: ^2.0.4 io: ^1.0.0 test: ^1.17.5 lints: ^1.0.0 +dependency_overrides: + angel3_container: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/container/angel_container + angel3_framework: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/framework + angel3_http_exception: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/http_exception + angel3_model: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/model + angel3_route: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/route + angel3_mock_request: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/mock_request + angel3_auth: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/auth + angel3_client: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/client + angel3_websocket: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/websocket + angel3_validate: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/validate + angel3_configuration: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/configuration + angel3_test: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/test + jael3: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/jael/jael + angel3_jael: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/jael/angel_jael + jael3_preprocessor: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/jael/jael_preprocessor + angel3_serialize: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/serialize/angel_serialize + angel3_serialize_generator: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/serialize/angel_serialize_generator + angel3_hot: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/hot + angel3_static: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/static + angel3_production: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/production + angel3_orm: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/orm/angel_orm + angel3_orm_generator: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/orm/angel_orm_generator + angel3_orm_postgres: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/orm/angel_orm_postgres + angel3_migration: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/orm/angel_migration + angel3_migration_runner: + git: + url: https://github.com/dukefirehawk/angel.git + ref: release/6.0.0 + path: packages/orm/angel_migration_runner + angel3_graphql: + git: + url: https://github.com/dukefirehawk/graphql_dart.git + ref: releaase/6.0.0 + path: angel_graphql + graphql_generator2: + git: + url: https://github.com/dukefirehawk/graphql_dart.git + ref: releaase/6.0.0 + path: graphql_generator From 563f7f8dde4881820bee194c845bb95cfa96724b Mon Sep 17 00:00:00 2001 From: thomashii Date: Tue, 26 Apr 2022 08:11:53 +0800 Subject: [PATCH 2/3] Updated to SDK 2.16.0 --- Dockerfile | 23 +++-- lib/src/routes/graphql/todo.dart | 6 +- pubspec.yaml | 144 +------------------------------ 3 files changed, 23 insertions(+), 150 deletions(-) diff --git a/Dockerfile b/Dockerfile index c84bc87..cfc2775 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,23 @@ -FROM google/dart:latest +FROM dart:latest -COPY ./ ./ +# Copy all the source code +COPY ./config /app/config +COPY ./lib /app/lib +COPY ./bin /app/bin +COPY ./views /app/views +COPY ./web /app/web +COPY ./*.yaml /app/ -# Install dependencies, pre-build -RUN pub get +WORKDIR /app +RUN dart pub upgrade -# Optionally build generaed sources. +# Optionally build generated sources. # RUN pub run build_runner build -# Set environment, start server +# Set environment, start server in JIT mode ENV ANGEL_ENV=production EXPOSE 3000 -CMD dart bin/prod.dart +CMD dart ./bin/prod.dart -p 3000 -a 0.0.0.0 + +# Use -j flag to set higher number of isolates +#CMD dart ./bin/prod.dart -p 3000 -a 0.0.0.0 -j 50 \ No newline at end of file diff --git a/lib/src/routes/graphql/todo.dart b/lib/src/routes/graphql/todo.dart index 4d30d9b..6147421 100644 --- a/lib/src/routes/graphql/todo.dart +++ b/lib/src/routes/graphql/todo.dart @@ -8,8 +8,8 @@ MapService? _getTodoService(Angel app) { const key = 'todoService'; // If there is already an existing singleton, return it. - if (app.container!.hasNamed(key)) { - return app.container!.findByName(key); + if (app.container.hasNamed(key)) { + return app.container.findByName(key); } // Create an in-memory service. We will use this @@ -18,7 +18,7 @@ MapService? _getTodoService(Angel app) { // Register this service as a named singleton in the app container, // so that we do not inadvertently create another instance. - app.container!.registerNamedSingleton(key, mapService); + app.container.registerNamedSingleton(key, mapService); return mapService; } diff --git a/pubspec.yaml b/pubspec.yaml index acb81f1..94ca2f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: angel description: A graphql starter application for Angel3 framework publish_to: none environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.16.0 <3.0.0' dependencies: angel3_auth: ^6.0.0 angel3_configuration: ^6.0.0 @@ -16,145 +16,9 @@ dev_dependencies: angel3_hot: ^6.0.0 angel3_serialize_generator: ^6.0.0 angel3_test: ^6.0.0 - graphql_generator2: ^3.0.0 + graphql_generator2: ^4.0.0 belatuk_pretty_logging: ^4.0.0 build_runner: ^2.0.4 io: ^1.0.0 - test: ^1.17.5 - lints: ^1.0.0 -dependency_overrides: - angel3_container: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/container/angel_container - angel3_framework: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/framework - angel3_http_exception: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/http_exception - angel3_model: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/model - angel3_route: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/route - angel3_mock_request: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/mock_request - angel3_auth: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/auth - angel3_client: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/client - angel3_websocket: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/websocket - angel3_validate: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/validate - angel3_configuration: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/configuration - angel3_test: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/test - jael3: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/jael/jael - angel3_jael: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/jael/angel_jael - jael3_preprocessor: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/jael/jael_preprocessor - angel3_serialize: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/serialize/angel_serialize - angel3_serialize_generator: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/serialize/angel_serialize_generator - angel3_hot: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/hot - angel3_static: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/static - angel3_production: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/production - angel3_orm: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/orm/angel_orm - angel3_orm_generator: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/orm/angel_orm_generator - angel3_orm_postgres: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/orm/angel_orm_postgres - angel3_migration: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/orm/angel_migration - angel3_migration_runner: - git: - url: https://github.com/dukefirehawk/angel.git - ref: release/6.0.0 - path: packages/orm/angel_migration_runner - angel3_graphql: - git: - url: https://github.com/dukefirehawk/graphql_dart.git - ref: releaase/6.0.0 - path: angel_graphql - graphql_generator2: - git: - url: https://github.com/dukefirehawk/graphql_dart.git - ref: releaase/6.0.0 - path: graphql_generator + test: ^1.21.0 + lints: ^1.0.0 \ No newline at end of file From b3b5d01aecb7a6362f73de4aeb2cfb8e226d5d7e Mon Sep 17 00:00:00 2001 From: thomashii Date: Tue, 26 Apr 2022 08:22:40 +0800 Subject: [PATCH 3/3] Updated log message --- bin/dev.dart | 4 ++-- bin/prod.dart | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/dev.dart b/bin/dev.dart index c0ab88d..8bf11cc 100644 --- a/bin/dev.dart +++ b/bin/dev.dart @@ -11,7 +11,7 @@ void main() async { hierarchicalLoggingEnabled = true; var hot = HotReloader(() async { - var logger = Logger.detached('{{angel}}') + var logger = Logger.detached('Angel3') ..level = Level.ALL ..onRecord.listen(prettyLog); var app = Angel(logger: logger, reflector: MirrorsReflector()); @@ -24,5 +24,5 @@ void main() async { var server = await hot.startServer('127.0.0.1', 3000); print( - '{{angel}} server listening at http://${server.address.address}:${server.port}'); + '[Angel3] server listening at http://${server.address.address}:${server.port}'); } diff --git a/bin/prod.dart b/bin/prod.dart index efd1e5e..4c861af 100644 --- a/bin/prod.dart +++ b/bin/prod.dart @@ -17,7 +17,7 @@ import 'package:angel3_production/angel3_production.dart'; // so use it if possible. // // However, the following alternatives exist: -// * Generation via `package:angel_container_generator` +// * Generation via `package:angel3_container_generator` // * Creating an instance of `StaticReflector` // * Manually implementing the `Reflector` interface (cumbersome; not recommended) // @@ -26,5 +26,4 @@ import 'package:angel3_production/angel3_production.dart'; // // https://gitter.im/angel_dart/discussion void main(List args) => - Runner('{{angel}}', configureServer, reflector: MirrorsReflector()) - .run(args); + Runner('Angel3', configureServer, reflector: MirrorsReflector()).run(args);