Merge pull request #2 from dukefirehawk/bug-fix/deprecated

Upgaded libraries
This commit is contained in:
Thomas Hii 2022-12-03 13:11:11 +08:00 committed by GitHub
commit 1bc6641651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 23 deletions

View file

@ -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

View file

@ -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)};';
}
}
}

View file

@ -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

View file

@ -8,6 +8,7 @@ class ServiceGenerator {
List<MakerDependency> get dependencies => [];
/*
@deprecated
bool get createsModel => true;
@ -22,6 +23,7 @@ class ServiceGenerator {
@deprecated
bool get shouldRunBuild => false;
*/
bool get goesFirst => false;

View file

@ -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) {

View file

@ -10,9 +10,6 @@ class MongoServiceGenerator extends ServiceGenerator {
List<MakerDependency> get dependencies =>
const [MakerDependency('angel3_mongo', '^7.0.0')];
@override
bool get createsModel => false;
@override
void applyToConfigureServer(
LibraryBuilder library,

View file

@ -10,9 +10,6 @@ class RethinkServiceGenerator extends ServiceGenerator {
List<MakerDependency> get dependencies =>
const [MakerDependency('angel3_rethink', '^4.0.0')];
@override
bool get createsModel => false;
@override
void applyToConfigureServer(
LibraryBuilder library,

View file

@ -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

View file

@ -42,7 +42,7 @@ void main() async {
var contents = lineList.fold<String>('', (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));