foobara-typescript-remote-command-generator 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/src/remote_generator/services/aggregate_entity_generator.rb +1 -1
- data/src/remote_generator/services/aggregate_model_generator.rb +1 -6
- data/src/remote_generator/services/atom_entity_generator.rb +1 -1
- data/src/remote_generator/services/atom_model_generator.rb +1 -6
- data/src/remote_generator/services/entity_generator.rb +5 -1
- data/src/remote_generator/services/entity_variants_generator.rb +3 -1
- data/src/remote_generator/services/loaded_entity_generator.rb +1 -1
- data/src/remote_generator/services/model_generator.rb +9 -1
- data/src/remote_generator/services/model_manifest_generator.rb +16 -1
- data/src/remote_generator/services/model_variants_generator.rb +1 -1
- data/src/remote_generator/services/type_generator.rb +20 -2
- data/src/remote_generator/services/typescript_from_manifest_base_generator.rb +0 -4
- data/src/remote_generator/services/unloaded_entity_generator.rb +1 -6
- data/templates/Command/Result.ts.erb +1 -1
- data/templates/Entity/Aggregate.ts.erb +5 -5
- data/templates/Entity/Ambiguous.ts.erb +9 -9
- data/templates/Entity/Atom.ts.erb +5 -5
- data/templates/Entity/Loaded.ts.erb +3 -3
- data/templates/Entity/Unloaded.ts.erb +6 -6
- data/templates/EntityVariants.ts.erb +25 -25
- data/templates/Error.ts.erb +1 -1
- data/templates/Model/Aggregate.ts.erb +6 -6
- data/templates/Model/Atom.ts.erb +6 -6
- data/templates/Model/Model.ts.erb +5 -5
- data/templates/ModelVariants.ts.erb +15 -15
- data/templates/Type/Type.ts.erb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7d35269e0cccd832d9f2273e87df63886b43653f8f3188c835f3d98b57bbb6
|
4
|
+
data.tar.gz: 2a28d7e124c91342b41f598e2d83fde63f9a6d1a4a882d8865b68da39763773b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221ffce09538be115791fd15ef205a4d381828974a8076fd693db489a749598edcdf68c5faafe21f570830c73f8ff3fb838af3b4a9c388ccf665282b6ce41952
|
7
|
+
data.tar.gz: e3a47338014c6d6f819c6ac9e1b6269558cf2955ae1d4a709a4c000d03029de634617683566c3f6a6d3f3a056add55fc4ff8a039e4acb4115b4f13a6fbdb4780
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
## [
|
1
|
+
## [0.0.5] - 2024-08-23
|
2
|
+
|
3
|
+
- Fix several naming/import issues in templates
|
4
|
+
|
5
|
+
## [0.0.4] - 2024-08-22
|
2
6
|
|
3
7
|
- Add type generators to command result generator
|
4
8
|
- Add type generators to domain generator
|
9
|
+
- Attempt to fix botched nested type paths
|
5
10
|
|
6
11
|
## [0.0.2] - 2024-08-21
|
7
12
|
|
@@ -17,7 +17,7 @@ module Foobara
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def target_path
|
20
|
-
[*
|
20
|
+
[*super[..-2], "Aggregate.ts"]
|
21
21
|
end
|
22
22
|
|
23
23
|
def template_path
|
@@ -38,11 +38,6 @@ module Foobara
|
|
38
38
|
aggregate_attributes_ts_type
|
39
39
|
end
|
40
40
|
|
41
|
-
def ts_instance_path
|
42
|
-
*prefix, name = scoped_path
|
43
|
-
[*prefix, "#{name}Aggregate"]
|
44
|
-
end
|
45
|
-
|
46
41
|
def ts_instance_full_path
|
47
42
|
*prefix, name = scoped_full_path
|
48
43
|
[*prefix, "#{name}Aggregate"]
|
@@ -17,7 +17,7 @@ module Foobara
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def target_path
|
20
|
-
[*
|
20
|
+
[*super[..-2], "Atom.ts"]
|
21
21
|
end
|
22
22
|
|
23
23
|
def template_path
|
@@ -34,11 +34,6 @@ module Foobara
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
def ts_instance_path
|
38
|
-
*prefix, name = scoped_path
|
39
|
-
[*prefix, "#{name}Atom"]
|
40
|
-
end
|
41
|
-
|
42
37
|
def ts_instance_full_path
|
43
38
|
*prefix, name = scoped_full_path
|
44
39
|
[*prefix, "#{name}Atom"]
|
@@ -7,7 +7,7 @@ module Foobara
|
|
7
7
|
alias entity_manifest relevant_manifest
|
8
8
|
|
9
9
|
def target_path
|
10
|
-
[*
|
10
|
+
[*super[..-2], "Ambiguous.ts"]
|
11
11
|
end
|
12
12
|
|
13
13
|
def template_path
|
@@ -18,6 +18,10 @@ module Foobara
|
|
18
18
|
model_name(...)
|
19
19
|
end
|
20
20
|
|
21
|
+
def entity_short_name
|
22
|
+
model_short_name
|
23
|
+
end
|
24
|
+
|
21
25
|
def primary_key_name
|
22
26
|
primary_key_attribute
|
23
27
|
end
|
@@ -5,7 +5,9 @@ module Foobara
|
|
5
5
|
class Services
|
6
6
|
class EntityVariantsGenerator < EntityGenerator
|
7
7
|
def target_path
|
8
|
-
|
8
|
+
*prefix, _entity_name, _file = super
|
9
|
+
|
10
|
+
[*prefix, "#{entity_short_name}.ts"]
|
9
11
|
end
|
10
12
|
|
11
13
|
def template_path
|
@@ -20,13 +20,21 @@ module Foobara
|
|
20
20
|
alias model_manifest relevant_manifest
|
21
21
|
|
22
22
|
def target_path
|
23
|
-
[*domain.scoped_full_path, "
|
23
|
+
[*domain.scoped_full_path, "Types", *model_prefix, model_short_name, "#{model_short_name}.ts"]
|
24
|
+
end
|
25
|
+
|
26
|
+
def model_short_name
|
27
|
+
type_short_name
|
24
28
|
end
|
25
29
|
|
26
30
|
def template_path
|
27
31
|
["Model", "Model.ts.erb"]
|
28
32
|
end
|
29
33
|
|
34
|
+
def model_prefix
|
35
|
+
type_prefix
|
36
|
+
end
|
37
|
+
|
30
38
|
def model_name(points = nil)
|
31
39
|
type_name(points)
|
32
40
|
end
|
@@ -3,7 +3,22 @@ module Foobara
|
|
3
3
|
class Services
|
4
4
|
class ModelManifestGenerator < ManifestGenerator
|
5
5
|
def target_path
|
6
|
-
[*domain.scoped_full_path, "
|
6
|
+
[*domain.scoped_full_path, "Types", *model_prefix, scoped_short_name, "manifest.json"]
|
7
|
+
end
|
8
|
+
|
9
|
+
# TODO: DRY this up
|
10
|
+
def model_prefix
|
11
|
+
path = scoped_prefix
|
12
|
+
|
13
|
+
if path && !path.empty?
|
14
|
+
if path.first == "Types"
|
15
|
+
path[1..]
|
16
|
+
else
|
17
|
+
path
|
18
|
+
end
|
19
|
+
else
|
20
|
+
[]
|
21
|
+
end
|
7
22
|
end
|
8
23
|
end
|
9
24
|
end
|
@@ -21,13 +21,31 @@ module Foobara
|
|
21
21
|
alias type_manifest relevant_manifest
|
22
22
|
|
23
23
|
def target_path
|
24
|
-
[*domain.scoped_full_path, "
|
24
|
+
[*domain.scoped_full_path, "Types", *type_prefix, "#{type_short_name}.ts"]
|
25
|
+
end
|
26
|
+
|
27
|
+
def type_short_name
|
28
|
+
scoped_short_name
|
25
29
|
end
|
26
30
|
|
27
31
|
def template_path
|
28
32
|
["Type", "Type.ts.erb"]
|
29
33
|
end
|
30
34
|
|
35
|
+
def type_prefix
|
36
|
+
path = scoped_prefix
|
37
|
+
|
38
|
+
if path && !path.empty?
|
39
|
+
if path.first == "Types"
|
40
|
+
path[1..]
|
41
|
+
else
|
42
|
+
path
|
43
|
+
end
|
44
|
+
else
|
45
|
+
[]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
31
49
|
def scoped_full_path(points = nil)
|
32
50
|
full_path = type_manifest.scoped_full_path
|
33
51
|
|
@@ -85,7 +103,7 @@ module Foobara
|
|
85
103
|
end
|
86
104
|
|
87
105
|
def type_name_downcase
|
88
|
-
|
106
|
+
type_short_name[0].downcase + type_short_name[1..]
|
89
107
|
end
|
90
108
|
|
91
109
|
def attributes_type_ts_type
|
@@ -3,18 +3,13 @@ module Foobara
|
|
3
3
|
class Services
|
4
4
|
class UnloadedEntityGenerator < EntityGenerator
|
5
5
|
def target_path
|
6
|
-
[*
|
6
|
+
[*super[..-2], "Unloaded.ts"]
|
7
7
|
end
|
8
8
|
|
9
9
|
def template_path
|
10
10
|
["Entity", "Unloaded.ts.erb"]
|
11
11
|
end
|
12
12
|
|
13
|
-
def ts_instance_path
|
14
|
-
*prefix, name = super
|
15
|
-
[*prefix, "Unloaded#{name}"]
|
16
|
-
end
|
17
|
-
|
18
13
|
def ts_instance_full_path
|
19
14
|
*prefix, name = super
|
20
15
|
[*prefix, "Unloaded#{name}"]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
type Result = <%= foobara_type_to_ts_type(result_type, dependency_group:, association_depth:) %>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
2
|
+
<%= entity_short_name %>AttributesType
|
3
3
|
} from "./Ambiguous"
|
4
|
-
import { Loaded<%=
|
4
|
+
import { Loaded<%= entity_short_name %> } from "./Loaded"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= entity_short_name %>AggregateAttributesType extends <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= entity_short_name %>Aggregate extends Loaded<%= entity_short_name %><<%= entity_short_name %>AggregateAttributesType> {
|
12
12
|
<% if has_associations? %>
|
13
13
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
14
14
|
get isAtom (): false { return false }
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import { Entity } from "<%= path_to_root %>base/Entity"
|
2
2
|
<% dependency_roots.each do |dependency_root| %>
|
3
|
-
import
|
3
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
export type <%=
|
6
|
+
export type <%= entity_short_name %>PrimaryKeyType = <%= primary_key_ts_type %>
|
7
7
|
export const <%= entity_name_downcase %>PrimaryKeyAttributeName: "<%= primary_key_name %>" = "<%= primary_key_name %>"
|
8
|
-
export interface <%=
|
8
|
+
export interface <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
|
9
9
|
|
10
|
-
export class <%=
|
11
|
-
AttributesType extends <%=
|
12
|
-
> extends Entity<<%=
|
13
|
-
static readonly modelName: string = "<%=
|
14
|
-
static readonly entityName: string = "<%=
|
10
|
+
export class <%= entity_short_name %><
|
11
|
+
AttributesType extends <%= entity_short_name %>AttributesType = <%= entity_short_name %>AttributesType
|
12
|
+
> extends Entity<<%= entity_short_name %>PrimaryKeyType, AttributesType> {
|
13
|
+
static readonly modelName: string = "<%= entity_short_name %>"
|
14
|
+
static readonly entityName: string = "<%= entity_short_name %>"
|
15
15
|
static readonly primaryKeyAttributeName: "<%= primary_key_name %>" = "<%= primary_key_name %>"
|
16
16
|
|
17
|
-
get <%= primary_key_name %> (): <%=
|
17
|
+
get <%= primary_key_name %> (): <%= entity_short_name %>PrimaryKeyType {
|
18
18
|
return this.primaryKey
|
19
19
|
}
|
20
20
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
2
|
+
<%= entity_short_name %>AttributesType
|
3
3
|
} from "./Ambiguous"
|
4
|
-
import { Loaded<%=
|
4
|
+
import { Loaded<%= entity_short_name %> } from "./Loaded"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= entity_short_name %>AtomAttributesType extends <%= entity_short_name %>AttributesType <%= atom_attributes_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= entity_short_name %>Atom extends Loaded<%= entity_short_name %><<%= entity_short_name %>AtomAttributesType> {
|
12
12
|
<% if has_associations? %>
|
13
13
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
14
14
|
get isAtom (): true { return true }
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
2
|
+
<%= entity_short_name %>,
|
3
|
+
<%= entity_short_name %>AttributesType
|
4
4
|
} from "./Ambiguous"
|
5
5
|
|
6
|
-
export class Loaded<%=
|
6
|
+
export class Loaded<%= entity_short_name %><T extends <%= entity_short_name %>AttributesType = <%= entity_short_name %>AttributesType> extends <%= entity_short_name %><T> {
|
7
7
|
readonly isLoaded: true = true
|
8
8
|
<% unless has_associations? %>
|
9
9
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Never } from "<%= path_to_root %>base/Entity"
|
2
2
|
import {
|
3
|
-
<%=
|
4
|
-
//<%=
|
5
|
-
<%=
|
3
|
+
<%= entity_short_name %>,
|
4
|
+
//<%= entity_short_name %>PrimaryKeyType
|
5
|
+
<%= entity_short_name %>AttributesType
|
6
6
|
} from "./Ambiguous"
|
7
7
|
|
8
|
-
export type Unloaded<%=
|
8
|
+
export type Unloaded<%= entity_short_name %>AttributesType = Never<<%= entity_short_name %>AttributesType>
|
9
9
|
|
10
|
-
export class Unloaded<%=
|
10
|
+
export class Unloaded<%= entity_short_name %> extends <%= entity_short_name %><Unloaded<%= entity_short_name %>AttributesType> {
|
11
11
|
/*
|
12
|
-
constructor(id: <%=
|
12
|
+
constructor(id: <%= entity_short_name %>PrimaryKeyType) {
|
13
13
|
super(id, {})
|
14
14
|
}
|
15
15
|
*/
|
@@ -1,40 +1,40 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
2
|
+
<%= entity_short_name %>,
|
3
|
+
<%= entity_short_name %>PrimaryKeyType,
|
4
4
|
<%= entity_name_downcase %>PrimaryKeyAttributeName,
|
5
|
-
<%=
|
6
|
-
} from "./<%=
|
5
|
+
<%= entity_short_name %>AttributesType
|
6
|
+
} from "./<%= entity_short_name %>/Ambiguous"
|
7
7
|
import {
|
8
|
-
Unloaded<%=
|
9
|
-
Unloaded<%=
|
10
|
-
} from "./<%=
|
8
|
+
Unloaded<%= entity_short_name %>,
|
9
|
+
Unloaded<%= entity_short_name %>AttributesType
|
10
|
+
} from "./<%= entity_short_name %>/Unloaded"
|
11
11
|
import {
|
12
|
-
Loaded<%=
|
13
|
-
} from "./<%=
|
12
|
+
Loaded<%= entity_short_name %>
|
13
|
+
} from "./<%= entity_short_name %>/Loaded"
|
14
14
|
|
15
15
|
<% if has_associations? %>
|
16
16
|
import {
|
17
|
-
<%=
|
18
|
-
<%=
|
19
|
-
} from "./<%=
|
17
|
+
<%= entity_short_name %>Atom,
|
18
|
+
<%= entity_short_name %>AtomAttributesType
|
19
|
+
} from "./<%= entity_short_name %>/Atom"
|
20
20
|
import {
|
21
|
-
<%=
|
22
|
-
<%=
|
23
|
-
} from "./<%=
|
21
|
+
<%= entity_short_name %>Aggregate,
|
22
|
+
<%= entity_short_name %>AggregateAttributesType
|
23
|
+
} from "./<%= entity_short_name %>/Aggregate"
|
24
24
|
<% end %>
|
25
25
|
|
26
26
|
export {
|
27
|
-
<%=
|
28
|
-
type <%=
|
29
|
-
Unloaded<%=
|
30
|
-
type Unloaded<%=
|
31
|
-
Loaded<%=
|
27
|
+
<%= entity_short_name %>,
|
28
|
+
type <%= entity_short_name %>AttributesType,
|
29
|
+
Unloaded<%= entity_short_name %>,
|
30
|
+
type Unloaded<%= entity_short_name %>AttributesType,
|
31
|
+
Loaded<%= entity_short_name %>,
|
32
32
|
<% if has_associations? %>
|
33
|
-
<%=
|
34
|
-
type <%=
|
35
|
-
<%=
|
36
|
-
type <%=
|
33
|
+
<%= entity_short_name %>Atom,
|
34
|
+
type <%= entity_short_name %>AtomAttributesType,
|
35
|
+
<%= entity_short_name %>Aggregate,
|
36
|
+
type <%= entity_short_name %>AggregateAttributesType,
|
37
37
|
<% end %>
|
38
|
-
type <%=
|
38
|
+
type <%= entity_short_name %>PrimaryKeyType,
|
39
39
|
<%= entity_name_downcase %>PrimaryKeyAttributeName
|
40
40
|
}
|
data/templates/Error.ts.erb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
import { <%= error_base_class %> } from "<%= path_to_root %>base/Error"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= model_short_name %>AggregateAttributesType extends <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= model_short_name %>Aggregate extends <%= model_short_name %><<%= model_short_name %>AggregateAttributesType> {
|
12
12
|
}
|
data/templates/Model/Atom.ts.erb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= model_short_name %>AtomAttributesType extends <%= model_short_name %>AttributesType <%= atom_attributes_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= model_short_name %>Atom extends <%= model_short_name %><<%= model_short_name %>AtomAttributesType> {
|
12
12
|
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Model } from "<%= path_to_root %>base/Model"
|
2
2
|
<% dependency_roots.each do |dependency_root| %>
|
3
|
-
import
|
3
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
export interface <%=
|
6
|
+
export interface <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
|
7
7
|
|
8
|
-
export class <%=
|
9
|
-
AttributesType extends <%=
|
8
|
+
export class <%= model_short_name %><
|
9
|
+
AttributesType extends <%= model_short_name %>AttributesType = <%= model_short_name %>AttributesType
|
10
10
|
> extends Model<AttributesType> {
|
11
|
-
static readonly modelName: string = "<%=
|
11
|
+
static readonly modelName: string = "<%= model_short_name %>"
|
12
12
|
|
13
13
|
<% attribute_names.each do |attribute_name| %>
|
14
14
|
get <%= attribute_name %> (): AttributesType["<%= attribute_name %>"] {
|
@@ -1,26 +1,26 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>/<%= model_short_name %>"
|
5
5
|
|
6
6
|
<% if has_associations? %>
|
7
7
|
import {
|
8
|
-
<%=
|
9
|
-
<%=
|
10
|
-
} from "./<%=
|
8
|
+
<%= model_short_name %>Atom,
|
9
|
+
<%= model_short_name %>AtomAttributesType
|
10
|
+
} from "./<%= model_short_name %>/Atom"
|
11
11
|
import {
|
12
|
-
<%=
|
13
|
-
<%=
|
14
|
-
} from "./<%=
|
12
|
+
<%= model_short_name %>Aggregate,
|
13
|
+
<%= model_short_name %>AggregateAttributesType
|
14
|
+
} from "./<%= model_short_name %>/Aggregate"
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
export {
|
18
|
-
<%=
|
19
|
-
type <%=
|
18
|
+
<%= model_short_name %>,
|
19
|
+
type <%= model_short_name %>AttributesType,
|
20
20
|
<% if has_associations? %>
|
21
|
-
<%=
|
22
|
-
type <%=
|
23
|
-
<%=
|
24
|
-
type <%=
|
21
|
+
<%= model_short_name %>Atom,
|
22
|
+
type <%= model_short_name %>AtomAttributesType,
|
23
|
+
<%= model_short_name %>Aggregate,
|
24
|
+
type <%= model_short_name %>AggregateAttributesType,
|
25
25
|
<% end %>
|
26
26
|
}
|
data/templates/Type/Type.ts.erb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
export type <%=
|
5
|
+
export type <%= type_short_name %> = <%= type_guts %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-typescript-remote-command-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foobara
|