Updated linter to package:lints
This commit is contained in:
parent
9fdeb7149a
commit
efca425bd0
72 changed files with 502 additions and 852 deletions
42
LICENSE
42
LICENSE
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
|
||||
# Change Log
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `package:belatuk_json_serializer`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.2
|
||||
|
||||
* Added logging
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Angel3 Client
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_client)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_client?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/client/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/client/LICENSE)
|
||||
|
||||
A browser, mobile and command line based client that supports querying Angel3 backend.
|
||||
|
||||
|
@ -32,7 +31,7 @@ foo() async {
|
|||
}
|
||||
```
|
||||
|
||||
The CLI client also supports reflection via `angel3_json_god`. There is no need to work with Maps; you can use the same class on the client and the server.
|
||||
The CLI client also supports reflection via `package:belatuk_json_serializer`. There is no need to work with Maps; you can use the same class on the client and the server.
|
||||
|
||||
```dart
|
||||
class Todo extends Model {
|
||||
|
|
|
@ -1,6 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
# errors:
|
||||
# unawaited_futures: ignore
|
||||
include: package:lints/recommended.yaml
|
|
@ -3,7 +3,7 @@ library angel_client.cli;
|
|||
|
||||
import 'dart:async';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:angel3_json_god/angel3_json_god.dart' as god;
|
||||
import 'package:belatuk_json_serializer/belatuk_json_serializer.dart' as god;
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'angel3_client.dart';
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
name: angel3_client
|
||||
version: 4.0.2
|
||||
version: 4.1.0
|
||||
description: A browser, mobile and command line based client that supports querying Angel3 servers
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/client
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/client
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_http_exception: ^3.0.0
|
||||
angel3_json_god: ^4.0.0
|
||||
belatuk_json_serializer: ^5.0.0
|
||||
collection: ^1.15.0
|
||||
http: ^0.13.1
|
||||
meta: ^1.3.0
|
||||
path: ^1.8.0
|
||||
logging: ^1.0.0
|
||||
dev_dependencies:
|
||||
angel3_framework: ^4.0.0
|
||||
angel3_framework: ^4.2.0
|
||||
angel3_model: ^3.0.0
|
||||
angel3_mock_request: ^2.0.0
|
||||
angel3_container: ^3.0.0
|
||||
|
@ -22,5 +22,10 @@ dev_dependencies:
|
|||
async: ^2.6.1
|
||||
build_runner: ^1.12.2
|
||||
build_web_compilers: ^2.16.5
|
||||
pedantic: ^1.11.0
|
||||
test: ^1.17.4
|
||||
test: ^1.17.5
|
||||
lints: ^1.0.0
|
||||
#dependency_overrides:
|
||||
# angel3_framework:
|
||||
# path: ../framework
|
||||
# angel3_route:
|
||||
# path: ../route
|
|
@ -1,10 +1,15 @@
|
|||
# Change Log
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `package:belatuk_merge_map`
|
||||
* Updated to use `package:belatuk_pretty_logging`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.1
|
||||
|
||||
* Updated README
|
||||
* Fixed unit tests
|
||||
* All 8 unit test passed
|
||||
* All 8 unit tests passed
|
||||
|
||||
## 4.0.0
|
||||
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Angel3 Configuration Loader
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dev/packages/angel3_configuration)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_configuration?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/configuration/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/configuration/LICENSE)
|
||||
|
||||
Automatic YAML configuration loader for [Angel3 framework](https://pub.dev/packages/angel3)
|
||||
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: true
|
||||
include: package:lints/recommended.yaml
|
|
@ -5,7 +5,7 @@ import 'dart:async';
|
|||
import 'package:angel3_framework/angel3_framework.dart';
|
||||
import 'package:dotenv/dotenv.dart' as dotenv;
|
||||
import 'package:file/file.dart';
|
||||
import 'package:angel3_merge_map/angel3_merge_map.dart';
|
||||
import 'package:belatuk_merge_map/belatuk_merge_map.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
Future<void> _loadYamlFile(Map map, File yamlFile, Map<String, String> env,
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
name: angel3_configuration
|
||||
description: Automatic YAML application configuration loader for Angel, with .env support.
|
||||
version: 4.0.1
|
||||
version: 4.1.0
|
||||
description: Automatic YAML application configuration loader for Angel 3, with .env support.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/configuration
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/configuration
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_framework: ^4.0.0
|
||||
angel3_merge_map: ^2.0.0
|
||||
angel3_framework: ^4.2.0
|
||||
belatuk_merge_map: ^3.0.0
|
||||
dotenv: ^3.0.0
|
||||
file: ^6.1.0
|
||||
yaml: ^3.1.0
|
||||
dev_dependencies:
|
||||
io: ^1.0.0
|
||||
logging: ^1.0.1
|
||||
pedantic: ^1.11.0
|
||||
angel3_pretty_logging: ^3.0.0
|
||||
test: ^1.17.3
|
||||
lints: ^1.0.0
|
||||
belatuk_pretty_logging: ^4.0.0
|
||||
test: ^1.17.5
|
||||
#dependency_overrides:
|
||||
# angel3_framework:
|
||||
# path: ../framework
|
|
@ -2,7 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:angel3_framework/angel3_framework.dart';
|
||||
import 'package:angel3_configuration/angel3_configuration.dart';
|
||||
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart';
|
||||
import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
|
||||
import 'package:file/local.dart';
|
||||
import 'package:io/ansi.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
|
6
packages/framework/.vscode/settings.json
vendored
6
packages/framework/.vscode/settings.json
vendored
|
@ -1,6 +0,0 @@
|
|||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"files.watcherExclude": {
|
||||
"**/target": true
|
||||
}
|
||||
}
|
|
@ -1,5 +1,11 @@
|
|||
# Change Log
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* Updated to use `package:belatuk_combinator`
|
||||
* Updated to use `package:belatuk_merge_map`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.1.3
|
||||
|
||||
* Updated README
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Angel3 Framework
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.1.3-brightgreen)](https://pub.dev/packages/angel3_framework)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_framework?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/framework/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/framework/LICENSE)
|
||||
|
||||
**Replacement of Angel Framework with major change to support NNBD.**
|
||||
|
||||
Angel3 framework is a high-powered HTTP server with support for dependency injection, sophisticated routing, authentication, ORM, graphql etc. It is designed to keep the core minimal but extensible through a series of plugin packages. It won't dictate which features, databases or web templating engine to use. This flexibility enable Angel3 framework to grow with your application as new features can be added to handle the new use cases.
|
||||
|
||||
This package is the core of the [Angel3](https://github.com/dukefirehawk/angel/tree/angel3) framework. To see more details, please refer to the [Developer Guide](https://angel3-docs.dukefirehawk.com).
|
||||
This package is the core package of [Angel 3](https://github.com/dukefirehawk/angel). To see more details, please refer to the [Developer Guide](https://angel3-docs.dukefirehawk.com).
|
||||
|
||||
## Installation and Setup
|
||||
|
||||
|
|
|
@ -1,16 +1,2 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
|
||||
analyzer:
|
||||
# errors:
|
||||
# always_declare_return_types: ignore
|
||||
# omit_local_variable_types: ignore
|
||||
# prefer_single_quotes: ignore
|
||||
# prefer_spread_collections: ignore
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
#linter:
|
||||
# rules:
|
||||
# - avoid_slow_async_io
|
||||
# - curly_braces_in_flow_control_structures
|
||||
# - unnecessary_const
|
||||
# - unnecessary_new
|
||||
include: package:lints/recommended.yaml
|
|
@ -3,7 +3,7 @@ import 'dart:convert';
|
|||
import 'dart:io' show stderr, Cookie;
|
||||
import 'package:angel3_http_exception/angel3_http_exception.dart';
|
||||
import 'package:angel3_route/angel3_route.dart';
|
||||
import 'package:angel3_combinator/angel3_combinator.dart';
|
||||
import 'package:belatuk_combinator/belatuk_combinator.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:stack_trace/stack_trace.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
|
|
@ -6,7 +6,7 @@ import 'dart:convert';
|
|||
import 'package:angel3_container/angel3_container.dart';
|
||||
import 'package:angel3_http_exception/angel3_http_exception.dart';
|
||||
import 'package:angel3_route/angel3_route.dart';
|
||||
import 'package:angel3_combinator/angel3_combinator.dart';
|
||||
import 'package:belatuk_combinator/belatuk_combinator.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:mime/mime.dart';
|
||||
|
|
|
@ -2,7 +2,7 @@ library angel_framework.http.service;
|
|||
|
||||
import 'dart:async';
|
||||
import 'package:angel3_http_exception/angel3_http_exception.dart';
|
||||
import 'package:angel3_merge_map/angel3_merge_map.dart';
|
||||
import 'package:belatuk_merge_map/belatuk_merge_map.dart';
|
||||
import 'package:quiver/core.dart';
|
||||
import '../util.dart';
|
||||
import 'anonymous_service.dart';
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
name: angel3_framework
|
||||
version: 4.1.3
|
||||
version: 4.2.0
|
||||
description: A high-powered HTTP server extensible framework with dependency injection, routing and much more.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/framework
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_container: ^3.0.0
|
||||
angel3_http_exception: ^3.0.0
|
||||
angel3_model: ^3.0.0
|
||||
angel3_route: ^5.0.0
|
||||
angel3_combinator: ^2.0.0
|
||||
angel3_merge_map: ^2.0.0
|
||||
angel3_route: ^5.1.0
|
||||
angel3_mock_request: ^2.0.0
|
||||
belatuk_merge_map: ^3.0.0
|
||||
belatuk_combinator: ^3.0.0
|
||||
belatuk_http_server: ^2.0.0
|
||||
charcode: ^1.2.0
|
||||
file: ^6.1.0
|
||||
http_parser: ^4.0.0
|
||||
belatuk_http_server: ^2.0.0
|
||||
http2: ^2.0.0
|
||||
logging: ^1.0.0
|
||||
matcher: ^0.12.10
|
||||
|
@ -33,5 +33,8 @@ dependencies:
|
|||
dev_dependencies:
|
||||
http: ^0.13.1
|
||||
io: ^1.0.0
|
||||
test: ^1.17.4
|
||||
pedantic: ^1.11.0
|
||||
test: ^1.17.5
|
||||
lints: ^1.0.0
|
||||
#dependency_overrides:
|
||||
# angel3_route:
|
||||
# path: ../route
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# Change Log
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* Updated to use `package:belatuk_code_buffer`
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `belatuk_symbol_table` package
|
||||
* Upgraded from `pendantic` to `lints` linter
|
||||
* Updated to use `package:belatuk_symbol_table`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.0
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Angel3 Jael
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/angel3_jael)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_jael?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/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/jael/angel_jael/LICENSE)
|
||||
|
||||
[Angel 3](https://github.com/dukefirehawk/angel/tree/angel3) support for [Jael 3](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael).
|
||||
[Angel 3](https://pub.dev/packages/angel3_framework) support for [Jael 3](https://pub.dev/packages/jael3).
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -13,7 +13,7 @@ In your `pubspec.yaml`:
|
|||
|
||||
```yaml
|
||||
dependencies:
|
||||
angel3_jael: ^4.1.0
|
||||
angel3_jael: ^4.2.0
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:angel3_framework/angel3_framework.dart';
|
||||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:jael3/jael3.dart';
|
||||
import 'package:jael3_preprocessor/jael3_preprocessor.dart';
|
||||
|
@ -17,7 +17,7 @@ AngelConfigurer jael(Directory viewsDirectory,
|
|||
bool cacheViews = false,
|
||||
Iterable<Patcher>? patch,
|
||||
bool asDSX = false,
|
||||
CodeBuffer createBuffer()?}) {
|
||||
CodeBuffer Function()? createBuffer}) {
|
||||
var cache = <String, Document?>{};
|
||||
fileExtension ??= '.jael';
|
||||
createBuffer ??= () => CodeBuffer();
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
name: angel3_jael
|
||||
version: 4.1.0
|
||||
version: 4.2.0
|
||||
description: Angel support for the Jael templating engine, similar to Blade or Liquid.
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/angel_jael
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/angel_jael
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_framework: ^4.0.0
|
||||
angel3_code_buffer: ^2.0.0
|
||||
angel3_framework: ^4.1.0
|
||||
belatuk_code_buffer: ^3.0.0
|
||||
belatuk_symbol_table: ^3.0.0
|
||||
jael3: ^4.1.0
|
||||
jael3: ^4.2.0
|
||||
jael3_preprocessor: ^4.1.0
|
||||
file: ^6.0.0
|
||||
logging: ^1.0.1
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# Change Log
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* Updated to use `package:belatuk_code_buffer`
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `belatuk_symbol_table` package
|
||||
* Upgraded from `pendantic` to `lints` linter
|
||||
* Updated to use `package:belatuk_symbol_table`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.0
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Jael 3
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.1.0-brightgreen)](https://pub.dev/packages/jael3)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3?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/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael/LICENSE)
|
||||
|
||||
A simple server-side HTML templating engine for Dart.
|
||||
|
||||
[See documentation.](https://docs.angel-dart.dev/packages/front-end/jael)
|
||||
[See documentation.](https://angel3-docs.dukefirehawk.com/packages/front-end/jael)
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -15,7 +15,7 @@ In your `pubspec.yaml`:
|
|||
|
||||
```yaml
|
||||
dependencies:
|
||||
jael3: ^4.1.0
|
||||
jael3: ^4.2.0
|
||||
```
|
||||
|
||||
## API
|
||||
|
@ -23,9 +23,9 @@ dependencies:
|
|||
The core `jael3` package exports classes for parsing Jael templates, an AST library, and a `Renderer` class that generates HTML on-the-fly.
|
||||
|
||||
```dart
|
||||
import 'package:angel3_code_buffer/code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/code_buffer.dart';
|
||||
import 'package:belatuk_symbol_table/symbol_table.dart';
|
||||
import 'package:jael3/jael.dart' as jael;
|
||||
import 'package:angel3_symbol_table/symbol_table.dart';
|
||||
|
||||
void myFunction() {
|
||||
const template = '''
|
||||
|
@ -50,5 +50,4 @@ void myFunction() {
|
|||
}
|
||||
```
|
||||
|
||||
Pre-processing (i.e. handling of blocks and includes) is handled
|
||||
by `package:jael3_preprocessor.`.
|
||||
Pre-processing (i.e. handling of blocks and includes) is handled by `package:jael3_preprocessor.`.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'package:charcode/charcode.dart';
|
||||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:jael3/jael3.dart' as jael;
|
||||
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'dart:convert';
|
||||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:collection/collection.dart' show IterableExtension;
|
||||
//import 'package:source_span/source_span.dart';
|
||||
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
name: jael3
|
||||
version: 4.1.0
|
||||
version: 4.2.0
|
||||
description: A simple server-side HTML templating engine for Dart. Comparable to Blade or Liquid.
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
args: ^2.0.0
|
||||
charcode: ^1.0.0
|
||||
angel3_code_buffer: ^2.0.0
|
||||
belatuk_code_buffer: ^3.0.0
|
||||
belatuk_symbol_table: ^3.0.0
|
||||
source_span: ^1.0.0
|
||||
string_scanner: ^1.0.0
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'dart:math';
|
||||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:jael3/jael3.dart' as jael;
|
||||
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:jael3/jael3.dart' as jael;
|
||||
import 'package:belatuk_symbol_table/belatuk_symbol_table.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# Change Log
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* Updated to use `package:belatuk_code_buffer`
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `belatuk_symbol_table` package
|
||||
* Upgraded from `pendantic` to `lints` linter
|
||||
* Updated to use `package:belatuk_symbol_table`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.1
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Jael Ppreprocessor
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dev/packages/jael3_preprocessor)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/jael3_preprocessor?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/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael_preprocessor/LICENSE)
|
||||
|
||||
A pre-processor for resolving blocks and includes within [Jael 3](https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael) templates.
|
||||
A pre-processor for resolving blocks and includes within [Jael 3](https://pub.dev/packages/jael3) templates.
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -13,19 +13,14 @@ In your `pubspec.yaml`:
|
|||
|
||||
```yaml
|
||||
dependencies:
|
||||
jael3_prepreprocessor: ^4.1.0
|
||||
jael3_prepreprocessor: ^4.2.0
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
It is unlikely that you will directly use this package, as it is
|
||||
more of an implementation detail than a requirement. However, it
|
||||
is responsible for handling `include` and `block` directives
|
||||
(template inheritance), so you are a package maintainer and want
|
||||
to support Jael, read on.
|
||||
It is unlikely that you will directly use this package, as it is more of an implementation detail than a requirement. However, it is responsible for handling `include` and `block` directives (template inheritance), so you are a package maintainer and want to support Jael, read on.
|
||||
|
||||
To keep things simple, just use the `resolve` function, which will
|
||||
take care of inheritance for you.
|
||||
To keep things simple, just use the `resolve` function, which will take care of inheritance for you.
|
||||
|
||||
```dart
|
||||
import 'package:jael3_preprocessor/jael3_preprocessor.dart' as jael;
|
||||
|
@ -36,9 +31,7 @@ myFunction() async {
|
|||
}
|
||||
```
|
||||
|
||||
You may occasionally need to manually patch in functionality that is not
|
||||
available through the official Jael packages. To achieve this, simply
|
||||
provide an `Iterable` of `Patcher` functions:
|
||||
You may occasionally need to manually patch in functionality that is not available through the official Jael packages. To achieve this, simply provide an `Iterable` of `Patcher` functions:
|
||||
|
||||
```dart
|
||||
myOtherFunction(jael.Document doc) {
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
name: jael3_preprocessor
|
||||
version: 4.1.0
|
||||
version: 4.2.0
|
||||
description: A pre-processor for resolving blocks and includes within Jael templates.
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/jael/jael_preprocessor
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/jael/jael_preprocessor
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
file: ^6.1.0
|
||||
jael3: ^4.1.0
|
||||
jael3: ^4.2.0
|
||||
belatuk_symbol_table: ^3.0.0
|
||||
collection: ^1.15.0
|
||||
dev_dependencies:
|
||||
angel3_code_buffer: ^2.0.0
|
||||
belatuk_code_buffer: ^3.0.0
|
||||
test: ^1.17.4
|
||||
lints: ^1.0.0
|
||||
#dependency_overrides:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:jael3/jael3.dart' as jael;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:jael3/jael3.dart' as jael;
|
||||
|
|
|
@ -1,15 +1,28 @@
|
|||
# 3.0.0
|
||||
# Change Log
|
||||
|
||||
## 3.1.0
|
||||
|
||||
* Updated to use `package:belatuk_merge_map`
|
||||
* Updated to use `package:belatuk_json_serializer`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 3.0.0
|
||||
|
||||
* Migrated to support Dart SDK 2.12.x NNBD
|
||||
|
||||
# 2.0.3
|
||||
* Add null-coalescing check when processing queries: https://github.com/angel-dart/mongo/pull/12
|
||||
## 2.0.3
|
||||
|
||||
* Add null-coalescing check when processing queries: <https://github.com/angel-dart/mongo/pull/12>
|
||||
|
||||
## 2.0.2
|
||||
|
||||
# 2.0.2
|
||||
* Fix flaw where clients could remove all records, even if `allowRemoveAll` were `false`.
|
||||
|
||||
# 2.0.1
|
||||
## 2.0.1
|
||||
|
||||
* Override `readMany` and `findOne`.
|
||||
|
||||
# 2.0.0-
|
||||
## 2.0.0-
|
||||
|
||||
* Delete `mongo_service_typed`.
|
||||
* Update for Angel 2.
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
The MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2016 angel-dart
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
# angel3_mongo
|
||||
[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_mongo)
|
||||
# Angel3 Mongo
|
||||
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_mongo?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/mongo/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/mongo/LICENSE)
|
||||
|
||||
MongoDB-enabled services for the Angel3 framework.
|
||||
|
||||
# Installation
|
||||
## Installation
|
||||
|
||||
Add the following to your `pubspec.yaml`:
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
angel3_mongo: ^3.0.0
|
||||
angel3_mongo: ^3.1.0
|
||||
```
|
||||
|
||||
# Usage
|
||||
## Usage
|
||||
|
||||
This library exposes one main class: `MongoService`.
|
||||
|
||||
## Model
|
||||
|
||||
`Model` is class with no real functionality; however, it represents a basic document, and your services should host inherited classes.
|
||||
Other Angel service providers host `Model` as well, so you will easily be able to modify your application if you ever switch databases.
|
||||
|
||||
|
@ -41,18 +44,24 @@ void main() async {
|
|||
```
|
||||
|
||||
## MongoService
|
||||
|
||||
This class interacts with a `DbCollection` (from mongo_dart) and serializing data to and from Maps.
|
||||
|
||||
## Querying
|
||||
|
||||
You can query these services as follows:
|
||||
|
||||
```bash
|
||||
/path/to/service?foo=bar
|
||||
```
|
||||
|
||||
The above will query the database to find records where 'foo' equals 'bar'.
|
||||
|
||||
The former will sort result in ascending order of creation, and so will the latter.
|
||||
The former will sort result in ascending order of creation, and so will the latter.
|
||||
|
||||
```dart
|
||||
List queried = await MyService.index({r"$query": where.id(new ObjectId.fromHexString("some hex string"})));
|
||||
```
|
||||
|
||||
And, of course, you can use mongo_dart queries. Just pass it as `query` within `params`.
|
||||
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
include: package:lints/recommended.yaml
|
|
@ -2,7 +2,7 @@ library angel3_mongo.services;
|
|||
|
||||
import 'dart:async';
|
||||
import 'package:angel3_framework/angel3_framework.dart';
|
||||
import 'package:angel3_merge_map/angel3_merge_map.dart';
|
||||
import 'package:belatuk_merge_map/belatuk_merge_map.dart';
|
||||
import 'package:mongo_dart/mongo_dart.dart';
|
||||
|
||||
part 'mongo_service.dart';
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
name: angel3_mongo
|
||||
version: 3.0.0
|
||||
version: 3.1.0
|
||||
description: MongoDB-enabled services for the Angel framework. Well-tested.
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/mongo
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/mongo
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_framework: ^4.0.0
|
||||
angel3_json_god: ^4.0.0
|
||||
angel3_merge_map: ^2.0.0
|
||||
angel3_framework: ^4.2.0
|
||||
belatuk_json_serializer: ^5.0.0
|
||||
belatuk_merge_map: ^3.0.0
|
||||
mongo_dart: ^0.7.0
|
||||
dev_dependencies:
|
||||
http: ^0.13.0
|
||||
pedantic: ^1.11.0
|
||||
test: ^1.17.0
|
||||
test: ^1.17.5
|
||||
lints: ^1.0.0
|
||||
#dependency_overrides:
|
||||
# angel3_framework:
|
||||
# path: ../framework
|
||||
# angel3_route:
|
||||
# path: ../route
|
|
@ -2,7 +2,7 @@ import 'package:angel3_framework/angel3_framework.dart';
|
|||
import 'package:angel3_framework/http.dart';
|
||||
import 'package:angel3_mongo/angel3_mongo.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:angel3_json_god/angel3_json_god.dart' as god;
|
||||
import 'package:belatuk_json_serializer/belatuk_json_serializer.dart' as god;
|
||||
import 'package:mongo_dart/mongo_dart.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
|
|
5
packages/route/.vscode/settings.json
vendored
5
packages/route/.vscode/settings.json
vendored
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"files.watcherExclude": {
|
||||
"**/target": true
|
||||
}
|
||||
}
|
|
@ -1,39 +1,58 @@
|
|||
# 5.0.1
|
||||
# Change Log
|
||||
|
||||
## 5.1.0
|
||||
|
||||
* Updated to use `package:belatuk_combinator`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 5.0.1
|
||||
|
||||
* Updated README
|
||||
|
||||
# 5.0.0
|
||||
## 5.0.0
|
||||
|
||||
* Migrated to support Dart SDK 2.12.x NNBD
|
||||
|
||||
# 4.0.0
|
||||
## 4.0.0
|
||||
|
||||
* Migrated to work with Dart SDK 2.12.x Non NNBD
|
||||
|
||||
# 3.1.0+1
|
||||
## 3.1.0+1
|
||||
|
||||
* Accidentally hit `CTRL-C` while uploading `3.1.0`; this version ensures everything is ok.
|
||||
|
||||
# 3.1.0
|
||||
## 3.1.0
|
||||
|
||||
* Add `Router.groupAsync`
|
||||
|
||||
# 3.0.6
|
||||
## 3.0.6
|
||||
|
||||
* Remove static default values for `middleware`.
|
||||
|
||||
# 3.0.5
|
||||
## 3.0.5
|
||||
|
||||
* Add `MiddlewarePipelineIterator`.
|
||||
|
||||
# 3.0.4
|
||||
## 3.0.4
|
||||
|
||||
* Add `RouteResult` class, which allows segments (i.e. wildcard) to
|
||||
modify the `tail`.
|
||||
* Add more wildcard tests.
|
||||
|
||||
# 3.0.3
|
||||
## 3.0.3
|
||||
|
||||
* Support trailing text after parameters with custom Regexes.
|
||||
|
||||
# 3.0.2
|
||||
## 3.0.2
|
||||
|
||||
* Support leading and trailing text for both `:parameters` and `*`
|
||||
|
||||
# 3.0.1
|
||||
## 3.0.1
|
||||
|
||||
* Make the callback in `Router.group` generically-typed.
|
||||
|
||||
# 3.0.0
|
||||
## 3.0.0
|
||||
|
||||
* Make `Router` and `Route` single-parameter generic.
|
||||
* Remove `package:browser` dependency.
|
||||
* `BrowserRouter.on` now only accepts a `String`.
|
||||
|
@ -42,8 +61,10 @@ an `Iterable<RoutingResult>`, instead of just a `List`.
|
|||
* Removed deprecated `Route.as`, as well as `Router.registerMiddleware`.
|
||||
* Completely removed `Route.requestMiddleware`.
|
||||
|
||||
# 2.0.7
|
||||
## 2.0.7
|
||||
|
||||
* Minor strong mode updates to work with stricter Dart 2.
|
||||
|
||||
# 2.0.5
|
||||
* Patch to work with `combinator@1.0.0`.
|
||||
## 2.0.5
|
||||
|
||||
* Patch to work with `combinator@1.0.0`.
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,41 +1,35 @@
|
|||
# angel3_route
|
||||
[![version](https://img.shields.io/badge/pub-v5.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_route)
|
||||
# Angel3 Route
|
||||
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_route?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/route/LICENSE)
|
||||
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/route/LICENSE)
|
||||
|
||||
A powerful, isomorphic routing library for Dart.
|
||||
|
||||
`angel3_route` exposes a routing system that takes the shape of a tree. This tree structure
|
||||
can be easily navigated, in a fashion somewhat similar to a filesystem. The `Router` API
|
||||
is a very straightforward interface that allows for your code to take a shape similar to
|
||||
the route tree. Users of Laravel and Express will be very happy.
|
||||
`angel3_route` exposes a routing system that takes the shape of a tree. This tree structure can be easily navigated, in a fashion somewhat similar to a filesystem. The `Router` API is a very straightforward interface that allows for your code to take a shape similar to the route tree. Users of Laravel and Express will be very happy.
|
||||
|
||||
`angel3_route` does not require the use of [Angel](https://github.com/dukefirehawk/angel),
|
||||
and has minimal dependencies. Thus, it can be used in any application, regardless of
|
||||
framework. This includes Web apps, Flutter apps, CLI apps, and smaller servers which do
|
||||
not need all the features of the Angel framework.
|
||||
`angel3_route` does not require the use of [Angel 3](https://pub.dev/packages/angel3_framework), and has minimal dependencies. Thus, it can be used in any application, regardless of framework. This includes Web apps, Flutter apps, CLI apps, and smaller servers which do not need all the features of the Angel framework.
|
||||
|
||||
# Contents
|
||||
## Contents
|
||||
|
||||
* [Examples](#examples)
|
||||
* [Routing](#routing)
|
||||
* [Tree Hierarchy and Path Resolution](#hierarchy)
|
||||
* [In the Browser](#in-the-browser)
|
||||
* [Route State](#route-state)
|
||||
* [Route Parameters](#route-parameters)
|
||||
|
||||
# Examples
|
||||
- [Angel3 Route](#angel3-route)
|
||||
- [Contents](#contents)
|
||||
- [Examples](#examples)
|
||||
- [Routing](#routing)
|
||||
- [Hierarchy](#hierarchy)
|
||||
- [In the Browser](#in-the-browser)
|
||||
- [Route State](#route-state)
|
||||
- [Route Parameters](#route-parameters)
|
||||
|
||||
## Routing
|
||||
If you use [Angel](https://github.com/dukefirehawk/angel), every `Angel` instance is
|
||||
a `Router` in itself.
|
||||
## Examples
|
||||
|
||||
### Routing
|
||||
|
||||
If you use [Angel 3](https://pub.dev/packages/angel3_framework), every `Angel` instance is a `Router` in itself.
|
||||
|
||||
```dart
|
||||
|
||||
main() {
|
||||
void main() {
|
||||
final router = Router();
|
||||
|
||||
router.get('/users', () {});
|
||||
|
@ -73,14 +67,12 @@ main() {
|
|||
}
|
||||
```
|
||||
|
||||
The default `Router` does not give any notification of routes being changed, because
|
||||
there is no inherent stream of URL's for it to listen to. This is good, because a server
|
||||
needs a lot of flexibility with which to handle requests.
|
||||
The default `Router` does not give any notification of routes being changed, because there is no inherent stream of URL's for it to listen to. This is good, because a server needs a lot of flexibility with which to handle requests.
|
||||
|
||||
## Hierarchy
|
||||
### Hierarchy
|
||||
|
||||
```dart
|
||||
main() {
|
||||
void main() {
|
||||
final router = Router();
|
||||
|
||||
router
|
||||
|
@ -101,20 +93,19 @@ main() {
|
|||
|
||||
See [the tests](test/route/no_params.dart) for good examples.
|
||||
|
||||
# In the Browser
|
||||
Supports both hashed routes and pushState. The `BrowserRouter` interface exposes
|
||||
a `Stream<RoutingResult> onRoute`, which can be listened to for changes. It will fire `"NULL"`
|
||||
whenever no route is matched.
|
||||
## In the Browser
|
||||
|
||||
`angel3_route` will also automatically intercept `<a>` elements and redirect them to
|
||||
your routes.
|
||||
Supports both hashed routes and pushState. The `BrowserRouter` interface exposes a `Stream<RoutingResult> onRoute`, which can be listened to for changes. It will fire `"NULL"` whenever no route is matched.
|
||||
|
||||
`angel3_route` will also automatically intercept `<a>` elements and redirect them to your routes.
|
||||
|
||||
To prevent this for a given anchor, do any of the following:
|
||||
* Do not provide an `href`
|
||||
* Provide a `download` or `target` attribute on the element
|
||||
* Set `rel="external"`
|
||||
|
||||
* Do not provide an `href`
|
||||
* Provide a `download` or `target` attribute on the element
|
||||
* Set `rel="external"`
|
||||
|
||||
# Route State
|
||||
## Route State
|
||||
|
||||
```dart
|
||||
main() {
|
||||
|
@ -130,12 +121,11 @@ main() {
|
|||
}
|
||||
```
|
||||
|
||||
For applications where you need to access a chain of handlers, consider using
|
||||
`onResolve` instead. You can see an example in `web/shared/basic.dart`.
|
||||
For applications where you need to access a chain of handlers, consider using `onResolve` instead. You can see an example in `web/shared/basic.dart`.
|
||||
|
||||
# Route Parameters
|
||||
Routes can have parameters, as seen in the above examples.
|
||||
Use `allParams` in a `RoutingResult` to get them as a nice `Map`:
|
||||
## Route Parameters
|
||||
|
||||
Routes can have parameters, as seen in the above examples. Use `allParams` in a `RoutingResult` to get them as a nice `Map`:
|
||||
|
||||
```dart
|
||||
var router = Router();
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
include: package:lints/recommended.yaml
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
library angel3_route.src.router;
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:angel3_combinator/angel3_combinator.dart';
|
||||
import 'package:belatuk_combinator/belatuk_combinator.dart';
|
||||
import 'package:string_scanner/string_scanner.dart';
|
||||
|
||||
import '../string_util.dart';
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
name: angel3_route
|
||||
version: 5.0.1
|
||||
version: 5.1.0
|
||||
description: A powerful, isomorphic routing library for Dart. It is mainly used in the Angel framework, but can be used in Flutter and on the Web.
|
||||
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/route
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/route
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_combinator: ^2.0.0
|
||||
belatuk_combinator: ^3.0.0
|
||||
string_scanner: ^1.1.0
|
||||
path: ^1.8.0
|
||||
dev_dependencies:
|
||||
build_runner: ^1.12.2
|
||||
build_web_compilers: ^2.16.5
|
||||
http: ^0.13.3
|
||||
pedantic: ^1.11.0
|
||||
test: ^1.17.4
|
||||
test: ^1.17.5
|
||||
lints: ^1.0.0
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
language: dart
|
||||
script: bash tool/.travis.sh
|
||||
dart:
|
||||
- stable
|
|
@ -1,21 +0,0 @@
|
|||
MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,427 +0,0 @@
|
|||
# serialize
|
||||
|
||||
[![Pub](https://img.shields.io/pub/v/angel_serialize.svg)](https://pub.dartlang.org/packages/angel_serialize)
|
||||
[![build status](https://travis-ci.org/angel-dart/serialize.svg)](https://travis-ci.org/angel-dart/serialize)
|
||||
|
||||
Source-generated serialization for Dart objects. This package uses `package:source_gen` to eliminate
|
||||
the time you spend writing boilerplate serialization code for your models.
|
||||
`package:angel_serialize` also powers `package:angel_orm`.
|
||||
|
||||
- [Usage](#usage)
|
||||
- [Models](#models)
|
||||
- [Subclasses](#subclasses)
|
||||
- [Field Aliases](#aliases)
|
||||
- [Excluding Keys](#excluding-keys)
|
||||
- [Required Fields](#required-fields)
|
||||
- [Adding Annotations to Generated Classes](#adding-annotations-to-generated-classes)
|
||||
- [Custom Serializers](#custom-serializers)
|
||||
- [Serialization](#serializaition)
|
||||
- [Nesting](#nesting)
|
||||
- [ID and Date Fields](#id-and-dates)
|
||||
- [Binary Data](#binary-data)
|
||||
- [TypeScript Definition Generator](#typescript-definitions)
|
||||
- [Constructor Parameters](#constructor-parameters)
|
||||
|
||||
# Usage
|
||||
|
||||
In your `pubspec.yaml`, you need to install the following dependencies:
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
angel_model: ^1.0.0
|
||||
angel_serialize: ^2.0.0
|
||||
dev_dependencies:
|
||||
angel_serialize_generator: ^2.0.0
|
||||
build_runner: ^1.0.0
|
||||
```
|
||||
|
||||
With the recent updates to `package:build_runner`, you can build models automatically,
|
||||
anywhere in your project structure,
|
||||
by running `pub run build_runner build`.
|
||||
|
||||
To tweak this:
|
||||
https://pub.dartlang.org/packages/build_config
|
||||
|
||||
If you want to watch for file changes and re-build when necessary, replace the `build` call
|
||||
with a call to `watch`. They take the same parameters.
|
||||
|
||||
# Models
|
||||
|
||||
There are a few changes opposed to normal Model classes. You need to add a `@serializable` annotation to your model
|
||||
class to have it serialized, and a serializable model class's name should also start
|
||||
with a leading underscore.
|
||||
|
||||
In addition, you may consider using an `abstract` class to ensure immutability
|
||||
of models.
|
||||
|
||||
Rather you writing the public class, `angel_serialize` does it for you. This means that the main class can have
|
||||
its constructors automatically generated, in addition into serialization functions.
|
||||
|
||||
For example, say we have a `Book` model. Create a class named `_Book`:
|
||||
|
||||
```dart
|
||||
library angel_serialize.test.models.book;
|
||||
|
||||
import 'package:angel_model/angel_model.dart';
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
part 'book.g.dart';
|
||||
|
||||
@serializable
|
||||
abstract class _Book extends Model {
|
||||
String get author;
|
||||
|
||||
@SerializableField(defaultValue: '[Untitled]')
|
||||
String get title;
|
||||
|
||||
String get description;
|
||||
|
||||
int get pageCount;
|
||||
|
||||
BookType get type;
|
||||
}
|
||||
|
||||
/// It even supports enums!
|
||||
enum BookType {
|
||||
fiction,
|
||||
nonFiction
|
||||
}
|
||||
```
|
||||
|
||||
The following file will be generated:
|
||||
|
||||
- `book.g.dart`
|
||||
|
||||
Producing these classes:
|
||||
|
||||
- `Book`: Extends or implements `_Book`; may be `const`-enabled.
|
||||
- `BookSerializer`: static functionality for serializing `Book` models.
|
||||
- `BookFields`: The names of all fields from the `Book` model, statically-available.
|
||||
- `BookEncoder`: Allows `BookSerializer` to extend `Codec<Book, Map>`.
|
||||
- `BookDecoder`: Also allows `BookSerializer` to extend `Codec<Book, Map>`.
|
||||
|
||||
And the following other features:
|
||||
- `bookSerializer`: A top-level, `const` instance of `BookSerializer`.
|
||||
- `Book.toString`: Prints out all of a `Book` instance's fields.
|
||||
|
||||
# Serialization
|
||||
|
||||
You can use the generated files as follows:
|
||||
|
||||
```dart
|
||||
myFunction() {
|
||||
var warAndPeace = new Book(
|
||||
author: 'Leo Tolstoy',
|
||||
title: 'War and Peace',
|
||||
description: 'You will cry after reading this.',
|
||||
pageCount: 1225
|
||||
);
|
||||
|
||||
// Easily serialize models into Maps
|
||||
var map = BookSerializer.toMap(warAndPeace);
|
||||
|
||||
// Also deserialize from Maps
|
||||
var book = BookSerializer.fromMap(map);
|
||||
print(book.title); // 'War and Peace'
|
||||
|
||||
// For compatibility with `JSON.encode`, a `toJson` method
|
||||
// is included that forwards to `BookSerializer.toMap`:
|
||||
expect(book.toJson(), map);
|
||||
|
||||
// Generated classes act as value types, and thus can be compared.
|
||||
expect(BookSerializer.fromMap(map), equals(warAndPeace));
|
||||
}
|
||||
```
|
||||
|
||||
As of `2.0.2`, the generated output also includes information
|
||||
about the serialized names of keys on your model class.
|
||||
|
||||
```dart
|
||||
myOtherFunction() {
|
||||
// Relying on the serialized key of a field? No worries.
|
||||
map[BookFields.author] = 'Zora Neale Hurston';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Customizing Serialization
|
||||
|
||||
Currently, these serialization methods are supported:
|
||||
|
||||
- to `Map`
|
||||
- to JSON
|
||||
- to TypeScript definitions
|
||||
|
||||
You can customize these by means of `serializers`:
|
||||
|
||||
```dart
|
||||
@Serializable(serializers: const [Serializers.map, Serializers.json])
|
||||
class _MyClass extends Model {}
|
||||
```
|
||||
|
||||
## Subclasses
|
||||
`angel_serialize` pulls in fields from parent classes, as well as
|
||||
implemented interfaces, so it is extremely easy to share attributes among
|
||||
model classes:
|
||||
|
||||
```dart
|
||||
import 'package:angel_serialize/angel_serialize.dart';
|
||||
part 'subclass.g.dart';
|
||||
|
||||
@serializable
|
||||
class _Animal {
|
||||
@notNull
|
||||
String genus;
|
||||
@notNull
|
||||
String species;
|
||||
}
|
||||
|
||||
@serializable
|
||||
class _Bird extends _Animal {
|
||||
@DefaultsTo(false)
|
||||
bool isSparrow;
|
||||
}
|
||||
|
||||
var saxaulSparrow = Bird(
|
||||
genus: 'Passer',
|
||||
species: 'ammodendri',
|
||||
isSparrow: true,
|
||||
);
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
Whereas Dart fields conventionally are camelCased, most database columns
|
||||
tend to be snake_cased. This is not a problem, because we can define an alias
|
||||
for a field.
|
||||
|
||||
By default `angel_serialize` will transform keys into snake case. Use `alias` to
|
||||
provide a custom name, or pass `autoSnakeCaseNames`: `false` to the builder;
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Spy extends Model {
|
||||
/// Will show up as 'agency_id' in serialized JSON.
|
||||
///
|
||||
/// When deserializing JSON, instead of searching for an 'agencyId' key,
|
||||
/// it will use 'agency_id'.
|
||||
///
|
||||
/// Hooray!
|
||||
String agencyId;
|
||||
|
||||
@SerializableField(alias: 'foo')
|
||||
String someOtherField;
|
||||
}
|
||||
```
|
||||
|
||||
You can also override `autoSnakeCaseNames` per model:
|
||||
|
||||
```dart
|
||||
@Serializable(autoSnakeCaseNames: false)
|
||||
abstract class _OtherCasing extends Model {
|
||||
String camelCasedField;
|
||||
}
|
||||
```
|
||||
|
||||
## Excluding Keys
|
||||
|
||||
In pratice, there may keys that you want to exclude from JSON.
|
||||
To accomplish this, simply annotate them with `@exclude`:
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Whisper extends Model {
|
||||
/// Will never be serialized to JSON
|
||||
@SerializableField(exclude: true)
|
||||
String secret;
|
||||
}
|
||||
```
|
||||
|
||||
There are times, however, when you want to only exclude either serialization
|
||||
or deserialization, but not both. For example, you might want to deserialize
|
||||
passwords from a database without sending them to users as JSON.
|
||||
|
||||
In this case, use `canSerialize` or `canDeserialize`:
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Whisper extends Model {
|
||||
/// Will never be serialized to JSON
|
||||
///
|
||||
/// ... But it can be deserialized
|
||||
@SerializableField(exclude: true, canDeserialize: true)
|
||||
String secret;
|
||||
}
|
||||
```
|
||||
|
||||
## Required Fields
|
||||
|
||||
It is easy to mark a field as required:
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Foo extends Model {
|
||||
@SerializableField(isNullable: false)
|
||||
int myRequiredInt;
|
||||
|
||||
@SerializableField(isNullable: false, errorMessage: 'Custom message')
|
||||
int myOtherRequiredInt;
|
||||
}
|
||||
```
|
||||
|
||||
The given field will be marked as `@required` in the
|
||||
generated constructor, and serializers will check for its
|
||||
presence, throwing a `FormatException` if it is missing.
|
||||
|
||||
## Adding Annotations to Generated Classes
|
||||
There are times when you need the generated class to have annotations affixed to it:
|
||||
|
||||
```dart
|
||||
@Serializable(
|
||||
includeAnnotations: [
|
||||
Deprecated('blah blah blah'),
|
||||
pragma('something...'),
|
||||
]
|
||||
)
|
||||
abstract class _Foo extends Model {}
|
||||
```
|
||||
|
||||
## Custom Serializers
|
||||
`package:angel_serialize` does not cover every known Dart data type; you can add support for your own.
|
||||
Provide `serializer` and `deserializer` arguments to `@SerializableField()` as you see fit.
|
||||
|
||||
They are typically used together. Note that the argument to `deserializer` will always be
|
||||
`dynamic`, while `serializer` can receive the data type in question.
|
||||
|
||||
In such a case, you might want to also provide a `serializesTo` argument.
|
||||
This lets the generator, as well as the ORM, apply the correct (de)serialization rules
|
||||
and validations.
|
||||
|
||||
```dart
|
||||
DateTime _dateFromString(s) => s is String ? HttpDate.parse(s) : null;
|
||||
String _dateToString(DateTime v) => v == null ? null : HttpDate.format(v);
|
||||
|
||||
@serializable
|
||||
abstract class _HttpRequest {
|
||||
@SerializableField(
|
||||
serializer: #_dateToString,
|
||||
deserializer: #_dateFromString,
|
||||
serializesTo: String)
|
||||
DateTime date;
|
||||
}
|
||||
```
|
||||
|
||||
# Nesting
|
||||
|
||||
`angel_serialize` also supports a few types of nesting of `@serializable` classes:
|
||||
|
||||
- As a class member, ex. `Book myField`
|
||||
- As the type argument to a `List`, ex. `List<Book>`
|
||||
- As the second type argument to a `Map`, ex. `Map<String, Book>`
|
||||
|
||||
In other words, the following are all legal, and will be serialized/deserialized.
|
||||
You can use either the underscored name of a child class (ex. `_Book`), or the
|
||||
generated class name (ex `Book`):
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Author extends Model {
|
||||
List<Book> books;
|
||||
Book newestBook;
|
||||
Map<String, Book> booksByIsbn;
|
||||
}
|
||||
```
|
||||
|
||||
If your model (`Author`) depends on a model defined in another file (`Book`),
|
||||
then you will need to generate `book.g.dart` before, `author.g.dart`,
|
||||
**in a separate build action**. This way, the analyzer can resolve the `Book` type.
|
||||
|
||||
# ID and Dates
|
||||
|
||||
This package will automatically generate `id`, `createdAt`, and `updatedAt` fields for you,
|
||||
in the style of an Angel `Model`. This will automatically be generated, **only** for classes
|
||||
extending `Model`.
|
||||
|
||||
# Binary Data
|
||||
|
||||
`package:angel_serialize` also handles `Uint8List` fields, by means of serialization to
|
||||
and from `base64` encoding.
|
||||
|
||||
# TypeScript Definitions
|
||||
|
||||
It is quite common to build frontends with JavaScript and/or TypeScript,
|
||||
so why not generate typings as well?
|
||||
|
||||
To accomplish this, add `Serializers.typescript` to your `@Serializable()` declaration:
|
||||
|
||||
```dart
|
||||
@Serializable(serializers: const [Serializers.map, Serializers.json, Serializers.typescript])
|
||||
class _Foo extends Model {}
|
||||
```
|
||||
|
||||
The aforementioned `_Author` class will generate the following in `author.d.ts`:
|
||||
|
||||
```typescript
|
||||
interface Author {
|
||||
id: string;
|
||||
name: string;
|
||||
age: number;
|
||||
books: Book[];
|
||||
newest_book: Book;
|
||||
created_at: any;
|
||||
updated_at: any;
|
||||
}
|
||||
interface Library {
|
||||
id: string;
|
||||
collection: BookCollection;
|
||||
created_at: any;
|
||||
updated_at: any;
|
||||
}
|
||||
interface BookCollection {
|
||||
[key: string]: Book;
|
||||
}
|
||||
```
|
||||
|
||||
Fields with an `@Exclude()` that specifies `canSerialize: false` will not be present in the
|
||||
TypeScript definition. The rationale for this is that if a field (i.e. `password`) will
|
||||
never be sent to the client, the client shouldn't even know the field exists.
|
||||
|
||||
# Constructor Parameters
|
||||
|
||||
Sometimes, you may need to have custom constructor parameters, for example, when
|
||||
using depedency injection frameworks. For these cases, `angel_serialize` can forward
|
||||
custom constructor parameters.
|
||||
|
||||
The following:
|
||||
|
||||
```dart
|
||||
@serializable
|
||||
abstract class _Bookmark extends _BookmarkBase {
|
||||
@SerializableField(exclude: true)
|
||||
final Book book;
|
||||
|
||||
int get page;
|
||||
String get comment;
|
||||
|
||||
_Bookmark(this.book);
|
||||
}
|
||||
```
|
||||
|
||||
Generates:
|
||||
|
||||
```dart
|
||||
class Bookmark extends _Bookmark {
|
||||
Bookmark(Book book,
|
||||
{this.id,
|
||||
this.page,
|
||||
this.comment,
|
||||
this.createdAt,
|
||||
this.updatedAt})
|
||||
: super(book);
|
||||
|
||||
@override
|
||||
final String id;
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
|
@ -1,5 +1,10 @@
|
|||
# Change Log
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated README
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.1
|
||||
|
||||
* Updated README
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
# Angel3 Serialization
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_serialize)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_serialize?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/serialize/angel_serialize/LICENSE)
|
||||
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/serialize/angel_serialize/LICENSE)
|
||||
|
||||
The frontend for Angel3 model serialization. See [`Documentation`](https://pub.dev/documentation/angel3_serialize/latest/)
|
||||
The frontend for Angel3 model serialization. See [`Documentation`](https://angel3-docs.dukefirehawk.com/guides/serialization)
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
include: package:lints/recommended.yaml
|
|
@ -1,5 +1,5 @@
|
|||
name: angel3_serialize
|
||||
version: 4.0.1
|
||||
version: 4.1.0
|
||||
description: Static annotations powering Angel3 model serialization. Combine with angel3_serialize_generator for flexible modeling.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/serialize/angel_serialize
|
||||
|
@ -11,5 +11,5 @@ dependencies:
|
|||
meta: ^1.3.0
|
||||
quiver: ^3.0.1
|
||||
dev_dependencies:
|
||||
pedantic: ^1.11.0
|
||||
lints: ^1.0.0
|
||||
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
# Change Log
|
||||
|
||||
## 4.3.0
|
||||
|
||||
* Updated to use `package:belatuk_code_buffer`
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* Fixed `toMap` method generation for non nullable Map
|
||||
* Fixed `fromMap` method generation for non nullable Map
|
||||
* Upgraded from `pendantic` to `lints` linter
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.1.2
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Angel3 Serialize Generator
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.2.0-brightgreen)](https://pub.dartlang.org/packages/angel3_serialize_generator)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_serialize_generator?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/serialize/angel_serialize_generator/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/serialize/angel_serialize_generator/LICENSE)
|
||||
|
||||
The builder for Angel3 model serialization.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'package:analyzer/dart/element/type.dart';
|
|||
import 'package:angel3_model/angel3_model.dart';
|
||||
import 'package:angel3_serialize/angel3_serialize.dart';
|
||||
import 'package:build/build.dart';
|
||||
import 'package:angel3_code_buffer/angel3_code_buffer.dart';
|
||||
import 'package:belatuk_code_buffer/belatuk_code_buffer.dart';
|
||||
import 'package:code_builder/code_builder.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:recase/recase.dart';
|
||||
|
|
|
@ -126,7 +126,7 @@ class ${pascal}Decoder extends Converter<Map, $pascal> {
|
|||
b
|
||||
..name = 'model'
|
||||
..type = TypeReference((b) => b
|
||||
..symbol = '$originalClassName'
|
||||
..symbol = originalClassName
|
||||
..isNullable = true);
|
||||
}));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel3_serialize_generator
|
||||
version: 4.2.0
|
||||
version: 4.3.0
|
||||
description: Angel3 model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/serialize/angel_serialize_generator
|
||||
|
@ -9,7 +9,7 @@ dependencies:
|
|||
analyzer: ^2.0.0
|
||||
angel3_model: ^3.0.0
|
||||
angel3_serialize: ^4.0.0
|
||||
angel3_code_buffer: ^2.0.0
|
||||
belatuk_code_buffer: ^3.0.0
|
||||
build: ^2.0.1
|
||||
build_config: ^1.0.0
|
||||
code_builder: ^4.0.0
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
# Change Log
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* Updated to use `package:belatuk_merge_map`
|
||||
* Updated linter to `package:lints`
|
||||
|
||||
## 4.0.1
|
||||
|
||||
* Updated README
|
||||
|
|
|
@ -1,21 +1,29 @@
|
|||
MIT License (MIT)
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2021 dukefirehawk.com
|
||||
Copyright (c) 2021, dukefirehawk.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# Angel3 Websocket Library
|
||||
# Angel3 Websocket
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_websocket)
|
||||
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_websocket?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/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/websocket/LICENSE)
|
||||
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/websocket/LICENSE)
|
||||
|
||||
WebSocket plugin for Angel3 framework. This plugin broadcasts events from hooked services via WebSockets. In addition, it adds itself to the app's IoC container as `AngelWebSocket`, so that it can be used in controllers as well.
|
||||
|
||||
|
@ -134,7 +133,7 @@ class Car extends Model {
|
|||
@override String toString() => "$year $brand $make";
|
||||
}
|
||||
|
||||
main() async {
|
||||
void main() async {
|
||||
Angel app = WebSockets("/ws");
|
||||
|
||||
// Wait for WebSocket connection...
|
||||
|
@ -155,3 +154,4 @@ main() async {
|
|||
// Authenticate a WebSocket, if you were not already authenticated...
|
||||
app.authenticateViaJwt('<some-jwt>');
|
||||
}
|
||||
```
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
include: package:pedantic/analysis_options.yaml
|
||||
analyzer:
|
||||
strong-mode:
|
||||
implicit-casts: false
|
||||
include: package:lints/recommended.yaml
|
|
@ -9,7 +9,7 @@ import 'package:angel3_auth/angel3_auth.dart';
|
|||
import 'package:angel3_framework/angel3_framework.dart';
|
||||
import 'package:angel3_framework/http.dart';
|
||||
import 'package:angel3_framework/http2.dart';
|
||||
import 'package:angel3_merge_map/angel3_merge_map.dart';
|
||||
import 'package:belatuk_merge_map/belatuk_merge_map.dart';
|
||||
import 'package:stream_channel/stream_channel.dart';
|
||||
import 'package:web_socket_channel/io.dart';
|
||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
name: angel3_websocket
|
||||
version: 4.1.0
|
||||
description: This library provides WebSockets support for Angel3 framework.
|
||||
version: 4.0.1
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/websocket
|
||||
repository: https://github.com/dukefirehawk/angel/tree/master/packages/websocket
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
dependencies:
|
||||
angel3_auth: ^4.0.0
|
||||
angel3_client: ^4.0.0
|
||||
angel3_framework: ^4.0.0
|
||||
angel3_framework: ^4.2.0
|
||||
angel3_http_exception: ^3.0.0
|
||||
angel3_merge_map: ^2.0.0
|
||||
belatuk_merge_map: ^3.0.0
|
||||
http: ^0.13.1
|
||||
meta: ^1.3.0
|
||||
stream_channel: ^2.1.0
|
||||
|
@ -20,8 +20,10 @@ dependencies:
|
|||
dev_dependencies:
|
||||
angel3_container: ^3.0.0
|
||||
angel3_model: ^3.0.0
|
||||
pedantic: ^1.11.0
|
||||
test: ^1.17.4
|
||||
|
||||
test: ^1.17.5
|
||||
lints: ^1.0.0
|
||||
#dependency_overrides:
|
||||
# angel3_framework:
|
||||
# path: ../framework
|
||||
|
||||
|
Loading…
Reference in a new issue