diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..c300356 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "stable" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5d892c5..4ca57c9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ pubspec.lock .env .idea/ +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/docs/pub_example/pubspec.yaml b/docs/pub_example/pubspec.yaml index 231d877..f0a5c21 100644 --- a/docs/pub_example/pubspec.yaml +++ b/docs/pub_example/pubspec.yaml @@ -2,13 +2,15 @@ name: pub_example publish_to: none environment: - sdk: ^3.0.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: - cli_annotations: ^0.1.0-dev.3 + cli_annotations: ^0.1.0-dev.6 dev_dependencies: build_runner: ^2.4.8 - cli_gen: ^0.1.0-dev.5 - lints: ^3.0.0 + cli_gen: ^0.1.0-dev.6 + lints: ^5.0.0 test: ^1.24.0 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index bc04e09..0aa3c0f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,16 +4,18 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.0.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: args: ^2.4.2 - cli_annotations: ^0.1.0-dev.5 + cli_annotations: ^0.1.0-dev.6 dev_dependencies: build_runner: ^2.4.8 - cli_gen: ^0.1.0-dev.5 - lints: ^3.0.0 + cli_gen: ^0.1.0-dev.6 + lints: ^5.0.0 test: ^1.24.0 executables: diff --git a/pubspec.yaml b/pubspec.yaml index 4d274d1..c67cb89 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,27 +1,28 @@ -name: workspace +name: cli_gen_workspace description: The workspace for the cli_gen package. environment: - sdk: ^3.3.0 + sdk: ^3.5.0 + +workspace: + - example + - docs/pub_example + - src/cli_annotations + - src/cli_gen + - test/goldens dependencies: - analyzer: ^6.4.1 - args: ^2.4.2 - cli_annotations: ^0.1.0-dev.4 - freezed_annotation: ^2.4.1 - json_annotation: ^4.8.1 + analyzer: ^6.8.0 + args: ^2.6.0 + cli_annotations: ^0.1.0-dev.6 + freezed_annotation: ^2.4.4 + json_annotation: ^4.9.0 dev_dependencies: - build_runner: ^2.4.8 + build_runner: ^2.4.13 cli_gen: ^0.1.0-dev.4 - freezed: ^2.4.7 - json_serializable: ^6.7.1 - lints: ^3.0.0 - melos: ^4.1.0 - test: ^1.24.0 - -dependency_overrides: - cli_gen: - path: src/cli_gen - cli_annotations: - path: src/cli_annotations + freezed: ^2.5.7 + json_serializable: ^6.9.0 + lints: ^5.0.0 + melos: ^6.2.0 + test: ^1.25.9 diff --git a/src/cli_annotations/pubspec.yaml b/src/cli_annotations/pubspec.yaml index 77aefdc..74583d2 100644 --- a/src/cli_annotations/pubspec.yaml +++ b/src/cli_annotations/pubspec.yaml @@ -1,7 +1,7 @@ name: cli_annotations description: | Annotations for building CLI applications using `package:cli_gen`. -version: 0.1.0-dev.5 +version: 0.1.0-dev.6 homepage: https://github.com/pattobrien/cli-gen repository: https://github.com/pattobrien/cli-gen issue_tracker: https://github.com/pattobrien/cli-gen/issues @@ -13,7 +13,9 @@ topics: - macros environment: - sdk: ^3.0.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: args: ^2.4.2 @@ -21,5 +23,5 @@ dependencies: dev_dependencies: coverage: ^1.7.2 - lints: ^3.0.0 + lints: ^5.0.0 test: ^1.24.0 diff --git a/src/cli_gen/pubspec.yaml b/src/cli_gen/pubspec.yaml index 00aa0cf..9b0a385 100644 --- a/src/cli_gen/pubspec.yaml +++ b/src/cli_gen/pubspec.yaml @@ -2,7 +2,7 @@ name: cli_gen description: | Build CLI applications from plain Dart classes and functions, with the help of code generation. -version: 0.1.0-dev.5 +version: 0.1.0-dev.6 homepage: https://github.com/pattobrien/cli-gen repository: https://github.com/pattobrien/cli-gen issue_tracker: https://github.com/pattobrien/cli-gen/issues @@ -14,21 +14,23 @@ topics: - macros environment: - sdk: ^3.0.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: - analyzer: ^6.4.1 + analyzer: ^6.8.0 build: ^2.4.1 - cli_annotations: ^0.1.0-dev.3 - code_builder: ^4.10.0 - dart_style: ^2.3.4 - meta: ^1.12.0 + cli_annotations: ^0.1.0-dev.6 + code_builder: ^4.10.1 + dart_style: ^2.3.7 + meta: ^1.16.0 recase: ^4.1.0 source_gen: ^1.5.0 dev_dependencies: checks: ^0.3.0 - lints: ^3.0.0 - test: ^1.24.0 - coverage: ^1.7.2 - build_runner: ^2.4.8 + lints: ^5.0.0 + test: ^1.25.9 + coverage: ^1.11.0 + build_runner: ^2.4.13 diff --git a/test/goldens/lib/args/named_positional/named_positional.g.golden.dart b/test/goldens/lib/args/named_positional/named_positional.g.golden.dart index 06a50e0..b3b7a12 100644 --- a/test/goldens/lib/args/named_positional/named_positional.g.golden.dart +++ b/test/goldens/lib/args/named_positional/named_positional.g.golden.dart @@ -1,3 +1,7 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'named_positional.dart'; + // ************************************************************************** // CliRunnerGenerator // ************************************************************************** @@ -49,7 +53,7 @@ class PositionalCommand extends Command { final void Function( String, [ - String, + String?, String, ]) userMethod; @@ -64,8 +68,8 @@ class PositionalCommand extends Command { final results = argResults!; return userMethod( results['req-value'], - results['opt-value'], - results['def-value'] != null ? results['def-value'] : 'default', + (results['opt-value'] as String?) ?? null, + (results['def-value'] as String?) ?? 'default', ); } } @@ -90,7 +94,7 @@ class NamedCommand extends Command { final void Function({ required String reqValue, - String optValue, + String? optValue, String defValue, }) userMethod; @@ -105,8 +109,8 @@ class NamedCommand extends Command { final results = argResults!; return userMethod( reqValue: results['req-value'], - optValue: results['opt-value'], - defValue: results['def-value'] != null ? results['def-value'] : 'default', + optValue: (results['opt-value'] as String?) ?? null, + defValue: (results['def-value'] as String?) ?? 'default', ); } } diff --git a/test/goldens/pubspec.yaml b/test/goldens/pubspec.yaml index 8d18c9f..ad8e5a8 100644 --- a/test/goldens/pubspec.yaml +++ b/test/goldens/pubspec.yaml @@ -3,19 +3,18 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.3.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: - # cli_annotations: ^0.1.0-dev.4 - cli_annotations: - path: ../../src/cli_annotations - test: ^1.25.2 + cli_annotations: ^0.1.0-dev.6 + test: ^1.25.9 dev_dependencies: build: ^2.4.1 - build_runner: ^2.4.8 + build_runner: ^2.4.13 build_test: ^2.2.2 - cli_gen: - path: ../../src/cli_gen - lints: ^3.0.0 + cli_gen: ^0.1.0-dev.6 + lints: ^5.0.0 path: ^1.9.0