foobara-typescript-react-command-form-generator 0.0.12 → 0.0.13

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: 89eda43a93ac1f7704e90f6505078d6dca634f8e327836ad27559cfdfd3abc05
4
- data.tar.gz: 04befdc1aabc41b17ede232116cb34382a187e414b1da4194a1a16f91eed1dd8
3
+ metadata.gz: 467c16c27b86a4c0aede45050097f8cd67737b3276ff03dd3d303d760ba314ee
4
+ data.tar.gz: f886f32ce4b8ce156082fcb46a904e55357d68b487b56625845491c248f136b6
5
5
  SHA512:
6
- metadata.gz: d3f84bb2d7d26485ab18b697f1bc90354632a7f94f89a4800252f50dc90601970e48753b4712be5af5727ee17fe921d57b9f79f42e6abf173acf1f3e3dd54b3d
7
- data.tar.gz: 916539dcd2b832027969f7c191a67e9bc5878a32a60d7210b30d919ea569da2930cb9d556301c59fbd70a7a365f2b963a5aa1deb028ce83835cadc24d094a63b
6
+ metadata.gz: d2f7a25c256ef1c9a715de4f50b1b43408ad2f646a58a56453f07d943d4b52a5077cde055d916e72b06027c413cf1db1cbdcde27f049ed11ad270d107c9710d4
7
+ data.tar.gz: b6715c387a8a59b4ef8d3d3a2e943b122bdf4725af8b1909da152223fa61bb834e43a8cacddfd64ab1692573f94553c8255eb391f45bb36abf955d767271d809
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.0.13] - 2025-08-05
2
+
3
+ - Properly cast values passed to set<State> functions
4
+ - Properly build forms for detached entities as if they were proper entities
5
+
1
6
  ## [0.0.12] - 2025-04-15
2
7
 
3
8
  - Fix non-camelized get/set useState names for nested types
@@ -35,11 +35,14 @@ module Foobara
35
35
  def type_generators(type_declaration = inputs_type, initial = true)
36
36
  return @type_generators if defined?(@type_generators)
37
37
 
38
- generators = if type_declaration.entity?
38
+ generators = if type_declaration.detached_entity?
39
39
  # For now, we'll not bother with entity/model classes in the inputs.
40
40
  # This simplifies things a bit re: form generation and setting UI
41
41
  # inputs into the inputs value.
42
+ # TODO: test this path or delete it if unreachable!
43
+ # :nocov:
42
44
  type_generators(type_declaration.to_type.primary_key_type, false)
45
+ # :nocov:
43
46
  # generator_class = RemoteGenerator::Services::UnloadedEntityGenerator
44
47
  # [generator_class.new(type_declaration.to_entity)]
45
48
  elsif type_declaration.model?
@@ -107,9 +110,12 @@ module Foobara
107
110
  type_declaration.attribute_declarations.each_pair do |attribute_name, attribute_declaration|
108
111
  non_colliding_inputs(attribute_declaration, result, [*path, attribute_name])
109
112
  end
110
- elsif type_declaration.entity?
113
+ elsif type_declaration.detached_entity?
111
114
  # TODO: figure out how to not pass self here...
115
+ # TODO: test this path or delete it if unreachable!
116
+ # :nocov:
112
117
  result << FlattenedAttribute.new(self, path, type_declaration.to_type.primary_key_type)
118
+ # :nocov:
113
119
  elsif type_declaration.model?
114
120
  non_colliding_inputs(type_declaration.to_type.attributes_type, result, path)
115
121
  elsif type_declaration.array?
@@ -257,7 +263,8 @@ module Foobara
257
263
  "parseFloat(e.target.value)"
258
264
  # :nocov:
259
265
  else
260
- "e.target.value"
266
+ ts_type = generator.foobara_type_to_ts_type(type_declaration)
267
+ "e.target.value as #{ts_type}"
261
268
  end
262
269
 
263
270
  "<input
metadata CHANGED
@@ -1,7 +1,7 @@
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.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: foobara-typescript-remote-command-generator
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - "<"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.1
18
+ version: 2.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - "<"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.0.1
25
+ version: 2.0.0
26
26
  email:
27
27
  - azimux@gmail.com
28
28
  executables: []
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
- rubygems_version: 3.6.7
63
+ rubygems_version: 3.6.9
64
64
  specification_version: 4
65
65
  summary: Generates Typescript React forms for Foobara remote commands
66
66
  test_files: []