Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
13de7e7
docs: Make the Axios migration guide agent-first
claude Oct 25, 2026
ed549fa
docs: Give each axios timeout and cancel its own request signal
claude Oct 25, 2026
8a13a19
docs: Keep extend({ signal }) cancellation with the axios timeout
claude Oct 25, 2026
8add772
docs: Declare the endpoint in the axios cancellation example
claude Oct 25, 2026
67ad89e
docs: Keep the axios migration to data definitions
claude Oct 25, 2026
62c32b3
docs: Keep the REST setup skill's hook step opt-in for axios migrations
claude Oct 25, 2026
15a8396
docs: Drop the blob cache claim from the axios binary example
claude Oct 25, 2026
a17086e
feat(codemods): Turn axios calls into working endpoint calls
claude Oct 25, 2026
556d973
fix(codemods): Join axios baseURL and urls with one slash
claude Oct 25, 2026
ba2982e
fix(codemods): Mark axios calls whose query or imports would change
claude Oct 25, 2026
c6eba13
fix(codemods): Mark exported axios responses
claude Oct 25, 2026
6d9d509
fix(codemods): Cast typed axios calls instead of overriding process()
claude Oct 25, 2026
b06f300
fix(codemods): Unwrap encodeURIComponent() in axios urls
claude Oct 25, 2026
9477d6d
fix(codemods): Mark axios calls whose params would run before the url
claude Oct 25, 2026
32fd80f
fix(codemods): Drop nullish axios params and mark variable ones
claude Oct 25, 2026
e0f0736
feat(skills): Link package skills during REST setup
claude Oct 25, 2026
c67c2d9
refactor(codemods): One evaluation-order rule for reordered axios args
claude Oct 25, 2026
baa60c6
docs(skills): Restore when to read a linked skill by path
claude Oct 25, 2026
94cb108
docs(skills): Fix REST setup gotchas found in a skills audit
claude Oct 25, 2026
a66c462
fix(codemods): Mark axios urls with credentials, which fetch rejects
claude Oct 25, 2026
0cb2f46
fix(codemods): Keep .data on calls through an instance with a respons…
claude Oct 25, 2026
6933b41
fix(codemods): Mark spread params beside a url query; say to drop url…
claude Oct 25, 2026
6845996
fix(codemods): Convert calls through an axios instance imported from …
claude Oct 25, 2026
50b6401
fix(codemods): Follow default and specifier exports of an axios insta…
claude Oct 25, 2026
16c9dea
fix(codemods): Import an aliased instance export under its alias
claude Oct 25, 2026
4f0e291
fix(codemods): Follow tsconfig path aliases to an axios instance's mo…
claude Oct 25, 2026
21589e1
docs(skills): Handle 401 in fetchResponse with try/catch
claude Oct 25, 2026
d5ce844
docs(skills): Guard envelope unwrap against 204 null bodies
claude Oct 25, 2026
df8ac4b
fix(codemods): Substitute tsconfig path wildcards literally
claude Oct 25, 2026
91bd240
fix(codemods): Keep repeated path reads separate after an effectful i…
claude Oct 25, 2026
e1c8647
docs(skills): Trim data-client-rest-setup to what agents get wrong
claude Oct 25, 2026
5aebf20
docs(skills): Restore rest-setup guidance on request body types and r…
claude Oct 25, 2026
0ea4372
fix(codemods): Share a repeated path param unless an effect runs betw…
claude Oct 25, 2026
e86d513
docs(skills): Tighten rest-setup's override table
claude Oct 25, 2026
26271c7
refactor: Simplify codemod param sharing and rest-setup override rows
claude Oct 25, 2026
a784016
Tighten router's HTTP-client-only pointer
claude Oct 25, 2026
b5453a2
docs(axios): show a swapped path param in Why migrate
claude Oct 25, 2026
816c827
refactor(codemods): simplify axios-to-rest helpers
claude Oct 25, 2026
b39af44
skills(rest-setup): note body: undefined for POST without a body
claude Oct 25, 2026
1cf42e5
docs(axios): longer URL and no schema in Why migrate
claude Oct 25, 2026
e6cb50d
docs(axios): keep the call signature the same in Why migrate
claude Oct 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 52 additions & 257 deletions .agents/skills/data-client-rest-setup/SKILL.md

Large diffs are not rendered by default.

867 changes: 418 additions & 449 deletions .agents/skills/data-client-rest-setup/references/axios-migration.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

309 changes: 52 additions & 257 deletions .agents/skills/data-client-setup/references/data-client-rest-setup.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions .agents/skills/data-client/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Read `../data-client-setup/SKILL.md` (next to this one) and follow it. It isn't
installs; the user asking to add or use Data Client in this app is the go-ahead. If they only asked about Data
Client, answer and offer to set it up instead.

To only swap an HTTP client (axios, fetch, ky, superagent, got) for `@data-client/rest` endpoints, without a provider
or store changes, follow `../data-client-setup/references/data-client-rest-setup.md` instead.

## Set up

Load the skill for the work. If it isn't available by name but its package is installed, run
Expand All @@ -30,9 +33,10 @@ ship into the project's skill folder, then read `.claude/skills/<skill>/SKILL.md
| Tests | `data-client-react-testing` or `data-client-vue-testing` | `react` or `vue` |
| WebSockets, SSE, polling, global side effects | `data-client-manager` | `core` |

To add a protocol the app doesn't depend on yet, or to write GraphQL queries or wrap async functions, follow its guide
in `data-client-setup` (`../data-client-setup/references/`): `data-client-rest-setup.md`,
`data-client-graphql-setup.md` or `data-client-endpoint-setup.md`, installing only packages the app lacks. They
To add a protocol the app doesn't depend on yet, move axios or fetch calls to REST endpoints, write GraphQL queries or
wrap async functions, follow its guide in `data-client-setup` (`../data-client-setup/references/`):
`data-client-rest-setup.md`, `data-client-graphql-setup.md` or `data-client-endpoint-setup.md`, installing only packages
the app lacks. They
aren't loaded by name.

If a skill named here isn't installed, follow [references/install.md](references/install.md).
If a skill named here isn't installed, follow [Installing a missing skill](references/install.md).
31 changes: 31 additions & 0 deletions .changeset/axios-codemod-calls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@data-client/codemods': patch
---

`axios-to-rest` now turns axios calls into working endpoint calls

It used to swap `api.get(url)` for `new ApiEndpoint({ path })` without calling it, so `await` returned the endpoint
instead of data, and POST bodies and `params` were dropped. Now it calls the endpoint, passes path params, `params`,
query strings and bodies as arguments, and reads the body where the code read `.data`:

```ts
// before the codemod
const res = await api.get<Post>(`/posts/${id}`, { params: { expand: 'author' } });
return res.data;
```

```ts
// after the codemod
const res = await (new ApiEndpoint({
path: '/posts/:id',
searchParams: {} as Record<string, unknown>,
})({ id, expand: 'author' }) as Promise<Post>);
return res;
```

Calls through an `axios.create()` instance that another file exports, like `import { api } from './client'`, are
converted too, and their import becomes the instance's new endpoint class.

Anything it can't convert, such as interceptors, `timeout` or `isAxiosError()`, gets a `// TODO(data-client):` comment
that links the [axios migration guide](https://dataclient.io/rest/guides/axios-migration) section covering it. Search
for `TODO(data-client)` after running it.
Loading
Loading