cmdx 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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.cursor/prompts/docs.md +9 -0
  3. data/.cursor/prompts/rspec.md +13 -12
  4. data/.cursor/prompts/yardoc.md +11 -6
  5. data/CHANGELOG.md +13 -2
  6. data/README.md +1 -0
  7. data/docs/ai_prompts.md +269 -195
  8. data/docs/basics/call.md +124 -58
  9. data/docs/basics/chain.md +190 -160
  10. data/docs/basics/context.md +242 -154
  11. data/docs/basics/setup.md +302 -32
  12. data/docs/callbacks.md +390 -94
  13. data/docs/configuration.md +181 -65
  14. data/docs/deprecation.md +245 -0
  15. data/docs/getting_started.md +161 -39
  16. data/docs/internationalization.md +590 -70
  17. data/docs/interruptions/exceptions.md +135 -118
  18. data/docs/interruptions/faults.md +150 -125
  19. data/docs/interruptions/halt.md +134 -80
  20. data/docs/logging.md +181 -118
  21. data/docs/middlewares.md +150 -377
  22. data/docs/outcomes/result.md +140 -112
  23. data/docs/outcomes/states.md +134 -99
  24. data/docs/outcomes/statuses.md +204 -146
  25. data/docs/parameters/coercions.md +232 -281
  26. data/docs/parameters/defaults.md +224 -169
  27. data/docs/parameters/definitions.md +289 -141
  28. data/docs/parameters/namespacing.md +250 -161
  29. data/docs/parameters/validations.md +260 -133
  30. data/docs/testing.md +191 -197
  31. data/docs/workflows.md +143 -98
  32. data/lib/cmdx/callback.rb +23 -19
  33. data/lib/cmdx/callback_registry.rb +1 -3
  34. data/lib/cmdx/chain_inspector.rb +23 -23
  35. data/lib/cmdx/chain_serializer.rb +38 -19
  36. data/lib/cmdx/coercion.rb +20 -12
  37. data/lib/cmdx/coercion_registry.rb +51 -32
  38. data/lib/cmdx/configuration.rb +84 -31
  39. data/lib/cmdx/context.rb +32 -21
  40. data/lib/cmdx/core_ext/hash.rb +13 -13
  41. data/lib/cmdx/core_ext/module.rb +1 -1
  42. data/lib/cmdx/core_ext/object.rb +12 -12
  43. data/lib/cmdx/correlator.rb +60 -39
  44. data/lib/cmdx/errors.rb +105 -131
  45. data/lib/cmdx/fault.rb +66 -45
  46. data/lib/cmdx/immutator.rb +20 -21
  47. data/lib/cmdx/lazy_struct.rb +78 -70
  48. data/lib/cmdx/log_formatters/json.rb +1 -1
  49. data/lib/cmdx/log_formatters/key_value.rb +1 -1
  50. data/lib/cmdx/log_formatters/line.rb +1 -1
  51. data/lib/cmdx/log_formatters/logstash.rb +1 -1
  52. data/lib/cmdx/log_formatters/pretty_json.rb +1 -1
  53. data/lib/cmdx/log_formatters/pretty_key_value.rb +1 -1
  54. data/lib/cmdx/log_formatters/pretty_line.rb +1 -1
  55. data/lib/cmdx/log_formatters/raw.rb +2 -2
  56. data/lib/cmdx/logger.rb +19 -14
  57. data/lib/cmdx/logger_ansi.rb +33 -17
  58. data/lib/cmdx/logger_serializer.rb +85 -24
  59. data/lib/cmdx/middleware.rb +39 -21
  60. data/lib/cmdx/middleware_registry.rb +4 -3
  61. data/lib/cmdx/parameter.rb +151 -89
  62. data/lib/cmdx/parameter_inspector.rb +34 -21
  63. data/lib/cmdx/parameter_registry.rb +36 -30
  64. data/lib/cmdx/parameter_serializer.rb +21 -14
  65. data/lib/cmdx/result.rb +136 -135
  66. data/lib/cmdx/result_ansi.rb +31 -17
  67. data/lib/cmdx/result_inspector.rb +32 -27
  68. data/lib/cmdx/result_logger.rb +23 -14
  69. data/lib/cmdx/result_serializer.rb +65 -27
  70. data/lib/cmdx/task.rb +234 -113
  71. data/lib/cmdx/task_deprecator.rb +22 -25
  72. data/lib/cmdx/task_processor.rb +89 -88
  73. data/lib/cmdx/task_serializer.rb +27 -14
  74. data/lib/cmdx/utils/monotonic_runtime.rb +2 -4
  75. data/lib/cmdx/validator.rb +25 -16
  76. data/lib/cmdx/validator_registry.rb +53 -31
  77. data/lib/cmdx/validators/exclusion.rb +1 -1
  78. data/lib/cmdx/validators/format.rb +2 -2
  79. data/lib/cmdx/validators/inclusion.rb +2 -2
  80. data/lib/cmdx/validators/length.rb +2 -2
  81. data/lib/cmdx/validators/numeric.rb +3 -3
  82. data/lib/cmdx/validators/presence.rb +2 -2
  83. data/lib/cmdx/version.rb +1 -1
  84. data/lib/cmdx/workflow.rb +54 -33
  85. data/lib/generators/cmdx/task_generator.rb +6 -6
  86. data/lib/generators/cmdx/workflow_generator.rb +6 -6
  87. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bd1613d4572cca134192d5c80bf3016b278b42a9a002d13fba66d2871da92fb
