This commit is contained in:
Tobe O 2019-01-11 19:12:06 -05:00
parent eb82f173a6
commit d2b1082435
4 changed files with 15 additions and 24 deletions

View file

@ -1,3 +1,7 @@
# 2.1.4
* The `migration` argument to `model` just emits an annotation now.
* Add the ORM boilerplate.
# 2.1.3 # 2.1.3
* Fix generation of ORM models. * Fix generation of ORM models.
* A `--project-name` to `init` command. * A `--project-name` to `init` command.

View file

@ -131,10 +131,10 @@ class InitCommand extends Command {
} }
} }
var boilerplate = basicBoilerplate; // var boilerplate = basicBoilerplate;
// print('Choose a project type before continuing:'); print('Choose a project type before continuing:');
// var boilerplate = prompts.choose( var boilerplate = prompts.choose(
// 'Choose a project type before continuing', boilerplates); 'Choose a project type before continuing', boilerplates);
print( print(
'Cloning "${boilerplate.name}" boilerplate from "${boilerplate.url}"...'); 'Cloning "${boilerplate.name}" boilerplate from "${boilerplate.url}"...');
@ -224,7 +224,8 @@ Future preBuild(Directory projectDir) async {
const BoilerplateInfo ormBoilerplate = const BoilerplateInfo( const BoilerplateInfo ormBoilerplate = const BoilerplateInfo(
'ORM', 'ORM',
"A starting point for applications that use Angel's 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( const BoilerplateInfo basicBoilerplate = const BoilerplateInfo(
@ -242,7 +243,7 @@ const BoilerplateInfo legacyBoilerplate = const BoilerplateInfo(
const List<BoilerplateInfo> boilerplates = const [ const List<BoilerplateInfo> boilerplates = const [
basicBoilerplate, basicBoilerplate,
//legacyBoilerplate, //legacyBoilerplate,
//ormBoilerplate, ormBoilerplate,
]; ];
class BoilerplateInfo { class BoilerplateInfo {

View file

@ -19,8 +19,8 @@ class ModelCommand extends Command {
argParser argParser
..addFlag('migration', ..addFlag('migration',
abbr: 'm', abbr: 'm',
help: 'Generate an angel_orm migration file.', help: 'Generate migrations when running `build_runner`.',
defaultsTo: false, defaultsTo: true,
negatable: false) negatable: false)
..addFlag('orm', help: 'Generate angel_orm code.', negatable: false) ..addFlag('orm', help: 'Generate angel_orm code.', negatable: false)
..addFlag('serializable', ..addFlag('serializable',
@ -29,10 +29,7 @@ class ModelCommand extends Command {
abbr: 'n', help: 'Specifies a name for the model class.') abbr: 'n', help: 'Specifies a name for the model class.')
..addOption('output-dir', ..addOption('output-dir',
help: 'Specifies a directory to create the model class in.', help: 'Specifies a directory to create the model class in.',
defaultsTo: 'lib/src/models') defaultsTo: 'lib/src/models');
..addOption('migration-dir',
help: 'Specifies a directory to create the migration class in.',
defaultsTo: 'tool/migrations');
} }
@override @override
@ -118,17 +115,6 @@ class ModelCommand extends Command {
print(green print(green
.wrap('$checkmark Created model file "${modelFile.absolute.path}".')); .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); if (deps.isNotEmpty) await depend(deps);
} }
} }

View file

@ -2,7 +2,7 @@ author: Tobe O <thosakwe@gmail.com>
description: Command-line tools for the Angel framework. description: Command-line tools for the Angel framework.
homepage: https://github.com/angel-dart/angel_cli homepage: https://github.com/angel-dart/angel_cli
name: angel_cli name: angel_cli
version: 2.1.3 version: 2.1.4
dependencies: dependencies:
analyzer: ">=0.32.0" analyzer: ">=0.32.0"
args: ^1.0.0 args: ^1.0.0