Skip to content

Commit

Permalink
Chore: add comment to generated SWR or ReactQuery hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Dec 15, 2023
1 parent 19fddbb commit 19a2dec
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This is the log of notable changes to the `tsdk` that are developer-facing.


### 0.0.30 2023/12/15

- Chore: add comment to generated `SWR` or `ReactQuery` hooks

### 0.0.29 2023/12/11

- Feat: respect `isGet` is `true` or `false` value
Expand Down
2 changes: 1 addition & 1 deletion packages/bench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"checktype": "tsc --noEmit"
},
"dependencies": {
"tsdk-server-adapters": "^0.0.29",
"tsdk-server-adapters": "^0.0.30",
"change-case": "^4.1.2",
"express": "^4.18.2",
"zod": "^3.22.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/tsdk-server-adapters/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsdk-server-adapters",
"version": "0.0.29",
"version": "0.0.30",
"main": "lib/index.js",
"repository": "tsdk-monorepo/tsdk",
"bugs": "https://github.com/tsdk-monorepo/tsdk/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/tsdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsdk",
"version": "0.0.29",
"version": "0.0.30",
"description": "Type-safe API development and code share tool for TypeScript projects.",
"repository": "tsdk-monorepo/tsdk",
"bugs": "https://github.com/tsdk-monorepo/tsdk/issues",
Expand Down
21 changes: 20 additions & 1 deletion packages/tsdk/src/sync-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ export async function syncAPI() {
${
isGET
? `
/**
* ${description}
*
* @category ${category}
*/
export function use${name}(
payload: ${name}Req,
options?: SWRConfiguration<${name}Res>,
Expand All @@ -147,6 +151,11 @@ return useSWR(
}
`
: `
/**
* ${description}
*
* @category ${category}
*/
export function use${name}(
options?: SWRMutationConfiguration<
${name}Res,
Expand All @@ -173,6 +182,11 @@ return useSWR(
${
isGET
? `
/**
* ${description}
*
* @category ${category}
*/
export function use${name}(
payload: ${name}Req,
options?: UndefinedInitialDataOptions<${name}Res, Error>,
Expand All @@ -192,6 +206,11 @@ return useSWR(
);
}`
: `
/**
* ${description}
*
* @category ${category}
*/
export function use${name}(
options?: UseMutationOptions<
${name}Res,
Expand Down
3 changes: 2 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 19a2dec

Please sign in to comment.