Browse Source
Phase 19 complete. All types now organized into 7 domain files: annotation, nodes, providers, models, workflow, api, quickstart. index.ts is a pure re-export hub. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>handoff-20260429-1057
3 changed files with 127 additions and 8 deletions
@ -0,0 +1,115 @@ |
|||
--- |
|||
phase: 19-type-refactoring |
|||
plan: 02 |
|||
subsystem: types |
|||
tags: [typescript, refactoring, types, modularization] |
|||
|
|||
# Dependency graph |
|||
requires: |
|||
- phase: 19-01 |
|||
provides: Node and annotation types extracted, re-export pattern established |
|||
provides: |
|||
- Provider types module (src/types/providers.ts) |
|||
- Model types module (src/types/models.ts) |
|||
- Workflow types module (src/types/workflow.ts) |
|||
- API types module (src/types/api.ts) |
|||
- Pure re-export hub (src/types/index.ts) |
|||
affects: [future-type-additions] |
|||
|
|||
# Tech tracking |
|||
tech-stack: |
|||
added: [] |
|||
patterns: |
|||
- Pure re-export index files for type organization |
|||
- Domain-specific type modules with explicit imports |
|||
- Circular dependency prevention via domain imports |
|||
|
|||
key-files: |
|||
created: |
|||
- src/types/providers.ts |
|||
- src/types/models.ts |
|||
- src/types/workflow.ts |
|||
- src/types/api.ts |
|||
modified: |
|||
- src/types/index.ts |
|||
- src/types/nodes.ts |
|||
|
|||
key-decisions: |
|||
- "RecentModel placed in providers.ts (tracks provider/model usage)" |
|||
- "nodes.ts imports from domain files (providers.ts, models.ts) instead of index.ts to avoid circular dependencies" |
|||
- "index.ts is now a pure re-export hub with no type definitions" |
|||
|
|||
patterns-established: |
|||
- "All types live in domain files, index.ts is re-exports only" |
|||
- "7 domain files: annotation, nodes, providers, models, workflow, api, quickstart" |
|||
|
|||
issues-created: [] |
|||
|
|||
# Metrics |
|||
duration: 8min |
|||
completed: 2026-01-13 |
|||
--- |
|||
|
|||
# Phase 19 Plan 02: Extract Provider, Workflow, API, Model Types Summary |
|||
|
|||
**Extracted all remaining types from index.ts into 4 domain files, making index.ts a pure re-export hub with 7 total domain modules** |
|||
|
|||
## Performance |
|||
|
|||
- **Duration:** 8 min |
|||
- **Started:** 2026-01-13T20:45:00Z |
|||
- **Completed:** 2026-01-13T20:53:00Z |
|||
- **Tasks:** 3 |
|||
- **Files modified:** 6 (4 created, 2 modified) |
|||
|
|||
## Accomplishments |
|||
|
|||
- Created src/types/providers.ts with ProviderType, SelectedModel, ProviderConfig, ProviderSettings, LLMProvider, LLMModelType, RecentModel |
|||
- Created src/types/models.ts with AspectRatio, Resolution, ModelType |
|||
- Created src/types/workflow.ts with WorkflowEdge, WorkflowEdgeData, WorkflowSaveConfig, WorkflowCostData, NodeGroup, GroupColor |
|||
- Created src/types/api.ts with GenerateRequest, GenerateResponse, LLMGenerateRequest, LLMGenerateResponse |
|||
- Converted index.ts to pure re-export hub (15 lines, down from ~130) |
|||
- Updated nodes.ts to import from domain files, eliminating circular dependency risk |
|||
- All 1135 tests pass (same as baseline) |
|||
|
|||
## Task Commits |
|||
|
|||
Each task was committed atomically: |
|||
|
|||
1. **Task 1: Extract provider types to providers.ts** - `1b486bd` (feat) |
|||
2. **Task 2: Extract workflow and model types** - `e07ec51` (feat) |
|||
3. **Task 3: Extract API types and finalize index.ts** - `1dd24e7` (feat) |
|||
|
|||
## Files Created/Modified |
|||
|
|||
- `src/types/providers.ts` - ProviderType, SelectedModel, ProviderConfig, ProviderSettings, LLMProvider, LLMModelType, RecentModel |
|||
- `src/types/models.ts` - AspectRatio, Resolution, ModelType |
|||
- `src/types/workflow.ts` - WorkflowEdge, WorkflowEdgeData, WorkflowSaveConfig, WorkflowCostData, NodeGroup, GroupColor |
|||
- `src/types/api.ts` - GenerateRequest, GenerateResponse, LLMGenerateRequest, LLMGenerateResponse |
|||
- `src/types/index.ts` - Pure re-export hub (15 lines) |
|||
- `src/types/nodes.ts` - Updated imports from domain files instead of index.ts |
|||
|
|||
## Decisions Made |
|||
|
|||
- **RecentModel in providers.ts:** Tracks recently used models with provider info, fits provider domain |
|||
- **Domain imports in nodes.ts:** Changed from importing from index.ts to importing from providers.ts and models.ts directly to prevent circular dependencies |
|||
- **Pure re-export index:** index.ts now contains only `export * from './domain'` statements |
|||
|
|||
## Deviations from Plan |
|||
|
|||
None - plan executed exactly as written |
|||
|
|||
## Issues Encountered |
|||
|
|||
- Pre-existing test failures in /api/models route tests (7 tests) - not related to this refactoring, present before and after changes |
|||
|
|||
## Next Phase Readiness |
|||
|
|||
- Phase 19 Type Refactoring complete |
|||
- All types organized into 7 domain files: annotation, nodes, providers, models, workflow, api, quickstart |
|||
- Backward compatibility maintained via re-exports from index.ts |
|||
- Ready for Phase 20 Integration Tests |
|||
|
|||
--- |
|||
*Phase: 19-type-refactoring* |
|||
*Completed: 2026-01-13* |
|||
Loading…
Reference in new issue