Removed deprecated code
This commit is contained in:
parent
9619342ab8
commit
00b0304af1
8 changed files with 6 additions and 26 deletions
|
@ -24,7 +24,7 @@ class KeyCommand extends Command {
|
||||||
if (await file.exists()) {
|
if (await file.exists()) {
|
||||||
var contents = await file.readAsString();
|
var contents = await file.readAsString();
|
||||||
contents = contents.replaceAll(RegExp(r'jwt_secret:[^\n]+\n?'), '');
|
contents = contents.replaceAll(RegExp(r'jwt_secret:[^\n]+\n?'), '');
|
||||||
await file.writeAsString(contents.trim() + '\njwt_secret: "$secret"');
|
await file.writeAsString('${contents.trim()}\njwt_secret: "$secret"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ String resolvePub() {
|
||||||
var exec = File(Platform.resolvedExecutable);
|
var exec = File(Platform.resolvedExecutable);
|
||||||
var pubPath = exec.parent.uri.resolve('pub').path;
|
var pubPath = exec.parent.uri.resolve('pub').path;
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
pubPath = pubPath.replaceAll(_leadingSlashes, '') + '.bat';
|
pubPath = '${pubPath.replaceAll(_leadingSlashes, '')}.bat';
|
||||||
}
|
}
|
||||||
pubPath = Uri.decodeFull(pubPath);
|
pubPath = Uri.decodeFull(pubPath);
|
||||||
return pubPath;
|
return pubPath;
|
||||||
|
|
|
@ -148,7 +148,7 @@ Future renameDartFiles(Directory dir, String oldName, String newName) async {
|
||||||
var contents = lineList.fold<String>('', (prev, cur) {
|
var contents = lineList.fold<String>('', (prev, cur) {
|
||||||
var updatedCur = updateImport(cur, oldName, newName);
|
var updatedCur = updateImport(cur, oldName, newName);
|
||||||
updatedCur = updateMustacheBinding(updatedCur, oldName, newName);
|
updatedCur = updateMustacheBinding(updatedCur, oldName, newName);
|
||||||
return prev + '\n' + updatedCur;
|
return '$prev\n$updatedCur';
|
||||||
});
|
});
|
||||||
await file.writeAsString(fmt.format(contents));
|
await file.writeAsString(fmt.format(contents));
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ class RenamingVisitor extends RecursiveAstVisitor {
|
||||||
if (uri == 'package:$oldName/$oldName.dart') {
|
if (uri == 'package:$oldName/$oldName.dart') {
|
||||||
return 'package:$newName/$newName.dart';
|
return 'package:$newName/$newName.dart';
|
||||||
} else if (uri.startsWith('package:$oldName/')) {
|
} else if (uri.startsWith('package:$oldName/')) {
|
||||||
return 'package:$newName/' + uri.replaceFirst('package:$oldName/', '');
|
return 'package:$newName/${uri.replaceFirst('package:$oldName/', '')}';
|
||||||
} else {
|
} else {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ class RenamingVisitor extends RecursiveAstVisitor {
|
||||||
|
|
||||||
if (name.startsWith(oldName)) {
|
if (name.startsWith(oldName)) {
|
||||||
replace[[node.offset, node.end]] =
|
replace[[node.offset, node.end]] =
|
||||||
'library ' + name.replaceFirst(oldName, newName) + ';';
|
'library ${name.replaceFirst(oldName, newName)};';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ class RenamingVisitor extends RecursiveAstVisitor {
|
||||||
|
|
||||||
if (name.startsWith(oldName)) {
|
if (name.startsWith(oldName)) {
|
||||||
replace[[node.offset, node.end]] =
|
replace[[node.offset, node.end]] =
|
||||||
'part of ' + name.replaceFirst(oldName, newName) + ';';
|
'part of ${name.replaceFirst(oldName, newName)};';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,8 @@ import 'package:code_builder/code_builder.dart';
|
||||||
import 'generator.dart';
|
import 'generator.dart';
|
||||||
|
|
||||||
class CustomServiceGenerator extends ServiceGenerator {
|
class CustomServiceGenerator extends ServiceGenerator {
|
||||||
@override
|
|
||||||
bool get createsModel => false;
|
bool get createsModel => false;
|
||||||
|
|
||||||
@override
|
|
||||||
bool get createsValidator => false;
|
bool get createsValidator => false;
|
||||||
|
|
||||||
const CustomServiceGenerator() : super('Custom');
|
const CustomServiceGenerator() : super('Custom');
|
||||||
|
|
|
@ -8,21 +8,6 @@ class ServiceGenerator {
|
||||||
|
|
||||||
List<MakerDependency> get dependencies => [];
|
List<MakerDependency> get dependencies => [];
|
||||||
|
|
||||||
@deprecated
|
|
||||||
bool get createsModel => true;
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
bool get createsValidator => true;
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
bool get exportedInServiceLibrary => true;
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
bool get injectsSingleton => false;
|
|
||||||
|
|
||||||
@deprecated
|
|
||||||
bool get shouldRunBuild => false;
|
|
||||||
|
|
||||||
bool get goesFirst => false;
|
bool get goesFirst => false;
|
||||||
|
|
||||||
void applyToLibrary(LibraryBuilder library, String name, String lower) {}
|
void applyToLibrary(LibraryBuilder library, String name, String lower) {}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'package:code_builder/code_builder.dart';
|
||||||
class MapServiceGenerator extends ServiceGenerator {
|
class MapServiceGenerator extends ServiceGenerator {
|
||||||
const MapServiceGenerator() : super('In-Memory');
|
const MapServiceGenerator() : super('In-Memory');
|
||||||
|
|
||||||
@override
|
|
||||||
bool get createsModel => false;
|
bool get createsModel => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -10,7 +10,6 @@ class MongoServiceGenerator extends ServiceGenerator {
|
||||||
List<MakerDependency> get dependencies =>
|
List<MakerDependency> get dependencies =>
|
||||||
const [MakerDependency('angel3_mongo', '^4.0.0')];
|
const [MakerDependency('angel3_mongo', '^4.0.0')];
|
||||||
|
|
||||||
@override
|
|
||||||
bool get createsModel => false;
|
bool get createsModel => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -10,7 +10,6 @@ class RethinkServiceGenerator extends ServiceGenerator {
|
||||||
List<MakerDependency> get dependencies =>
|
List<MakerDependency> get dependencies =>
|
||||||
const [MakerDependency('angel3_rethink', '^4.0.0')];
|
const [MakerDependency('angel3_rethink', '^4.0.0')];
|
||||||
|
|
||||||
@override
|
|
||||||
bool get createsModel => false;
|
bool get createsModel => false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue