diff --git a/CHANGELOG.md b/CHANGELOG.md index 071ad77..1c180d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 7.1.0 + +* Required Dart >= 2.18.x +* Updated `analyzer` to 5.x.x + ## 7.0.0 * Required Dart >= 2.17.x diff --git a/lib/src/commands/rename.dart b/lib/src/commands/rename.dart index 84923c3..7fbbb3f 100644 --- a/lib/src/commands/rename.dart +++ b/lib/src/commands/rename.dart @@ -225,11 +225,13 @@ class RenamingVisitor extends RecursiveAstVisitor { @override void visitLibraryDirective(LibraryDirective node) { - var name = node.name.name; + var name = node.name2?.name; - if (name.startsWith(oldName)) { - replace[[node.offset, node.end]] = - 'library ${name.replaceFirst(oldName, newName)};'; + if (name != null) { + if (name.startsWith(oldName)) { + replace[[node.offset, node.end]] = + 'library ${name.replaceFirst(oldName, newName)};'; + } } } diff --git a/lib/src/commands/service_generators/custom.dart b/lib/src/commands/service_generators/custom.dart index 9008b69..7d70c43 100644 --- a/lib/src/commands/service_generators/custom.dart +++ b/lib/src/commands/service_generators/custom.dart @@ -2,12 +2,6 @@ import 'package:code_builder/code_builder.dart'; import 'generator.dart'; class CustomServiceGenerator extends ServiceGenerator { - @override - bool get createsModel => false; - - @override - bool get createsValidator => false; - const CustomServiceGenerator() : super('Custom'); @override diff --git a/lib/src/commands/service_generators/generator.dart b/lib/src/commands/service_generators/generator.dart index 6328958..6cd76ae 100644 --- a/lib/src/commands/service_generators/generator.dart +++ b/lib/src/commands/service_generators/generator.dart @@ -8,6 +8,7 @@ class ServiceGenerator { List get dependencies => []; + /* @deprecated bool get createsModel => true; @@ -22,6 +23,7 @@ class ServiceGenerator { @deprecated bool get shouldRunBuild => false; + */ bool get goesFirst => false; diff --git a/lib/src/commands/service_generators/map.dart b/lib/src/commands/service_generators/map.dart index 545961d..e6482a5 100644 --- a/lib/src/commands/service_generators/map.dart +++ b/lib/src/commands/service_generators/map.dart @@ -4,9 +4,6 @@ import 'package:code_builder/code_builder.dart'; class MapServiceGenerator extends ServiceGenerator { const MapServiceGenerator() : super('In-Memory'); - @override - bool get createsModel => false; - @override Expression createInstance(LibraryBuilder library, MethodBuilder methodBuilder, String name, String lower) { diff --git a/lib/src/commands/service_generators/mongo.dart b/lib/src/commands/service_generators/mongo.dart index 0e84fce..9ce01b2 100644 --- a/lib/src/commands/service_generators/mongo.dart +++ b/lib/src/commands/service_generators/mongo.dart @@ -10,9 +10,6 @@ class MongoServiceGenerator extends ServiceGenerator { List get dependencies => const [MakerDependency('angel3_mongo', '^7.0.0')]; - @override - bool get createsModel => false; - @override void applyToConfigureServer( LibraryBuilder library, diff --git a/lib/src/commands/service_generators/rethink.dart b/lib/src/commands/service_generators/rethink.dart index dcc18c8..097bea8 100644 --- a/lib/src/commands/service_generators/rethink.dart +++ b/lib/src/commands/service_generators/rethink.dart @@ -10,9 +10,6 @@ class RethinkServiceGenerator extends ServiceGenerator { List get dependencies => const [MakerDependency('angel3_rethink', '^4.0.0')]; - @override - bool get createsModel => false; - @override void applyToConfigureServer( LibraryBuilder library, diff --git a/pubspec.yaml b/pubspec.yaml index 28695bc..2189e06 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,12 +1,12 @@ name: angel3_cli -version: 7.0.0 +version: 7.1.0 description: Command line tools for the Angel3 framework, including scaffolding. homepage: https://angel3-framework.web.app/ repository: https://github.com/dukefirehawk/angel3-cli environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.18.0 <3.0.0' dependencies: - analyzer: ^4.0.0 + analyzer: ^5.2.0 args: ^2.1.1 code_builder: ^4.0.0 dart_style: ^2.0.1 diff --git a/test/replace_name.dart b/test/replace_name.dart index a037115..67df9d6 100644 --- a/test/replace_name.dart +++ b/test/replace_name.dart @@ -42,7 +42,7 @@ void main() async { var contents = lineList.fold('', (prev, cur) { var updatedCur = updateImport(cur, oldName, newName); updatedCur = updateMustacheBinding(updatedCur, oldName, newName); - return prev + '\n' + updatedCur; + return '$prev\n$updatedCur'; }); await file.writeAsString(fmt.format(contents));