4
- data.tar.gz: 1a174bc8b62bf3402e1e464b8252cdcd589731f8e81141723b8dbf3cf97f9f1b
3
+ metadata.gz: 2517b9b2e36f957800d10bf952bd8062fbcd4c66ff760574c741c96b5d76d925
4
+ data.tar.gz: f52d86024e590060604c17da1ff31ed520d9f5d561367d6ef59b6df93ed01b45
5
5
  SHA512:
6
- metadata.gz: df70552dbf814fddff62cb3e1d593edf6bf5c33087d84154f36c794d430ee156b986998651383fa15b3b08e4d14d198d69020bb0dec7a13ffab43c75b1c57b02
7
- data.tar.gz: 03ad35b1f6007e1afa3c41f3b63d44784566e78b9eb9b7f25f301d81165753af14b06bb8a6cfd67ea7e5bce02a03c311c338f61538d9d981d7de58d7f2b36f8f
6
+ metadata.gz: b260acf4cf76fa11cb9af6fd498536c8260b813880fb46dca0569162eda32d08f67c9a3ccd06611a84fc75067b7b49c8365beebeafc766b6098961cf2fa46830
7
+ data.tar.gz: 7fe5dd38adfdee7db0b54f2748f19a74bbe34da632288275fd012a4ea15216ad8bc35a8e189e9274463797511d59f260063dab2903d9052968fbb69653bb93ef
@@ -0,0 +1,9 @@
1
+ Update the file in context using the following guidelines:
2
+
3
+ - Follow best practices and implementation
4
+ - Use a consistent professional voice
5
+ - Examples should be concise, non-repetitive, and realistic
6
+ - Update any pre-existing documentation to match stated rules
7
+ - Examples should not cross boundaries or focus
8
+ - Docs must cover both typical use cases, including invalid inputs and error conditions
9
+ - Use GitHub flavored markdown, including alerts to emphasize critical information (https://github.com/orgs/community/discussions/16925)
@@ -1,20 +1,21 @@
1
- Add tests for the file in context.
1
+ Add tests for the file in context using the following guidelines:
2
+
2
3
  - Expectations should be concise, non-repetitive, and realistic (how it would be used in the real world)
3
4
  - Follow best practices and implementation
4
5
  - Update any pre-existing specs to match stated rules
5
6
  - New tests should be consistent with current `spec/cmdx` specs
6
7
  - Use custom matchers available within `lib/cmdx/rspec`
7
8
  - Use task helpers available within `spec/support/helpers`
8
- - Use stubs to return predefined values for specific methods. Isolate the unit being tested, but avoid over-mocking; test real behavior when possible. (mocks should be used only when necessary)
9
- - Ensure each test is independent; avoid shared state between tests.
10
- - Use let and let! to define test data, ensuring minimal and necessary setup.
9
+ - Use stubs to return predefined values for specific methods. Isolate the unit being tested, but avoid over-mocking; test real behavior when possible (mocks should be used only when necessary)
10
+ - Ensure each test is independent; avoid shared state between tests
11
+ - Use let and let! to define test data, ensuring minimal and necessary setup
11
12
  - Context block descriptions should start with the following words: `when`, `with`, `without`
12
- - Organize tests logically using describe for classes/modules and context for different scenarios.
13
- - Use subject to define the object under test when appropriate to avoid repetition.
14
- - Ensure test file paths mirror the structure of the files being tested, but within the spec directory (e.g., lib/cmdx/task.rb → spec/cmdx/task_spec.rb).
15
- - Use clear and descriptive names for describe, context, and it blocks.
16
- - Prefer the expect syntax for assertions to improve readability.
17
- - Keep test code concise; avoid unnecessary complexity or duplication.
18
- - Tests must cover both typical cases and edge cases, including invalid inputs and error conditions.
19
- - Consider all possible scenarios for each method or behavior and ensure they are tested.
13
+ - Organize tests logically using describe for classes/modules and context for different scenarios
14
+ - Use subject to define the object under test when appropriate to avoid repetition
15
+ - Ensure test file paths mirror the structure of the files being tested, but within the spec directory (e.g., lib/cmdx/task.rb → spec/cmdx/task_spec.rb)
16
+ - Use clear and descriptive names for describe, context, and it blocks
17
+ - Prefer the expect syntax for assertions to improve readability
18
+ - Keep test code concise; avoid unnecessary complexity or duplication
19
+ - Tests must cover both typical cases and edge cases, including invalid inputs and error conditions
20
+ - Consider all possible scenarios for each method or behavior and ensure they are tested
20
21
  - Verify all specs are passing
@@ -1,8 +1,13 @@
1
- Add yardoc to the file in context.
2
- - Do NOT include `CMDx` module level docs
3
- - Module level docs description should NOT include `@example`
4
- - Method level docs should include `@example`, `@return`, `@raise`
5
- - Examples should be concise and realistic
1
+ Add yardoc to the file in context using the following guidelines:
2
+
6
3
  - Follow best practices and implementation
7
- - Update any pre-existing docs to match stated rules
8
4
  - New documentation should be consistent with current `lib/cmdx` documentation
5
+ - Examples should be concise, non-repetitive, and realistic
6
+ - Avoid unnecessary complexity or duplication
7
+ - Consider all possible scenarios for each method or behavior and ensure they are tested.
8
+ - Update any pre-existing documentation to match stated rules
9
+ - Do NOT include `CMDx` module level docs
10
+ - Module level docs description should NOT include `@example`
11
+ - Method level docs should include `@example`, `param`, `@options`, `@return`, and any `@raise`
12
+ - Hash `@params` should expand with possible `@option`
13
+ - Module and method level docs should NOT include `@since`
data/CHANGELOG.md CHANGED
@@ -7,16 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [TODO]
9
9
 
10
- - Add table and pretty_table log formatters
11
- - Refactor all `docs`
10
+ - Rebuild parameters to use a less magical approach
11
+ - Validators to add errors directly instead of raising errors
12
+ - Coercions to add errors directly instead of raising errors
13
+ - Update procs to call with object as first item
12
14
 
13
15
  ## [Unreleased]
14
16
 
17
+ ## [1.1.1] - 2025-07-20
18
+
19
+ ### Changed
20
+ - Updated all docs and specs
21
+ - Update deprecation key words
22
+
23
+ ## [1.1.0] - 2025-07-17
24
+
15
25
  ### Added
16
26
  - Added `CoercionRegistry` class for managing parameter coercions with support for custom type registration
17
27
  - Added `ValidatorRegistry` class for managing parameter validators with support for custom validator registration
18
28
  - Added `CallbackRegistry` class to take uninstantiated callback classes
19
29
  - Added `Validator` and `Coercion` classes to build their respective handlers
30
+ - Added deprecation setting
20
31
 
21
32
  ### Changed
22
33
  - Moved `Task::CALLBACKS` constant to `CallbackRegistry::TYPES`
data/README.md CHANGED
@@ -102,6 +102,7 @@ end
102
102
  - [Logging](docs/logging.md)
103
103
  - [Internationalization (i18n)](docs/internationalization.md)
104
104
  - [Testing](docs/testing.md)
105
+ - [Deprecation](docs/deprecation.md)
105
106
  - [AI Prompts](docs/ai_prompts.md)
106
107
  - [Tips & Tricks](docs/tips_and_tricks.md)
107
108