From 0aee2f64da6b2b766a12a58c225a36b4944e651d Mon Sep 17 00:00:00 2001 From: "thomashii@dukefirehawk.com" Date: Thu, 16 Nov 2023 23:44:09 +0800 Subject: [PATCH] Updated lints --- packages/body_parser/README.md | 6 ++-- packages/code_buffer/README.md | 2 +- packages/code_buffer/pubspec.yaml | 2 +- packages/combinator/pubspec.yaml | 2 +- packages/html_builder/README.md | 2 +- packages/html_builder/pubspec.yaml | 2 +- packages/json_serializer/README.md | 2 +- packages/json_serializer/pubspec.yaml | 2 +- packages/merge_map/README.md | 3 +- packages/merge_map/pubspec.yaml | 2 +- packages/pretty_logging/README.md | 2 +- packages/pretty_logging/pubspec.yaml | 2 +- packages/pub_sub/README.md | 41 +++++++-------------------- packages/pub_sub/pubspec.yaml | 2 +- packages/range_header/README.md | 2 +- packages/range_header/pubspec.yaml | 2 +- packages/symbol_table/README.md | 3 +- packages/symbol_table/pubspec.yaml | 2 +- packages/user_agent/pubspec.yaml | 2 +- 19 files changed, 30 insertions(+), 53 deletions(-) diff --git a/packages/body_parser/README.md b/packages/body_parser/README.md index 05e893f..a5c7558 100644 --- a/packages/body_parser/README.md +++ b/packages/body_parser/README.md @@ -21,16 +21,14 @@ This is the request body parser powering the [Angel3 framework](https://pub.dev/ ### About -I needed something like Express.js's `body-parser` module, so I made it here. It fully supports JSON requests. x-www-form-urlencoded fully supported, as well as query strings. You can also include arrays in your query, in the same way you would for a PHP application. Full file upload support will also be present by the production 1.0.0 release. - -A benefit of this is that primitive types are automatically deserialized correctly. As in, if you have a `hello=1.5` request, then `body['hello']` will equal `1.5` and not `'1.5'`. A very semantic difference, yes, but it relieves stress in my head. +This package is similar to Express.js's `body-parser` module. It fully supports JSON, x-www-form-urlencoded as well as query strings requests. You can also include arrays in your query, in the same way you would for a PHP application. A benefit of this is that primitive types are automatically deserialized correctly. As in, if you have a `hello=1.5` request, then `body['hello']` will equal `1.5` and not `'1.5'`. ### Installation To install Body Parser for your Dart project, simply add body_parser to your pub dependencies. dependencies: - belatuk_body_parser: ^5.1.0 + belatuk_body_parser: ^8.0.0 ### Usage diff --git a/packages/code_buffer/README.md b/packages/code_buffer/README.md index 13747b7..0710eb8 100644 --- a/packages/code_buffer/README.md +++ b/packages/code_buffer/README.md @@ -14,7 +14,7 @@ In your `pubspec.yaml`: ```yaml dependencies: - belatuk_code_buffer: ^5.0.0 + belatuk_code_buffer: ^8.0.0 ``` ## Usage diff --git a/packages/code_buffer/pubspec.yaml b/packages/code_buffer/pubspec.yaml index d6a5c3b..7e6d388 100644 --- a/packages/code_buffer/pubspec.yaml +++ b/packages/code_buffer/pubspec.yaml @@ -9,4 +9,4 @@ dependencies: source_span: ^1.8.1 dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/combinator/pubspec.yaml b/packages/combinator/pubspec.yaml index e1d3928..72b39a9 100644 --- a/packages/combinator/pubspec.yaml +++ b/packages/combinator/pubspec.yaml @@ -12,4 +12,4 @@ dependencies: tuple: ^2.0.0 dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 \ No newline at end of file diff --git a/packages/html_builder/README.md b/packages/html_builder/README.md index 7df12a4..2212166 100644 --- a/packages/html_builder/README.md +++ b/packages/html_builder/README.md @@ -18,7 +18,7 @@ In your `pubspec.yaml`: ```yaml dependencies: - belatuk_html_builder: ^5.0.0 + belatuk_html_builder: ^8.0.0 ``` ## Usage diff --git a/packages/html_builder/pubspec.yaml b/packages/html_builder/pubspec.yaml index fe9fc63..1c0ae04 100644 --- a/packages/html_builder/pubspec.yaml +++ b/packages/html_builder/pubspec.yaml @@ -9,4 +9,4 @@ dependencies: dev_dependencies: html: ^0.15.0 test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/json_serializer/README.md b/packages/json_serializer/README.md index def3b27..03a6722 100644 --- a/packages/json_serializer/README.md +++ b/packages/json_serializer/README.md @@ -12,7 +12,7 @@ The ***new and improved*** definitive solution for JSON in Dart. It supports syn ## Installation dependencies: - belatuk_json_serializer: ^7.0.0 + belatuk_json_serializer: ^8.0.0 ## Usage diff --git a/packages/json_serializer/pubspec.yaml b/packages/json_serializer/pubspec.yaml index 23ee766..75cccd3 100644 --- a/packages/json_serializer/pubspec.yaml +++ b/packages/json_serializer/pubspec.yaml @@ -9,4 +9,4 @@ dependencies: dev_dependencies: stack_trace: ^1.10.0 test: ^1.24.0 - lints: ^2.0.0 \ No newline at end of file + lints: ^3.0.0 \ No newline at end of file diff --git a/packages/merge_map/README.md b/packages/merge_map/README.md index 2f56a18..b18cd1d 100644 --- a/packages/merge_map/README.md +++ b/packages/merge_map/README.md @@ -7,8 +7,7 @@ **Replacement of `package:merge_map` with breaking changes to support NNBD.** Combine multiple Maps into one. Equivalent to -[Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -in JS. +[Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) in JS. ## Example diff --git a/packages/merge_map/pubspec.yaml b/packages/merge_map/pubspec.yaml index 31c3f50..de9c43d 100644 --- a/packages/merge_map/pubspec.yaml +++ b/packages/merge_map/pubspec.yaml @@ -6,4 +6,4 @@ environment: sdk: '>=3.0.0 <4.0.0' dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/pretty_logging/README.md b/packages/pretty_logging/README.md index 9325e40..db09cf0 100644 --- a/packages/pretty_logging/README.md +++ b/packages/pretty_logging/README.md @@ -15,7 +15,7 @@ In your `pubspec.yaml`: ```yaml dependencies: - belatuk_pretty_logging: ^6.0.0 + belatuk_pretty_logging: ^8.0.0 ``` ## Usage diff --git a/packages/pretty_logging/pubspec.yaml b/packages/pretty_logging/pubspec.yaml index 549823a..e546dda 100644 --- a/packages/pretty_logging/pubspec.yaml +++ b/packages/pretty_logging/pubspec.yaml @@ -9,4 +9,4 @@ dependencies: logging: ^1.0.1 dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/pub_sub/README.md b/packages/pub_sub/README.md index 5501031..bb4867b 100644 --- a/packages/pub_sub/README.md +++ b/packages/pub_sub/README.md @@ -14,7 +14,7 @@ Add `belatuk_pub_sub` as a dependency in your `pubspec.yaml` file: ```yaml dependencies: - belatuk_pub_sub: ^6.0.0 + belatuk_pub_sub: ^8.0.0 ``` Then, be sure to run `dart pub get` in your terminal. @@ -22,17 +22,13 @@ Then, be sure to run `dart pub get` in your terminal. ## Usage `belatuk_pub_sub` is your typical pub/sub API. However, `belatuk_pub_sub` enforces authentication of every -request. It is very possible that `belatuk_pub_sub` will run on both servers and in the browser, -or on a platform belatuk_pub_sublike Flutter. Thus, there are provisions available to limit -access. +request. It is very possible that `belatuk_pub_sub` will run on both server and in the browser, +or on a platform like Flutter. **Be careful to not leak any `belatuk_pub_sub` client ID's if operating over a network.** -If you do, you risk malicious users injecting events into your application, which -could ultimately spell *disaster*. +If you do, you run the risk of malicious users injecting events into your application. -A `belatuk_pub_sub` server can operate across multiple *adapters*, which take care of interfacing data over different -media. For example, a single server can handle pub/sub between multiple Isolates and TCP Sockets, as well as -WebSockets, simultaneously. +A `belatuk_pub_sub` server can operate across multiple *adapters*, which take care of interfacing data over different media. For example, a single server can handle pub/sub between multiple Isolates and TCP Sockets, as well as WebSockets, simultaneously. ```dart import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub; @@ -52,13 +48,7 @@ main() async { ### Trusted Clients -You can use `package:belatuk_pub_sub` without explicitly registering -clients, *if and only if* those clients come from trusted sources. - -Clients via `Isolate` are always trusted. - -Clients via `package:json_rpc_2` must be explicitly marked -as trusted (i.e. using an IP whitelist mechanism): +You can use `package:belatuk_pub_sub` without explicitly registering clients, *if and only if* those clients come from trusted sources. Clients via `Isolate` are always trusted. Clients via `package:json_rpc_2` must be explicitly marked as trusted (i.e. using an IP whitelist mechanism): ```dart JsonRpc2Adapter(..., isTrusted: false); @@ -71,8 +61,7 @@ pub_sub.IsolateClient(null); The ID's of all *untrusted* clients who will connect to the server must be known at start-up time. You may not register new clients after the server has started. This is mostly a security consideration; -if it is impossible to register new clients, then malicious users cannot grant themselves additional -privileges within the system. +mainly to make it impossible to register new clients, thus preventing malicious users from granting themselves additional privileges within the system. ```dart import 'package:belatuk_pub_sub/belatuk_pub_sub.dart' as pub_sub; @@ -96,10 +85,7 @@ void main() async { ### Isolates -If you are just running multiple instances of a server, -use `package:belatuk_pub_sub/isolate.dart`. - -You'll need one isolate to be the master. Typically this is the first isolate you create. +If you are just running multiple instances of a server, use `package:belatuk_pub_sub/isolate.dart`. You'll need one isolate to be the master. Typically this is the first isolate you create. ```dart import 'dart:io'; @@ -157,9 +143,7 @@ Check out `test/json_rpc_2_test.dart` for an example of serving `belatuk_pub_sub ## Protocol -`belatuk_pub_sub` is built upon a simple RPC, and this package includes -an implementation that runs via `SendPort`s and `ReceivePort`s, as -well as one that runs on any `StreamChannel`. +`belatuk_pub_sub` is built upon a simple RPC, and this package includes an implementation that runs via `SendPort`s and `ReceivePort`s, as well as one that runs on any `StreamChannel`. Data sent over the wire looks like the following: @@ -219,14 +203,11 @@ In the case of Isolate clients/servers, events will be simply sent as Lists: ['', value] ``` -Clients can send the following (3) methods: +Clients can send with the following 3 methods: * `subscribe` (`event_name`:string): Subscribe to an event. * `unsubscribe` (`subscription_id`:string): Unsubscribe from an event you previously subscribed to. * `publish` (`event_name`:string, `value`:any): Publish an event to all other clients who are subscribed. -The client and server in `package:belatuk_pub_sub/isolate.dart` must make extra -provisions to keep track of client ID's. Since `SendPort`s and `ReceivePort`s -do not have any sort of guaranteed-unique ID's, new clients must send their -`SendPort` to the server before sending any requests. The server then responds +The client and server in `package:belatuk_pub_sub/isolate.dart` must make extra provisions to keep track of client ID's. Since `SendPort`s and `ReceivePort`s do not have any sort of guaranteed-unique ID's, new clients must send their `SendPort` to the server before sending any requests. The server then responds with an `id` that must be used to identify a `SendPort` to send a response to. diff --git a/packages/pub_sub/pubspec.yaml b/packages/pub_sub/pubspec.yaml index 63f7067..73bd96b 100644 --- a/packages/pub_sub/pubspec.yaml +++ b/packages/pub_sub/pubspec.yaml @@ -10,5 +10,5 @@ dependencies: uuid: ^4.0.0 collection: ^1.17.0 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.24.0 diff --git a/packages/range_header/README.md b/packages/range_header/README.md index 742ba28..eb02430 100644 --- a/packages/range_header/README.md +++ b/packages/range_header/README.md @@ -14,7 +14,7 @@ In your `pubspec.yaml`: ```yaml dependencies: - belatuk_range_header: ^6.0.0 + belatuk_range_header: ^8.0.0 ``` ## Usage diff --git a/packages/range_header/pubspec.yaml b/packages/range_header/pubspec.yaml index 6de9eab..e6c6e1d 100644 --- a/packages/range_header/pubspec.yaml +++ b/packages/range_header/pubspec.yaml @@ -15,4 +15,4 @@ dev_dependencies: http_parser: ^4.0.0 logging: ^1.0.1 test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/symbol_table/README.md b/packages/symbol_table/README.md index abb7fac..c1457e8 100644 --- a/packages/symbol_table/README.md +++ b/packages/symbol_table/README.md @@ -30,8 +30,7 @@ foo.value = 'baz'; // Also throws a StateError - Once a variable is locked, it c ## Visibility -Variables are *public* by default, but can also be marked as *private* or *protected*. This can be helpful if you are trying -to determine which symbols should be exported from a library or class. +Variables are *public* by default, but can also be marked as *private* or *protected*. This can be helpful if you are trying to determine which symbols should be exported from a library or class. ```dart myVariable.visibility = Visibility.protected; diff --git a/packages/symbol_table/pubspec.yaml b/packages/symbol_table/pubspec.yaml index 71b32b0..42deea2 100644 --- a/packages/symbol_table/pubspec.yaml +++ b/packages/symbol_table/pubspec.yaml @@ -8,4 +8,4 @@ dependencies: collection: ^1.17.0 dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/packages/user_agent/pubspec.yaml b/packages/user_agent/pubspec.yaml index a5e35a7..d7ff4af 100644 --- a/packages/user_agent/pubspec.yaml +++ b/packages/user_agent/pubspec.yaml @@ -6,4 +6,4 @@ environment: sdk: '>=3.0.0 <4.0.0' dev_dependencies: test: ^1.24.0 - lints: ^2.0.0 + lints: ^3.0.0