foobara-typescript-react-command-form-generator 0.0.5 → 0.0.7
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 +7 -3
- data/src/typescript_react_command_form_generator.rb +22 -4
- data/templates/CommandForm.tsx.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b35897d20a8b13506b4ec8199672f48b7137359289ed8bb86d20f7d69586907d
|
4
|
+
data.tar.gz: 01cdd93d50664be688e3df5f18278a4f8a973d544e3d97f356824c19692feed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41bdbeff66ef095ee0fed2d8290602fee4886fcd06b45403a1e99b230990e2967eecf000c8947a1c0475c8b6c4e14478cd7b9ad8cb877da01e042bd44263a690
|
7
|
+
data.tar.gz: d73b1cc9074ff09f3604ae9496fd78c5279543bf0386955342d112476487afbb5858d8b11db15ded93c19d781ef564f42167bb4cb6701e0766e97af0c80387ae
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
## [0.0.
|
1
|
+
## [0.0.7] - 2025-02-21
|
2
|
+
|
3
|
+
- import JSX in remote command form
|
2
4
|
|
3
|
-
-
|
5
|
+
## [0.0.6] - 2025-02-21
|
4
6
|
|
5
|
-
|
7
|
+
- Fix a bug where we don't use the name of a custom type when we could
|
8
|
+
|
9
|
+
## [0.0.5] - 2025-02-21
|
6
10
|
|
7
11
|
- Bump Ruby to 3.4.2
|
8
12
|
- 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
|
-
|
210
|
+
real_type_declaration.attribute? && default
|
191
211
|
end
|
192
212
|
|
193
213
|
def default
|
194
|
-
|
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.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-22 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foobara
|