foobara-typescript-react-command-form-generator 1.1.0 → 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/src/generate_typescript_react_command_form.rb +25 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 903e593f005e51408a6d87cee35611d5eb47e7ad99a74edbc736e53a34d5face
|
4
|
+
data.tar.gz: 2f5729c0ab7631a6f505da2a3b8db1d7208668b558dc3206a15a1874460c3b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a18843bbca13d23425bb3d4f502356d5690542f0643a2f83d33ca21101c143c0e8015372948f1d1c4b559a8d89bbd137f07627d5f71a9ddd417410b1dd5faf2
|
7
|
+
data.tar.gz: 83f5381a9e8e275cf852ad12885d6dcd5c3fc0d1ac1da29f8e2fde7336b23043ce5e0fbeccce62af9d2532f822d017063b043f439f1cdc7913aa16533166ab47
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
57
|
-
|
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
|