This commit is contained in:
Tobe O 2018-12-09 17:55:52 -05:00
parent 133dafe710
commit 7db3ec1a36
6 changed files with 60 additions and 5 deletions

View file

@ -1,3 +1,6 @@
# 2.2.2
* Split out TS def builder, to emit to source.
# 2.2.1
* Explicit changes for assisting `angel_orm_generator`.

View file

@ -1,20 +1,28 @@
builders:
angel_serialize:
target: "angel_serialize_generator"
# target: "angel_serialize_generator"
import: "package:angel_serialize_generator/angel_serialize_generator.dart"
builder_factories:
- jsonModelBuilder
- serializerBuilder
- typescriptDefinitionBuilder
auto_apply: root_package
build_to: cache
build_extensions:
.dart:
- "angel_serialize.g.part"
- "angel_serialize_serializer.g.part"
- ".d.ts"
applies_builders: ["source_gen|combining_builder", "source_gen|part_cleanup"]
runs_before: ["angel_orm_generator|angel_orm"]
typescript:
# target: "angel_serialize_generator"
import: "package:angel_serialize_generator/angel_serialize_generator.dart"
builder_factories:
- typescriptDefinitionBuilder
auto_apply: root_package
build_to: source
build_extensions:
.dart:
- ".d.ts"
targets:
_book:
sources:

View file

@ -1,5 +1,5 @@
name: angel_serialize_generator
version: 2.2.1
version: 2.2.2
description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/serialize

View file

@ -0,0 +1,30 @@
/// <reference path="./book.d.ts" />
// GENERATED CODE - DO NOT MODIFY BY HAND
declare module 'angel_serialize_generator' {
interface Author {
id?: string;
name: string;
age: number;
books?: Book[];
newest_book?: Book;
created_at?: any;
updated_at?: any;
}
interface Library {
id?: string;
collection?: LibraryCollection;
created_at?: any;
updated_at?: any;
}
interface LibraryCollection {
[key: string]: Book;
}
interface Bookmark {
id?: string;
history?: number[];
page: number;
comment?: string;
created_at?: any;
updated_at?: any;
}
}

View file

@ -7,7 +7,7 @@ import 'package:meta/meta.dart';
import 'book.dart';
part 'author.g.dart';
@serializable
@Serializable(serializers: Serializers.all)
abstract class _Author extends Model {
@required
String get name;

View file

@ -0,0 +1,14 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
declare module 'angel_serialize_generator' {
interface Book {
id?: string;
author?: string;
title?: string;
description?: string;
page_count?: number;
not_models?: number[];
camelCase?: string;
created_at?: any;
updated_at?: any;
}
}