Skip to content

Commit

Permalink
fix: support for dataReturnType data (#747)
Browse files Browse the repository at this point in the history
* fix: support for dataReturnType `data`

* chore: clean
  • Loading branch information
stijnvanhulle authored Dec 23, 2023
1 parent 12f0488 commit 2927221
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 243 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-gifts-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kubb/swagger-tanstack-query": patch
---

support for dataReturnType `data`
12 changes: 7 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"prettier.configPath": "configs/prettier.config.cjs",
"editor.defaultFormatter": "dprint.dprint",
"[json]": {
"editor.defaultFormatter": "dprint.dprint"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
Expand All @@ -20,9 +25,6 @@
"*.tmp.txt": true,
"**/.turbo": true,
"**/.next": true,
"**/node_modules": true
},
"prettier.configPath": "configs/prettier.config.cjs",
"editor.defaultFormatter": "dprint.dprint",
"references.preferredLocation": "peek"
"**/node_modules": false
}
}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@vercel/analytics": "^1.1.1",
"sitemap": "^7.1.1",
"vitepress": "^1.0.0-rc.32",
"vitepress": "1.0.0-rc.32",
"vue": "^3.3.13"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"@kubb/swagger-ts": "workspace:*",
"@kubb/swagger-zod": "workspace:*",
"@kubb/swagger-zodios": "workspace:*",
"@tanstack/react-query": "^5.14.2",
"@tanstack/react-query": "^5.14.6",
"@tanstack/solid-query": "^5.14.2",
"@tanstack/svelte-query": "^5.14.2",
"@tanstack/vue-query": "^5.14.4",
"@tanstack/svelte-query": "^5.14.6",
"@tanstack/vue-query": "^5.14.6",
"@zodios/core": "^10.9.6",
"axios": "^1.6.2",
"msw": "^1.3.2",
Expand All @@ -51,7 +51,7 @@
"@kubb/ts-config": "workspace:*",
"@kubb/tsup-config": "workspace:*",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"typescript": "~5.2.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@kubb/ts-config": "workspace:*",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"typescript": "~5.2.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/msw-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"devDependencies": {
"@kubb/ts-config": "workspace:*",
"@types/express": "^4.17.21",
"typescript": "^5.3.3"
"typescript": "~5.2.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/msw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@kubb/ts-config": "workspace:*",
"typescript": "^5.3.3"
"typescript": "~5.2.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions examples/react-query-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@kubb/swagger-client": "workspace:*",
"@kubb/swagger-tanstack-query": "workspace:*",
"@kubb/swagger-ts": "workspace:*",
"@tanstack/react-query": "^5.14.2",
"@tanstack/react-query": "^5.14.6",
"@tanstack/react-query-devtools": "5.0.0",
"axios": "^1.6.2",
"react": "^18.2.0",
Expand All @@ -40,7 +40,7 @@
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"msw": "^1.3.2",
"typescript": "^5.3.3",
"typescript": "~5.2.2",
"vite": "^4.5.1"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"msw": "^1.3.2",
"typescript": "^5.3.3",
"typescript": "~5.2.2",
"vite": "^4.5.1"
},
"packageManager": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions examples/vue-query-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
"@kubb/swagger-tanstack-query": "workspace:*",
"@kubb/swagger-ts": "workspace:*",
"@kubb/swagger-zod": "workspace:*",
"@tanstack/vue-query": "^5.14.4",
"@tanstack/vue-query": "^5.14.6",
"axios": "^1.6.2",
"vue": "^3.3.13"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.5.2",
"msw": "^1.3.2",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"typescript": "~5.2.2",
"vite": "^4.5.1"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@vitejs/plugin-vue": "^4.5.2",
"msw": "^1.3.2",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"typescript": "~5.2.2",
"vite": "^4.5.1"
},
"packageManager": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"@types/node": "^20.10.5",
"@vitest/coverage-v8": "^1.1.0",
"@vitest/ui": "^1.1.0",
"bun-types": "^1.0.18",
"dprint": "^0.43.2",
"bun-types": "^1.0.19",
"dprint": "^0.44.0",
"prettier": "^3.1.1",
"prettier-eslint": "^16.2.0",
"rimraf": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"cosmiconfig": "^9.0.0",
"esbuild": "^0.19.10",
"execa": "^8.0.1",
"ora": "^7.0.1",
"ora": "^8.0.1",
"pretty-error": "^4.0.0",
"string-argv": "^0.3.2",
"tinyrainbow": "^1.1.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/config/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"dependencies": {
"@eslint/js": "^8.56.0",
"@types/eslint": "~8.44.9",
"@types/eslint": "~8.56.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "~6.13.2",
"@typescript-eslint/parser": "~6.15.0",
"eslint-config-prettier": "~9.1.0",
"eslint-config-turbo": "^1.11.2",
"eslint-formatter-pretty": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/tsup-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"tsup": "^8.0.1"
},
"peerDependencies": {
"tsup": "^8.0.0"
"tsup": "^8.0.1"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@types/semver": "^7.5.6",
"eslint": "^8.56.0",
"lodash.isequal": "^4.5.0",
"ora": "^7.0.1",
"ora": "^8.0.1",
"tinyrainbow": "^1.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/swagger-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"typescript": "^5.3.3"
},
"peerDependencies": {
"axios": "^1.4.0",
"axios": "^1.6.2",
"@kubb/react": "workspace:*"
},
"peerDependenciesMeta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ function Template({
isV5 && !!infinite && !!infinite.cursorParam
? `getPreviousPageParam: (firstPage) => firstPage['${infinite.cursorParam}']`
: undefined,
isV5 && !!infinite && !infinite.cursorParam
isV5 && !!infinite && !infinite.cursorParam && dataReturnType === 'full'
? `getNextPageParam: (lastPage, allPages, lastPageParam) => lastPage.data.length === 0 ? undefined : lastPageParam + 1`
: undefined,
isV5 && !!infinite && !infinite.cursorParam && dataReturnType === 'data'
? `getNextPageParam: (lastPage, allPages, lastPageParam) => lastPage.length === 0 ? undefined : lastPageParam + 1`
: undefined,
isV5 && !!infinite && !infinite.cursorParam
Expand Down
2 changes: 1 addition & 1 deletion packages/swagger-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@kubb/swagger": "workspace:*",
"@kubb/types": "workspace:*",
"hotscript": "^1.0.13",
"json-schema-to-ts": "^2.12.0",
"json-schema-to-ts": "^3.0.0",
"ts-toolbelt": "^9.6.0"
},
"devDependencies": {
Expand Down
Loading

1 comment on commit 2927221

@vercel
Copy link

@vercel vercel bot commented on 2927221 Dec 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kubb – ./

kubb-kubb.vercel.app
www.kubb.dev
kubb-git-main-kubb.vercel.app
kubb.dev

Please sign in to comment.