From cf1b813578a1f12d94ccd6d04162ccc9c07bc753 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 29 Apr 2019 13:41:35 -0400 Subject: [PATCH] 2.1.6 --- CHANGELOG.md | 5 +++++ bin/angel.dart | 9 ++++++--- lib/src/commands/init.dart | 8 ++++++++ lib/src/commands/make/model.dart | 1 - pubspec.yaml | 5 +++-- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fd025e..bf20d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.1.6 +* Fix a bug where models always defaulted to ORM. +* Add GraphQL boilerplate. +* Automatically restore terminal colors on shutdown. + # 2.1.5+1 * Update to `inflection2`. diff --git a/bin/angel.dart b/bin/angel.dart index bdeddff..43c62d8 100644 --- a/bin/angel.dart +++ b/bin/angel.dart @@ -4,6 +4,7 @@ library angel_cli.tool; import "dart:io"; import "package:args/command_runner.dart"; import 'package:angel_cli/angel_cli.dart'; +import 'package:io/ansi.dart'; final String DOCTOR = "doctor"; @@ -28,17 +29,19 @@ main(List args) async { ..addCommand(new RenameCommand()) ..addCommand(new MakeCommand()); - return await runner.run(args).then((_) {}).catchError((exc, st) { + return await runner.run(args).catchError((exc, st) { if (exc is String) { stdout.writeln(exc); } else { stderr.writeln("Oops, something went wrong: $exc"); - exitCode = 1; - if (args.contains('--verbose')) { stderr.writeln(st); } } + + exitCode = 1; + }).whenComplete(() { + stdout.write(resetAll.wrap('')); }); } diff --git a/lib/src/commands/init.dart b/lib/src/commands/init.dart index 099b421..6e80977 100644 --- a/lib/src/commands/init.dart +++ b/lib/src/commands/init.dart @@ -221,6 +221,13 @@ Future preBuild(Directory projectDir) async { if (buildCode != 0) throw new Exception('Failed to pre-build resources.'); } +const BoilerplateInfo graphQLBoilerplate = const BoilerplateInfo( + 'GraphQL', + "A starting point for GraphQL API servers.", + 'https://github.com/angel-dart/angel.git', + ref: 'graphql', +); + const BoilerplateInfo ormBoilerplate = const BoilerplateInfo( 'ORM', "A starting point for applications that use Angel's ORM.", @@ -256,6 +263,7 @@ const List boilerplates = const [ basicBoilerplate, //legacyBoilerplate, ormBoilerplate, + graphQLBoilerplate, sharedBoilerplate, sharedOrmBoilerplate, ]; diff --git a/lib/src/commands/make/model.dart b/lib/src/commands/make/model.dart index 68f4bef..1676258 100644 --- a/lib/src/commands/make/model.dart +++ b/lib/src/commands/make/model.dart @@ -20,7 +20,6 @@ class ModelCommand extends Command { ..addFlag('migration', abbr: 'm', help: 'Generate migrations when running `build_runner`.', - defaultsTo: true, negatable: false) ..addFlag('orm', help: 'Generate angel_orm code.', negatable: false) ..addFlag('serializable', diff --git a/pubspec.yaml b/pubspec.yaml index a548fb3..27a1bde 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,14 +2,14 @@ author: Tobe O description: Command-line tools for the Angel framework, including scaffolding. homepage: https://github.com/angel-dart/angel_cli name: angel_cli -version: 2.1.5+2 +version: 2.1.6 dependencies: analyzer: ">=0.32.0 <2.0.0" args: ^1.0.0 code_builder: ^3.0.0 dart_style: ^1.0.0 glob: ^1.1.0 - http: ^0.11.3 + http: ^0.12.0 io: ^0.3.2 inflection2: ^0.4.2 mustache4dart: ^3.0.0-dev.1.0 @@ -18,6 +18,7 @@ dependencies: pubspec_parse: ^0.1.2 quiver: ^2.0.0 recase: ^2.0.0 + shutdown: ^0.4.0 watcher: ^0.9.7 yaml: ^2.0.0 #yamlicious: ^0.0.5