foobara-typescript-remote-command-generator 1.0.0 → 1.1.0
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: db13480080256230a0ee361598357093dd46bbcdf8df77c4f2b1bbfed50b60a9
|
4
|
+
data.tar.gz: 2a31788c9f7d961562a2464727e041a268beaa4af21a13e9c6ec67bea9ba1eeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2857104d038b376a8110ac80110241c36f3a93c4d50032fb2e2b2f2b4403cd3ec8777cfd687fe498d4e54381544eeedd0b0dec0e4119aca841bc564e9e926754
|
7
|
+
data.tar.gz: '09a6db101684a17949ce423d72733db28ca8e44eca892033a992de66c37947b92c5f04f29eef659f2b17a1fe3deb04c96124452dc89f77102bd2ed5720833699'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [1.1.0] - 2025-08-22
|
2
|
+
|
3
|
+
- Handle Foobara 0.1.0 type declarations
|
4
|
+
|
5
|
+
## [1.0.1] - 2025-08-04
|
6
|
+
|
7
|
+
- Properly handle no result type with a Result type of null
|
8
|
+
- Add "date" to list of supported types and use Date for it
|
9
|
+
|
1
10
|
## [1.0.0] - 2025-07-31
|
2
11
|
|
3
12
|
- Create never types for Error/PossibleErrors when command cannot error
|
@@ -19,6 +19,8 @@ module Foobara
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def model_generators(type = result_type, initial = true)
|
22
|
+
return [] if type.nil?
|
23
|
+
|
22
24
|
if type.detached_entity?
|
23
25
|
generator_class = if atom?
|
24
26
|
if initial
|
@@ -66,7 +68,7 @@ module Foobara
|
|
66
68
|
type = result_type
|
67
69
|
type = type.to_type if result_type.is_a?(Manifest::TypeDeclaration)
|
68
70
|
|
69
|
-
if !type.builtin? && !type.model?
|
71
|
+
if type && !type.builtin? && !type.model?
|
70
72
|
# TODO: Test this!!
|
71
73
|
# :nocov:
|
72
74
|
[TypeGenerator.new(type)]
|
@@ -257,7 +257,7 @@ module Foobara
|
|
257
257
|
"string"
|
258
258
|
when "duck"
|
259
259
|
"any"
|
260
|
-
when "datetime"
|
260
|
+
when "datetime", "date"
|
261
261
|
"Date"
|
262
262
|
else
|
263
263
|
if type_declaration.model?
|
@@ -287,12 +287,14 @@ module Foobara
|
|
287
287
|
end
|
288
288
|
|
289
289
|
if type_string
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
290
|
+
unless type_declaration.reference?
|
291
|
+
if type_declaration.one_of
|
292
|
+
type_string = type_declaration.one_of.map(&:inspect).join(" | ")
|
293
|
+
end
|
294
|
+
|
295
|
+
if type_declaration.allows_nil?
|
296
|
+
type_string = "#{type_string} | null"
|
297
|
+
end
|
296
298
|
end
|
297
299
|
|
298
300
|
# TODO: Add description as a comment?
|
@@ -2,6 +2,8 @@
|
|
2
2
|
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
type Result = <%=
|
5
|
+
type Result = <%=
|
6
|
+
result_type.nil? ? "null" : foobara_type_to_ts_type(result_type, dependency_group:, association_depth:)
|
7
|
+
%>
|
6
8
|
|
7
9
|
export default Result
|
metadata
CHANGED
@@ -1,14 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-typescript-remote-command-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: foobara
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: 0.1.1
|
19
|
+
- - "<"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 0.1.1
|
29
|
+
- - "<"
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 2.0.0
|
12
32
|
- !ruby/object:Gem::Dependency
|
13
33
|
name: foobara-files-generator
|
14
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
158
|
- !ruby/object:Gem::Version
|
139
159
|
version: '0'
|
140
160
|
requirements: []
|
141
|
-
rubygems_version: 3.6.
|
161
|
+
rubygems_version: 3.6.9
|
142
162
|
specification_version: 4
|
143
163
|
summary: Generates remote commands for Typescript from a foobara manifest
|
144
164
|
test_files: []
|