Skip to content

Commit

Permalink
chore: more dependency cleanups, use records (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed May 30, 2024
1 parent ce51282 commit 7af9bd6
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 32 deletions.
4 changes: 2 additions & 2 deletions dartfn/lib/src/generators/cloudevent.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dartfn/lib/src/generators/helloworld.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dartfn/lib/src/generators/json.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dartfn/templates/cloudevent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.0
functions_framework_builder: ^0.4.1
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
dart_flutter_team_lints: ^3.0.0
test: ^1.16.6
test_process: ^2.0.0
2 changes: 1 addition & 1 deletion dartfn/templates/helloworld/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.0
functions_framework_builder: ^0.4.1
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
dart_flutter_team_lints: ^3.0.0
test: ^1.16.6
test_process: ^2.0.0
4 changes: 2 additions & 2 deletions dartfn/templates/json/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ environment:

dependencies:
functions_framework: ^0.4.0
json_annotation: ^4.8.1
json_annotation: ^4.9.0
shelf: ^1.0.0

dev_dependencies:
build_runner: ^2.2.1
functions_framework_builder: ^0.4.7
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
json_serializable: ^6.6.0
dart_flutter_team_lints: ^3.0.0
test: ^1.21.6
Expand Down
4 changes: 2 additions & 2 deletions examples/fullstack/backend/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ environment:

dependencies:
functions_framework: ^0.4.0
json_annotation: ^4.8.1
json_annotation: ^4.9.0
shelf: ^1.0.0

dev_dependencies:
build_runner: ^2.2.1
dart_flutter_team_lints: ^3.0.0
functions_framework_builder: ^0.4.7
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
json_serializable: ^6.6.0
test: ^1.21.6
test_process: ^2.0.0
2 changes: 1 addition & 1 deletion examples/fullstack/frontend-cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executables:
dependencies:
http: '>=0.13.1 <2.0.0'
io: ^1.0.0
json_annotation: ^4.8.1
json_annotation: ^4.9.0

dev_dependencies:
build_runner: ^2.2.1
Expand Down
4 changes: 2 additions & 2 deletions examples/fullstack/frontend/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter
http: '>=0.13.0 <2.0.0'
json_annotation: ^4.8.1
http: ^1.0.0
json_annotation: ^4.9.0
provider: ^6.0.0

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion examples/hello/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dev_dependencies:
build_runner: ^2.0.0
dart_flutter_team_lints: ^3.0.0
functions_framework_builder: ^0.4.1
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
test: ^1.16.6
test_process: ^2.0.0
4 changes: 2 additions & 2 deletions examples/json/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ environment:

dependencies:
functions_framework: ^0.4.0
json_annotation: ^4.8.1
json_annotation: ^4.9.0
shelf: ^1.0.0

dev_dependencies:
build_runner: ^2.2.1
dart_flutter_team_lints: ^3.0.0
functions_framework_builder: ^0.4.7
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
json_serializable: ^6.6.0
test: ^1.21.6
test_process: ^2.0.0
2 changes: 1 addition & 1 deletion examples/raw_cloudevent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ dev_dependencies:
build_runner: ^2.0.0
dart_flutter_team_lints: ^3.0.0
functions_framework_builder: ^0.4.1
http: '>=0.13.0 <2.0.0'
http: ^1.0.0
test: ^1.16.6
test_process: ^2.0.0
2 changes: 1 addition & 1 deletion functions_framework/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
http: ">=0.13.5 <2.0.0"
http_parser: ^4.0.0
io: ^1.0.3
json_annotation: ^4.8.1
json_annotation: ^4.9.0
meta: ^1.7.0
shelf: ^1.4.0
stack_trace: ^1.11.0
Expand Down
11 changes: 3 additions & 8 deletions functions_framework_builder/lib/src/valid_json_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ bool _validJsonType(DartType type, bool allowComplexMembers) {
return false;
}

class JsonParamInfo {
final DartType jsonType;
final InterfaceType? paramType;

JsonParamInfo._(this.jsonType, this.paramType);
}
typedef JsonParamInfo = ({DartType jsonType, InterfaceType? paramType});

JsonParamInfo? validJsonParamType(DartType type) {
// Look for a `fromJson` factory that takes a JSON-able type
Expand All @@ -68,14 +63,14 @@ JsonParamInfo? validJsonParamType(DartType type) {
if (requiredParams.length == 1) {
final paramType = requiredParams.single.type;
if (_validJsonType(paramType, false)) {
return JsonParamInfo._(paramType, type);
return (jsonType: paramType, paramType: type);
}
}
}
}

if (_validJsonType(type, false)) {
return JsonParamInfo._(type, null);
return (jsonType: type, paramType: null);
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion integration_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:

dependencies:
functions_framework: ^0.4.3+1
json_annotation: ^4.8.1
json_annotation: ^4.9.0
shelf: ^1.4.0

dev_dependencies:
Expand Down

0 comments on commit 7af9bd6

Please sign in to comment.