Skip to content

Commit

Permalink
chore: include examples in workspace, fix generations/parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mathew65 committed Jan 15, 2025
1 parent dce2758 commit 457b067
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/drift/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
1 change: 1 addition & 0 deletions examples/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
1 change: 1 addition & 0 deletions examples/freezed/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
1 change: 1 addition & 0 deletions examples/injectable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
1 change: 1 addition & 0 deletions examples/json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
1 change: 1 addition & 0 deletions packages/auto_mappr/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ class MapModelBodyMethodBuilder {
? mapping.whenSourceIsNullExpression!.returned
: refer('Exception').newInstance([
refer(
"r'Mapping $mapping failed because ${mapping.source} was null, and no default value was provided. \n Consider setting the whenSourceIsNull parameter on the MapType<${mapping.source}, ${mapping.target}> to handle null values during mapping.'",
// ignore: avoid-adjacent-strings, to avoid parsing the errors in tests
"r'Mapping $mapping failed because ${mapping.source} was null, and no default value was provided. '\n"
"r'Consider setting the whenSourceIsNull parameter on the MapType<${mapping.source}, ${mapping.target}> to handle null values during mapping.'",
),
]).thrown;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: prefer-abstract-final-static-class

import 'package:auto_mappr_annotation/auto_mappr_annotation.dart';
import 'package:equatable/equatable.dart';

Expand Down Expand Up @@ -41,13 +43,13 @@ class InstanceGetter {
set value(int value) => _value = value;
}

abstract final class StaticField {
class StaticField {
// ignore: avoid-global-state, for testing
static int value = 666;
static const String secondValue = 'test 3';
}

abstract final class StaticGetter {
class StaticGetter {
static int? _value;

static int get value => _value ?? 0;
Expand Down
1 change: 1 addition & 0 deletions packages/auto_mappr_annotation/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ publish_to: none

environment:
sdk: ^3.6.0
resolution: workspace

dependencies:
auto_mappr_annotation: ^2.3.0
Expand Down
7 changes: 7 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ publish_to: "none"
workspace:
- packages/auto_mappr
- packages/auto_mappr_annotation
- packages/auto_mappr/example
- packages/auto_mappr_annotation/example
- examples/drift
- examples/example
- examples/freezed
- examples/injectable
- examples/json_serializable

environment:
sdk: ^3.6.0
Expand Down

0 comments on commit 457b067

Please sign in to comment.