foobara-typescript-remote-command-generator 1.2.3 → 1.2.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 +8 -0
- data/src/remote_generator/services/aggregate_entity_generator.rb +0 -4
- data/src/remote_generator/services/domain_generator.rb +44 -8
- data/src/remote_generator/services/typescript_from_manifest_base_generator.rb +9 -1
- data/templates/Domain.ts.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 36ad5c92589d7b37a31298d44d7b3f3ccd6b3537a90d96816d9c35eb8cf7730d
|
|
4
|
+
data.tar.gz: 1d9d7564f82a39eec11aa36d5f1270a569a2936501ec87694933b67a8aeb6699
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0381acb1520c210bf2c3062c33841e2b90938877d3945b81130232c032f8c00798570bbb460fc48bc344920e4f50f0eb717481676335c063c0517824b2ebd964'
|
|
7
|
+
data.tar.gz: a51174dd6ef504fcb130c287281b1df30c0c0ffae7e651cc9d8b8718ac10b5d1c594d29e3194b934439c7a35700b2ae342542ab98f45a591c9d51640cd46a39a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.2.5] - 2026-01-27
|
|
2
|
+
|
|
3
|
+
- Fix circular dependency that happens if an item from this domain collides
|
|
4
|
+
|
|
5
|
+
## [1.2.4] - 2026-01-26
|
|
6
|
+
|
|
7
|
+
- Fix bug where we include models/entities from command inputs
|
|
8
|
+
|
|
1
9
|
## [1.2.3] - 2026-01-24
|
|
2
10
|
|
|
3
11
|
- Default the project_directory to "." instead of the output_directory
|
|
@@ -28,9 +28,9 @@ module Foobara
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def
|
|
32
|
-
@
|
|
33
|
-
|
|
31
|
+
def detached_entity_generators
|
|
32
|
+
@detached_entity_generators ||= domain_manifest.detached_entities.flat_map do |entity_manifest|
|
|
33
|
+
EntityVariantsGenerator.new(entity_manifest).dependencies.to_a
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
@@ -47,19 +47,55 @@ module Foobara
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def model_generators
|
|
50
|
-
# HERE!!!
|
|
51
50
|
@model_generators ||= begin
|
|
52
51
|
only_models = domain_manifest.models.reject(&:detached_entity?)
|
|
53
52
|
|
|
54
|
-
only_models.
|
|
55
|
-
|
|
53
|
+
only_models.flat_map do |model_manifest|
|
|
54
|
+
ModelVariantsGenerator.new(model_manifest).dependencies.to_a
|
|
56
55
|
end
|
|
57
56
|
end
|
|
58
57
|
end
|
|
59
58
|
|
|
59
|
+
def all_type_generators
|
|
60
|
+
all_type_generators = []
|
|
61
|
+
|
|
62
|
+
generators_allowed_for_inputs = [*type_generators, *model_generators]
|
|
63
|
+
generators_allowed_for_errors_or_result = [*generators_allowed_for_inputs, *detached_entity_generators]
|
|
64
|
+
|
|
65
|
+
Manifest::RootManifest.new(root_manifest).commands.each do |command_manifest|
|
|
66
|
+
command_generator = CommandGenerator.new(command_manifest)
|
|
67
|
+
|
|
68
|
+
command_generator.inputs_types_depended_on.each do |type_manifest|
|
|
69
|
+
next unless type_manifest.domain == relevant_manifest
|
|
70
|
+
|
|
71
|
+
generators_allowed_for_inputs.each do |generator|
|
|
72
|
+
if generator.relevant_manifest == type_manifest
|
|
73
|
+
all_type_generators << generator
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
[
|
|
79
|
+
*command_generator.result_type&.to_type,
|
|
80
|
+
*command_generator.result_types_depended_on.each,
|
|
81
|
+
*command_generator.errors_types_depended_on
|
|
82
|
+
].each do |type_manifest|
|
|
83
|
+
next unless type_manifest.domain == relevant_manifest
|
|
84
|
+
|
|
85
|
+
generators_allowed_for_errors_or_result.each do |generator|
|
|
86
|
+
if generator.relevant_manifest == type_manifest
|
|
87
|
+
all_type_generators << generator
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
all_type_generators.uniq!
|
|
94
|
+
all_type_generators
|
|
95
|
+
end
|
|
96
|
+
|
|
60
97
|
def dependencies
|
|
61
|
-
@dependencies ||= [*command_generators, *
|
|
62
|
-
*organization]
|
|
98
|
+
@dependencies ||= [*command_generators, *all_type_generators, organization]
|
|
63
99
|
end
|
|
64
100
|
|
|
65
101
|
def domain_name
|
|
@@ -145,7 +145,15 @@ module Foobara
|
|
|
145
145
|
@dependency_roots = dependency_group.non_colliding_dependency_roots.sort_by(&:scoped_full_name)
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
-
def collision_winners
|
|
148
|
+
def collision_winners
|
|
149
|
+
# TODO: odd that root_manifest exists but isn't decorated. We need a decorated and undecorated method
|
|
150
|
+
root_manifest = Manifest::RootManifest.new(self.root_manifest)
|
|
151
|
+
|
|
152
|
+
[*dependencies].select do |dependency|
|
|
153
|
+
root_manifest.contains?(dependency.domain_reference, :domain) &&
|
|
154
|
+
dependency.domain == domain
|
|
155
|
+
end
|
|
156
|
+
end
|
|
149
157
|
|
|
150
158
|
def ts_instance_path
|
|
151
159
|
scoped_path
|
data/templates/Domain.ts.erb
CHANGED
|
@@ -12,6 +12,6 @@ export <%= command.command_errors_index_generator.import_destructure %> from "<%
|
|
|
12
12
|
<% end %>
|
|
13
13
|
|
|
14
14
|
// TODO: put these on an entities module so that commands can be the only top-level interface.
|
|
15
|
-
<%
|
|
15
|
+
<% all_type_generators.each do |entity| %>
|
|
16
16
|
export <%= entity.import_destructure %> from "<%= path_to_root %><%= entity.import_path %>"
|
|
17
17
|
<% end %>
|