From d2b1082435f0dfc7ab774f6a00c0badc0c2558ee Mon Sep 17 00:00:00 2001 From: Tobe O Date: Fri, 11 Jan 2019 19:12:06 -0500 Subject: [PATCH] 2.1.4 --- CHANGELOG.md | 4 ++++ lib/src/commands/init.dart | 13 +++++++------ lib/src/commands/make/model.dart | 20 +++----------------- pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2607c..322936d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.4 +* The `migration` argument to `model` just emits an annotation now. +* Add the ORM boilerplate. + # 2.1.3 * Fix generation of ORM models. * A `--project-name` to `init` command. diff --git a/lib/src/commands/init.dart b/lib/src/commands/init.dart index 53e355a..a7f4e85 100644 --- a/lib/src/commands/init.dart +++ b/lib/src/commands/init.dart @@ -131,10 +131,10 @@ class InitCommand extends Command { } } - var boilerplate = basicBoilerplate; - // print('Choose a project type before continuing:'); - // var boilerplate = prompts.choose( - // 'Choose a project type before continuing', boilerplates); + // var boilerplate = basicBoilerplate; + print('Choose a project type before continuing:'); + var boilerplate = prompts.choose( + 'Choose a project type before continuing', boilerplates); print( 'Cloning "${boilerplate.name}" boilerplate from "${boilerplate.url}"...'); @@ -224,7 +224,8 @@ Future preBuild(Directory projectDir) async { const BoilerplateInfo ormBoilerplate = const BoilerplateInfo( 'ORM', "A starting point for applications that use Angel's ORM.", - 'https://github.com/angel-dart/boilerplate_orm.git', + 'https://github.com/angel-dart/angel.git', + ref: 'orm', ); const BoilerplateInfo basicBoilerplate = const BoilerplateInfo( @@ -242,7 +243,7 @@ const BoilerplateInfo legacyBoilerplate = const BoilerplateInfo( const List boilerplates = const [ basicBoilerplate, //legacyBoilerplate, - //ormBoilerplate, + ormBoilerplate, ]; class BoilerplateInfo { diff --git a/lib/src/commands/make/model.dart b/lib/src/commands/make/model.dart index f40b3d9..45ebc1b 100644 --- a/lib/src/commands/make/model.dart +++ b/lib/src/commands/make/model.dart @@ -19,8 +19,8 @@ class ModelCommand extends Command { argParser ..addFlag('migration', abbr: 'm', - help: 'Generate an angel_orm migration file.', - defaultsTo: false, + help: 'Generate migrations when running `build_runner`.', + defaultsTo: true, negatable: false) ..addFlag('orm', help: 'Generate angel_orm code.', negatable: false) ..addFlag('serializable', @@ -29,10 +29,7 @@ class ModelCommand extends Command { abbr: 'n', help: 'Specifies a name for the model class.') ..addOption('output-dir', help: 'Specifies a directory to create the model class in.', - defaultsTo: 'lib/src/models') - ..addOption('migration-dir', - help: 'Specifies a directory to create the migration class in.', - defaultsTo: 'tool/migrations'); + defaultsTo: 'lib/src/models'); } @override @@ -118,17 +115,6 @@ class ModelCommand extends Command { print(green .wrap('$checkmark Created model file "${modelFile.absolute.path}".')); - if (argResults['migration'] as bool) { - await runner.run([ - 'make', - 'migration', - '-n', - name, - '--output-dir', - argResults['migration-dir'] as String, - ]); - } - if (deps.isNotEmpty) await depend(deps); } } diff --git a/pubspec.yaml b/pubspec.yaml index ecfea27..cd125d7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: Tobe O description: Command-line tools for the Angel framework. homepage: https://github.com/angel-dart/angel_cli name: angel_cli -version: 2.1.3 +version: 2.1.4 dependencies: analyzer: ">=0.32.0" args: ^1.0.0