2.2.2
This commit is contained in:
parent
133dafe710
commit
7db3ec1a36
6 changed files with 60 additions and 5 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# 2.2.2
|
||||||
|
* Split out TS def builder, to emit to source.
|
||||||
|
|
||||||
# 2.2.1
|
# 2.2.1
|
||||||
* Explicit changes for assisting `angel_orm_generator`.
|
* Explicit changes for assisting `angel_orm_generator`.
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,28 @@
|
||||||
builders:
|
builders:
|
||||||
angel_serialize:
|
angel_serialize:
|
||||||
target: "angel_serialize_generator"
|
# target: "angel_serialize_generator"
|
||||||
import: "package:angel_serialize_generator/angel_serialize_generator.dart"
|
import: "package:angel_serialize_generator/angel_serialize_generator.dart"
|
||||||
builder_factories:
|
builder_factories:
|
||||||
- jsonModelBuilder
|
- jsonModelBuilder
|
||||||
- serializerBuilder
|
- serializerBuilder
|
||||||
- typescriptDefinitionBuilder
|
|
||||||
auto_apply: root_package
|
auto_apply: root_package
|
||||||
build_to: cache
|
build_to: cache
|
||||||
build_extensions:
|
build_extensions:
|
||||||
.dart:
|
.dart:
|
||||||
- "angel_serialize.g.part"
|
- "angel_serialize.g.part"
|
||||||
- "angel_serialize_serializer.g.part"
|
- "angel_serialize_serializer.g.part"
|
||||||
- ".d.ts"
|
|
||||||
applies_builders: ["source_gen|combining_builder", "source_gen|part_cleanup"]
|
applies_builders: ["source_gen|combining_builder", "source_gen|part_cleanup"]
|
||||||
runs_before: ["angel_orm_generator|angel_orm"]
|
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:
|
targets:
|
||||||
_book:
|
_book:
|
||||||
sources:
|
sources:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel_serialize_generator
|
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.
|
description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/serialize
|
homepage: https://github.com/angel-dart/serialize
|
||||||
|
|
30
angel_serialize_generator/test/models/author.d.ts
vendored
Normal file
30
angel_serialize_generator/test/models/author.d.ts
vendored
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ import 'package:meta/meta.dart';
|
||||||
import 'book.dart';
|
import 'book.dart';
|
||||||
part 'author.g.dart';
|
part 'author.g.dart';
|
||||||
|
|
||||||
@serializable
|
@Serializable(serializers: Serializers.all)
|
||||||
abstract class _Author extends Model {
|
abstract class _Author extends Model {
|
||||||
@required
|
@required
|
||||||
String get name;
|
String get name;
|
||||||
|
|
14
angel_serialize_generator/test/models/book.d.ts
vendored
Normal file
14
angel_serialize_generator/test/models/book.d.ts
vendored
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue