Skip to content

Commit 09aebb9

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into fix-codegen-tests
2 parents b45e23f + 6037afa commit 09aebb9

File tree

8 files changed

+37
-15
lines changed

8 files changed

+37
-15
lines changed

packages/rtk-query-codegen-openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"dependencies": {
6060
"@apidevtools/swagger-parser": "^10.0.2",
6161
"commander": "^6.2.0",
62-
"oazapfts": "^4.8.0",
62+
"oazapfts": "^6.0.2",
6363
"prettier": "^3.2.5",
6464
"semver": "^7.3.5",
6565
"swagger2openapi": "^7.0.4",

packages/rtk-query-codegen-openapi/src/generate.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import ApiGenerator, {
55
getReferenceName,
66
isReference,
77
supportDeepObjects,
8-
} from 'oazapfts/lib/codegen/generate';
9-
import {
108
createPropertyAssignment,
119
createQuestionToken,
1210
isValidIdentifier,
1311
keywordType,
14-
} from 'oazapfts/lib/codegen/tscodegen';
12+
} from 'oazapfts/generate';
1513
import type { OpenAPIV3 } from 'openapi-types';
1614
import ts from 'typescript';
1715
import type { ObjectPropertyDefinitions } from './codegen';

packages/rtk-query-codegen-openapi/src/generators/react-hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ts from 'typescript';
2-
import { getOperationName } from 'oazapfts/lib/codegen/generate';
2+
import { getOperationName } from 'oazapfts/generate';
33
import { capitalize, isQuery } from '../utils';
44
import type { OperationDefinition, EndpointOverrides, ConfigFile } from '../types';
55
import { getOverrides } from '../generate';

