foobara-typescript-react-command-form-generator 0.0.5 → 0.0.6

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: 98f12c88a8181b6b5e97ce639cf82f169e085e7a2f2ad0766028d20cdee4ee01
4
- data.tar.gz: 88965d8870c4b33f9f7456abc9e9a5d348acd61b8bffe1833ba4f28494a75381
3
+ metadata.gz: 47704d6a141641f250df5e1c521f14ae1e5c60173e0b352651396a443a8bdb06
4
+ data.tar.gz: b02b4270b601341ca141679cca139a32c0fdfc70d2e4beae9b55d40517855eec
5
5
  SHA512:
6
- metadata.gz: 5b5d9b8836f3306141791e7c4f02ba929439a7f82679003bbc7b36d55995e63ef9e102feb3e3704d9f8cab3d442a6106654d93af6567d8db36dd17c625cb9aeb
7
- data.tar.gz: d62086d2df517d675be8f99df7e2dba8f50d7a490d369497b6b2c49427f44022313a8b8af45158285ceb6e774d5afb0f4b8aa598ea6e8606cacb2d320b885202
6
+ metadata.gz: c415082b254db71de3392f7934b80107ffe81fe28ca9d6c329379175a86b7a5b8fbe4e6cbce72b5af14d16211d0fa5607848be529a21492ac3ca56896a430832
7
+ data.tar.gz: 6eba139f88e611203a7428211c465eae8498573f6e882bd2cd28ea4efd8fb386db26af321f5f8e5886d0f63f01c7aae1f20017c0fa8b036914020c304b133074
data/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## [0.0.5] - 2025-02-21
1
+ ## [0.0.6] - 2025-02-21
2
2
 
3
- -
3
+ - Fix a bug where we don't use the name of a custom type when we could
4
4
 
5
- ## [0.0.4] - 2025-02-21
5
+ ## [0.0.5] - 2025-02-21
6
6
 
7
7
  - Bump Ruby to 3.4.2
8
8
  - Include custom types in form generator
@@ -105,6 +105,7 @@ module Foobara
105
105
  non_colliding_inputs(type_declaration.to_type.attributes_type, result, path)
106
106
  elsif type_declaration.array?
107
107
  if type_declaration.element_type
108
+ # TODO: isn't this a no-op??
108
109
  type_generators(type_declaration.element_type, false)
109
110
  end
110
111
  else
@@ -166,6 +167,25 @@ module Foobara
166
167
  self.type_declaration = type_declaration
167
168
  end
168
169
 
170
+ def custom?
171
+ type_declaration.custom?
172
+ end
173
+
174
+ def one_of
175
+ real_type_declaration.one_of
176
+ end
177
+
178
+ # TODO: something feels kind of wrong here, hmmm
179
+ def real_type_declaration
180
+ @real_type_declaration ||= if custom?
181
+ # We are dealing with a reference to a registered type
182
+ # so we need the declaration this type name was registered to
183
+ type_declaration.to_type.to_type_declaration_from_declaration_data
184
+ else
185
+ type_declaration
186
+ end
187
+ end
188
+
169
189
  def name
170
190
  first, *rest = path
171
191
 
@@ -187,11 +207,11 @@ module Foobara
187
207
  end
188
208
 
189
209
  def has_default?
190
- type_declaration.attribute? && default
210
+ real_type_declaration.attribute? && default
191
211
  end
192
212
 
193
213
  def default
194
- type_declaration.default
214
+ real_type_declaration.default
195
215
  end
196
216
 
197
217
  def ts_default
@@ -204,8 +224,6 @@ module Foobara
204
224
 
205
225
  def html_input
206
226
  # TODO: handle boolean, etc
207
- one_of = type_declaration.one_of
208
-
209
227
  if one_of
210
228
  ts_type = generator.foobara_type_to_ts_type(type_declaration)
211
229
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-typescript-react-command-form-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-21 00:00:00.000000000 Z
10
+ date: 2025-02-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara