- Move transformResponse and transformRequest functions from client.ts to schemas/transforms.ts
- Update imports in base.adapter.ts and schemas/party.ts
- Delete unused APIClient class and related exports from client.ts
- Delete src/lib/api/resources/ directory (search.ts, weapons.ts, characters.ts, summons.ts)
- Delete src/lib/api/core.ts (unused helper functions)
- Delete src/lib/api/index.ts (empty file)
The adapters layer (src/lib/api/adapters/) is now the single, canonical HTTP layer.
The services layer (src/lib/services/) remains as the business logic layer on top of adapters.
Co-Authored-By: Justin Edmund <justin@jedmund.com>
- Added beforeNavigate hook to close sidebar when navigating between pages
- Prevents search sidebar from staying open when browsing different sections
- Ensures clean UI state transitions between pages
- Update database grid navigation to use granblueId
- Update column definitions to use granblueId
- Fix all detail pages to use camelCase field names from transformed API responses
- Fix field names for HP/ATK stats, abilities, and metadata
- Update DatabaseProvider to use SearchAdapter instead of direct fetch
- Fix RequestCache error by using cacheTTL instead of cache
- Update image cells to use shared image utilities with correct parameters
- Use only camelCase field names (granblueId) from transformed responses
- Update Party interface to use transformed field names (weapons/characters/summons)
- Fix runed import to use useDebounce instead of debounced
- Clean up debug logging
- Add centralized adapter config with proper baseURL
- Fix API response transformation (object -> weapon/character/summon)
- Update components to use image service and correct property names
- Fix Svelte 5 $derived syntax and missing PartyAdapter.list method
Images now display correctly in grids.
Phase 4 - Page Server Components:
- Migrated database page servers to use EntityAdapter directly
- Removed fetch parameter from all page server loads
Phase 5 - Utility Files:
- Deleted lib/api.ts (functionality inlined)
- Deleted lib/server/detail/load.ts (no longer needed)
- Updated DatabaseProvider to use PUBLIC_SIERO_API_URL directly
- Updated OAuth to use native fetch type
Migration Complete:
- All 32 files migrated from api/core to adapter pattern
- Zero remaining dependencies on lib/api/core
- Clean separation of concerns with dedicated adapters
- Created dedicated utility functions for API route proxies (buildApiUrl, extractHeaders, handleApiError)
- Migrated all 20 API route handlers to use new utilities instead of api/core
- Routes continue to act as proxies to Rails API (correct architecture)
- Removed dependency on buildUrl from api/core in all route handlers
- Updated migration plan to reflect completed Phase 3
- Created new UserAdapter for user profile and favorites operations
- Updated routes/teams/explore and routes/[username] to use adapters directly
- Deleted resource facade files (parties.ts, grid.ts, users.ts)
- All services and initial routes now use adapters without backward compatibility
- Updated migration plan to track completed work
- Update services to use adapters directly without FetchLike
- Remove constructor fetch dependency from services
- Add favorite/unfavorite methods to PartyAdapter
- Simplify API resource files to act as facades temporarily
- Services now instantiate without fetch parameter
- Direct adapter usage improves type safety and reduces complexity
- Add tests for GridAdapter covering weapons, characters, and summons
- Add tests for EntityAdapter covering canonical data access
- Test CRUD operations, positioning, uncap updates, and caching
- Verify snake_case transformation and error handling
- Ensure proper cache management with TTL support
- Add GridAdapter for managing user grid item instances
- Support CRUD, position management, and uncap operations
- Add EntityAdapter for read-only canonical game data
- Separate user instances from game reference data
- Export all adapters from index
- Remove non-existent batch update methods for grid items
- Add gridUpdate for atomic batch operations
- Add preview management methods
- Split job management into separate endpoints
- Update tests to match new API structure
- Add PartyAdapter for party CRUD and grid management
- Create reactive PartyResource with optimistic updates
- Support user parties listing with filters
- Handle grid conflicts and job updates
- Include comprehensive test coverage
- Create SearchResource class with reactive state management
- Implement debounced search using Runed utilities
- Support concurrent searches for different entity types
- Add request cancellation and state management
- Include tests for resource functionality
- Implement SearchAdapter extending BaseAdapter
- Support searching weapons, characters, and summons
- Add filtering by element, rarity, proficiency, etc.
- Include pagination support
- Add comprehensive test coverage
- Add BaseAdapter class with request/response transformation
- Implement comprehensive error handling and normalization
- Add retry logic with exponential backoff for network/server errors
- Support request cancellation and deduplication
- Include response caching with configurable TTL
- Add full test coverage for adapter functionality