Skip to content

Commit 6ec6d21

Browse files
committed
1702935889
1 parent 09bd8de commit 6ec6d21

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

src/remote_generator/services/base_generator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def template_string
9999
end
100100

101101
def erb_template
102-
erb = ERB.new(template_string.gsub("\n<% end %>", "<% end %>"))
102+
# erb = ERB.new(template_string.gsub("\n<% end %>", "<% end %>"))
103+
erb = ERB.new(template_string)
103104
erb.filename = absolute_template_path
104105
erb
105106
end

src/remote_generator/services/entity_generator.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ def aggregate_name
4545
entity_name
4646
end
4747
end
48+
49+
def entity_generators
50+
types_depended_on.select(&:entity?).map do |entity|
51+
Services::EntityGenerator.new(entity, elements_to_generate)
52+
end
53+
rescue => e
54+
binding.pry
55+
raise
56+
end
57+
58+
def primary_key_name
59+
primary_key_attribute
60+
end
61+
62+
def primary_key_ts_type
63+
foobara_type_to_ts_type(primary_key_type)
64+
end
65+
66+
def entity_name_downcase
67+
entity_name[0].downcase + entity_name[1..]
68+
end
69+
70+
def attributes_type_ts_type
71+
binding.pry
72+
end
4873
end
4974
end
5075
end

src/remote_generator/templates/Error.ts.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<% binding.pry %>
2-
3-
interface <%= error_name %><
1+
export interface <%= error_name %><
42
keyT extends string,
53
pathT extends string[] = [],
64
runtime_pathT extends string[] = []

0 commit comments

Comments
 (0)