foobara-typescript-remote-command-generator 0.0.8 → 0.0.9

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: 27cb6ef7f6663334fbcc7c69452e640433ac4ad1f3625936c5f3831bd3188df5
4
- data.tar.gz: 4d82620538e0785816f0162866245a733bc07d2408532b5924e7b5973375e947
3
+ metadata.gz: cc6158bda17aa24741a79802c5e0016120801eed6a7f73a4c26eb68040fbd0ed
4
+ data.tar.gz: 8803880e3bd4463b21be3a08b09d33387a43f5d6a497af42cc59b9aa5dd764bb
5
5
  SHA512:
6
- metadata.gz: b3beba79567383ff5e840473670a8f42e7844f44d6f5f8b83c6bebafac325fb3a12129f4c9e801fe33d6c41c49cf35bd12108be72b5200a9430e0468050fbeb8
7
- data.tar.gz: dec1d11f0255485c8670eaaa08181b1115b062c55e1e9f4d430c0294b255e4390d772af12a5771517308777463c038314179b687c7b4f5a8406baf10fcc7c330
6
+ metadata.gz: 2c62a4e4597c9774b894747137a834d9a5aaff70269f322e20e93192ee6d34dff8bb88c0cd8a1fd488320eb373b9002d3523d6ee51b48f1887a5f4cedf4cb9ee
7
+ data.tar.gz: ec1a895e62d555c58b1ffe0a2161b4c422dc2222ae0d762da4adfb34631a7d8369a824021fd7fd36242101e281bbc5a7ac97d13fa5f48fdedf751836c905f4a6
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.0.8] - 2025-02-02
1
+ ## [0.0.9] - 2025-02-21
2
+
3
+ - Fix a bug where we don't use the name of a custom type when we could
4
+
5
+ ## [0.0.8] - 2025-02-21
2
6
 
3
7
  - Make sure entity/detached_entity/model are used properly in several places
4
8
 
@@ -17,6 +17,7 @@ module Foobara
17
17
  include_non_templated_files
18
18
 
19
19
  add_root_manifest_to_set_of_elements_to_generate
20
+ # TODO: allow specifying subset of commands
20
21
  add_all_commands_to_set_of_elements_to_generate
21
22
 
22
23
  each_element_to_generate do
@@ -222,10 +222,8 @@ module Foobara
222
222
  else
223
223
  if type_declaration.model?
224
224
  model_to_ts_model_name(type_declaration, association_depth:, initial:)
225
- elsif can_convert_type_declaration_to_ts_type?(type_declaration)
226
- type = type_declaration.to_type
227
-
228
- custom_type_to_ts_type_name(type)
225
+ elsif type_declaration.custom?
226
+ custom_type_to_ts_type_name(type_declaration)
229
227
  end
230
228
  end
231
229
  end
@@ -247,22 +245,6 @@ module Foobara
247
245
  end
248
246
  end
249
247
 
250
- def can_convert_type_declaration_to_ts_type?(type_declaration)
251
- type = type_declaration.to_type
252
-
253
- return false if BuiltinTypes.builtin_reference?(type.reference)
254
-
255
- allowed_keys = %w[type one_of allows_nil]
256
-
257
- declaration_data = type.declaration_data
258
-
259
- bad_keys = declaration_data.keys - allowed_keys
260
-
261
- return false unless bad_keys.empty?
262
-
263
- BuiltinTypes.builtin_reference?(declaration_data["type"])
264
- end
265
-
266
248
  def attributes_to_ts_type(attributes, dependency_group:, association_depth: AssociationDepth::AMBIGUOUS)
267
249
  guts = attributes.attribute_declarations.map do |attribute_name, attribute_declaration|
268
250
  " #{attribute_name}#{"?" unless attributes.required?(attribute_name)}: #{
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-typescript-remote-command-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-02 00:00:00.000000000 Z
10
+ date: 2025-02-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara