diff --git a/packages/orm/angel_orm_generator/CHANGELOG.md b/packages/orm/angel_orm_generator/CHANGELOG.md index a14bfaf9..bba78bc4 100644 --- a/packages/orm/angel_orm_generator/CHANGELOG.md +++ b/packages/orm/angel_orm_generator/CHANGELOG.md @@ -1,4 +1,4 @@ -# 4.0.0 +# 4.0.0-beta.1 * Migrated to support Dart SDK 2.12.x NNBD # 3.0.0 diff --git a/packages/orm/angel_orm_generator/README.md b/packages/orm/angel_orm_generator/README.md index 9ba833f7..d2d53ea9 100644 --- a/packages/orm/angel_orm_generator/README.md +++ b/packages/orm/angel_orm_generator/README.md @@ -1,4 +1,10 @@ -# angel_orm_generator +# angel3_orm_generator +[![version](https://img.shields.io/badge/pub-v4.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_orm_generator) +[![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) + +[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel3_orm_generator/LICENSE) + Source code generators for Angel's ORM. This package can generate: * A strongly-typed ORM diff --git a/packages/orm/angel_orm_generator/example/main.dart b/packages/orm/angel_orm_generator/example/main.dart index 438c2b19..f80fede2 100644 --- a/packages/orm/angel_orm_generator/example/main.dart +++ b/packages/orm/angel_orm_generator/example/main.dart @@ -1,9 +1,9 @@ import 'dart:async'; -import 'package:angel_migration/angel_migration.dart'; -import 'package:angel_model/angel_model.dart'; -import 'package:angel_orm/angel_orm.dart'; -import 'package:angel_orm/src/query.dart'; -import 'package:angel_serialize/angel_serialize.dart'; +import 'package:angel3_migration/angel3_migration.dart'; +import 'package:angel3_model/angel3_model.dart'; +import 'package:angel3_orm/angel3_orm.dart'; +import 'package:angel3_orm/src/query.dart'; +import 'package:angel3_serialize/angel3_serialize.dart'; import 'package:optional/optional.dart'; part 'main.g.dart'; diff --git a/packages/orm/angel_orm_generator/lib/angel_orm_generator.dart b/packages/orm/angel_orm_generator/lib/angel3_orm_generator.dart similarity index 100% rename from packages/orm/angel_orm_generator/lib/angel_orm_generator.dart rename to packages/orm/angel_orm_generator/lib/angel3_orm_generator.dart diff --git a/packages/orm/angel_orm_generator/lib/src/migration_generator.dart b/packages/orm/angel_orm_generator/lib/src/migration_generator.dart index ab57ab89..9533ba44 100644 --- a/packages/orm/angel_orm_generator/lib/src/migration_generator.dart +++ b/packages/orm/angel_orm_generator/lib/src/migration_generator.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/type.dart'; -import 'package:angel_model/angel_model.dart'; -import 'package:angel_orm/angel_orm.dart'; -import 'package:angel_serialize_generator/angel_serialize_generator.dart'; +import 'package:angel3_model/angel3_model.dart'; +import 'package:angel3_orm/angel3_orm.dart'; +import 'package:angel3_serialize_generator/angel3_serialize_generator.dart'; import 'package:build/build.dart'; import 'package:code_builder/code_builder.dart'; import 'package:dart_style/dart_style.dart'; diff --git a/packages/orm/angel_orm_generator/lib/src/orm_build_context.dart b/packages/orm/angel_orm_generator/lib/src/orm_build_context.dart index 8c5713cc..11e1ba46 100644 --- a/packages/orm/angel_orm_generator/lib/src/orm_build_context.dart +++ b/packages/orm/angel_orm_generator/lib/src/orm_build_context.dart @@ -3,15 +3,15 @@ import 'dart:async'; import 'package:analyzer/dart/constant/value.dart'; import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/type.dart'; -import 'package:angel_model/angel_model.dart'; -import 'package:angel_orm/angel_orm.dart'; -import 'package:angel_serialize/angel_serialize.dart'; -import 'package:angel_serialize_generator/angel_serialize_generator.dart'; -import 'package:angel_serialize_generator/build_context.dart'; -import 'package:angel_serialize_generator/context.dart'; +import 'package:angel3_model/angel3_model.dart'; +import 'package:angel3_orm/angel3_orm.dart'; +import 'package:angel3_serialize/angel3_serialize.dart'; +import 'package:angel3_serialize_generator/angel3_serialize_generator.dart'; +import 'package:angel3_serialize_generator/build_context.dart'; +import 'package:angel3_serialize_generator/context.dart'; import 'package:build/build.dart'; import 'package:collection/collection.dart' show IterableExtension; -import 'package:inflection2/inflection2.dart'; +import 'package:inflection3/inflection3.dart'; import 'package:recase/recase.dart'; import 'package:source_gen/source_gen.dart'; @@ -114,16 +114,13 @@ Future buildOrmContext( type: ColumnType.serial, indexType: IndexType.primaryKey); } - if (column == null) { - // Guess what kind of column this is... - column = Column( - type: inferColumnType( - buildCtx.resolveSerializedFieldType(field.name), - ), - ); - } + column ??= Column( + type: inferColumnType( + buildCtx.resolveSerializedFieldType(field.name), + ), + ); - if (column != null && column.type == null) { + if (column.type == null) { column = Column( isNullable: column.isNullable, length: column.length, diff --git a/packages/orm/angel_orm_generator/lib/src/orm_generator.dart b/packages/orm/angel_orm_generator/lib/src/orm_generator.dart index 23d209b4..49e230b1 100644 --- a/packages/orm/angel_orm_generator/lib/src/orm_generator.dart +++ b/packages/orm/angel_orm_generator/lib/src/orm_generator.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/type.dart'; -import 'package:angel_orm/angel_orm.dart'; -import 'package:angel_serialize_generator/angel_serialize_generator.dart'; +import 'package:angel3_orm/angel3_orm.dart'; +import 'package:angel3_serialize_generator/angel3_serialize_generator.dart'; import 'package:build/build.dart'; import 'package:code_builder/code_builder.dart' hide LibraryBuilder; import 'package:source_gen/source_gen.dart'; diff --git a/packages/orm/angel_orm_generator/lib/src/readers.dart b/packages/orm/angel_orm_generator/lib/src/readers.dart index a061b861..bd1d7745 100644 --- a/packages/orm/angel_orm_generator/lib/src/readers.dart +++ b/packages/orm/angel_orm_generator/lib/src/readers.dart @@ -1,7 +1,7 @@ import 'package:analyzer/dart/constant/value.dart'; import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/type.dart'; -import 'package:angel_orm/angel_orm.dart'; +import 'package:angel3_orm/angel3_orm.dart'; import 'package:source_gen/source_gen.dart'; import 'orm_build_context.dart'; diff --git a/packages/orm/angel_orm_generator/pubspec.yaml b/packages/orm/angel_orm_generator/pubspec.yaml index f7c270c6..4ae55c52 100644 --- a/packages/orm/angel_orm_generator/pubspec.yaml +++ b/packages/orm/angel_orm_generator/pubspec.yaml @@ -1,37 +1,16 @@ name: angel_orm_generator -version: 4.0.0 +version: 4.0.0-beta.1 description: Code generators for Angel's ORM. Generates query builder classes. -homepage: https://github.com/dukefirehawk/angel -publish_to: none +homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel3_orm_generator environment: sdk: '>=2.12.0 <3.0.0' dependencies: analyzer: ^1.5.0 - angel_model: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/model - angel_serialize: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/serialize/angel_serialize - angel_orm: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/orm/angel_orm - angel_serialize_generator: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/serialize/angel_serialize_generator - inflection2: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/inflection2 + angel3_model: ^3.0.0 + angel3_serialize: ^4.0.0 + angel3_orm: ^4.0.0-beta.1 + angel3_serialize_generator: ^4.0.0 + inflection3: ^0.5.3+1 build: ^2.0.1 build_config: ^1.0.0 code_builder: ^4.0.0 @@ -42,16 +21,8 @@ dependencies: source_gen: ^1.0.0 collection: ^1.15.0 dev_dependencies: - angel_framework: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/framework - angel_migration: - git: - url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x_nnbd - path: packages/orm/angel_migration + angel3_framework: ^4.0.0 + angel3_migration: ^4.0.0-beta.1 #angel_test: ^1.0.0 build_runner: ^2.0.1 pedantic: ^1.11.0