A tool to help Granblue Fantasy players create and share teams and strategies.
# Remove legacy API layer (APIClient, core.ts, resources/) ## Summary This PR consolidates the API layer by removing unused legacy code. The codebase had two API patterns: 1. **Adapters layer** (`src/lib/api/adapters/`) - The newer, canonical HTTP layer with retry logic, caching, and proper error handling 2. **Legacy layer** (`src/lib/api/client.ts`, `core.ts`, `resources/`) - An older pattern using SvelteKit proxy endpoints that was no longer imported anywhere The legacy layer was confirmed unused via grep analysis. The only exception was `transformResponse` and `transformRequest` functions in `client.ts` which were still used by `BaseAdapter` and `schemas/party.ts` - these have been moved to `schemas/transforms.ts`. **Files deleted:** - `src/lib/api/client.ts` (732 lines - APIClient class was dead code) - `src/lib/api/core.ts` (helper functions, unused) - `src/lib/api/index.ts` (empty file) - `src/lib/api/resources/` directory (search.ts, weapons.ts, characters.ts, summons.ts - all unused) **Files modified:** - `src/lib/api/schemas/transforms.ts` - Added `transformResponse`, `transformRequest`, and their helper functions - `src/lib/api/adapters/base.adapter.ts` - Updated import path - `src/lib/api/schemas/party.ts` - Updated import path ## Review & Testing Checklist for Human - [ ] **Verify transform functions work correctly** - The `transformResponse` and `transformRequest` functions handle critical data transformation (snake_case ↔ camelCase, object ↔ entity field renaming). Test that party data loads correctly with proper field names. - [ ] **Test party CRUD operations** - Create, update, and delete a party to verify the adapters layer still works end-to-end - [ ] **Test grid operations** - Add/remove weapons, characters, and summons to verify the entity field renaming still works correctly - [ ] **Check for any runtime errors** - The local type checking couldn't run due to missing dev dependencies, so CI is the first line of defense **Recommended test plan:** 1. Load an existing party page and verify all data displays correctly 2. Create a new party and add weapons/characters/summons 3. Edit an existing party (update name, add/remove items) 4. Verify search functionality works for weapons/characters/summons ### Notes - Local lint/typecheck commands failed due to missing dependencies (prettier-plugin-svelte, eslint-config-prettier) - relying on CI for type verification - The services layer (`src/lib/services/`) was intentionally kept as it's a business logic layer that wraps the adapters Link to Devin run: https://app.devin.ai/sessions/611580bc2db94e20a48c3692d3cbd432 Requested by: Justin Edmund (justin@jedmund.com) / @jedmund Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Justin Edmund <justin@jedmund.com> |
||
|---|---|---|
| .storybook | ||
| .vscode | ||
| messages | ||
| project.inlang | ||
| src | ||
| static | ||
| .gitignore | ||
| .mcp.json | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| CLAUDE.md | ||
| eslint.config.js | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest-setup-client.ts | ||
| vitest.config.adapter.ts | ||
sv
Everything you need to build a Svelte project, powered by sv.
Creating a project
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
Developing
Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.