Skip to content

Commit

Permalink
fix: importPath without extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Jan 3, 2025
1 parent fba76b6 commit f484787
Show file tree
Hide file tree
Showing 38 changed files with 110 additions and 83 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ title: Changelog
- [`plugin-svelte-query`](/plugins/plugin-svelte-query/): queryOptions with custom Error type
- [`plugin-vue-query`](/plugins/plugin-vue-query/): queryOptions with custom Error type
- [`plugin-solid-query`](/plugins/plugin-solid-query/): queryOptions with custom Error type
- [`react`](/helpers/react/): importPath without extensions


## 3.3.4
- [`plugin-ts`](/plugins/plugin-ts): minLength, maxLength, pattern as part of the jsdocs
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"unplugin-kubb": "workspace:^",
"vite": "^6.0.7"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"tsup": "catalog:",
"typescript": "catalog:"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.3.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/configs/kubb.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export default defineConfig(() => {
group: { type: 'tag' },
client: {
dataReturnType: 'full',
importPath: '../../../../tanstack-query-client.ts',
importPath: '../../../../tanstack-query-client',
},
query: {
importPath: '../../../../tanstack-query-hook.ts',
importPath: '../../../../tanstack-query-hook',
},
infinite: false,
suspense: false,
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from '../../../models/ts/petController/AddPet.ts'
import type { UseMutationOptions } from '@tanstack/react-query'
import { addPetMutationResponseSchema } from '../../../zod/petController/addPetSchema.ts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderParams, DeletePet400 } from '../../../models/ts/petController/DeletePet.ts'
import type { UseMutationOptions } from '@tanstack/react-query'
import { deletePetMutationResponseSchema } from '../../../zod/petController/deletePetSchema.ts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type { FindPetsByStatusQueryResponse, FindPetsByStatusPathParams, FindPetsByStatus400 } from '../../../models/ts/petController/FindPetsByStatus.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { findPetsByStatusQueryResponseSchema } from '../../../zod/petController/findPetsByStatusSchema.ts'

export const findPetsByStatusQueryKey = ({ step_id }: { step_id: FindPetsByStatusPathParams['step_id'] }) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type {
FindPetsByTagsQueryResponse,
FindPetsByTagsQueryParams,
FindPetsByTagsHeaderParams,
FindPetsByTags400,
} from '../../../models/ts/petController/FindPetsByTags.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { findPetsByTagsQueryResponseSchema } from '../../../zod/petController/findPetsByTagsSchema.ts'

export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { InfiniteData, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { InfiniteData, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryResult } from '../../../../tanstack-query-hook'
import type {
FindPetsByTagsQueryResponse,
FindPetsByTagsQueryParams,
FindPetsByTagsHeaderParams,
FindPetsByTags400,
} from '../../../models/ts/petController/FindPetsByTags.ts'
import { infiniteQueryOptions, useInfiniteQuery } from '../../../../tanstack-query-hook.ts'
import { infiniteQueryOptions, useInfiniteQuery } from '../../../../tanstack-query-hook'
import { findPetsByTagsQueryResponseSchema } from '../../../zod/petController/findPetsByTagsSchema.ts'

export const findPetsByTagsInfiniteQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetPetById404 } from '../../../models/ts/petController/GetPetById.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { getPetByIdQueryResponseSchema } from '../../../zod/petController/getPetByIdSchema.ts'

export const getPetByIdQueryKey = ({ petId }: { petId: GetPetByIdPathParams['petId'] }) => [{ url: '/pet/:petId', params: { petId: petId } }] as const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type {
UpdatePetMutationRequest,
UpdatePetMutationResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type {
UpdatePetWithFormMutationResponse,
UpdatePetWithFormPathParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type {
UploadFileMutationRequest,
UploadFileMutationResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type {
CreatePetsMutationRequest,
CreatePetsMutationResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../../../models/ts/userController/CreateUser.ts'
import type { UseMutationOptions } from '@tanstack/react-query'
import { createUserMutationResponseSchema } from '../../../zod/userController/createUserSchema.ts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type {
CreateUsersWithListInputMutationRequest,
CreateUsersWithListInputMutationResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, DeleteUser404 } from '../../../models/ts/userController/DeleteUser.ts'
import type { UseMutationOptions } from '@tanstack/react-query'
import { deleteUserMutationResponseSchema } from '../../../zod/userController/deleteUserSchema.ts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type {
GetUserByNameQueryResponse,
GetUserByNamePathParams,
GetUserByName400,
GetUserByName404,
} from '../../../models/ts/userController/GetUserByName.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { getUserByNameQueryResponseSchema } from '../../../zod/userController/getUserByNameSchema.ts'

export const getUserByNameQueryKey = ({ username }: { username: GetUserByNamePathParams['username'] }) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from '../../../models/ts/userController/LoginUser.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { loginUserQueryResponseSchema } from '../../../zod/userController/loginUserSchema.ts'

export const loginUserQueryKey = (params?: LoginUserQueryParams) => [{ url: '/user/login' }, ...(params ? [params] : [])] as const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { QueryKey, QueryObserverOptions, UseQueryResult } from '../../../../tanstack-query-hook'
import type { LogoutUserQueryResponse } from '../../../models/ts/userController/LogoutUser.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook.ts'
import { queryOptions, useQuery } from '../../../../tanstack-query-hook'
import { logoutUserQueryResponseSchema } from '../../../zod/userController/logoutUserSchema.ts'

export const logoutUserQueryKey = () => [{ url: '/user/logout' }] as const
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '../../../../tanstack-query-client.ts'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client.ts'
import client from '../../../../tanstack-query-client'
import type { RequestConfig, ResponseConfig } from '../../../../tanstack-query-client'
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../../models/ts/userController/UpdateUser.ts'
import type { UseMutationOptions } from '@tanstack/react-query'
import { updateUserMutationResponseSchema } from '../../../zod/userController/updateUserSchema.ts'
Expand Down
2 changes: 1 addition & 1 deletion examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/faker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@kubb/config-ts": "workspace:*",
"typescript": "catalog:"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/msw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/express": "^4.17.21",
"typescript": "~5.2.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
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 @@ -45,7 +45,7 @@
"typescript": "^5.7.2",
"vite": "^6.0.7"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/solid-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@kubb/plugin-solid-query": "workspace:*",
"@kubb/plugin-ts": "workspace:*",
"@kubb/plugin-zod": "workspace:*",
"@tanstack/solid-query": "^5.62.12",
"@tanstack/solid-query": "5.62.7",
"axios": "^1.7.9",
"solid-js": "^1.9.3",
"tsup": "^8.3.5"
Expand All @@ -36,7 +36,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/svelte-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"@kubb/plugin-svelte-query": "workspace:*",
"@kubb/plugin-ts": "workspace:*",
"@kubb/plugin-zod": "workspace:*",
"@tanstack/svelte-query": "^5.62.12",
"@tanstack/svelte-query": "5.62.7",
"axios": "^1.7.9",
"svelte": "^3.59.2",
"tsup": "^8.3.5"
},
"devDependencies": {
"typescript": "catalog:"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
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 @@ -41,7 +41,7 @@
"typescript": "^5.7.2",
"vite": "^6.0.7"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@kubb/config-ts": "workspace:*",
"typescript": "catalog:"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"vite-tsconfig-paths": "5.1.0",
"vitest": "^2.1.8"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"engines": {
"node": ">=20",
"pnpm": ">=8.15.0"
Expand Down
Loading

0 comments on commit f484787

Please sign in to comment.