diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..67c7014
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+belatuk_common_utilities
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..d91ddef
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/melos_bootstrap.xml b/.idea/runConfigurations/melos_bootstrap.xml
new file mode 100644
index 0000000..d571530
--- /dev/null
+++ b/.idea/runConfigurations/melos_bootstrap.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/runConfigurations/melos_clean.xml b/.idea/runConfigurations/melos_clean.xml
new file mode 100644
index 0000000..f45d436
--- /dev/null
+++ b/.idea/runConfigurations/melos_clean.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/melos.yaml b/melos.yaml
new file mode 100644
index 0000000..435ab47
--- /dev/null
+++ b/melos.yaml
@@ -0,0 +1,4 @@
+name: belatuk_common_utilities
+
+packages:
+ - packages/*
diff --git a/melos_belatuk_common_utilities.iml b/melos_belatuk_common_utilities.iml
new file mode 100644
index 0000000..9681559
--- /dev/null
+++ b/melos_belatuk_common_utilities.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/body_parser/CHANGELOG.md b/packages/body_parser/CHANGELOG.md
index 60d76d7..b61f245 100644
--- a/packages/body_parser/CHANGELOG.md
+++ b/packages/body_parser/CHANGELOG.md
@@ -1,5 +1,14 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+* Updated `belatuk_http_server` to 4.0.0
+
## 4.0.1
* Updated `belatuk_http_server` to 3.0.0
diff --git a/packages/body_parser/README.md b/packages/body_parser/README.md
index 8eb0211..c5c71e4 100644
--- a/packages/body_parser/README.md
+++ b/packages/body_parser/README.md
@@ -30,7 +30,7 @@ A benefit of this is that primitive types are automatically deserialized correct
To install Body Parser for your Dart project, simply add body_parser to your pub dependencies.
dependencies:
- belatuk_body_parser: ^4.0.0
+ belatuk_body_parser: ^5.0.0
### Usage
diff --git a/packages/body_parser/pubspec.yaml b/packages/body_parser/pubspec.yaml
index 1134321..c1283cd 100644
--- a/packages/body_parser/pubspec.yaml
+++ b/packages/body_parser/pubspec.yaml
@@ -1,14 +1,14 @@
name: belatuk_body_parser
-version: 4.0.1
+version: 5.0.0
description: Parse request bodies and query strings in Dart. Supports JSON, URL-encoded, and multi-part bodies.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/body_parser
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
http_parser: ^4.0.0
- belatuk_http_server: ^3.0.0
+ belatuk_http_server: ^4.0.0
mime: ^1.0.0
dev_dependencies:
http: ^0.13.0
- test: ^1.17.8
+ test: ^1.24.0
lints: ^2.0.0
\ No newline at end of file
diff --git a/packages/code_buffer/CHANGELOG.md b/packages/code_buffer/CHANGELOG.md
index a325d9b..04e70b4 100644
--- a/packages/code_buffer/CHANGELOG.md
+++ b/packages/code_buffer/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/code_buffer/README.md b/packages/code_buffer/README.md
index e305835..13747b7 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: ^4.0.0
+ belatuk_code_buffer: ^5.0.0
```
## Usage
diff --git a/packages/code_buffer/pubspec.yaml b/packages/code_buffer/pubspec.yaml
index b76cf97..d6a5c3b 100644
--- a/packages/code_buffer/pubspec.yaml
+++ b/packages/code_buffer/pubspec.yaml
@@ -1,12 +1,12 @@
name: belatuk_code_buffer
-version: 4.0.0
+version: 5.0.0
description: An advanced StringBuffer geared toward generating code, and source maps.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/code_buffer
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
charcode: ^1.2.0
source_span: ^1.8.1
dev_dependencies:
- test: ^1.17.3
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/combinator/CHANGELOG.md b/packages/combinator/CHANGELOG.md
index 01f140d..0555a1f 100644
--- a/packages/combinator/CHANGELOG.md
+++ b/packages/combinator/CHANGELOG.md
@@ -1,5 +1,14 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+* Updated `belatuk_code_buffer` to 5.0.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/combinator/pubspec.yaml b/packages/combinator/pubspec.yaml
index c56b08a..e1d3928 100644
--- a/packages/combinator/pubspec.yaml
+++ b/packages/combinator/pubspec.yaml
@@ -1,15 +1,15 @@
name: belatuk_combinator
-version: 4.0.0
+version: 5.0.0
description: Packrat parser combinators that support static typing, generics, file spans, memoization, and more.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/combinator
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
- belatuk_code_buffer: ^4.0.0
+ belatuk_code_buffer: ^5.0.0
matcher: ^0.12.10
source_span: ^1.8.1
string_scanner: ^1.1.0
tuple: ^2.0.0
dev_dependencies:
- test: ^1.17.4
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/combinator/pubspec_overrides.yaml b/packages/combinator/pubspec_overrides.yaml
new file mode 100644
index 0000000..dad33fb
--- /dev/null
+++ b/packages/combinator/pubspec_overrides.yaml
@@ -0,0 +1,4 @@
+# melos_managed_dependency_overrides: belatuk_code_buffer
+#dependency_overrides:
+# belatuk_code_buffer:
+# path: ../code_buffer
diff --git a/packages/html_builder/CHANGELOG.md b/packages/html_builder/CHANGELOG.md
index e2c2d5f..099fefa 100644
--- a/packages/html_builder/CHANGELOG.md
+++ b/packages/html_builder/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/html_builder/README.md b/packages/html_builder/README.md
index b59ff25..7df12a4 100644
--- a/packages/html_builder/README.md
+++ b/packages/html_builder/README.md
@@ -10,7 +10,7 @@ This package builds HTML AST's and renders them to HTML. It can be used as an in
## Requirements
-* Dart SDK: 2.17.x or later
+* Dart SDK: 3.0.x or later
## Installation
@@ -18,7 +18,7 @@ In your `pubspec.yaml`:
```yaml
dependencies:
- belatuk_html_builder: ^4.0.0
+ belatuk_html_builder: ^5.0.0
```
## Usage
diff --git a/packages/html_builder/lib/src/mutations.dart b/packages/html_builder/lib/src/mutations.dart
index 3173163..f3cdc7e 100644
--- a/packages/html_builder/lib/src/mutations.dart
+++ b/packages/html_builder/lib/src/mutations.dart
@@ -12,9 +12,9 @@ Node Function(Node) rebuild(NodeBuilder Function(NodeBuilder) transform,
///
/// Use this alongside [rebuild].
Node Function(Node) rebuildRecursive(Node Function(Node) f) {
- Node _build(Node node) {
- return NodeBuilder.from(f(node)).mapChildren(_build).build();
+ Node build(Node node) {
+ return NodeBuilder.from(f(node)).mapChildren(build).build();
}
- return _build;
+ return build;
}
diff --git a/packages/html_builder/pubspec.yaml b/packages/html_builder/pubspec.yaml
index 26b993a..fe9fc63 100644
--- a/packages/html_builder/pubspec.yaml
+++ b/packages/html_builder/pubspec.yaml
@@ -1,12 +1,12 @@
name: belatuk_html_builder
-version: 4.0.0
+version: 5.0.0
description: Build HTML AST's and render them to HTML. This can be used as an internal DSL, i.e. for a templating engine.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/html_builder
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
- collection: ^1.15.0
+ collection: ^1.17.0
dev_dependencies:
html: ^0.15.0
- test: ^1.17.4
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/html_builder/test/render_test.dart b/packages/html_builder/test/render_test.dart
index 17a2867..e078b4f 100644
--- a/packages/html_builder/test/render_test.dart
+++ b/packages/html_builder/test/render_test.dart
@@ -1,6 +1,5 @@
import 'package:html/parser.dart' as html5;
import 'package:belatuk_html_builder/elements.dart';
-import 'package:belatuk_html_builder/belatuk_html_builder.dart';
import 'package:test/test.dart';
void main() {
diff --git a/packages/json_serializer/CHANGELOG.md b/packages/json_serializer/CHANGELOG.md
index 634a713..cd8cd38 100644
--- a/packages/json_serializer/CHANGELOG.md
+++ b/packages/json_serializer/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 7.0.0
+
+* Require Dart >= 3.0
+
+## 7.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 6.0.1
* Updated README
diff --git a/packages/json_serializer/README.md b/packages/json_serializer/README.md
index 5b26248..def3b27 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: ^6.0.0
+ belatuk_json_serializer: ^7.0.0
## Usage
diff --git a/packages/json_serializer/pubspec.yaml b/packages/json_serializer/pubspec.yaml
index 2257aac..23ee766 100644
--- a/packages/json_serializer/pubspec.yaml
+++ b/packages/json_serializer/pubspec.yaml
@@ -1,12 +1,12 @@
name: belatuk_json_serializer
-version: 6.0.1
+version: 7.0.0
description: Easy JSON to Object serialization and deserialization in Dart.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/json_serializer
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
logging: ^1.0.1
dev_dependencies:
stack_trace: ^1.10.0
- test: ^1.17.4
+ test: ^1.24.0
lints: ^2.0.0
\ No newline at end of file
diff --git a/packages/json_serializer/test/deserialization_test.dart b/packages/json_serializer/test/deserialization_test.dart
index d9d3535..9edef21 100644
--- a/packages/json_serializer/test/deserialization_test.dart
+++ b/packages/json_serializer/test/deserialization_test.dart
@@ -105,11 +105,11 @@ testDeserializationWithSchemaValidation() async {
god.deserialize(babelRcJson, outputType: BabelRc) as BabelRc;
print(deserialized.presets.runtimeType);
- expect(deserialized.presets is List, equals(true));
+ //expect(deserialized.presets is List, equals(true));
expect(deserialized.presets.length, equals(2));
expect(deserialized.presets[0], equals('es2015'));
expect(deserialized.presets[1], equals('stage-0'));
- expect(deserialized.plugins is List, equals(true));
+ //expect(deserialized.plugins is List, equals(true));
expect(deserialized.plugins.length, equals(1));
expect(deserialized.plugins[0], equals('add-module-exports'));
}
diff --git a/packages/json_serializer/test/shared.dart b/packages/json_serializer/test/shared.dart
index a35ce4f..78261c6 100644
--- a/packages/json_serializer/test/shared.dart
+++ b/packages/json_serializer/test/shared.dart
@@ -11,14 +11,14 @@ void printRecord(LogRecord rec) {
class SampleNestedClass {
String? bar;
- SampleNestedClass([String? this.bar]);
+ SampleNestedClass([this.bar]);
}
class SampleClass {
String? hello;
List nested = [];
- SampleClass([String? this.hello]);
+ SampleClass([this.hello]);
}
@WithSchemaUrl(
@@ -27,25 +27,23 @@ class BabelRc {
List presets;
List plugins;
- BabelRc(
- {List this.presets: const [],
- List this.plugins: const []});
+ BabelRc({this.presets = const [], this.plugins = const []});
}
-@WithSchema(const {
+@WithSchema({
r"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Validated Sample Class",
"description": "Sample schema for validation via JSON God",
"type": "object",
- "hello": const {"description": "A friendly greeting.", "type": "string"},
- "nested": const {
+ "hello": {"description": "A friendly greeting.", "type": "string"},
+ "nested": {
"description": "A list of NestedSampleClass items within this instance.",
"type": "array",
- "items": const {
+ "items": {
"type": "object",
- "bar": const {"description": "Filler text", "type": "string"}
+ "bar": {"description": "Filler text", "type": "string"}
}
},
- "required": const ["hello", "nested"]
+ "required": ["hello", "nested"]
})
class ValidatedSampleClass {}
diff --git a/packages/json_serializer/test/to_json_test.dart b/packages/json_serializer/test/to_json_test.dart
index 8da16ef..0e7911b 100644
--- a/packages/json_serializer/test/to_json_test.dart
+++ b/packages/json_serializer/test/to_json_test.dart
@@ -8,7 +8,7 @@ main() {
test('fromJson', () {
var foo = god.deserialize('{"bar":"baz"}', outputType: Foo) as Foo;
- expect(foo is Foo, true);
+ //expect(foo is Foo, true);
expect(foo.text, equals('baz'));
});
diff --git a/packages/merge_map/CHANGELOG.md b/packages/merge_map/CHANGELOG.md
index 6f6f95a..72187c7 100644
--- a/packages/merge_map/CHANGELOG.md
+++ b/packages/merge_map/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/merge_map/pubspec.yaml b/packages/merge_map/pubspec.yaml
index d19c995..31c3f50 100644
--- a/packages/merge_map/pubspec.yaml
+++ b/packages/merge_map/pubspec.yaml
@@ -1,9 +1,9 @@
name: belatuk_merge_map
-version: 4.0.0
+version: 5.0.0
description: Combine multiple Maps into one. Equivalent to Object.assign in JS.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/merge_map
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dev_dependencies:
- test: ^1.17.4
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/pretty_logging/AUTHORS.md b/packages/pretty_logging/AUTHORS.md
index ac95ab5..8563156 100644
--- a/packages/pretty_logging/AUTHORS.md
+++ b/packages/pretty_logging/AUTHORS.md
@@ -3,8 +3,7 @@ Primary Authors
* __[Thomas Hii](dukefirehawk.apps@gmail.com)__
- Thomas is the current maintainer of the code base. He has refactored and migrated the
- code base to support NNBD.
+ Thomas is the current maintainer of the code base. He has refactored and migrated the code base to support NNBD.
* __[Tobe O](thosakwe@gmail.com)__
diff --git a/packages/pretty_logging/CHANGELOG.md b/packages/pretty_logging/CHANGELOG.md
index 22edb40..2f3d492 100644
--- a/packages/pretty_logging/CHANGELOG.md
+++ b/packages/pretty_logging/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 6.0.0
+
+* Require Dart >= 3.0
+
+## 6.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 5.0.0
* Require Dart >= 2.17
diff --git a/packages/pretty_logging/README.md b/packages/pretty_logging/README.md
index 3877a89..9325e40 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: ^5.0.0
+ belatuk_pretty_logging: ^6.0.0
```
## Usage
diff --git a/packages/pretty_logging/pubspec.yaml b/packages/pretty_logging/pubspec.yaml
index 65576c1..549823a 100644
--- a/packages/pretty_logging/pubspec.yaml
+++ b/packages/pretty_logging/pubspec.yaml
@@ -1,11 +1,12 @@
name: belatuk_pretty_logging
-version: 5.0.0
+version: 6.0.0
description: Standalone helper for colorful logging output, using pkg:io AnsiCode.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/pretty_logging
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
io: ^1.0.0
logging: ^1.0.1
dev_dependencies:
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/pretty_logging/test/all_test.dart b/packages/pretty_logging/test/all_test.dart
new file mode 100644
index 0000000..917f186
--- /dev/null
+++ b/packages/pretty_logging/test/all_test.dart
@@ -0,0 +1,8 @@
+import 'package:test/test.dart';
+
+void main() {
+ test('test', () {
+ var message = "Testing";
+ expect(message, equals('Testing'));
+ });
+}
diff --git a/packages/pub_sub/CHANGELOG.md b/packages/pub_sub/CHANGELOG.md
index 9ba9c63..6eb4bb7 100644
--- a/packages/pub_sub/CHANGELOG.md
+++ b/packages/pub_sub/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 6.0.0
+
+* Require Dart >= 3.0
+
+## 6.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 5.0.0
* Require Dart >= 2.17
diff --git a/packages/pub_sub/README.md b/packages/pub_sub/README.md
index e205bff..5501031 100644
--- a/packages/pub_sub/README.md
+++ b/packages/pub_sub/README.md
@@ -14,10 +14,10 @@ Add `belatuk_pub_sub` as a dependency in your `pubspec.yaml` file:
```yaml
dependencies:
- belatuk_pub_sub: ^5.0.0
+ belatuk_pub_sub: ^6.0.0
```
-Then, be sure to run `pub get` in your terminal.
+Then, be sure to run `dart pub get` in your terminal.
## Usage
diff --git a/packages/pub_sub/pubspec.yaml b/packages/pub_sub/pubspec.yaml
index 0df14dd..7eb2c65 100644
--- a/packages/pub_sub/pubspec.yaml
+++ b/packages/pub_sub/pubspec.yaml
@@ -1,14 +1,14 @@
name: belatuk_pub_sub
-version: 5.0.0
+version: 6.0.0
description: Keep application instances in sync with a simple pub/sub API.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/pub_sub
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
json_rpc_2: ^3.0.0
stream_channel: ^2.1.0
uuid: ^3.0.4
- collection: ^1.15.0
+ collection: ^1.17.0
dev_dependencies:
lints: ^2.0.0
- test: ^1.17.4
+ test: ^1.24.0
diff --git a/packages/range_header/CHANGELOG.md b/packages/range_header/CHANGELOG.md
index aa3552a..9149bc2 100644
--- a/packages/range_header/CHANGELOG.md
+++ b/packages/range_header/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 6.0.0
+
+* Require Dart >= 3.0
+
+## 6.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 5.0.0
* Require Dart >= 2.17
diff --git a/packages/range_header/README.md b/packages/range_header/README.md
index 0c5b902..742ba28 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: ^5.0.0
+ belatuk_range_header: ^6.0.0
```
## Usage
diff --git a/packages/range_header/example/main.dart b/packages/range_header/example/main.dart
index a815762..46274ea 100644
--- a/packages/range_header/example/main.dart
+++ b/packages/range_header/example/main.dart
@@ -15,7 +15,9 @@ void handleRequest(HttpRequest request) async {
// Get info
header.items;
header.rangeUnit;
- header.items.forEach((item) => item.toContentRange(400));
+ for (var item in header.items) {
+ item.toContentRange(400);
+ }
// Serve the file
var transformer =
diff --git a/packages/range_header/lib/src/converter.dart b/packages/range_header/lib/src/converter.dart
index d5c5645..d0ef65a 100644
--- a/packages/range_header/lib/src/converter.dart
+++ b/packages/range_header/lib/src/converter.dart
@@ -1,7 +1,9 @@
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
-import 'dart:io' show BytesBuilder;
+//import 'dart:io' hide BytesBuilder;
+import 'dart:typed_data';
+
import 'dart:math';
import 'package:async/async.dart';
import 'package:charcode/ascii.dart';
diff --git a/packages/range_header/lib/src/exception.dart b/packages/range_header/lib/src/exception.dart
index c6b3a7b..f5c6cf1 100644
--- a/packages/range_header/lib/src/exception.dart
+++ b/packages/range_header/lib/src/exception.dart
@@ -1,8 +1,8 @@
class RangeHeaderParseException extends FormatException {
- @override
- final String message;
+ //@override
+ //final String message;
- RangeHeaderParseException(this.message);
+ RangeHeaderParseException(super.message);
@override
String toString() => 'Range header parse exception: $message';
diff --git a/packages/range_header/lib/src/parser.dart b/packages/range_header/lib/src/parser.dart
index ecc365c..2ca5ffa 100644
--- a/packages/range_header/lib/src/parser.dart
+++ b/packages/range_header/lib/src/parser.dart
@@ -9,7 +9,7 @@ import 'range_header_item.dart';
final RegExp _rgxInt = RegExp(r'[0-9]+');
final RegExp _rgxWs = RegExp(r'[ \n\r\t]');
-enum TokenType { RANGE_UNIT, COMMA, INT, DASH, EQUALS }
+enum TokenType { rangeUnit, comma, int, dash, equals }
class Token {
final TokenType type;
@@ -27,19 +27,19 @@ List scan(String text, List allowedRangeUnits) {
scanner.scan(_rgxWs);
if (scanner.scanChar($comma)) {
- tokens.add(Token(TokenType.COMMA, scanner.lastSpan));
+ tokens.add(Token(TokenType.comma, scanner.lastSpan));
} else if (scanner.scanChar($dash)) {
- tokens.add(Token(TokenType.DASH, scanner.lastSpan));
+ tokens.add(Token(TokenType.dash, scanner.lastSpan));
} else if (scanner.scan(_rgxInt)) {
- tokens.add(Token(TokenType.INT, scanner.lastSpan));
+ tokens.add(Token(TokenType.int, scanner.lastSpan));
} else if (scanner.scanChar($equal)) {
- tokens.add(Token(TokenType.EQUALS, scanner.lastSpan));
+ tokens.add(Token(TokenType.equals, scanner.lastSpan));
} else {
var matched = false;
for (var unit in allowedRangeUnits) {
if (scanner.scan(unit)) {
- tokens.add(Token(TokenType.RANGE_UNIT, scanner.lastSpan));
+ tokens.add(Token(TokenType.rangeUnit, scanner.lastSpan));
matched = true;
break;
}
@@ -98,9 +98,9 @@ class Parser {
}
RangeHeader? parseRangeHeader() {
- if (next(TokenType.RANGE_UNIT)) {
+ if (next(TokenType.rangeUnit)) {
var unit = current!.span!.text;
- next(TokenType.EQUALS); // Consume =, if any.
+ next(TokenType.equals); // Consume =, if any.
var items = [];
var item = parseHeaderItem();
@@ -108,7 +108,7 @@ class Parser {
while (item != null) {
items.add(item);
// Parse comma
- if (next(TokenType.COMMA)) {
+ if (next(TokenType.comma)) {
item = parseHeaderItem();
} else {
item = null;
@@ -126,11 +126,11 @@ class Parser {
}
RangeHeaderItem? parseHeaderItem() {
- if (next(TokenType.INT)) {
+ if (next(TokenType.int)) {
// i.e 500-544, or 600-
var start = int.parse(current!.span!.text);
- if (next(TokenType.DASH)) {
- if (next(TokenType.INT)) {
+ if (next(TokenType.dash)) {
+ if (next(TokenType.int)) {
return RangeHeaderItem(start, int.parse(current!.span!.text));
} else {
return RangeHeaderItem(start);
@@ -138,9 +138,9 @@ class Parser {
} else {
throw _expected('"-"');
}
- } else if (next(TokenType.DASH)) {
+ } else if (next(TokenType.dash)) {
// i.e. -599
- if (next(TokenType.INT)) {
+ if (next(TokenType.int)) {
return RangeHeaderItem(-1, int.parse(current!.span!.text));
} else {
throw _expected('integer');
diff --git a/packages/range_header/pubspec.yaml b/packages/range_header/pubspec.yaml
index e421cf7..54b5d08 100644
--- a/packages/range_header/pubspec.yaml
+++ b/packages/range_header/pubspec.yaml
@@ -1,18 +1,18 @@
name: belatuk_range_header
-version: 5.0.0
+version: 6.0.0
description: Range header parser for Dart. Beyond parsing, a stream transformer is included.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/range_header
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
- async: ^2.6.0
- charcode: ^1.2.0
- quiver: ^3.0.1
- source_span: ^1.8.1
- string_scanner: ^1.1.0
+ async: ^2.11.0
+ charcode: ^1.3.0
+ quiver: ^3.2.0
+ source_span: ^1.10.0
+ string_scanner: ^1.2.0
dev_dependencies:
file: ^6.1.0
http_parser: ^4.0.0
logging: ^1.0.1
- test: ^1.17.8
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/symbol_table/CHANGELOG.md b/packages/symbol_table/CHANGELOG.md
index 1a294c4..d87cb94 100644
--- a/packages/symbol_table/CHANGELOG.md
+++ b/packages/symbol_table/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/symbol_table/README.md b/packages/symbol_table/README.md
index cfb8688..abb7fac 100644
--- a/packages/symbol_table/README.md
+++ b/packages/symbol_table/README.md
@@ -12,8 +12,7 @@ and utilize basic memoization to speed up repeated lookups.
## Variables
-To represent a symbol, use `Variable`. I opted for the name
-`Variable` to avoid conflict with the Dart primitive `Symbol`.
+To represent a symbol, use `Variable`. I opted for the name `Variable` to avoid conflict with the Dart primitive `Symbol`.
```dart
var foo = Variable('foo');
diff --git a/packages/symbol_table/pubspec.yaml b/packages/symbol_table/pubspec.yaml
index 35413aa..71b32b0 100644
--- a/packages/symbol_table/pubspec.yaml
+++ b/packages/symbol_table/pubspec.yaml
@@ -1,11 +1,11 @@
name: belatuk_symbol_table
-version: 4.0.0
+version: 5.0.0
description: A generic symbol table implementation in Dart, with support for scopes and constants.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/symbol_table
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dependencies:
- collection: ^1.15.0
+ collection: ^1.17.0
dev_dependencies:
- test: ^1.17.4
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/packages/user_agent/CHANGELOG.md b/packages/user_agent/CHANGELOG.md
index e5f4881..98da8a0 100644
--- a/packages/user_agent/CHANGELOG.md
+++ b/packages/user_agent/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 5.0.0
+
+* Require Dart >= 3.0
+
+## 5.0.0-beta.1
+
+* Require Dart >= 3.0
+
## 4.0.0
* Require Dart >= 2.17
diff --git a/packages/user_agent/pubspec.yaml b/packages/user_agent/pubspec.yaml
index 7b0e078..a5e35a7 100644
--- a/packages/user_agent/pubspec.yaml
+++ b/packages/user_agent/pubspec.yaml
@@ -1,9 +1,9 @@
name: user_agent_analyzer
-version: 4.0.0
+version: 5.0.0
description: A library to identify the type of devices and web browsers based on User-Agent string.
homepage: https://github.com/dart-backend/belatuk-common-utilities/tree/main/packages/user_agent
environment:
- sdk: '>=2.17.0 <3.0.0'
+ sdk: '>=3.0.0 <4.0.0'
dev_dependencies:
- test: ^1.17.8
+ test: ^1.24.0
lints: ^2.0.0
diff --git a/pubspec.yaml b/pubspec.yaml
new file mode 100644
index 0000000..9d28025
--- /dev/null
+++ b/pubspec.yaml
@@ -0,0 +1,6 @@
+name: belatuk_common_utilities_workspace
+
+environment:
+ sdk: '>=2.18.0 <4.0.0'
+dev_dependencies:
+ melos: ^3.0.0