Updated CLI

This commit is contained in:
thomashii 2021-07-18 16:00:08 +08:00
parent fe5b7ecd47
commit aa57f3b301
10 changed files with 28 additions and 28 deletions

View file

@ -2,7 +2,7 @@
[![Screenshot of Terminal](screenshots/angel3-screenshot.png)](https://github.com/dukefirehawk/angel3-cli) [![Screenshot of Terminal](screenshots/angel3-screenshot.png)](https://github.com/dukefirehawk/angel3-cli)
[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/angel3_cli) [![version](https://img.shields.io/badge/pub-v3.0.1-brightgreen)](https://pub.dartlang.org/angel3_cli)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)

View file

@ -11,7 +11,7 @@ final String DOCTOR = 'doctor';
void main(List<String> args) async { void main(List<String> args) async {
var runner = CommandRunner( var runner = CommandRunner(
'angel', 'angel3',
asciiArt + asciiArt +
'\n\n' + '\n\n' +
'Command-line tools for the Angel3 framework.' + 'Command-line tools for the Angel3 framework.' +

View file

@ -39,7 +39,7 @@ class ControllerCommand extends Command {
} }
var deps = <MakerDependency>[ var deps = <MakerDependency>[
const MakerDependency('angel_framework', '^2.0.0') const MakerDependency('angel3_framework', '^4.1.0')
]; ];
//${pubspec.name}.src.models.${rc.snakeCase} //${pubspec.name}.src.models.${rc.snakeCase}
@ -47,12 +47,12 @@ class ControllerCommand extends Command {
var rc = ReCase(name!); var rc = ReCase(name!);
var controllerLib = Library((controllerLib) { var controllerLib = Library((controllerLib) {
if (argResults!['websocket'] as bool) { if (argResults!['websocket'] as bool) {
deps.add(const MakerDependency('angel_websocket', '^2.0.0')); deps.add(const MakerDependency('angel3_websocket', '^4.0.0'));
controllerLib.directives controllerLib.directives
.add(Directive.import('package:angel_websocket/server.dart')); .add(Directive.import('package:angel3_websocket/server.dart'));
} else { } else {
controllerLib.directives.add( controllerLib.directives.add(
Directive.import('package:angel_framework/angel_framework.dart')); Directive.import('package:angel3_framework/angel3_framework.dart'));
} }
controllerLib.body.add(Class((clazz) { controllerLib.body.add(Class((clazz) {

View file

@ -35,13 +35,13 @@ class MigrationCommand extends Command {
name = prompts.get('Name of model class'); name = prompts.get('Name of model class');
} }
var deps = [const MakerDependency('angel_migration', '^2.0.0')]; var deps = [const MakerDependency('angel3_migration', '^4.0.0')];
var rc = ReCase(name!); var rc = ReCase(name!);
var migrationLib = Library((migrationLib) { var migrationLib = Library((migrationLib) {
migrationLib migrationLib
..directives.add(Directive.import( ..directives.add(Directive.import(
'package:angel_migration.dart/angel_migration.dart')) 'package:angel3_migration.dart/angel3_migration.dart'))
..body.add(Class((migrationClazz) { ..body.add(Class((migrationClazz) {
migrationClazz migrationClazz
..name = '${rc.pascalCase}Migration' ..name = '${rc.pascalCase}Migration'

View file

@ -41,7 +41,7 @@ class ModelCommand extends Command {
} }
var deps = <MakerDependency>[ var deps = <MakerDependency>[
const MakerDependency('angel_model', '^1.0.0'), const MakerDependency('angel3_model', '^3.0.0'),
]; ];
var rc = ReCase(name!); var rc = ReCase(name!);
@ -49,7 +49,7 @@ class ModelCommand extends Command {
var modelLib = Library((modelLib) { var modelLib = Library((modelLib) {
if (argResults!['orm'] as bool && argResults!['migration'] as bool) { if (argResults!['orm'] as bool && argResults!['migration'] as bool) {
modelLib.directives.addAll([ modelLib.directives.addAll([
Directive.import('package:angel_migration/angel_migration.dart'), Directive.import('package:angel3_migration/angel3_migration.dart'),
]); ]);
} }
@ -59,10 +59,10 @@ class ModelCommand extends Command {
if (needsSerialize) { if (needsSerialize) {
modelLib.directives.add( modelLib.directives.add(
Directive.import('package:angel_serialize/angel_serialize.dart')); Directive.import('package:angel3_serialize/angel3_serialize.dart'));
deps.add(const MakerDependency('angel_serialize', '^2.0.0')); deps.add(const MakerDependency('angel3_serialize', '^4.0.0'));
deps.add(const MakerDependency('angel_serialize_generator', '^2.0.0')); deps.add(const MakerDependency('angel3_serialize_generator', '^4.0.0'));
deps.add(const MakerDependency('build_runner', '^1.0.0')); deps.add(const MakerDependency('build_runner', '^2.0.0'));
} }
// else { // else {
@ -73,9 +73,9 @@ class ModelCommand extends Command {
if (argResults!['orm'] as bool) { if (argResults!['orm'] as bool) {
modelLib.directives.addAll([ modelLib.directives.addAll([
Directive.import('package:angel_orm/angel_orm.dart'), Directive.import('package:angel3_orm/angel3_orm.dart'),
]); ]);
deps.add(const MakerDependency('angel_orm', '^2.0.0')); deps.add(const MakerDependency('angel3_orm', '^4.0.0'));
} }
modelLib.body.addAll([ modelLib.body.addAll([

View file

@ -35,7 +35,7 @@ class PluginCommand extends Command {
} }
var deps = <MakerDependency>[ var deps = <MakerDependency>[
const MakerDependency('angel_framework', '^2.0.0') const MakerDependency('angel3_framework', '^4.1.0')
]; ];
var rc = ReCase(name!); var rc = ReCase(name!);
@ -57,7 +57,7 @@ class PluginCommand extends Command {
return ''' return '''
library ${pubspec.name}.src.config.plugins.${rc.snakeCase}; library ${pubspec.name}.src.config.plugins.${rc.snakeCase};
import 'package:angel_framework/angel_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
AngelConfigurer ${rc.camelCase}() { AngelConfigurer ${rc.camelCase}() {
return (Angel app) async { return (Angel app) async {

View file

@ -41,7 +41,7 @@ class ServiceCommand extends Command {
} }
var deps = <MakerDependency>[ var deps = <MakerDependency>[
const MakerDependency('angel_framework', '^2.0.0') const MakerDependency('angel3_framework', '^4.1.0')
]; ];
// '${pubspec.name}.src.services.${rc.snakeCase}' // '${pubspec.name}.src.services.${rc.snakeCase}'
@ -64,10 +64,10 @@ class ServiceCommand extends Command {
if (generator.goesFirst) { if (generator.goesFirst) {
generator.applyToLibrary(serviceLib, name, rc.snakeCase); generator.applyToLibrary(serviceLib, name, rc.snakeCase);
serviceLib.directives.add( serviceLib.directives.add(
Directive.import('package:angel_framework/angel_framework.dart')); Directive.import('package:angel3_framework/angel3_framework.dart'));
} else { } else {
serviceLib.directives.add( serviceLib.directives.add(
Directive.import('package:angel_framework/angel_framework.dart')); Directive.import('package:angel3_framework/angel3_framework.dart'));
generator.applyToLibrary(serviceLib, name, rc.snakeCase); generator.applyToLibrary(serviceLib, name, rc.snakeCase);
} }

View file

@ -38,9 +38,9 @@ class TestCommand extends Command {
} }
var deps = <MakerDependency>[ var deps = <MakerDependency>[
const MakerDependency('angel_framework', '^2.0.0'), const MakerDependency('angel3_framework', '^4.1.0'),
const MakerDependency('angel_test', '^2.0.0', dev: true), const MakerDependency('angel3_test', '^4.0.0', dev: true),
const MakerDependency('test', '^1.0.0', dev: true), const MakerDependency('test', '^1.17.0', dev: true),
]; ];
var rc = ReCase(name!); var rc = ReCase(name!);
@ -85,15 +85,15 @@ class TestCommand extends Command {
return ''' return '''
import 'dart:io'; import 'dart:io';
import 'package:${pubspec.name}/${pubspec.name}.dart' as ${pubspec.name}; import 'package:${pubspec.name}/${pubspec.name}.dart' as ${pubspec.name};
import 'package:angel_framework/angel_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel_test/angel_test.dart'; import 'package:angel3_test/angel3_test.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
main() async { main() async {
TestClient client; TestClient client;
setUp(() async { setUp(() async {
var app = new Angel(); var app = Angel();
await app.configure(${pubspec.name}.configureServer); await app.configure(${pubspec.name}.configureServer);
client = await connectTo(app); client = await connectTo(app);
}); });

View file

@ -1,5 +1,5 @@
name: angel3_cli name: angel3_cli
version: 3.0.0 version: 3.0.1
description: Command line tools for the Angel3 framework, including scaffolding. description: Command line tools for the Angel3 framework, including scaffolding.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel3-cli repository: https://github.com/dukefirehawk/angel3-cli

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB