- Deleted src/entities/Font/model/store/googleFontsStore.svelte.ts
- Deleted src/entities/Font/model/store/fontshareStore.svelte.ts
- Deleted src/entities/Font/model/services/fetchGoogleFonts.svelte.ts
- Deleted src/entities/Font/model/services/fetchFontshareFonts.svelte.ts
- Deleted src/entities/Font/model/services/index.ts
- Updated Font entity exports to remove deprecated stores
- Updated model index exports to remove deprecated services
- Updated store index to only export unified store
Phase 6/7: Proxy API Integration for GlyphDiff
- Replaced fontshareStore with unifiedFontStore in FontSearch.svelte
- Replaced fontshareStore with unifiedFontStore in SuggestedFonts.svelte
- Updated Font entity exports to include unifiedFontStore
- Updated model exports to include unified store exports
- Kept fontshareStore exports as deprecated for backward compatibility
Phase 4/7: Proxy API Integration for GlyphDiff
- Added GoogleFontItem type alias for backward compatibility
- Updated normalize.ts to properly type Record<string, string> values
- Fixed import paths in Font index.ts (added subdirectory paths)
- Removed unused Readable import from store
- Removed type exports from normalize and API index files
- Updated stores index.ts to import types from parent types.ts
- All tests passing (129 tests)
All imports now use centralized types from model/types.ts:
- API clients re-export types for backward compatibility
- Normalize module imports types and exports functions
- Store module imports types and exports factory
- Main index.ts exports all types from model/types.ts
- Created unified model/types.ts with all type definitions
- Consolidated domain types (FontCategory, FontProvider, FontSubset)
- Consolidated Google Fonts API types (FontItem, GoogleFontsApiModel, etc.)
- Consolidated Fontshare API types (FontshareFont, FontshareStyle, etc.)
- Consolidated normalization types (UnifiedFont, FontStyleUrls, etc.)
- Consolidated store types (FontCollectionStore, FontCollectionFilters, etc.)
- Removed duplicate type files (font.ts, google_fonts.ts, fontshare_fonts.ts)
- Updated all imports to use consolidated types
- Updated normalize module to import from /Font
- Updated API clients to re-export types for backward compatibility
- Updated store to use centralized types
- Updated Font index.ts to export all types
Benefits:
- Centralized type definitions in single location
- Cleaner imports (single import from /Font)
- Better code organization with clear sections
- Follows FSD principles (types in model layer)
- No duplicate type definitions
- Rename fontCache.ts to collectionCache.ts
- Rename FontCacheManager interface to CollectionCacheManager
- Make implementation fully generic (already was, just renamed interface)
- Update exports in shared/fetch/index.ts
- Fix getStats() to return derived store value for accurate statistics
- Add comprehensive test coverage for collection cache manager
- 41 test cases covering all functionality
- Tests for caching, deduplication, state tracking
- Tests for statistics, reactivity, and edge cases
Closes task-1 of Phase 1 refactoring