Commit 7799b5f
Define design tokens; refactor CLI modules and theme wiring (#275)
* docs(execplans): add detailed ExecPlan for defining CLI theme design tokens
Introduce a comprehensive execution plan (ExecPlan 3.12.1) that outlines the approach to creating a tokenized theme layer for CLI output. The plan covers purpose, constraints, tolerances, risks, progress steps, decisions, and anticipated outcomes. It establishes goals for resolving themes via OrthoConfig, centralizing design tokens for colors, symbols, and spacing, and preserving accessibility and backward compatibility. This foundational documentation sets the stage for subsequent implementation stages, testing, and validation required to build a robust CLI theme system.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* feat(theme): add CLI theme support with token resolution system
Introduce a new theme system controlling CLI output symbols, spacing, and semantic colors.
Add ThemePreference enum with options auto, unicode, ascii and integrate CLI --theme flag.
Implement theme resolution pipeline considering CLI input, no_emoji legacy flag, environment, and output mode.
Update output preferences to delegate to theme tokens while preserving backward compatibility.
Add localization keys and validation errors for theme parsing.
Include 12 unit tests for theme resolution precedence and token consistency.
This forms the foundation for future theme-driven CLI presentation and improved customization.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* docs(execplans): update execplan for design tokens and theme module progress
- Clarify completion status of theme module and associated enums/types
- Adjust formatting and line breaks for improved readability
- Note deferred work on reporter integration and BDD coverage
Also include minor build.rs and theme.rs adjustments for theme resolution fn type references and clippy test attribute.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* docs(theme): fix formatting in design tokens doc and add Default derive to ThemePreference
- Corrected line breaks and spacing in docs/execplans/3-12-1-define-design-tokens.md for readability.
- Added #[derive(Default)] and #[default] attribute to ThemePreference enum to consolidate default implementation and remove manual impl.
- Removed redundant Default impl from src/theme.rs.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* feat(cli,theme): add localized CLI validation and enhance theme resolution
- Introduce localized parsing with `LocalizedValueParser` to provide CLI argument validation errors with localized messages.
- Move CLI validation parser configuration to a dedicated `validation` module for better organization.
- Enhance theme parsing with robust error handling and add unit tests to cover valid and invalid inputs.
- Refactor `ThemePreference` to centralize parsing logic with a `parse_raw` method and a canonical list of valid options.
- Update theme resolution logic to consider the new `NO_COLOR` environment variable alongside `NETSUKE_NO_EMOJI` for ASCII symbol enforcement.
- Adjust `OutputPrefs` to reflect whether emoji are allowed based on the resolved theme.
- Revise and extend tests to cover new environment variable influences and updated theme resolution precedence.
These changes improve CLI UX by providing localized validation feedback and precisely control CLI theme presentation based on configuration and environment.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* feat(cli): add layered configuration merging and diag_json resolution
- Introduce `config_merge` module to handle CLI configuration discovery and merging
- Support layering of default, file, environment, and CLI overrides
- Preserve diagnostic JSON flag from merged layers for early error reporting
- Refactor CLI module to use new config merging utilities
- Add tests for theme resolution and output preferences
This improves configuration handling flexibility by cleanly merging multiple sources, enabling consistent CLI behavior and localization support.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
* refactor(output_prefs): fix env var precedence and update resolution docs
- Corrected environment variable precedence in theme resolution tests to
properly handle NO_COLOR before NETSUKE_NO_EMOJI.
- Updated output_prefs resolution documentation to include NO_COLOR in the
correct precedence order.
- Minor doc corrections in execplans markdown for clarity and punctuation.
These changes improve accuracy of environment variable handling in theme
resolution, ensuring backward compatibility and enhanced theming logic.
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
---------
Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>1 parent 28e097d commit 7799b5f
File tree
16 files changed
+1476
-238
lines changed- docs/execplans
- locales
- en-US
- es-ES
- src
- cli
- localization
16 files changed
+1476
-238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
| |||
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
| 118 | + | |
| 119 | + | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
| |||
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
| 279 | + | |
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | | - | |
289 | | - | |
| 287 | + | |
290 | 288 | | |
291 | 289 | | |
292 | | - | |
293 | | - | |
| 290 | + | |
294 | 291 | | |
295 | 292 | | |
296 | 293 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
0 commit comments