A tool to help Granblue Fantasy players create and share teams and strategies.
Find a file
devin-ai-integration[bot] 9b54039a15
Remove legacy API layer (APIClient, core.ts, resources/) (#438)
# 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>
2025-11-28 11:09:08 -08:00
.storybook Init Svelte migration repo 2025-09-08 13:43:09 -07:00
.vscode Add project configuration files 2025-09-15 04:12:26 -07:00
messages implement visual party segmented control 2025-09-16 20:08:57 -07:00
project.inlang Add project configuration files 2025-09-15 04:12:26 -07:00
src Remove legacy API layer (APIClient, core.ts, resources/) (#438) 2025-11-28 11:09:08 -08:00
static Init Svelte migration repo 2025-09-08 13:43:09 -07:00
.gitignore Add docs to gitignore 2025-09-15 04:16:50 -07:00
.mcp.json Add project configuration files 2025-09-15 04:12:26 -07:00
.npmrc Init Svelte migration repo 2025-09-08 13:43:09 -07:00
.prettierignore Init Svelte migration repo 2025-09-08 13:43:09 -07:00
.prettierrc Update config files 2025-09-09 00:27:09 -07:00
CLAUDE.md Add project configuration files 2025-09-15 04:12:26 -07:00
eslint.config.js Update config files 2025-09-09 00:27:09 -07:00
package.json update dependencies 2025-09-23 22:10:44 -07:00
pnpm-lock.yaml update dependencies 2025-09-23 22:10:44 -07:00
README.md Init Svelte migration repo 2025-09-08 13:43:09 -07:00
svelte.config.js Update config files 2025-09-09 00:27:09 -07:00
tsconfig.json Update config files 2025-09-09 00:27:09 -07:00
vite.config.ts fix scss imports with modern compiler api 2025-09-16 01:35:05 -07:00
vitest-setup-client.ts Init Svelte migration repo 2025-09-08 13:43:09 -07:00
vitest.config.adapter.ts feat: implement base adapter with retry logic and caching 2025-09-19 23:03:36 -07:00

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.