diff --git a/README.md b/README.md index 151d490..274cbdc 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,21 @@ + +[![Angel 3 Framework](./logo3.png)] + + +[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/framework) +[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) +[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/angel_dart/discussion) + +[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/LICENSE) + + **A polished, production-ready backend framework in Dart.** @@ -11,39 +23,20 @@ ----- ## About -Angel is a full-stack Web framework in Dart. It aims to +Angel3 is a full-stack Web framework in Dart. It aims to streamline development by providing many common features out-of-the-box in a consistent manner. -With features like the following, Angel is the all-in-one framework you should choose to build your next project: -* [GraphQL Support](https://github.com/angel-dart/graphql) -* [PostgreSQL ORM](https://github.com/angel-dart/orm) -* [Dependency Injection](https://docs.angel-dart.dev/guides/dependency-injection) -* And [much more](https://github.com/angel-dart)... - ## Installation & Setup -Once you have [Dart](https://www.dartlang.org/) installed, bootstrapping a project is as simple as running a few shell commands: - -Install the [Angel CLI](https://github.com/angel-dart/cli): - -```bash -pub global activate angel_cli -``` - -Bootstrap a project: - -```bash -angel init hello -``` - -You can even have your server run and be *hot-reloaded* on file changes: +1. Download and install [Dart](https://www.dartlang.org/). +2. Run the following command to start Angel3 server in dev mode to *hot-reloaded* on file changes: ```bash dart --observe bin/dev.dart ``` -Next, check out the [detailed documentation](https://docs.angel-dart.dev/v/2.x) to learn to flesh out your project. +3. Next, check out the [detailed documentation](https://docs.angel-dart.dev/v/2.x) to learn to flesh out your project. Angel3 works the same way as the original Angel. ## Examples and Documentation Visit the [documentation](https://docs.angel-dart.dev/v/2.x) diff --git a/bin/dev.dart b/bin/dev.dart index 034a416..549be3a 100644 --- a/bin/dev.dart +++ b/bin/dev.dart @@ -1,10 +1,10 @@ import 'dart:io'; -import 'package:angel/src/pretty_logging.dart'; -import 'package:angel/angel.dart'; -import 'package:angel_container/mirrors.dart'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_hot/angel_hot.dart'; import 'package:logging/logging.dart'; +import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; +import 'package:angel3_container/mirrors.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_hot/angel3_hot.dart'; +import 'package:myapp/myapp.dart'; void main() async { // Watch the config/ and web/ directories for changes, and hot-reload the server. diff --git a/bin/prod.dart b/bin/prod.dart index fb7de39..827768a 100644 --- a/bin/prod.dart +++ b/bin/prod.dart @@ -1,6 +1,6 @@ -import 'package:angel/angel.dart'; -import 'package:angel_container/mirrors.dart'; -import 'package:angel_production/angel_production.dart'; +import 'package:angel3_container/mirrors.dart'; +import 'package:angel3_production/angel3_production.dart'; +import 'package:myapp/myapp.dart'; // NOTE: By default, the Runner class does not use the `MirrorsReflector`, or any // reflector, by default. diff --git a/lib/angel.dart b/lib/myapp.dart similarity index 90% rename from lib/angel.dart rename to lib/myapp.dart index e4c6f76..a3a46b4 100644 --- a/lib/angel.dart +++ b/lib/myapp.dart @@ -1,8 +1,8 @@ /// Your very own web application! -library angel; +library myapp; import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; import 'package:file/local.dart'; import 'src/config/config.dart' as configuration; import 'src/routes/routes.dart' as routes; diff --git a/lib/src/config/config.dart b/lib/src/config/config.dart index ba224a7..9e1325e 100644 --- a/lib/src/config/config.dart +++ b/lib/src/config/config.dart @@ -1,9 +1,9 @@ /// Configuration for this Angel instance. -library angel.src.config; +library myapp.src.config; -import 'package:angel_configuration/angel_configuration.dart'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_jael/angel_jael.dart'; +import 'package:angel3_configuration/angel3_configuration.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_jael/angel3_jael.dart'; import 'package:file/file.dart'; import 'plugins/plugins.dart' as plugins; diff --git a/lib/src/config/plugins/plugins.dart b/lib/src/config/plugins/plugins.dart index b025b21..f68683b 100644 --- a/lib/src/config/plugins/plugins.dart +++ b/lib/src/config/plugins/plugins.dart @@ -1,8 +1,8 @@ /// Custom plugins go here. -library angel.src.config.plugins; +library myapp.src.config.plugins; import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; Future configureServer(Angel app) async { // Include any plugins you have made here. diff --git a/lib/src/pretty_logging.dart b/lib/src/pretty_logging.dart deleted file mode 100644 index 1413f0f..0000000 --- a/lib/src/pretty_logging.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:angel_http_exception/angel_http_exception.dart'; -import 'package:logging/logging.dart'; -import 'package:io/ansi.dart'; - -/// Prints the contents of a [LogRecord] with pretty colors. -void prettyLog(LogRecord record) { - var code = chooseLogColor(record.level); - - if (record.error == null) print(code.wrap(record.toString())); - - if (record.error != null) { - var err = record.error; - if (err is AngelHttpException && err.statusCode != 500) return; - print(code.wrap(record.toString() + '\n')); - print(code.wrap(err.toString())); - - if (record.stackTrace != null) { - print(code.wrap(record.stackTrace.toString())); - } - } -} - -/// Chooses a color based on the logger [level]. -AnsiCode chooseLogColor(Level level) { - if (level == Level.SHOUT) - return backgroundRed; - else if (level == Level.SEVERE) - return red; - else if (level == Level.WARNING) - return yellow; - else if (level == Level.INFO) - return cyan; - else if (level == Level.CONFIG || - level == Level.FINE || - level == Level.FINER || - level == Level.FINEST) return lightGray; - return resetAll; -} diff --git a/lib/src/routes/controllers/controllers.dart b/lib/src/routes/controllers/controllers.dart index e23b375..67ad6cd 100644 --- a/lib/src/routes/controllers/controllers.dart +++ b/lib/src/routes/controllers/controllers.dart @@ -1,7 +1,7 @@ -library angel.src.routes.controllers; +library myapp.src.routes.controllers; import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; Future configureServer(Angel app) async { /// Controllers will not function unless wired to the application! diff --git a/lib/src/routes/routes.dart b/lib/src/routes/routes.dart index 9396211..4c7c9c0 100644 --- a/lib/src/routes/routes.dart +++ b/lib/src/routes/routes.dart @@ -1,8 +1,8 @@ /// This app's route configuration. -library angel.src.routes; +library myapp.src.routes; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_static/angel_static.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_static/angel3_static.dart'; import 'package:file/file.dart'; import 'controllers/controllers.dart' as controllers; diff --git a/lib/src/services/services.dart b/lib/src/services/services.dart index 86c3eb9..02d2d28 100644 --- a/lib/src/services/services.dart +++ b/lib/src/services/services.dart @@ -1,8 +1,8 @@ /// Declare services here! -library angel.services; +library myapp.services; import 'dart:async'; -import 'package:angel_framework/angel_framework.dart'; +import 'package:angel3_framework/angel3_framework.dart'; /// Configure our application to use *services*. /// Services must be wired to the app via `app.use`. diff --git a/pubspec.yaml b/pubspec.yaml index 7ce2fd7..e1ddcfd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,57 +1,22 @@ -name: angel +name: myapp version: 4.0.0 description: An app that's going to be amazing pretty soon. publish_to: none # Ensure we don't accidentally publish our private code! ;) +homepage: https://github.com/dukefirehawk/angel environment: sdk: '>=2.12.0 <3.0.0' -homepage: https://github.com/angel-dart/angel dependencies: - angel_auth: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/auth - angel_configuration: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/configuration - angel_framework: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/framework - angel_jael: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/jael/angel_jael - angel_production: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/production - angel_static: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/static - angel_validate: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/validate + angel3_auth: ^4.0.0 + angel3_configuration: ^4.0.0 + angel3_framework: ^4.0.0 + angel3_jael: ^4.0.0 + angel3_production: ^3.0.0 + angel3_static: ^4.0.0 + angel3_validate: ^4.0.0 + angel3_pretty_logging: ^3.0.0 dev_dependencies: - angel_hot: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/hot - angel_test: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/test + angel3_hot: ^4.0.0 + angel3_test: ^4.0.0 io: ^1.0.0 # For pretty printing. pedantic: ^1.11.0 # Enforces Dart style conventions. test: ^1.17.3 # For unit testing. diff --git a/test/all_test.dart b/test/all_test.dart index 6529b07..42ede8f 100644 --- a/test/all_test.dart +++ b/test/all_test.dart @@ -1,7 +1,7 @@ -import 'package:angel/angel.dart'; -import 'package:angel_framework/angel_framework.dart'; -import 'package:angel_test/angel_test.dart'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_test/angel3_test.dart'; import 'package:test/test.dart'; +import 'package:myapp/myapp.dart'; // Angel also includes facilities to make testing easier. // @@ -19,7 +19,7 @@ import 'package:test/test.dart'; // here: // https://github.com/dart-lang/test -main() async { +void main() async { late TestClient client; setUp(() async {