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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/src/remote_generator/services/aggregate_entity_generator.rb +1 -1
  4. data/src/remote_generator/services/aggregate_model_generator.rb +1 -6
  5. data/src/remote_generator/services/atom_entity_generator.rb +1 -1
  6. data/src/remote_generator/services/atom_model_generator.rb +1 -6
  7. data/src/remote_generator/services/entity_generator.rb +5 -1
  8. data/src/remote_generator/services/entity_variants_generator.rb +3 -1
  9. data/src/remote_generator/services/loaded_entity_generator.rb +1 -1
  10. data/src/remote_generator/services/model_generator.rb +9 -1
  11. data/src/remote_generator/services/model_manifest_generator.rb +16 -1
  12. data/src/remote_generator/services/model_variants_generator.rb +1 -1
  13. data/src/remote_generator/services/type_generator.rb +20 -2
  14. data/src/remote_generator/services/typescript_from_manifest_base_generator.rb +0 -4
  15. data/src/remote_generator/services/unloaded_entity_generator.rb +1 -6
  16. data/templates/Command/Result.ts.erb +1 -1
  17. data/templates/Entity/Aggregate.ts.erb +5 -5
  18. data/templates/Entity/Ambiguous.ts.erb +9 -9
  19. data/templates/Entity/Atom.ts.erb +5 -5
  20. data/templates/Entity/Loaded.ts.erb +3 -3
  21. data/templates/Entity/Unloaded.ts.erb +6 -6
  22. data/templates/EntityVariants.ts.erb +25 -25
  23. data/templates/Error.ts.erb +1 -1
  24. data/templates/Model/Aggregate.ts.erb +6 -6
  25. data/templates/Model/Atom.ts.erb +6 -6
  26. data/templates/Model/Model.ts.erb +5 -5
  27. data/templates/ModelVariants.ts.erb +15 -15
  28. data/templates/Type/Type.ts.erb +2 -2
  29. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0778047e7295db9856a2f2c5907aa62e320857f514a29b68bd9eaf9a5f0c9df4'
4
- data.tar.gz: 2a2e997115c42c315725afe2632c73359819a642d48f311d8efb14fee53798d9
3
+ metadata.gz: 0a7d35269e0cccd832d9f2273e87df63886b43653f8f3188c835f3d98b57bbb6
4
+ data.tar.gz: 2a28d7e124c91342b41f598e2d83fde63f9a6d1a4a882d8865b68da39763773b
5
5
  SHA512:
6
- metadata.gz: cdc5356fa30759987e1d854a7aab83aa9ad0bb7dd3194aa2d8156cf9871990e2d2904bd6bd3a2f2fb487e7125fe81d6677180f85726b7887300451bb71a97b74
7
- data.tar.gz: 1bb61a8659f0816ffa2ebbd42065b2e3f34471820012a5c5528081229d83be1e857155c4a5655457890b5c30d622340e4b68b9b8e26b6f71734f3315c62aa0c5
6
+ metadata.gz: 221ffce09538be115791fd15ef205a4d381828974a8076fd693db489a749598edcdf68c5faafe21f570830c73f8ff3fb838af3b4a9c388ccf665282b6ce41952
7
+ data.tar.gz: e3a47338014c6d6f819c6ac9e1b6269558cf2955ae1d4a709a4c000d03029de634617683566c3f6a6d3f3a056add55fc4ff8a039e4acb4115b4f13a6fbdb4780
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
- ## [unreleased] - 2024-08-2x
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
- [*domain.scoped_full_path, "types", entity_name, "Aggregate.ts"]
20
+ [*super[..-2], "Aggregate.ts"]
21
21
  end
22
22
 
23
23
  def template_path
@@ -17,7 +17,7 @@ module Foobara
17
17
  end
18
18
 
19
19
  def target_path
20
- [*domain.scoped_full_path, "types", model_name, "Aggregate.ts"]
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"]
@@ -15,7 +15,7 @@ module Foobara
15
15
  end
16
16
 
17
17
  def target_path
18
- [*domain.scoped_full_path, "types", entity_name, "Atom.ts"]
18
+ [*super[..-2], "Atom.ts"]
19
19
  end
