Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .changeset/sixty-singers-see.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@changesets/cli": "^2.28.1",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"knip": "^5.62.0",
"prettier": "^3.3.3",
"prettier": "^3.7.3",
"turbo": "^2.1.2",
"typescript": "^5.6.2"
},
Expand Down
20 changes: 8 additions & 12 deletions packages/openapi-typescript-plugin/src/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ describe('openapi-typescript types generation', () => {
);

test('no extra options', async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -31,9 +30,8 @@ describe('openapi-typescript types generation', () => {
});

test('with extra options', async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -57,9 +55,8 @@ describe('openapi-typescript types generation', () => {
});

test('with --explicit-component-exports', async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -83,9 +80,8 @@ describe('openapi-typescript types generation', () => {
});

test('with --explicit-component-exports and --enum', async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"jscodeshift": "^17.0.0",
"jsdom": "^26.0.0",
"msw": "^2.7.0",
"prettier": "^3.3.3",
"prettier": "^3.7.3",
"query-string": "^8.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/react-client/src/Unstable_QraftSecureRequestFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ interface QraftSecureRequestFnBaseProps<TRequestFn extends RequestFn> {
securitySchemes: SecuritySchemeHandlers<string>;
}

export interface QraftSecureRequestFnProps<TRequestFn extends RequestFn>
extends QraftSecureRequestFnBaseProps<TRequestFn> {
export interface QraftSecureRequestFnProps<
TRequestFn extends RequestFn,
> extends QraftSecureRequestFnBaseProps<TRequestFn> {
children(secureRequestFn: TRequestFn): ReactNode;
queryClient?: QueryClient;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/react-client/src/qraftAPIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export interface CreateAPIBasicQueryClientOptions {
}

export interface CreateAPIQueryClientOptions
extends CreateAPIBasicClientOptions,
CreateAPIBasicQueryClientOptions {}
extends CreateAPIBasicClientOptions, CreateAPIBasicQueryClientOptions {}

/**
* @deprecated use `CreateAPIClientOptions` instead
Expand Down
65 changes: 26 additions & 39 deletions packages/tanstack-query-react-plugin/src/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--export-openapi-types --explicit-import-extensions --filter-services <blob>', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -74,9 +73,8 @@ describe('TanStack Query React Client Generation', () => {

describe('no "--export-openapi-types"', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -102,9 +100,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--openapi-types-import-path *.d.ts', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -131,9 +128,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--openapi-types-import-path *.ts', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand All @@ -160,9 +156,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--explicit-import-extensions .ts --openapi-types-import-path ./openapi.d.ts', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -191,9 +186,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--operation-predefined-parameters <...patterns> --explicit-import-extensions --openapi-types-import-path ./openapi.d.ts', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -229,9 +223,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--override-import-type <...patterns> --operation-predefined-parameters <...patterns> --create-api-client-fn <...patterns>', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -314,9 +307,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--queryable-write-operations', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -355,9 +347,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--create-api-client-fn creates multiple clients', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -400,9 +391,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--create-api-client-fn with specific callbacks and custom filename', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -434,9 +424,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--create-api-client-fn with "all" value', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -468,9 +457,8 @@ describe('TanStack Query React Client Generation', () => {

describe('--create-api-client-fn with "none" value', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down Expand Up @@ -502,9 +490,8 @@ describe('TanStack Query React Client Generation', () => {

describe('default behavior (no --create-api-client-fn option)', () => {
beforeAll(async () => {
const { QraftCommand } = await import(
'@openapi-qraft/plugin/lib/QraftCommand'
);
const { QraftCommand } =
await import('@openapi-qraft/plugin/lib/QraftCommand');
const { plugin } = await import('./plugin.js');
const command = new QraftCommand();
plugin.setupCommand(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ const isSeparateParametersOperation = (
) =>
Boolean(
options.queryableWriteOperations &&
operation.requestBody &&
!isReadOnlyOperation(operation)
operation.requestBody &&
!isReadOnlyOperation(operation)
);

const getOperationDataTypeName = (operation: ServiceOperation) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export interface ServiceOperationQuery<
TData,
TParams,
TError,
> extends ServiceOperationUseQuery<TSchema, TData, TParams, TError>,
>
extends
ServiceOperationUseQuery<TSchema, TData, TParams, TError>,
ServiceOperationUseQueries<TSchema, TData, TParams, TError>,
ServiceOperationUseSuspenseQueries<TSchema, TData, TParams, TError>,
ServiceOperationUseInfiniteQuery<TSchema, TData, TParams, TError>,
Expand Down Expand Up @@ -69,7 +71,9 @@ export interface ServiceOperationMutation<
TData,
TParams,
TError,
> extends ServiceOperationUseMutation<TSchema, TBody, TData, TParams, TError>,
>
extends
ServiceOperationUseMutation<TSchema, TBody, TData, TParams, TError>,
ServiceOperationUseIsMutating<TSchema, TBody, TData, TParams, TError>,
ServiceOperationUseMutationState<TSchema, TBody, TData, TParams, TError>,
ServiceOperationIsMutatingQueries<TSchema, TBody, TData, TParams, TError>,
Expand Down
48 changes: 24 additions & 24 deletions packages/tanstack-query-react-types/src/shared/QueryFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ interface QueryFiltersByExactQueryKey<
TParams = {},
TError = DefaultError,
> extends QueryFiltersByQueryKeyBase<
TSchema,
TData,
TInfinite,
TParams,
TError
> {
TSchema,
TData,
TInfinite,
TParams,
TError
> {
/**
* Include queries matching this query key
*/
Expand All @@ -84,12 +84,12 @@ interface QueryFiltersWeakExactQueryKey<
TParams = {},
TError = DefaultError,
> extends QueryFiltersByQueryKeyBase<
TSchema,
TData,
TInfinite,
TParams,
TError
> {
TSchema,
TData,
TInfinite,
TParams,
TError
> {
/**
* Include queries matching this query key
*/
Expand Down Expand Up @@ -137,12 +137,12 @@ interface QueryFiltersByExactParameters<
TParams = {},
TError = DefaultError,
> extends QueryFiltersByParametersBase<
TSchema,
TData,
TInfinite,
TParams,
TError
> {
TSchema,
TData,
TInfinite,
TParams,
TError
> {
/**
* Match query key exactly
*/
Expand All @@ -161,12 +161,12 @@ interface QueryFiltersByWeakParameters<
TParams = {},
TError = DefaultError,
> extends QueryFiltersByParametersBase<
TSchema,
TData,
TInfinite,
TParams,
TError
> {
TSchema,
TData,
TInfinite,
TParams,
TError
> {
/**
* Match query key exactly
*/
Expand Down
6 changes: 4 additions & 2 deletions packages/tanstack-query-react-types/src/shared/RequestFn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ export interface OperationSchema {
readonly security?: string[];
}

export interface RequestFnInfo
extends Omit<RequestInit, 'headers' | 'method' | 'body' | 'signal'> {
export interface RequestFnInfo extends Omit<
RequestInit,
'headers' | 'method' | 'body' | 'signal'
> {
/**
* Request headers
* @example { 'X-Auth': '123' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export interface QueryFnOptionsByParameters<
TParams,
TMeta extends Record<string, any>,
TSignal extends AbortSignal = AbortSignal,
> extends QueryFnOptionsBase<TMeta, TSignal>,
QueryFnBaseUrlOptions {
>
extends QueryFnOptionsBase<TMeta, TSignal>, QueryFnBaseUrlOptions {
parameters: DeepReadonly<TParams>;

queryKey?: never;
Expand All @@ -25,8 +25,8 @@ export interface QueryFnOptionsByQueryKey<
TParams,
TMeta extends Record<string, any>,
TSignal extends AbortSignal = AbortSignal,
> extends QueryFnOptionsBase<TMeta, TSignal>,
QueryFnBaseUrlOptions {
>
extends QueryFnOptionsBase<TMeta, TSignal>, QueryFnBaseUrlOptions {
queryKey: ServiceOperationQueryKey<TSchema, TParams>;

parameters?: never;
Expand Down
Loading
Loading