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
* Fix generation of ORM models.
* A `--project-name` to `init` command.

View file

@ -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<BoilerplateInfo> boilerplates = const [
basicBoilerplate,
//legacyBoilerplate,
//ormBoilerplate,
ormBoilerplate,
];
class BoilerplateInfo {

View file

@ -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);
}
}

View file

@ -2,7 +2,7 @@ author: Tobe O <thosakwe@gmail.com>
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