packages/rtk-query-codegen-openapi/test/__snapshots__/cli.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export type Pet = {
192192
category?: Category;
193193
photoUrls: string[];
194194
tags?: Tag[];
195+
/** pet status in the store */
195196
status?: 'available' | 'pending' | 'sold';
196197
};
197198
export type ApiResponse = {
@@ -204,6 +205,7 @@ export type Order = {
204205
petId?: number;
205206
quantity?: number;
206207
shipDate?: string;
208+
/** Order Status */
207209
status?: 'placed' | 'approved' | 'delivered';
208210
complete?: boolean;
209211
};
@@ -215,6 +217,7 @@ export type User = {
215217
email?: string;
216218
password?: string;
217219
phone?: string;
220+
/** User Status */
218221
userStatus?: number;
219222
};
220223
"
@@ -412,6 +415,7 @@ export type Pet = {
412415
category?: Category;
413416
photoUrls: string[];
414417
tags?: Tag[];
418+
/** pet status in the store */
415419
status?: 'available' | 'pending' | 'sold';
416420
};
417421
export type ApiResponse = {
@@ -424,6 +428,7 @@ export type Order = {
424428
petId?: number;
425429
quantity?: number;
426430
shipDate?: string;
431+
/** Order Status */
427432
status?: 'placed' | 'approved' | 'delivered';
428433
complete?: boolean;
429434
};
@@ -435,6 +440,7 @@ export type User = {
435440
email?: string;
436441
password?: string;
437442
phone?: string;
443+
/** User Status */
438444
userStatus?: number;
439445
};
440446
"

packages/rtk-query-codegen-openapi/test/__snapshots__/generateEndpoints.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ export type Pet = {
698698
category?: Category | undefined;
699699
photoUrls: string[];
700700
tags?: Tag[] | undefined;
701+
/** pet status in the store */
701702
status?: ("available" | "pending" | "sold") | undefined;
702703
};
703704
export type ApiResponse = {
@@ -710,6 +711,7 @@ export type Order = {
710711
petId?: number | undefined;
711712
quantity?: number | undefined;
712713
shipDate?: string | undefined;
714+
/** Order Status */
713715
status?: ("placed" | "approved" | "delivered") | undefined;
714716
complete?: boolean | undefined;
715717
};
@@ -721,6 +723,7 @@ export type User = {
721723
email?: string | undefined;
722724
password?: string | undefined;
723725
phone?: string | undefined;
726+
/** User Status */
724727
userStatus?: number | undefined;
725728
};
726729
"
@@ -826,6 +829,7 @@ export type Order = {
826829
petId?: number | undefined;
827830
quantity?: number | undefined;
828831
shipDate?: string | undefined;
832+
/** Order Status */
829833
status?: ("placed" | "approved" | "delivered") | undefined;
830834
complete?: boolean | undefined;
831835
};
@@ -934,6 +938,7 @@ export type Pet = {
934938
category?: Category | undefined;
935939
photoUrls: string[];
936940
tags?: Tag[] | undefined;
941+
/** pet status in the store */
937942
status?: ("available" | "pending" | "sold") | undefined;
938943
};
939944
export const { useAddPetMutation, useGetPetByIdQuery } = injectedRtkApi;
@@ -1120,6 +1125,7 @@ export type Pet = {
11201125
category?: Category;
11211126
photoUrls: string[];
11221127
tags?: Tag[];
1128+
/** pet status in the store */
11231129
status?: "available" | "pending" | "sold";
11241130
};
11251131
export const { useAddPetMutation, useGetPetByIdQuery, useLazyGetPetByIdQuery } =
@@ -1169,6 +1175,7 @@ export type Pet = {
11691175
category?: Category;
11701176
photoUrls: string[];
11711177
tags?: Tag[];
1178+
/** pet status in the store */
11721179
status?: "available" | "pending" | "sold";
11731180
};
11741181
export const { useLazyGetPetByIdQuery } = injectedRtkApi;
@@ -1217,6 +1224,7 @@ export type Pet = {
12171224
category?: Category;
12181225
photoUrls: string[];
12191226
tags?: Tag[];
1227+
/** pet status in the store */
12201228
status?: "available" | "pending" | "sold";
12211229
};
12221230
export const { useAddPetMutation } = injectedRtkApi;
@@ -1265,6 +1273,7 @@ export type Pet = {
12651273
category?: Category;
12661274
photoUrls: string[];
12671275
tags?: Tag[];
1276+
/** pet status in the store */
12681277
status?: "available" | "pending" | "sold";
12691278
};
12701279
export const { useGetPetByIdQuery } = injectedRtkApi;
@@ -1593,6 +1602,7 @@ export type Pet = {
15931602
category?: Category | undefined;
15941603
photoUrls: string[];
15951604
tags?: Tag[] | undefined;
1605+
/** pet status in the store */
15961606
status?: ("available" | "pending" | "sold") | undefined;
15971607
};
15981608
export type ApiResponse = {
@@ -1605,6 +1615,7 @@ export type Order = {
16051615
petId?: number | undefined;
16061616
quantity?: number | undefined;
16071617
shipDate?: string | undefined;
1618+
/** Order Status */
16081619
status?: ("placed" | "approved" | "delivered") | undefined;
16091620
complete?: boolean | undefined;
16101621
};
@@ -1616,6 +1627,7 @@ export type User = {
16161627
email?: string | undefined;
16171628
password?: string | undefined;
16181629
phone?: string | undefined;
1630+
/** User Status */
16191631
userStatus?: number | undefined;
16201632
};
16211633
export const {
@@ -1977,6 +1989,7 @@ export type Pet = {
19771989
category?: Category | undefined;
19781990
photoUrls: string[];
19791991
tags?: Tag[] | undefined;
1992+
/** pet status in the store */
19801993
status?: ("available" | "pending" | "sold") | undefined;
19811994
};
19821995
export type ApiResponse = {
@@ -1989,6 +2002,7 @@ export type Order = {
19892002
petId?: number | undefined;
19902003
quantity?: number | undefined;
19912004
shipDate?: string | undefined;
2005+
/** Order Status */
19922006
status?: ("placed" | "approved" | "delivered") | undefined;
19932007
complete?: boolean | undefined;
19942008
};
@@ -2000,6 +2014,7 @@ export type User = {
20002014
email?: string | undefined;
20012015
password?: string | undefined;
20022016
phone?: string | undefined;
2017+
/** User Status */
20032018
userStatus?: number | undefined;
20042019
};
20052020
export const {

packages/rtk-query-codegen-openapi/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"isolatedModules": true,
1212
"jsx": "react",
1313
"module": "ESNext",
14-
"moduleResolution": "Node",
14+
"moduleResolution": "Bundler",
1515
"noEmit": true,
1616
"noErrorTruncation": true,
1717
"noImplicitReturns": true,

packages/toolkit/src/query/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type {
3434
} from './endpointDefinitions'
3535
export { fetchBaseQuery } from './fetchBaseQuery'
3636
export type {
37+
FetchBaseQueryArgs,
3738
FetchBaseQueryError,
3839
FetchBaseQueryMeta,
3940
FetchArgs,

yarn.lock

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7733,7 +7733,7 @@ __metadata:
77337733
husky: "npm:^4.3.6"
77347734
msw: "npm:^2.1.5"
77357735
node-fetch: "npm:^3.3.2"
7736-
oazapfts: "npm:^4.8.0"
7736+
oazapfts: "npm:^6.0.2"
77377737
openapi-types: "npm:^9.1.0"
77387738
prettier: "npm:^3.2.5"
77397739
pretty-quick: "npm:^4.0.0"
@@ -21527,18 +21527,20 @@ __metadata:
2152721527
languageName: node
2152821528
linkType: hard
2152921529

21530-
"oazapfts@npm:^4.8.0":
21531-
version: 4.10.0
21532-
resolution: "oazapfts@npm:4.10.0"
21530+
"oazapfts@npm:^6.0.2":
21531+
version: 6.0.2
21532+
resolution: "oazapfts@npm:6.0.2"
2153321533
dependencies:
2153421534
"@apidevtools/swagger-parser": "npm:^10.1.0"
2153521535
lodash: "npm:^4.17.21"
2153621536
minimist: "npm:^1.2.8"
2153721537
swagger2openapi: "npm:^7.0.8"
21538-
typescript: "npm:^5.2.2"
21538+
typescript: "npm:^5.3.3"
21539+
peerDependencies:
21540+
"@oazapfts/runtime": "*"
2153921541
bin:
21540-
oazapfts: lib/codegen/cli.js
21541-
checksum: 10/361915b5bafea470b63e54274a54ec19a1d5de09f017f11a4dc380f6e00bd7fb043ae7e0b6a166a46276c41e19a9206cc13b9213d7e7a4e0e08f783ef7b4ec07
21542+
oazapfts: dist/cli.js
21543+
checksum: 10/9132e4bbc589cefba2b93a2421309c89e7685cf75108ac8611d93f78c4e985a0d95829feb2f2b109fa22cb6feb12a6a1e03a679bba9892633c22fe9fb21bd91c
2154221544
languageName: node
2154321545
linkType: hard
2154421546

@@ -28329,7 +28331,7 @@ __metadata:
2832928331
languageName: node
2833028332
linkType: hard
2833128333

28332-
"typescript@npm:5.3.3, typescript@npm:^5.2.2, typescript@npm:^5.3.3":
28334+
"typescript@npm:5.3.3, typescript@npm:^5.3.3":
2833328335
version: 5.3.3
2833428336
resolution: "typescript@npm:5.3.3"
2833528337
bin:
@@ -28399,7 +28401,7 @@ __metadata:
2839928401
languageName: node
2840028402
linkType: hard
2840128403

28402-
"typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.2.2#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>":
28404+
"typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>":
2840328405
version: 5.3.3
2840428406
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
2840528407
bin:

0 commit comments

Comments
 (0)