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

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: 467c16c27b86a4c0aede45050097f8cd67737b3276ff03dd3d303d760ba314ee
4
- data.tar.gz: f886f32ce4b8ce156082fcb46a904e55357d68b487b56625845491c248f136b6
3
+ metadata.gz: 903e593f005e51408a6d87cee35611d5eb47e7ad99a74edbc736e53a34d5face
4
+ data.tar.gz: 2f5729c0ab7631a6f505da2a3b8db1d7208668b558dc3206a15a1874460c3b3a
5
5
  SHA512:
6
- metadata.gz: d2f7a25c256ef1c9a715de4f50b1b43408ad2f646a58a56453f07d943d4b52a5077cde055d916e72b06027c413cf1db1cbdcde27f049ed11ad270d107c9710d4
7
- data.tar.gz: b6715c387a8a59b4ef8d3d3a2e943b122bdf4725af8b1909da152223fa61bb834e43a8cacddfd64ab1692573f94553c8255eb391f45bb36abf955d767271d809
6
+ metadata.gz: 6a18843bbca13d23425bb3d4f502356d5690542f0643a2f83d33ca21101c143c0e8015372948f1d1c4b559a8d89bbd137f07627d5f71a9ddd417410b1dd5faf2
7
+ data.tar.gz: 83f5381a9e8e275cf852ad12885d6dcd5c3fc0d1ac1da29f8e2fde7336b23043ce5e0fbeccce62af9d2532f822d017063b043f439f1cdc7913aa16533166ab47
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.1.1] - 2025-10-05
2
+
3
+ - Allow using non-absolute command names
4
+
5
+ ## [1.1.0] - 2025-08-22
6
+
7
+ - Handle new Foobara 0.1.0 type declarations
8
+
1
9
  ## [0.0.13] - 2025-08-05
2
10
 
3
11
  - Properly cast values passed to set<State> functions
@@ -43,18 +43,32 @@ module Foobara
43
43
  self.command_manifest = Manifest::Command.new(manifest_data, [:command, command_name])
44
44
  rescue Manifest::InvalidPath
45
45
  valid_keys = manifest_data["command"].keys.sort
46
- message = "Invalid command name: #{command_name}. Expected one of #{valid_keys.join(", ")}"
47
- error = BadCommandNameError.new(
48
- message:,
49
- context: {
50
- bad_name: command_name,
51
- valid_names: valid_keys
52
- },
53
- path: [:command_name]
54
- )
55
46
 
56
- add_input_error(error)
57
- halt!
47
+ suffix = command_name
48
+
49
+ unless suffix.start_with?("::")
50
+ suffix = "::#{suffix}"
51
+ end
52
+
53
+ matching_command_names = valid_keys.select { |key| key.end_with?(suffix) }
54
+
55
+ if matching_command_names.size == 1
56
+ best_command_name = matching_command_names.first
57
+ self.command_manifest = Manifest::Command.new(manifest_data, [:command, best_command_name])
58
+ else
59
+ message = "Invalid command name: #{command_name}. Expected one of #{valid_keys.join(", ")}"
60
+ error = BadCommandNameError.new(
61
+ message:,
62
+ context: {
63
+ bad_name: command_name,
64
+ valid_names: valid_keys
65
+ },
66
+ path: [:command_name]
67
+ )
68
+
69
+ add_input_error(error)
70
+ halt!
71
+ end
58
72
  end
59
73
 
60
74
  def add_command_manifest_to_set_of_elements_to_generate
@@ -187,14 +187,15 @@ module Foobara
187
187
  end
188
188
 
189
189
  def one_of
190
- real_type_declaration.one_of
190
+ unless real_type_declaration.primitive?
191
+ real_type_declaration.one_of
192
+ end
191
193
  end
192
194
 
193
195
  def sensitive?
194
196
  type_declaration.sensitive?
195
197
  end
196
198
 
197
- # TODO: something feels kind of wrong here, hmmm
198
199
  def real_type_declaration
199
200
  @real_type_declaration ||= if custom?
200
201
  # We are dealing with a reference to a registered type
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.13
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -9,6 +9,26 @@ bindir: bin
9
9
  cert_chain: []
10
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-typescript-remote-command-generator
14
34
  requirement: !ruby/object:Gem::Requirement