Skip to content

Commit 8c45bc3

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into improve-treeshakeability
2 parents 6db0c61 + 6037afa commit 8c45bc3

File tree

8 files changed

+38
-16
lines changed

8 files changed

+38
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"dependencies": {
5959
"@apidevtools/swagger-parser": "^10.0.2",
6060
"commander": "^6.2.0",
61-
"oazapfts": "^4.8.0",
61+
"oazapfts": "^6.0.2",
6262
"prettier": "^3.2.5",
6363
"semver": "^7.3.5",
6464
"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
@@ -258,6 +258,7 @@ export type Pet = {
258258
category?: Category | undefined;
259259
photoUrls: string[];
260260
tags?: Tag[] | undefined;
261+
/** pet status in the store */
261262
status?: ("available" | "pending" | "sold") | undefined;
262263
};
263264
export type ApiResponse = {
@@ -270,6 +271,7 @@ export type Order = {
270271
petId?: number | undefined;
271272
quantity?: number | undefined;
272273
shipDate?: string | undefined;
274+
/** Order Status */
273275
status?: ("placed" | "approved" | "delivered") | undefined;
274276
complete?: boolean | undefined;
275277
};
@@ -281,6 +283,7 @@ export type User = {
281283
email?: string | undefined;
282284
password?: string | undefined;
283285
phone?: string | undefined;
286+
/** User Status */
284287
userStatus?: number | undefined;
285288
};
286289
"
@@ -386,6 +389,7 @@ export type Order = {
386389
petId?: number | undefined;
387390
quantity?: number | undefined;
388391
shipDate?: string | undefined;
392+
/** Order Status */
389393
status?: ("placed" | "approved" | "delivered") | undefined;
390394
complete?: boolean | undefined;
391395
};
@@ -494,6 +498,7 @@ export type Pet = {
494498
category?: Category | undefined;
495499
photoUrls: string[];
496500
tags?: Tag[] | undefined;
501+
/** pet status in the store */
497502
status?: ("available" | "pending" | "sold") | undefined;
498503
};
499504
export const { useAddPetMutation, useGetPetByIdQuery } = injectedRtkApi;
@@ -680,6 +685,7 @@ export type Pet = {
680685
category?: Category;
681686
photoUrls: string[];
682687
tags?: Tag[];
688+
/** pet status in the store */
683689
status?: "available" | "pending" | "sold";
684690
};
685691
export const { useAddPetMutation, useGetPetByIdQuery, useLazyGetPetByIdQuery } =
@@ -729,6 +735,7 @@ export type Pet = {
729735
category?: Category;
730736
photoUrls: string[];
731737
tags?: Tag[];
738+
/** pet status in the store */
732739
status?: "available" | "pending" | "sold";
733740
};
734741
export const { useLazyGetPetByIdQuery } = injectedRtkApi;
@@ -777,6 +784,7 @@ export type Pet = {
777784
category?: Category;
778785
photoUrls: string[];
779786
tags?: Tag[];
787+
/** pet status in the store */
780788
status?: "available" | "pending" | "sold";
781789
};
782790
export const { useAddPetMutation } = injectedRtkApi;
@@ -825,6 +833,7 @@ export type Pet = {
825833
category?: Category;
826834
photoUrls: string[];
827835
tags?: Tag[];
836+
/** pet status in the store */
828837
status?: "available" | "pending" | "sold";
829838
};
830839
export const { useGetPetByIdQuery } = injectedRtkApi;
@@ -1153,6 +1162,7 @@ export type Pet = {
11531162
category?: Category | undefined;
11541163
photoUrls: string[];
11551164
tags?: Tag[] | undefined;
1165+
/** pet status in the store */
11561166
status?: ("available" | "pending" | "sold") | undefined;
11571167
};
11581168
export type ApiResponse = {
@@ -1165,6 +1175,7 @@ export type Order = {
11651175
petId?: number | undefined;
11661176
quantity?: number | undefined;
11671177
shipDate?: string | undefined;
1178+
/** Order Status */
11681179
status?: ("placed" | "approved" | "delivered") | undefined;
11691180
complete?: boolean | undefined;
11701181
};
@@ -1176,6 +1187,7 @@ export type User = {
11761187
email?: string | undefined;
11771188
password?: string | undefined;
11781189
phone?: string | undefined;
1190+
/** User Status */
11791191
userStatus?: number | undefined;
11801192
};
11811193
export const {
@@ -1537,6 +1549,7 @@ export type Pet = {
15371549
category?: Category | undefined;
15381550
photoUrls: string[];
15391551
tags?: Tag[] | undefined;
1552+
/** pet status in the store */
15401553
status?: ("available" | "pending" | "sold") | undefined;
15411554
};
15421555
export type ApiResponse = {
@@ -1549,6 +1562,7 @@ export type Order = {
15491562
petId?: number | undefined;
15501563
quantity?: number | undefined;
15511564
shipDate?: string | undefined;
1565+
/** Order Status */
15521566
status?: ("placed" | "approved" | "delivered") | undefined;
15531567
complete?: boolean | undefined;
15541568
};
@@ -1560,6 +1574,7 @@ export type User = {
15601574
email?: string | undefined;
15611575
password?: string | undefined;
15621576
phone?: string | undefined;
1577+
/** User Status */
15631578
userStatus?: number | undefined;
15641579
};
15651580
export const {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"compilerOptions": {
33
"target": "ESNext",
4-
"module": "CommonJS",
4+
"module": "ESNext",
55
"declaration": true,
66
"sourceMap": true,
77
"outDir": "lib",
88
"rootDir": "src",
99
"strict": true,
1010
"noUnusedLocals": false,
1111
"resolveJsonModule": true,
12-
"moduleResolution": "Node",
12+
"moduleResolution": "bundler",
1313
"types": ["vitest/globals", "vitest/importMeta"],
1414
"esModuleInterop": true,
1515
"skipLibCheck": 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
@@ -8343,7 +8343,7 @@ __metadata:
83438343
husky: "npm:^4.3.6"
83448344
msw: "npm:^2.1.5"
83458345
node-fetch: "npm:^3.3.2"
8346-
oazapfts: "npm:^4.8.0"
8346+
oazapfts: "npm:^6.0.2"
83478347
openapi-types: "npm:^9.1.0"
83488348
prettier: "npm:^3.2.5"
83498349
pretty-quick: "npm:^4.0.0"
@@ -22630,18 +22630,20 @@ __metadata:
2263022630
languageName: node
2263122631
linkType: hard
2263222632

22633-
"oazapfts@npm:^4.8.0":
22634-
version: 4.10.0
22635-
resolution: "oazapfts@npm:4.10.0"
22633+
"oazapfts@npm:^6.0.2":
22634+
version: 6.0.2
22635+
resolution: "oazapfts@npm:6.0.2"
2263622636
dependencies:
2263722637
"@apidevtools/swagger-parser": "npm:^10.1.0"
2263822638
lodash: "npm:^4.17.21"
2263922639
minimist: "npm:^1.2.8"
2264022640
swagger2openapi: "npm:^7.0.8"
22641-
typescript: "npm:^5.2.2"
22641+
typescript: "npm:^5.3.3"
22642+
peerDependencies:
22643+
"@oazapfts/runtime": "*"
2264222644
bin:
22643-
oazapfts: lib/codegen/cli.js
22644-
checksum: 10/361915b5bafea470b63e54274a54ec19a1d5de09f017f11a4dc380f6e00bd7fb043ae7e0b6a166a46276c41e19a9206cc13b9213d7e7a4e0e08f783ef7b4ec07
22645+
oazapfts: dist/cli.js
22646+
checksum: 10/9132e4bbc589cefba2b93a2421309c89e7685cf75108ac8611d93f78c4e985a0d95829feb2f2b109fa22cb6feb12a6a1e03a679bba9892633c22fe9fb21bd91c
2264522647
languageName: node
2264622648
linkType: hard
2264722649

@@ -29480,7 +29482,7 @@ __metadata:
2948029482
languageName: node
2948129483
linkType: hard
2948229484

29483-
"typescript@npm:5.3.3, typescript@npm:^5.2.2, typescript@npm:^5.3.3":
29485+
"typescript@npm:5.3.3, typescript@npm:^5.3.3":
2948429486
version: 5.3.3
2948529487
resolution: "typescript@npm:5.3.3"
2948629488
bin:
@@ -29550,7 +29552,7 @@ __metadata:
2955029552
languageName: node
2955129553
linkType: hard
2955229554

29553-
"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>":
29555+
"typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>":
2955429556
version: 5.3.3
2955529557
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
2955629558
bin:

0 commit comments

Comments
 (0)