Commit 8bed8c9
authored
🤖 Reorganize utils/ into domain-specific subdirectories with absolute imports (#33)
## Summary
Reorganizes the flat directory (26+ files) into domain-specific
subdirectories and converts all imports to use absolute paths with the
`@/` alias.
## Changes
### Directory Structure
- `utils/concurrency/` - Synchronization primitives (asyncMutex,
mutexMap)
- `utils/validation/` - Input validation utilities
- `utils/ui/` - UI-specific utilities (keybinds, modeUtils)
- `utils/ai/` - AI/LLM configuration (cacheStrategy, providerOptions)
- `utils/messages/` - Message transformation and aggregation
- `utils/tools/` - Tool definitions, policies, and setup
- `utils/tokens/` - Token counting, statistics, and model metadata
- `utils/slashCommands/` - (already organized)
### Import System
- Added `@/*` path alias pointing to `src/*` in tsconfig.json and
vite.config.ts
- Converted all relative imports (`../`, `../../`, etc.) to absolute
imports (`@/`)
- Updated tsconfig.main.json to properly resolve @/ paths
## Benefits
- **Discoverability**: Related functionality grouped together by domain
- **Scalability**: Clear homes for new utilities based on their purpose
- **Maintainability**: No more import path hell with `../../../`
- **Consistency**: All imports follow the same `@/` pattern
- **Refactoring**: Easier to move files without updating dozens of
import paths
## Testing
- ✅ `bun typecheck` passes
- ✅ `bun x jest` - 51 tests pass (13 failures are pre-existing empty
test files)
- No functional changes, only organizational improvements
## Commits
1. Move files to subdirectories (one domain at a time)
2. Update imports to reflect new locations
3. Convert all imports to absolute paths with @/ alias
_Generated with `cmux`_1 parent 83c940d commit 8bed8c9
File tree
61 files changed
+100
-87
lines changed- src
- components
- ChatMetaSidebar
- Messages
- tools
- contexts
- debug
- services
- tools
- types
- utils
- ai
- concurrency
- messages
- tokens
- tools
- ui
- validation
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+100
-87
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments