Merge pull request #1 from dart-backend/feature/sdk2.17

Upgraded to support sdk 2.17
This commit is contained in:
Thomas Hii 2022-07-06 22:33:05 +08:00 committed by GitHub
commit 3767bbf838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 294 additions and 86 deletions

12
melos_melos.iml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,4 +0,0 @@
language: dart
dart:
- dev
- stable

View file

@ -1,5 +1,9 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
## 3.0.1
* Fixed boken license link

View file

@ -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: ^3.0.0
belatuk_body_parser: ^4.0.0
### Usage

View file

@ -1,5 +1,5 @@
/// A library for parsing HTTP request bodies and queries.
library angel3_body_parser;
library belatuk_body_parser;
export 'src/body_parse_result.dart';
export 'src/file_upload_info.dart';

View file

@ -12,7 +12,7 @@ import 'file_upload_info.dart';
import 'map_from_uri.dart';
/// Forwards to [parseBodyFromStream].
@deprecated
@Deprecated("parseBodyFromStream")
Future<BodyParseResult> parseBody(HttpRequest request,
{bool storeOriginalBuffer = false}) {
return parseBodyFromStream(
@ -135,7 +135,7 @@ class _BodyParseResultImpl implements BodyParseResult {
Map<String?, dynamic> query = {};
@override
var error;
dynamic error;
@override
StackTrace? stack;

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,9 +1,9 @@
name: belatuk_body_parser
version: 3.0.1
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
http_parser: ^4.0.0
belatuk_http_server: ^2.0.0
@ -11,4 +11,4 @@ dependencies:
dev_dependencies:
http: ^0.13.0
test: ^1.17.8
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1 +0,0 @@
language: dart

View file

@ -1,5 +1,9 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
## 3.0.2
* Fixed license link

View file

@ -14,7 +14,7 @@ In your `pubspec.yaml`:
```yaml
dependencies:
belatuk_code_buffer: ^3.0.0
belatuk_code_buffer: ^4.0.0
```
## Usage

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,12 +1,12 @@
name: belatuk_code_buffer
version: 3.0.2
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
charcode: ^1.2.0
source_span: ^1.8.1
dev_dependencies:
test: ^1.17.3
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,4 +0,0 @@
language: dart
dart:
- stable
- dev

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,5 +1,10 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
* Added hashCode
## 3.0.2
* Fixed license link

View file

@ -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.12.x or later
* Dart SDK: 2.17.x or later
## Installation
@ -18,7 +18,7 @@ In your `pubspec.yaml`:
```yaml
dependencies:
belatuk_html_builder: ^3.0.0
belatuk_html_builder: ^4.0.0
```
## Usage

View file

@ -33,6 +33,12 @@ class Node {
const MapEquality<String, dynamic>()
.equals(other.attributes, attributes);
}
@override
int get hashCode {
int hash = Object.hash(tagName, Object.hashAll(children));
return Object.hash(hash, Object.hashAll(attributes.values));
}
}
/// Represents a self-closing tag, i.e. `<br>`.
@ -60,4 +66,7 @@ class TextNode extends Node {
@override
bool operator ==(other) => other is TextNode && other.text == text;
@override
int get hashCode => text.hashCode;
}

View file

@ -59,7 +59,9 @@ class _StringRendererImpl implements StringRenderer {
buf.write((html5 != false) ? '>' : '/>');
} else {
buf.write('>');
node.children.forEach((child) => _renderInto(child, buf));
for (var child in node.children) {
_renderInto(child, buf);
}
buf.write('</${node.tagName}>');
}
}
@ -118,7 +120,9 @@ class _PrettyStringRendererImpl implements StringRenderer {
buf.write((html5 != false) ? '>' : '/>');
} else {
buf.write('>');
node.children.forEach((child) => _renderInto(tabs + 1, child, buf));
for (var child in node.children) {
_renderInto(tabs + 1, child, buf);
}
buf.writeln();
_applyTabs(tabs, buf);
buf.write('</${node.tagName}>');

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,12 +1,12 @@
name: belatuk_html_builder
version: 3.0.2
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
collection: ^1.15.0
dev_dependencies:
html: ^0.15.0
test: ^1.17.4
lints: ^1.0.1
lints: ^2.0.0

View file

@ -1,4 +0,0 @@
language: dart
dart:
- dev
- stable

View file

@ -1,5 +1,9 @@
# Change Log
## 6.0.0
* Require Dart >= 2.17
## 5.0.0
* Added `lints` linter

View file

@ -12,7 +12,7 @@ The ***new and improved*** definitive solution for JSON in Dart. It supports syn
## Installation
dependencies:
belatuk_json_serializer: ^5.0.0
belatuk_json_serializer: ^6.0.0
## Usage

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,13 +1,12 @@
name: belatuk_json_serializer
version: 5.0.0
version: 6.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
#dart2_constant: ^1.0.0
logging: ^1.0.1
dev_dependencies:
stack_trace: ^1.10.0
test: ^1.17.4
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,5 +1,9 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
## 3.0.2
* Fixed license link

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,9 +1,9 @@
name: belatuk_merge_map
version: 3.0.2
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dev_dependencies:
test: ^1.17.4
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,5 +1,9 @@
# Change Log
## 5.0.0
* Require Dart >= 2.17
## 4.0.0
* Added `lints` linter

View file

@ -15,7 +15,7 @@ In your `pubspec.yaml`:
```yaml
dependencies:
belatuk_pretty_logging: ^4.0.0
belatuk_pretty_logging: ^5.0.0
```
## Usage

View file

@ -16,16 +16,18 @@ void prettyLog(LogRecord record,
printFunction ??= print;
var code = logColorChooser(record.level);
if (record.error == null) printFunction(code.wrap(record.toString())!);
if (record.error == null) {
printFunction(code.wrap(record.toString()) ?? "");
}
if (record.error != null) {
var err = record.error;
if (omitError(record)) return;
printFunction(code.wrap(record.toString() + '\n')!);
printFunction(code.wrap(err.toString())!);
printFunction(code.wrap('$record\n') ?? "");
printFunction(code.wrap(err.toString()) ?? "");
if (record.stackTrace != null) {
printFunction(code.wrap(record.stackTrace.toString())!);
printFunction(code.wrap(record.stackTrace.toString()) ?? "");
}
}
}

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,11 +1,11 @@
name: belatuk_pretty_logging
version: 4.0.0
version: 5.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
io: ^1.0.0
logging: ^1.0.1
dev_dependencies:
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1 +0,0 @@
language: dart

View file

@ -1,5 +1,9 @@
# Change Log
## 5.0.0
* Require Dart >= 2.17
## 4.0.3
* Fixed license link

View file

@ -14,7 +14,7 @@ Add `belatuk_pub_sub` as a dependency in your `pubspec.yaml` file:
```yaml
dependencies:
belatuk_pub_sub: ^4.0.0
belatuk_pub_sub: ^5.0.0
```
Then, be sure to run `pub get` in your terminal.

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,14 +1,14 @@
name: belatuk_pub_sub
version: 4.0.3
version: 5.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
json_rpc_2: ^3.0.0
stream_channel: ^2.1.0
uuid: ^3.0.4
collection: ^1.15.0
dev_dependencies:
lints: ^1.0.0
lints: ^2.0.0
test: ^1.17.4

View file

@ -1,5 +1,9 @@
# Change Log
## 5.0.0
* Require Dart >= 2.17
## 4.0.1
* Fixed license link

View file

@ -14,7 +14,7 @@ In your `pubspec.yaml`:
```yaml
dependencies:
belatuk_range_header: ^4.0.0
belatuk_range_header: ^5.0.0
```
## Usage

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,9 +1,9 @@
name: belatuk_range_header
version: 4.0.1
version: 5.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
async: ^2.6.0
charcode: ^1.2.0
@ -15,4 +15,4 @@ dev_dependencies:
http_parser: ^4.0.0
logging: ^1.0.1
test: ^1.17.8
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1,5 +1,9 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
## 3.0.1
* Fixed license link

View file

@ -99,7 +99,7 @@ class SymbolTable<T> {
}
/// Use [allVariablesWithVisibility] instead.
@deprecated
@Deprecated("allVariablesWithVisibility")
List<Variable<T>> allVariablesOfVisibility(Visibility visibility) {
return allVariablesWithVisibility(visibility);
}
@ -145,7 +145,7 @@ class SymbolTable<T> {
}
/// Use [create] instead.
@deprecated
@Deprecated("create")
Variable<T> add(String name, {T? value, bool? constant}) {
return create(name, value: value, constant: constant);
}
@ -168,7 +168,7 @@ class SymbolTable<T> {
}
/// Use [assign] instead.
@deprecated
@Deprecated("assign")
Variable<T> put(String name, T value) {
return assign(name, value);
}

View file

@ -1,13 +1,5 @@
part of symbol_table;
/// Holds an immutable symbol, the value of which is set once and only once.
@deprecated
class Constant<T> extends Variable<T> {
Constant(String name, T value) : super._(name, null, value: value) {
lock();
}
}
/// Holds a symbol, the value of which may change or be marked immutable.
class Variable<T> {
final String name;
@ -23,12 +15,6 @@ class Variable<T> {
/// If `true`, then the value of this variable cannot be overwritten.
bool get isImmutable => _locked;
/// This flag has no meaning within the context of this library, but if you
/// are implementing some sort of interpreter, you may consider acting based on
/// whether a variable is private.
@deprecated
bool get isPrivate => visibility == Visibility.private;
T? get value => _value;
set value(T? value) {
@ -42,10 +28,4 @@ class Variable<T> {
void lock() {
_locked = true;
}
/// Marks this symbol as private.
@deprecated
void markAsPrivate() {
visibility = Visibility.private;
}
}

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,11 +1,11 @@
name: belatuk_symbol_table
version: 3.0.1
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dependencies:
collection: ^1.15.0
dev_dependencies:
test: ^1.17.4
lints: ^1.0.0
lints: ^2.0.0

View file

@ -1 +0,0 @@
language: dart

View file

@ -1,5 +1,9 @@
# Change Log
## 4.0.0
* Require Dart >= 2.17
## 3.1.0
* Fixed license link

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>

View file

@ -1,9 +1,9 @@
name: user_agent_analyzer
version: 3.1.0
version: 4.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.12.0 <3.0.0'
sdk: '>=2.17.0 <3.0.0'
dev_dependencies:
test: ^1.17.8
lints: ^1.0.0
lints: ^2.0.0