From f4847872dda64d0fcfadde9de01122bf925c2137 Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Fri, 3 Jan 2025 18:01:07 +0100 Subject: [PATCH] fix: importPath without extensions --- docs/changelog.md | 2 ++ docs/package.json | 2 +- e2e/package.json | 2 +- examples/advanced/configs/kubb.config.ts | 4 +-- examples/advanced/package.json | 2 +- .../clients/hooks/petController/useAddPet.ts | 4 +-- .../hooks/petController/useDeletePet.ts | 4 +-- .../petController/useFindPetsByStatus.ts | 8 ++--- .../hooks/petController/useFindPetsByTags.ts | 8 ++--- .../useFindPetsByTagsInfinite.ts | 8 ++--- .../hooks/petController/useGetPetById.ts | 8 ++--- .../hooks/petController/useUpdatePet.ts | 4 +-- .../petController/useUpdatePetWithForm.ts | 4 +-- .../hooks/petController/useUploadFile.ts | 4 +-- .../hooks/petsController/useCreatePets.ts | 4 +-- .../hooks/userController/useCreateUser.ts | 4 +-- .../useCreateUsersWithListInput.ts | 4 +-- .../hooks/userController/useDeleteUser.ts | 4 +-- .../hooks/userController/useGetUserByName.ts | 8 ++--- .../hooks/userController/useLoginUser.ts | 8 ++--- .../hooks/userController/useLogoutUser.ts | 8 ++--- .../hooks/userController/useUpdateUser.ts | 4 +-- examples/client/package.json | 2 +- examples/faker/package.json | 2 +- examples/fetch/package.json | 2 +- examples/generators/package.json | 2 +- examples/msw/package.json | 2 +- examples/react-query/package.json | 2 +- examples/react/package.json | 2 +- examples/solid-query/package.json | 4 +-- examples/svelte-query/package.json | 4 +-- examples/typescript/package.json | 2 +- examples/vue-query/package.json | 2 +- examples/zod/package.json | 2 +- package.json | 2 +- .../__snapshots__/FileManager.test.ts.snap | 20 +++++------ packages/core/src/utils/parser.ts | 2 +- pnpm-lock.yaml | 33 ++++++++++++++++--- 38 files changed, 110 insertions(+), 83 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 9fa99bf54..b8583ee1e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 diff --git a/docs/package.json b/docs/package.json index 5cb52aa48..ff2eb10e1 100644 --- a/docs/package.json +++ b/docs/package.json @@ -51,7 +51,7 @@ "unplugin-kubb": "workspace:^", "vite": "^6.0.7" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/e2e/package.json b/e2e/package.json index 27ddd0f2f..02be3cb77 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -52,7 +52,7 @@ "tsup": "catalog:", "typescript": "catalog:" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.3.0" diff --git a/examples/advanced/configs/kubb.config.ts b/examples/advanced/configs/kubb.config.ts index d1792c61e..8bdbc15f8 100644 --- a/examples/advanced/configs/kubb.config.ts +++ b/examples/advanced/configs/kubb.config.ts @@ -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, diff --git a/examples/advanced/package.json b/examples/advanced/package.json index 9ec404c24..e5a458fe9 100644 --- a/examples/advanced/package.json +++ b/examples/advanced/package.json @@ -58,7 +58,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/advanced/src/gen/clients/hooks/petController/useAddPet.ts b/examples/advanced/src/gen/clients/hooks/petController/useAddPet.ts index 2460c68d7..ff9fc3c6f 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useAddPet.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useAddPet.ts @@ -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' diff --git a/examples/advanced/src/gen/clients/hooks/petController/useDeletePet.ts b/examples/advanced/src/gen/clients/hooks/petController/useDeletePet.ts index 559dd3b02..b4707ca2c 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useDeletePet.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useDeletePet.ts @@ -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' diff --git a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByStatus.ts b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByStatus.ts index 513a17a70..e2665f1f5 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByStatus.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByStatus.ts @@ -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'] }) => diff --git a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTags.ts b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTags.ts index d3ed3014c..9cdbe4530 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTags.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTags.ts @@ -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 diff --git a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTagsInfinite.ts b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTagsInfinite.ts index 20f355365..ecec90a24 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTagsInfinite.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useFindPetsByTagsInfinite.ts @@ -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 diff --git a/examples/advanced/src/gen/clients/hooks/petController/useGetPetById.ts b/examples/advanced/src/gen/clients/hooks/petController/useGetPetById.ts index 3572212c6..ae102c655 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useGetPetById.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useGetPetById.ts @@ -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 diff --git a/examples/advanced/src/gen/clients/hooks/petController/useUpdatePet.ts b/examples/advanced/src/gen/clients/hooks/petController/useUpdatePet.ts index 31cb0a177..6c28aed61 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useUpdatePet.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useUpdatePet.ts @@ -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, diff --git a/examples/advanced/src/gen/clients/hooks/petController/useUpdatePetWithForm.ts b/examples/advanced/src/gen/clients/hooks/petController/useUpdatePetWithForm.ts index a5f5d41de..613ffb81e 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useUpdatePetWithForm.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useUpdatePetWithForm.ts @@ -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, diff --git a/examples/advanced/src/gen/clients/hooks/petController/useUploadFile.ts b/examples/advanced/src/gen/clients/hooks/petController/useUploadFile.ts index f5b0ba45b..711050f15 100644 --- a/examples/advanced/src/gen/clients/hooks/petController/useUploadFile.ts +++ b/examples/advanced/src/gen/clients/hooks/petController/useUploadFile.ts @@ -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, diff --git a/examples/advanced/src/gen/clients/hooks/petsController/useCreatePets.ts b/examples/advanced/src/gen/clients/hooks/petsController/useCreatePets.ts index d379e6cf7..2553dc90a 100644 --- a/examples/advanced/src/gen/clients/hooks/petsController/useCreatePets.ts +++ b/examples/advanced/src/gen/clients/hooks/petsController/useCreatePets.ts @@ -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, diff --git a/examples/advanced/src/gen/clients/hooks/userController/useCreateUser.ts b/examples/advanced/src/gen/clients/hooks/userController/useCreateUser.ts index 7870bfd09..00e238dd7 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useCreateUser.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useCreateUser.ts @@ -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' diff --git a/examples/advanced/src/gen/clients/hooks/userController/useCreateUsersWithListInput.ts b/examples/advanced/src/gen/clients/hooks/userController/useCreateUsersWithListInput.ts index 36021700b..9a66226fa 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useCreateUsersWithListInput.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useCreateUsersWithListInput.ts @@ -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, diff --git a/examples/advanced/src/gen/clients/hooks/userController/useDeleteUser.ts b/examples/advanced/src/gen/clients/hooks/userController/useDeleteUser.ts index 4342f0656..cd9f1131c 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useDeleteUser.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useDeleteUser.ts @@ -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' diff --git a/examples/advanced/src/gen/clients/hooks/userController/useGetUserByName.ts b/examples/advanced/src/gen/clients/hooks/userController/useGetUserByName.ts index d210cb307..7312c3a70 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useGetUserByName.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useGetUserByName.ts @@ -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'] }) => diff --git a/examples/advanced/src/gen/clients/hooks/userController/useLoginUser.ts b/examples/advanced/src/gen/clients/hooks/userController/useLoginUser.ts index 60982e769..ace8a2a9c 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useLoginUser.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useLoginUser.ts @@ -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 diff --git a/examples/advanced/src/gen/clients/hooks/userController/useLogoutUser.ts b/examples/advanced/src/gen/clients/hooks/userController/useLogoutUser.ts index c98720fc1..533788fc7 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useLogoutUser.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useLogoutUser.ts @@ -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 diff --git a/examples/advanced/src/gen/clients/hooks/userController/useUpdateUser.ts b/examples/advanced/src/gen/clients/hooks/userController/useUpdateUser.ts index 6339b55d9..aab8c4c9c 100644 --- a/examples/advanced/src/gen/clients/hooks/userController/useUpdateUser.ts +++ b/examples/advanced/src/gen/clients/hooks/userController/useUpdateUser.ts @@ -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' diff --git a/examples/client/package.json b/examples/client/package.json index 56a2fe9bc..ecac6f853 100644 --- a/examples/client/package.json +++ b/examples/client/package.json @@ -35,7 +35,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/faker/package.json b/examples/faker/package.json index f517edba8..0097c45fc 100644 --- a/examples/faker/package.json +++ b/examples/faker/package.json @@ -40,7 +40,7 @@ "@kubb/config-ts": "workspace:*", "typescript": "catalog:" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/fetch/package.json b/examples/fetch/package.json index e60346435..fd3dcec6b 100644 --- a/examples/fetch/package.json +++ b/examples/fetch/package.json @@ -32,7 +32,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/generators/package.json b/examples/generators/package.json index c7ca691d4..5adf8e2de 100644 --- a/examples/generators/package.json +++ b/examples/generators/package.json @@ -35,7 +35,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/msw/package.json b/examples/msw/package.json index 0f74da48d..f98f7983c 100644 --- a/examples/msw/package.json +++ b/examples/msw/package.json @@ -42,7 +42,7 @@ "@types/express": "^4.17.21", "typescript": "~5.2.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/react-query/package.json b/examples/react-query/package.json index c24297078..68849a07a 100644 --- a/examples/react-query/package.json +++ b/examples/react-query/package.json @@ -45,7 +45,7 @@ "typescript": "^5.7.2", "vite": "^6.0.7" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/react/package.json b/examples/react/package.json index d051f8648..7a7819d2d 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -34,7 +34,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/solid-query/package.json b/examples/solid-query/package.json index e243a4b80..28aaf1643 100644 --- a/examples/solid-query/package.json +++ b/examples/solid-query/package.json @@ -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" @@ -36,7 +36,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/svelte-query/package.json b/examples/svelte-query/package.json index a8a704dd2..03038da8e 100644 --- a/examples/svelte-query/package.json +++ b/examples/svelte-query/package.json @@ -27,7 +27,7 @@ "@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" @@ -35,7 +35,7 @@ "devDependencies": { "typescript": "catalog:" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/typescript/package.json b/examples/typescript/package.json index 7a9d2c240..370e2d79e 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -32,7 +32,7 @@ "tsup": "^8.3.5", "typescript": "^5.7.2" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/vue-query/package.json b/examples/vue-query/package.json index 8d7d6d2bd..4b7c88534 100644 --- a/examples/vue-query/package.json +++ b/examples/vue-query/package.json @@ -41,7 +41,7 @@ "typescript": "^5.7.2", "vite": "^6.0.7" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/examples/zod/package.json b/examples/zod/package.json index 7ec5f88d8..44fd68ae3 100644 --- a/examples/zod/package.json +++ b/examples/zod/package.json @@ -35,7 +35,7 @@ "@kubb/config-ts": "workspace:*", "typescript": "catalog:" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/package.json b/package.json index 7444279eb..d51f1f62c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "vite-tsconfig-paths": "5.1.0", "vitest": "^2.1.8" }, - "packageManager": "pnpm@9.15.0", + "packageManager": "pnpm@9.15.2", "engines": { "node": ">=20", "pnpm": ">=8.15.0" diff --git a/packages/core/src/__snapshots__/FileManager.test.ts.snap b/packages/core/src/__snapshots__/FileManager.test.ts.snap index 23e764129..304a62e3a 100644 --- a/packages/core/src/__snapshots__/FileManager.test.ts.snap +++ b/packages/core/src/__snapshots__/FileManager.test.ts.snap @@ -1,8 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`FileManager utils > if getFileSource is returning code with exports and exports as 1`] = ` -"import type Dog from './Dog' -import type { Pets, Lily } from './Pets' +"import type Dog from './Dog.ts' +import type { Pets, Lily } from './Pets.ts' export const test = 2 type Test = Pets | Lily | Dog @@ -16,16 +16,16 @@ export type { Pets, Lily } from './Pets' `; exports[`FileManager utils > if getFileSource is returning code with imports 1`] = ` -"import type { Pets } from './Pets' +"import type { Pets } from './Pets.ts' export type Pet = Pets " `; exports[`FileManager utils > if getFileSource is returning code with imports 2`] = ` -"import client from './Pets' -import React from './React' -import type { Pets, Cat } from './Pets' +"import client from './Pets.ts' +import React from './React.ts' +import type { Pets, Cat } from './Pets.ts' export type Pet = Pets | Cat const test = [client, React] @@ -33,9 +33,9 @@ const test = [client, React] `; exports[`FileManager utils > if getFileSource is returning code with imports 3`] = ` -"import client from './Pets' -import React from './React' -import type { Pets, Cat } from './Pets' +"import client from './Pets.ts' +import React from './React.ts' +import type { Pets, Cat } from './Pets.ts' export type Pet = Pets | Cat const test = [client, React] @@ -43,7 +43,7 @@ const test = [client, React] `; exports[`FileManager utils > if getFileSource is returning code with imports and default import 1`] = ` -"import type Pets from './Pets' +"import type Pets from './Pets.ts' export type Pet = Pets " diff --git a/packages/core/src/utils/parser.ts b/packages/core/src/utils/parser.ts index b4c399984..e7fe64fa8 100644 --- a/packages/core/src/utils/parser.ts +++ b/packages/core/src/utils/parser.ts @@ -93,7 +93,7 @@ const typeScriptParser = createFileParser({ return module.factory.createImportDeclaration({ name: item.name, - path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : trimExtName(importPath), + path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : item.root ? trimExtName(importPath) : importPath, isTypeOnly: item.isTypeOnly, }) }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45ca0e1ce..99f75aa30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -721,8 +721,8 @@ importers: specifier: workspace:* version: link:../../packages/plugin-zod '@tanstack/solid-query': - specifier: ^5.62.12 - version: 5.62.12(solid-js@1.9.3) + specifier: 5.62.7 + version: 5.62.7(solid-js@1.9.3) axios: specifier: ^1.7.9 version: 1.7.9 @@ -761,8 +761,8 @@ importers: specifier: workspace:* version: link:../../packages/plugin-zod '@tanstack/svelte-query': - specifier: ^5.62.12 - version: 5.62.12(svelte@3.59.2) + specifier: 5.62.7 + version: 5.62.7(svelte@3.59.2) axios: specifier: ^1.7.9 version: 1.7.9 @@ -3242,6 +3242,9 @@ packages: '@tanstack/query-core@5.62.12': resolution: {integrity: sha512-6igFeBgymHkCxVgaEk+yiLwkMf9haui/EQLmI3o9CatOyDThEoFKe8toLWvWliZC/Jf+h7NwHi/zjfyLArr1ow==} + '@tanstack/query-core@5.62.7': + resolution: {integrity: sha512-fgpfmwatsrUal6V+8EC2cxZIQVl9xvL7qYa03gsdsCy985UTUlS4N+/3hCzwR0PclYDqisca2AqR1BVgJGpUDA==} + '@tanstack/query-devtools@5.62.9': resolution: {integrity: sha512-b1NZzDLVf6laJsB1Cfm3ieuYzM+WqoO8qpm9v+3Etwd+Ph4zkhUMiT+wcWj5AhEPsXiRodKYiiW048VDNdBxNg==} @@ -3261,11 +3264,21 @@ packages: peerDependencies: solid-js: ^1.6.0 + '@tanstack/solid-query@5.62.7': + resolution: {integrity: sha512-KhA86YvhNw+vxEXW6s98mA5UAKRd82THPx6NPmZj6F13QdIhZCDLpw1Vb0ymKX91cDjIxuRURZbxqU06DlubPQ==} + peerDependencies: + solid-js: ^1.6.0 + '@tanstack/svelte-query@5.62.12': resolution: {integrity: sha512-tG/FR6ttvf4nBeCvV/fel7KsvEJe/drAC/+WrfxgA5TzmjorSka0RoCN9TcoETcneGMXGqOD8rE9iK5z9KABUw==} peerDependencies: svelte: ^3.54.0 || ^4.0.0 || ^5.0.0-next.0 + '@tanstack/svelte-query@5.62.7': + resolution: {integrity: sha512-WTu70TtgX90r8OVlvQbRhDAnj12mvQRQ5Sp+2Dgsvdq1b3uDWwjV9ufhyhAM/2YkY03Gtlfs2GL1fyMhSx9tbQ==} + peerDependencies: + svelte: ^3.54.0 || ^4.0.0 || ^5.0.0-next.0 + '@tanstack/virtual-core@3.10.9': resolution: {integrity: sha512-kBknKOKzmeR7lN+vSadaKWXaLS0SZZG+oqpQ/k80Q6g9REn6zRHS/ZYdrIzHnpHgy/eWs00SujveUN/GJT2qTw==} @@ -9476,6 +9489,8 @@ snapshots: '@tanstack/query-core@5.62.12': {} + '@tanstack/query-core@5.62.7': {} + '@tanstack/query-devtools@5.62.9': {} '@tanstack/react-query-devtools@5.62.12(@tanstack/react-query@5.62.12(react@18.3.1))(react@18.3.1)': @@ -9499,11 +9514,21 @@ snapshots: '@tanstack/query-core': 5.62.12 solid-js: 1.9.3 + '@tanstack/solid-query@5.62.7(solid-js@1.9.3)': + dependencies: + '@tanstack/query-core': 5.62.7 + solid-js: 1.9.3 + '@tanstack/svelte-query@5.62.12(svelte@3.59.2)': dependencies: '@tanstack/query-core': 5.62.12 svelte: 3.59.2 + '@tanstack/svelte-query@5.62.7(svelte@3.59.2)': + dependencies: + '@tanstack/query-core': 5.62.7 + svelte: 3.59.2 + '@tanstack/virtual-core@3.10.9': {} '@tanstack/vue-query@5.62.12(vue@3.5.13(typescript@5.7.2))':