20
20
 
21
21
  def template_path
@@ -17,7 +17,7 @@ module Foobara
17
17
  end
18
18
 
19
19
  def target_path
20
- [*domain.scoped_full_path, "types", model_name, "Atom.ts"]
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
- [*domain.scoped_full_path, "types", entity_name, "Ambiguous.ts"]
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
- [*domain.scoped_full_path, "types", "#{model_name}.ts"]
8
+ *prefix, _entity_name, _file = super
9
+
10
+ [*prefix, "#{entity_short_name}.ts"]
9
11
  end
10
12
 
11
13
  def template_path
@@ -5,7 +5,7 @@ module Foobara
5
5
  class Services
6
6
  class LoadedEntityGenerator < EntityGenerator
7
7
  def target_path
8
- [*domain.scoped_full_path, "types", entity_name, "Loaded.ts"]
8
+ [*super[..-2], "Loaded.ts"]
9
9
  end
10
10
 
11
11
  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, "types", model_name, "#{model_name}.ts"]
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, "types", model_name, "manifest.json"]
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
@@ -3,7 +3,7 @@ module Foobara
3
3
  class Services
4
4
  class ModelVariantsGenerator < ModelGenerator
5
5
  def target_path
6
- [*domain.scoped_full_path, "types", "#{model_name}.ts"]
6
+ [*domain.scoped_full_path, "Types", *model_prefix, "#{scoped_short_name}.ts"]
7
7
  end
8
8
 
9
9
  def template_path
@@ -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, "types", "#{type_name}.ts"]
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
- type_name[0].downcase + type_name[1..]
106
+ type_short_name[0].downcase + type_short_name[1..]
89
107
  end
90
108
 
91
109
  def attributes_type_ts_type
@@ -117,10 +117,6 @@ module Foobara
117
117
  dependency_group.non_colliding_dependency_roots.sort_by(&:scoped_full_name)
118
118
  end
119
119
 
120
- def ts_instance_name
121
- ts_instance_path.join(".")
122
- end
123
-
124
120
  def ts_instance_path
125
121
  scoped_path
126
122
  end
@@ -3,18 +3,13 @@ module Foobara
3
3
  class Services
4
4
  class UnloadedEntityGenerator < EntityGenerator
5
5
  def target_path
6
- [*domain.scoped_full_path, "types", entity_name, "Unloaded.ts"]
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 { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
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
- <%= entity_name %>AttributesType
2
+ <%= entity_short_name %>AttributesType
3
3
  } from "./Ambiguous"
4
- import { Loaded<%= entity_name %> } from "./Loaded"
4
+ import { Loaded<%= entity_short_name %> } from "./Loaded"
5
5
  <% dependency_roots.each do |dependency_root| %>
