Skip to content

Commit

Permalink
Import all types a type depends on
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Apr 12, 2024
1 parent 854f581 commit 13fcfde
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/foobara/remote_imports/import_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module RemoteImports
class ImportType < Command
include ImportBase

depends_on ImportDomain
depends_on ImportDomain, ImportType

def find_manifests_to_import
root_manifest.types
Expand All @@ -17,6 +17,15 @@ def import_object_from_manifest

return if existing_type

manifest_to_import.types_depended_on.each do |depended_on_type|
run_subcommand!(
ImportType,
raw_manifest: manifest_data,
to_import: depended_on_type.reference,
already_imported:
)
end

domain_manifest = manifest_to_import.domain

run_subcommand!(
Expand All @@ -31,7 +40,8 @@ def import_object_from_manifest
mode: Namespace::LookupMode::ABSOLUTE
)

domain.foobara_register_type(manifest_to_import.scoped_short_name, manifest_to_import.declaration_data)
domain.foobara_register_type(manifest_to_import.scoped_short_name,
manifest_to_import.declaration_data)
end
end
end
Expand Down

0 comments on commit 13fcfde

Please sign in to comment.