From cfd34cbce09b7f825fc218eecf059d05d8648da2 Mon Sep 17 00:00:00 2001 From: thomashii Date: Fri, 14 May 2021 20:24:45 +0800 Subject: [PATCH] Publish angle3_json_god --- packages/client/.gitignore | 96 +++++++++---------- packages/client/AUTHORS.md | 14 ++- packages/client/LICENSE | 4 +- packages/json_god/.gitignore | 59 +++++------- packages/json_god/AUTHORS.md | 14 ++- packages/json_god/LICENSE | 2 +- packages/json_god/README.md | 24 ++--- .../{json_god.dart => angel3_json_god.dart} | 4 +- packages/json_god/lib/src/deserialize.dart | 5 +- packages/json_god/lib/src/reflection.dart | 30 +++--- packages/json_god/lib/src/serialize.dart | 2 +- packages/json_god/lib/src/util.dart | 4 +- packages/json_god/lib/src/validation.dart | 4 +- packages/json_god/pubspec.yaml | 6 +- .../json_god/test/deserialization_test.dart | 13 ++- .../json_god/test/serialization_test.dart | 20 ++-- packages/json_god/test/shared.dart | 4 +- packages/json_god/test/to_json_test.dart | 6 +- packages/websocket/.gitignore | 59 ++++++------ packages/websocket/AUTHORS.md | 14 ++- packages/websocket/LICENSE | 4 +- 21 files changed, 197 insertions(+), 191 deletions(-) rename packages/json_god/lib/{json_god.dart => angel3_json_god.dart} (85%) diff --git a/packages/client/.gitignore b/packages/client/.gitignore index 7752ec67..24d68312 100644 --- a/packages/client/.gitignore +++ b/packages/client/.gitignore @@ -1,15 +1,34 @@ # See https://www.dartlang.org/tools/private-files.html # Files and directories created by pub -.buildlog +.dart_tool .packages -.project .pub/ build/ + +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock + +# Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. +doc/api/ + +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) +.project +.buildlog **/packages/ + # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -20,62 +39,33 @@ build/ *.info.json # Directory created by dartdoc -doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) -pubspec.lock -.idea +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 -lib/angel_client.js -*.sum +# User-specific stuff: -# Logs -logs -*.log -npm-debug.log* +## VsCode +.vscode/ -# Runtime data -pids -*.pid -*.seed -*.pid.lock +## File-based project format: +*.iws -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov +## Plugin-specific files: -# Coverage directory used by tools like istanbul -coverage +# IntelliJ +.idea/ +/out/ +.idea_modules/ -# nyc test coverage -.nyc_output +# JIRA plugin +atlassian-ide-plugin.xml -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules -jspm_packages - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -.dart_tool \ No newline at end of file +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties diff --git a/packages/client/AUTHORS.md b/packages/client/AUTHORS.md index 2a973de6..ac95ab58 100644 --- a/packages/client/AUTHORS.md +++ b/packages/client/AUTHORS.md @@ -1,2 +1,12 @@ -Tobe O -Thomas Hii \ No newline at end of file +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. + +* __[Tobe O](thosakwe@gmail.com)__ + + Tobe has written much of the original code prior to NNBD migration. He has moved on and + is no longer involved with the project. diff --git a/packages/client/LICENSE b/packages/client/LICENSE index eb4ce33e..b593ac86 100644 --- a/packages/client/LICENSE +++ b/packages/client/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2016 angel-dart +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 diff --git a/packages/json_god/.gitignore b/packages/json_god/.gitignore index 88de2609..24d68312 100644 --- a/packages/json_god/.gitignore +++ b/packages/json_god/.gitignore @@ -1,44 +1,45 @@ # See https://www.dartlang.org/tools/private-files.html -.idea -**/bower_components/ # Files and directories created by pub -.buildlog +.dart_tool .packages -.project .pub/ build/ -**/packages/ -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -# *.dart.js -*.part.js -*.js.deps -# *.js.map -*.info.json +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock # Directory created by dartdoc -doc/ +# If you don't generate documentation locally you can remove this line. +doc/api/ -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock ### Dart template # See https://www.dartlang.org/tools/private-files.html # Files and directories created by pub +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) +.project +.buildlog +**/packages/ + + # Files created by dart2js # (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) *.dart.js +*.part.js +*.js.deps +*.js.map +*.info.json + # Directory created by dartdoc + # Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) ### JetBrains template @@ -46,22 +47,9 @@ pubspec.lock # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: -.idea/tasks.xml -.idea/dictionaries -.idea/jsLibraryMappings.xml -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml - -# Gradle: -.idea/gradle.xml -# Mongo Explorer plugin: -.idea/mongoSettings.xml +## VsCode +.vscode/ ## File-based project format: *.iws @@ -69,9 +57,8 @@ pubspec.lock ## Plugin-specific files: # IntelliJ +.idea/ /out/ - -# mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin diff --git a/packages/json_god/AUTHORS.md b/packages/json_god/AUTHORS.md index 2a973de6..ac95ab58 100644 --- a/packages/json_god/AUTHORS.md +++ b/packages/json_god/AUTHORS.md @@ -1,2 +1,12 @@ -Tobe O -Thomas Hii \ No newline at end of file +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. + +* __[Tobe O](thosakwe@gmail.com)__ + + Tobe has written much of the original code prior to NNBD migration. He has moved on and + is no longer involved with the project. diff --git a/packages/json_god/LICENSE b/packages/json_god/LICENSE index 66b339ee..b593ac86 100644 --- a/packages/json_god/LICENSE +++ b/packages/json_god/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016 Tobe O +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 diff --git a/packages/json_god/README.md b/packages/json_god/README.md index c1f3b8c8..f85b53b5 100644 --- a/packages/json_god/README.md +++ b/packages/json_god/README.md @@ -1,21 +1,23 @@ -# JSON God v2 +# angel3_json_god +[![version](https://img.shields.io/badge/pub-v2.12.4-brightgreen)](https://pub.dartlang.org/packages/angel3_json_god) +[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) + +[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/json_god/LICENSE) -[![Pub](https://img.shields.io/pub/v/json_god.svg)](https://pub.dartlang.org/packages/json_god) -[![build status](https://travis-ci.org/thosakwe/json_god.svg)](https://travis-ci.org/thosakwe/json_god) The ***new and improved*** definitive solution for JSON in Dart. # Installation dependencies: - json_god: ^2.0.0-beta + angel3_json_god: ^4.0.0 # Usage It is recommended to import the library under an alias, i.e., `god`. ```dart -import 'package:json_god/json_god.dart' as god; +import 'package:angel3_json_god/angel3_json_god.dart' as god; ``` ## Serializing JSON @@ -42,13 +44,13 @@ class B { A nested; B(String hello, String foo) { this.hello = hello; - this.nested = new A(foo); + this.nested = A(foo); } } main() { - God god = new God(); - print(god.serialize(new B("world", "bar"))); + God god = God(); + print(god.serialize( B("world", "bar"))); } // Output: {"hello":"world","nested":{"foo":"bar"}} @@ -78,18 +80,18 @@ class Child { class Parent { String hello; - Child child = new Child(); + Child child = Child(); } main() { - God god = new God(); + God god = God(); Parent parent = god.deserialize('{"hello":"world","child":{"foo":"bar"}}', Parent); print(parent); } ``` **Any JSON-deserializable classes must initializable without parameters. -If `new Foo()` would throw an error, then you can't use Foo with JSON.** +If ` Foo()` would throw an error, then you can't use Foo with JSON.** This allows for validation of a sort, as only fields you have declared will be accepted. diff --git a/packages/json_god/lib/json_god.dart b/packages/json_god/lib/angel3_json_god.dart similarity index 85% rename from packages/json_god/lib/json_god.dart rename to packages/json_god/lib/angel3_json_god.dart index 44e33491..b638bd30 100644 --- a/packages/json_god/lib/json_god.dart +++ b/packages/json_god/lib/angel3_json_god.dart @@ -1,5 +1,5 @@ /// A robust library for JSON serialization and deserialization. -library json_god; +library angel3_json_god; //import 'package:dart2_constant/convert.dart'; import 'dart:convert'; @@ -15,4 +15,4 @@ part 'src/util.dart'; @deprecated bool debug = false; -final Logger logger = new Logger('json_god'); +final Logger logger = Logger('json_god'); diff --git a/packages/json_god/lib/src/deserialize.dart b/packages/json_god/lib/src/deserialize.dart index fd66e3ef..54f76398 100644 --- a/packages/json_god/lib/src/deserialize.dart +++ b/packages/json_god/lib/src/deserialize.dart @@ -1,4 +1,4 @@ -part of json_god; +part of angel3_json_god; /// Deserializes a JSON string into a Dart datum. /// @@ -14,7 +14,8 @@ deserializeJson(String s, {Type? outputType}) { logger.info("Deserializing the following JSON: $s"); if (outputType == null) { - logger.info("No output type was specified, so we are just using json.decode"); + logger + .info("No output type was specified, so we are just using json.decode"); return json.decode(s); } else { logger.info("Now deserializing to type: $outputType"); diff --git a/packages/json_god/lib/src/reflection.dart b/packages/json_god/lib/src/reflection.dart index 6d498a1e..11aef374 100644 --- a/packages/json_god/lib/src/reflection.dart +++ b/packages/json_god/lib/src/reflection.dart @@ -1,7 +1,7 @@ -library json_god.reflection; +library angel3_json_god.reflection; import 'dart:mirrors'; -import 'package:json_god/json_god.dart'; +import '../angel3_json_god.dart'; const Symbol hashCodeSymbol = #hashCode; const Symbol runtimeTypeSymbol = #runtimeType; @@ -76,8 +76,8 @@ deserialize(value, Type outputType, Deserializer deserializer, } if (typeArguments.isEmpty) return it.toList(); - logger.info('Casting list elements to ${typeArguments[0] - .reflectedType} via List.from'); + logger.info( + 'Casting list elements to ${typeArguments[0].reflectedType} via List.from'); var mirror = reflectType(List, [typeArguments[0].reflectedType]); @@ -86,7 +86,7 @@ deserialize(value, Type outputType, Deserializer deserializer, logger.info('Casted list type: ${output.runtimeType}'); return output; } else { - throw new ArgumentError( + throw ArgumentError( '${typeArguments[0].reflectedType} is not a class.'); } } else if (value is Map) @@ -107,12 +107,11 @@ _deserializeFromJsonByReflection( var typeMirror = reflectType(outputType); if (typeMirror is! ClassMirror) { - throw new ArgumentError('$outputType is not a class.'); + throw ArgumentError('$outputType is not a class.'); } var type = typeMirror; - var fromJson = - new Symbol('${MirrorSystem.getName(type.simpleName)}.fromJson'); + var fromJson = Symbol('${MirrorSystem.getName(type.simpleName)}.fromJson'); for (Symbol symbol in type.declarations.keys) { if (symbol == fromJson) { @@ -129,7 +128,7 @@ _deserializeFromJsonByReflection( } ClassMirror classMirror = type; - InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(""), []); + InstanceMirror instanceMirror = classMirror.newInstance(Symbol(""), []); if (classMirror.isSubclassOf(reflectClass(Map))) { var typeArguments = classMirror.typeArguments; @@ -143,7 +142,7 @@ _deserializeFromJsonByReflection( reflectType(Map, typeArguments.map((t) => t.reflectedType).toList()) as ClassMirror; logger.info('Casting this map $data to Map of [$typeArguments]'); - var output = mapType.newInstance(new Symbol(''), []).reflectee; + var output = mapType.newInstance(Symbol(''), []).reflectee; for (var key in data.keys) { output[key] = data[key]; @@ -159,10 +158,10 @@ _deserializeFromJsonByReflection( logger.info("data[\"$key\"] = ${data[key]}"); var deserializedValue = deserializer(data[key]); - logger.info("I want to set $key to the following ${deserializedValue - .runtimeType}: $deserializedValue"); + logger.info( + "I want to set $key to the following ${deserializedValue.runtimeType}: $deserializedValue"); // Get target type of getter - Symbol searchSymbol = new Symbol(key.toString()); + Symbol searchSymbol = Symbol(key.toString()); Symbol symbolForGetter = classMirror.instanceMembers.keys .firstWhere((x) => x == searchSymbol); Type requiredType = classMirror @@ -176,9 +175,8 @@ _deserializeFromJsonByReflection( } logger.info( - "Final deserialized value for $key: $deserializedValue <${deserializedValue - .runtimeType}>"); - instanceMirror.setField(new Symbol(key.toString()), deserializedValue); + "Final deserialized value for $key: $deserializedValue <${deserializedValue.runtimeType}>"); + instanceMirror.setField(Symbol(key.toString()), deserializedValue); logger.info("Success! $key has been set to $deserializedValue"); } catch (e, st) { diff --git a/packages/json_god/lib/src/serialize.dart b/packages/json_god/lib/src/serialize.dart index 1e1b71b9..d6ef41ff 100644 --- a/packages/json_god/lib/src/serialize.dart +++ b/packages/json_god/lib/src/serialize.dart @@ -1,4 +1,4 @@ -part of json_god; +part of angel3_json_god; /// Serializes any arbitrary Dart datum to JSON. Supports schema validation. String serialize(value) { diff --git a/packages/json_god/lib/src/util.dart b/packages/json_god/lib/src/util.dart index a562c4c8..9c1c1e8b 100644 --- a/packages/json_god/lib/src/util.dart +++ b/packages/json_god/lib/src/util.dart @@ -1,5 +1,5 @@ -part of json_god; +part of angel3_json_god; bool _isPrimitive(value) { return value is num || value is bool || value is String || value == null; -} \ No newline at end of file +} diff --git a/packages/json_god/lib/src/validation.dart b/packages/json_god/lib/src/validation.dart index eeb7f564..ac5e8c3b 100644 --- a/packages/json_god/lib/src/validation.dart +++ b/packages/json_god/lib/src/validation.dart @@ -1,4 +1,4 @@ -part of json_god; +part of angel3_json_god; /// Thrown when schema validation fails. class JsonValidationError implements Exception { @@ -7,7 +7,7 @@ class JsonValidationError implements Exception { final String cause; const JsonValidationError( - String this.cause, this.invalidData);//, Schema this.schema); + String this.cause, this.invalidData); //, Schema this.schema); } /// Specifies a schema to validate a class with. diff --git a/packages/json_god/pubspec.yaml b/packages/json_god/pubspec.yaml index cabea502..5790213b 100644 --- a/packages/json_god/pubspec.yaml +++ b/packages/json_god/pubspec.yaml @@ -1,7 +1,7 @@ -name: json_god +name: angel3_json_god version: 4.0.0 description: Easy JSON serialization and deserialization in Dart. -homepage: https://github.com/thosakwe/json_god +homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/json_god environment: sdk: '>=2.12.0 <3.0.0' dependencies: @@ -9,4 +9,4 @@ dependencies: logging: ^1.0.1 dev_dependencies: stack_trace: ^1.10.0 - test: ^1.17.3 \ No newline at end of file + test: ^1.17.4 \ No newline at end of file diff --git a/packages/json_god/test/deserialization_test.dart b/packages/json_god/test/deserialization_test.dart index df8f64aa..4e10ccd3 100644 --- a/packages/json_god/test/deserialization_test.dart +++ b/packages/json_god/test/deserialization_test.dart @@ -1,4 +1,4 @@ -import 'package:json_god/json_god.dart' as god; +import 'package:angel3_json_god/angel3_json_god.dart' as god; import 'package:test/test.dart'; import 'shared.dart'; @@ -10,7 +10,8 @@ main() { test('deserialize maps', testDeserializationOfMaps); - test('deserialize maps + reflection', testDeserializationOfMapsWithReflection); + test('deserialize maps + reflection', + testDeserializationOfMapsWithReflection); test('deserialize lists + reflection', testDeserializationOfListsAsWellAsViaReflection); @@ -33,7 +34,7 @@ testDeserializationOfMaps() { '{"hello":"world", "one": 1, "class": {"hello": "world"}}'; String nestedJson = '{"foo": {"bar": "baz", "funny": {"how": "life", "seems": 2, "hate": "us sometimes"}}}'; - var simple = god.deserialize(simpleJson ) as Map; + var simple = god.deserialize(simpleJson) as Map; var nested = god.deserialize(nestedJson) as Map; expect(simple['hello'], equals('world')); @@ -78,7 +79,8 @@ testDeserializationOfListsAsWellAsViaReflection() { ] '''; - var list = god.deserialize(json, outputType: ([]).runtimeType) as List; + var list = god.deserialize(json, outputType: ([]).runtimeType) + as List; SampleClass first = list[0]; SampleClass second = list[1]; @@ -99,7 +101,8 @@ testDeserializationWithSchemaValidation() async { String babelRcJson = '{"presets":["es2015","stage-0"],"plugins":["add-module-exports"]}'; - var deserialized = god.deserialize(babelRcJson, outputType: BabelRc) as BabelRc; + var deserialized = + god.deserialize(babelRcJson, outputType: BabelRc) as BabelRc; print(deserialized.presets.runtimeType); expect(deserialized.presets is List, equals(true)); diff --git a/packages/json_god/test/serialization_test.dart b/packages/json_god/test/serialization_test.dart index ae316f1d..7d4b5526 100644 --- a/packages/json_god/test/serialization_test.dart +++ b/packages/json_god/test/serialization_test.dart @@ -1,7 +1,7 @@ //import 'package:dart2_constant/convert.dart'; import 'dart:convert'; -import 'package:json_god/json_god.dart' as god; +import 'package:angel3_json_god/angel3_json_god.dart' as god; import 'package:test/test.dart'; import 'shared.dart'; @@ -33,7 +33,7 @@ testSerializationOfPrimitives() { } testSerializationOfDates() { - DateTime date = new DateTime.now(); + DateTime date = DateTime.now(); String s = god.serialize({'date': date}); print(s); @@ -43,8 +43,8 @@ testSerializationOfDates() { } testSerializationOfMaps() { - var simple = json.decode(god.serialize( - {'hello': 'world', 'one': 1, 'class': new SampleClass('world')})); + var simple = json.decode(god + .serialize({'hello': 'world', 'one': 1, 'class': SampleClass('world')})); var nested = json.decode(god.serialize({ 'foo': { 'bar': 'baz', @@ -66,8 +66,8 @@ testSerializationOfLists() { List pandorasBox = [ 1, "2", - {"num": 3, "four": new SampleClass('five')}, - new SampleClass('six')..nested.add(new SampleNestedClass('seven')) + {"num": 3, "four": SampleClass('five')}, + SampleClass('six')..nested.add(SampleNestedClass('seven')) ]; String s = god.serialize(pandorasBox); print(s); @@ -91,10 +91,10 @@ testSerializationOfLists() { } testSerializationViaReflection() { - SampleClass sample = new SampleClass('world'); + SampleClass sample = SampleClass('world'); for (int i = 0; i < 3; i++) { - sample.nested.add(new SampleNestedClass('baz')); + sample.nested.add(SampleNestedClass('baz')); } String s = god.serialize(sample); @@ -110,8 +110,8 @@ testSerializationViaReflection() { } testSerializationWithSchemaValidation() async { - BabelRc babelRc = new BabelRc( - presets: ['es2015', 'stage-0'], plugins: ['add-module-exports']); + BabelRc babelRc = + BabelRc(presets: ['es2015', 'stage-0'], plugins: ['add-module-exports']); String s = god.serialize(babelRc); print(s); diff --git a/packages/json_god/test/shared.dart b/packages/json_god/test/shared.dart index 8fdc9bb1..31512ce9 100644 --- a/packages/json_god/test/shared.dart +++ b/packages/json_god/test/shared.dart @@ -1,11 +1,11 @@ import 'package:logging/logging.dart'; -import 'package:json_god/json_god.dart'; +import 'package:angel3_json_god/angel3_json_god.dart'; import 'package:stack_trace/stack_trace.dart'; void printRecord(LogRecord rec) { print(rec); if (rec.error != null) print(rec.error); - if (rec.stackTrace != null) print(new Chain.forTrace(rec.stackTrace!).terse); + if (rec.stackTrace != null) print(Chain.forTrace(rec.stackTrace!).terse); } class SampleNestedClass { diff --git a/packages/json_god/test/to_json_test.dart b/packages/json_god/test/to_json_test.dart index 57fbfba2..a47c2609 100644 --- a/packages/json_god/test/to_json_test.dart +++ b/packages/json_god/test/to_json_test.dart @@ -1,4 +1,4 @@ -import 'package:json_god/json_god.dart' as god; +import 'package:angel3_json_god/angel3_json_god.dart' as god; import 'package:test/test.dart'; import 'shared.dart'; @@ -13,7 +13,7 @@ main() { }); test('toJson', () { - var foo = new Foo(text: 'baz'); + var foo = Foo(text: 'baz'); var data = god.serializeObject(foo); expect(data, equals({'bar': 'baz', 'foo': 'poobaz'})); }); @@ -26,7 +26,7 @@ class Foo { Foo({this.text}); - factory Foo.fromJson(Map json) => new Foo(text: json['bar'].toString()); + factory Foo.fromJson(Map json) => Foo(text: json['bar'].toString()); Map toJson() => {'bar': text, 'foo': foo}; } diff --git a/packages/websocket/.gitignore b/packages/websocket/.gitignore index 2a40aa1c..24d68312 100644 --- a/packages/websocket/.gitignore +++ b/packages/websocket/.gitignore @@ -1,15 +1,34 @@ # See https://www.dartlang.org/tools/private-files.html # Files and directories created by pub -.buildlog +.dart_tool .packages -.project .pub/ build/ -#**/packages/ + +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock + +# Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. +doc/api/ + +### Dart template +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub + +# SDK 1.20 and later (no longer creates packages directories) + +# Older SDK versions +# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) +.project +.buildlog +**/packages/ + # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -20,38 +39,17 @@ build/ *.info.json # Directory created by dartdoc -doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) -pubspec.lock -.idea - -log.txt ### JetBrains template # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml +## VsCode +.vscode/ ## File-based project format: *.iws @@ -59,9 +57,8 @@ log.txt ## Plugin-specific files: # IntelliJ +.idea/ /out/ - -# mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin @@ -72,5 +69,3 @@ com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties - -.dart_tool \ No newline at end of file diff --git a/packages/websocket/AUTHORS.md b/packages/websocket/AUTHORS.md index 2a973de6..ac95ab58 100644 --- a/packages/websocket/AUTHORS.md +++ b/packages/websocket/AUTHORS.md @@ -1,2 +1,12 @@ -Tobe O -Thomas Hii \ No newline at end of file +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. + +* __[Tobe O](thosakwe@gmail.com)__ + + Tobe has written much of the original code prior to NNBD migration. He has moved on and + is no longer involved with the project. diff --git a/packages/websocket/LICENSE b/packages/websocket/LICENSE index eb4ce33e..b593ac86 100644 --- a/packages/websocket/LICENSE +++ b/packages/websocket/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2016 angel-dart +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