Skip to content

Commit

Permalink
1702935889
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Dec 18, 2023
1 parent 09bd8de commit 6ec6d21
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/remote_generator/services/base_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def template_string
end

def erb_template
erb = ERB.new(template_string.gsub("\n<% end %>", "<% end %>"))
# erb = ERB.new(template_string.gsub("\n<% end %>", "<% end %>"))
erb = ERB.new(template_string)
erb.filename = absolute_template_path
erb
end
Expand Down
25 changes: 25 additions & 0 deletions src/remote_generator/services/entity_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ def aggregate_name
entity_name
end
end

def entity_generators
types_depended_on.select(&:entity?).map do |entity|
Services::EntityGenerator.new(entity, elements_to_generate)
end
rescue => e
binding.pry
raise
end

def primary_key_name
primary_key_attribute
end

def primary_key_ts_type
foobara_type_to_ts_type(primary_key_type)
end

def entity_name_downcase
entity_name[0].downcase + entity_name[1..]
end

def attributes_type_ts_type
binding.pry
end
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions src/remote_generator/templates/Error.ts.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<% binding.pry %>

interface <%= error_name %><
export interface <%= error_name %><
keyT extends string,
pathT extends string[] = [],
runtime_pathT extends string[] = []
Expand Down

0 comments on commit 6ec6d21

Please sign in to comment.