foobara-typescript-remote-command-generator 1.2.2 → 1.2.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d547512385bac27319b644bb141ab01c46a53020b10e8aaf59f97f281733bc4
|
|
4
|
+
data.tar.gz: 0b5156e84353c299cd9b9076ad416f420306993181d9984e01b62fbbb2b4dbbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 076de1fb493fa9ad32f00fce13fef08f92da9dd9864efb17dd9137ea939737ada06485c0de0552d4d6ef59b7e4c5ae5ea541d3bc122bd8a088dbdfcd510efd42
|
|
7
|
+
data.tar.gz: 378f783a3dba0e843b5409414f2eb553aab1099555a9443c48d2ccdd3c8d67ef54b8d473c780bc83c44a469250445f9a624546915cde317d5ffc3fd6fc2d2e15
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.2.4] - 2026-01-26
|
|
2
|
+
|
|
3
|
+
- Fix bug where we include models/entities from command inputs
|
|
4
|
+
|
|
5
|
+
## [1.2.3] - 2026-01-24
|
|
6
|
+
|
|
7
|
+
- Default the project_directory to "." instead of the output_directory
|
|
8
|
+
|
|
1
9
|
## [1.2.2] - 2026-01-24
|
|
2
10
|
|
|
3
11
|
- Add support for an app model named Model, which collide's with Foobara's Model
|
|
@@ -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
|
|
@@ -9,7 +9,9 @@ module Foobara
|
|
|
9
9
|
raw_manifest :associative_array, :allow_nil
|
|
10
10
|
manifest_url :string, :allow_nil
|
|
11
11
|
# TODO: should be able to delete this and inherit it
|
|
12
|
-
project_directory :string,
|
|
12
|
+
project_directory :string,
|
|
13
|
+
default: ".",
|
|
14
|
+
description: "This lets you specify a directory to run the linter or npm run build in"
|
|
13
15
|
output_directory :string, default: "src/domains"
|
|
14
16
|
fail_if_does_not_pass_linter :boolean, default: false
|
|
15
17
|
end
|
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 %>
|