6
- import { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
6
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
7
7
  <% end %>
8
8
 
9
- export interface <%= entity_name %>AggregateAttributesType extends <%= entity_name %>AttributesType <%= attributes_type_ts_type %>
9
+ export interface <%= entity_short_name %>AggregateAttributesType extends <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
10
10
 
11
- export class <%= entity_name %>Aggregate extends Loaded<%= entity_name %><<%= entity_name %>AggregateAttributesType> {
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 { <%= dependency_root.scoped_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
3
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
4
4
  <% end %>
5
5
 
6
- export type <%= entity_name %>PrimaryKeyType = <%= primary_key_ts_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 <%= entity_name %>AttributesType <%= attributes_type_ts_type %>
8
+ export interface <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
9
9
 
10
- export class <%= entity_name %><
11
- AttributesType extends <%= entity_name %>AttributesType = <%= entity_name %>AttributesType
12
- > extends Entity<<%= entity_name %>PrimaryKeyType, AttributesType> {
13
- static readonly modelName: string = "<%= entity_name %>"
14
- static readonly entityName: string = "<%= entity_name %>"
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 %> (): <%= entity_name %>PrimaryKeyType {
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
- <%= entity_name %>AttributesType
2
+ <%= entity_short_name %>AttributesType
3
3
  } from "./Ambiguous"
4
- import { Loaded<%= entity_name %> } from "./Loaded"
4
+ import { Loaded<%= entity_short_name %> } from "./Loaded"
5
5
  <% dependency_roots.each do |dependency_root| %>
6
- import { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
6
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
7
7
  <% end %>
8
8
 
9
- export interface <%= entity_name %>AtomAttributesType extends <%= entity_name %>AttributesType <%= atom_attributes_ts_type %>
9
+ export interface <%= entity_short_name %>AtomAttributesType extends <%= entity_short_name %>AttributesType <%= atom_attributes_ts_type %>
10
10
 
11
- export class <%= entity_name %>Atom extends Loaded<%= entity_name %><<%= entity_name %>AtomAttributesType> {
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
- <%= entity_name %>,
3
- <%= entity_name %>AttributesType
2
+ <%= entity_short_name %>,
3
+ <%= entity_short_name %>AttributesType
4
4
  } from "./Ambiguous"
5
5
 
6
- export class Loaded<%= entity_name %><T extends <%= entity_name %>AttributesType = <%= entity_name %>AttributesType> extends <%= entity_name %><T> {
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
- <%= entity_name %>,
4
- //<%= entity_name %>PrimaryKeyType
5
- <%= entity_name %>AttributesType
3
+ <%= entity_short_name %>,
4
+ //<%= entity_short_name %>PrimaryKeyType
5
+ <%= entity_short_name %>AttributesType
6
6
  } from "./Ambiguous"
7
7
 
8
- export type Unloaded<%= entity_name %>AttributesType = Never<<%= entity_name %>AttributesType>
8
+ export type Unloaded<%= entity_short_name %>AttributesType = Never<<%= entity_short_name %>AttributesType>
9
9
 
10
- export class Unloaded<%= entity_name %> extends <%= entity_name %><Unloaded<%= entity_name %>AttributesType> {
10
+ export class Unloaded<%= entity_short_name %> extends <%= entity_short_name %><Unloaded<%= entity_short_name %>AttributesType> {
11
11
  /*
12
- constructor(id: <%= entity_name %>PrimaryKeyType) {
12
+ constructor(id: <%= entity_short_name %>PrimaryKeyType) {
13
13
  super(id, {})
14
14
  }
15
15
  */
@@ -1,40 +1,40 @@
1
1
  import {
2
- <%= entity_name %>,
3
- <%= entity_name %>PrimaryKeyType,
2
+ <%= entity_short_name %>,
3
+ <%= entity_short_name %>PrimaryKeyType,
4
4
  <%= entity_name_downcase %>PrimaryKeyAttributeName,
5
- <%= entity_name %>AttributesType
6
- } from "./<%= entity_name %>/Ambiguous"
5
+ <%= entity_short_name %>AttributesType
6
+ } from "./<%= entity_short_name %>/Ambiguous"
7
7
  import {
8
- Unloaded<%= entity_name %>,
9
- Unloaded<%= entity_name %>AttributesType
10
- } from "./<%= entity_name %>/Unloaded"
8
+ Unloaded<%= entity_short_name %>,
9
+ Unloaded<%= entity_short_name %>AttributesType
10
+ } from "./<%= entity_short_name %>/Unloaded"
11
11
  import {
12
- Loaded<%= entity_name %>
13
- } from "./<%= entity_name %>/Loaded"
12
+ Loaded<%= entity_short_name %>
13
+ } from "./<%= entity_short_name %>/Loaded"
14
14
 
15
15
  <% if has_associations? %>
16
16
  import {
17
- <%= entity_name %>Atom,
18
- <%= entity_name %>AtomAttributesType
19
- } from "./<%= entity_name %>/Atom"
17
+ <%= entity_short_name %>Atom,
18
+ <%= entity_short_name %>AtomAttributesType
19
+ } from "./<%= entity_short_name %>/Atom"
20
20
  import {
21
- <%= entity_name %>Aggregate,
22
- <%= entity_name %>AggregateAttributesType
23
- } from "./<%= entity_name %>/Aggregate"
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
- <%= entity_name %>,
28
- type <%= entity_name %>AttributesType,
29
- Unloaded<%= entity_name %>,
30
- type Unloaded<%= entity_name %>AttributesType,
31
- Loaded<%= entity_name %>,
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
- <%= entity_name %>Atom,
34
- type <%= entity_name %>AtomAttributesType,
35
- <%= entity_name %>Aggregate,
36
- type <%= entity_name %>AggregateAttributesType,
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 <%= entity_name %>PrimaryKeyType,
38
+ type <%= entity_short_name %>PrimaryKeyType,
39
39
  <%= entity_name_downcase %>PrimaryKeyAttributeName
40
40
  }
@@ -1,5 +1,5 @@
1
1
  <% dependency_roots.each do |dependency_root| %>
2
- import { <%= dependency_root.scoped_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
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
- <%= model_name %>,
3
- <%= model_name %>AttributesType
4
- } from "./<%= model_name %>"
2
+ <%= model_short_name %>,
3
+ <%= model_short_name %>AttributesType
4
+ } from "./<%= model_short_name %>"
5
5
  <% dependency_roots.each do |dependency_root| %>
6
- import { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
6
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
7
7
  <% end %>
8
8
 
9
- export interface <%= model_name %>AggregateAttributesType extends <%= model_name %>AttributesType <%= attributes_type_ts_type %>
9
+ export interface <%= model_short_name %>AggregateAttributesType extends <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
10
10
 
11
- export class <%= model_name %>Aggregate extends <%= model_name %><<%= model_name %>AggregateAttributesType> {
11
+ export class <%= model_short_name %>Aggregate extends <%= model_short_name %><<%= model_short_name %>AggregateAttributesType> {
12
12
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
- <%= model_name %>,
3
- <%= model_name %>AttributesType
4
- } from "./<%= model_name %>"
2
+ <%= model_short_name %>,
3
+ <%= model_short_name %>AttributesType
4
+ } from "./<%= model_short_name %>"
5
5
  <% dependency_roots.each do |dependency_root| %>
6
- import { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
6
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
7
7
  <% end %>
8
8
 
9
- export interface <%= model_name %>AtomAttributesType extends <%= model_name %>AttributesType <%= atom_attributes_ts_type %>
9
+ export interface <%= model_short_name %>AtomAttributesType extends <%= model_short_name %>AttributesType <%= atom_attributes_ts_type %>
10
10
 
11
- export class <%= model_name %>Atom extends <%= model_name %><<%= model_name %>AtomAttributesType> {
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 { <%= dependency_root.scoped_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
3
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
4
4
  <% end %>
5
5
 
6
- export interface <%= model_name %>AttributesType <%= attributes_type_ts_type %>
6
+ export interface <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
7
7
 
8
- export class <%= model_name %><
9
- AttributesType extends <%= model_name %>AttributesType = <%= model_name %>AttributesType
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 = "<%= model_name %>"
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
- <%= model_name %>,
3
- <%= model_name %>AttributesType
4
- } from "./<%= model_name %>/<%= model_name %>"
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
- <%= model_name %>Atom,
9
- <%= model_name %>AtomAttributesType
10
- } from "./<%= model_name %>/Atom"
8
+ <%= model_short_name %>Atom,
9
+ <%= model_short_name %>AtomAttributesType
10
+ } from "./<%= model_short_name %>/Atom"
11
11
  import {
12
- <%= model_name %>Aggregate,
13
- <%= model_name %>AggregateAttributesType
14
- } from "./<%= model_name %>/Aggregate"
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
- <%= model_name %>,
19
- type <%= model_name %>AttributesType,
18
+ <%= model_short_name %>,
19
+ type <%= model_short_name %>AttributesType,
20
20
  <% if has_associations? %>
21
- <%= model_name %>Atom,
22
- type <%= model_name %>AtomAttributesType,
23
- <%= model_name %>Aggregate,
24
- type <%= model_name %>AggregateAttributesType,
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
  }
@@ -1,5 +1,5 @@
1
1
  <% dependency_roots.each do |dependency_root| %>
2
- import { <%= dependency_root.ts_instance_name %> } from "<%= path_to_root %><%= dependency_root.import_path %>"
2
+ import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
3
3
  <% end %>
4
4
 
5
- export type <%= type_name %> = <%= type_guts %>
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.3
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-22 00:00:00.000000000 Z
11
+ date: 2024-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara