File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/code-gen/src/api-client Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,6 @@ import { apiClientDistilledTargetInfo } from "./generator.js";
23
23
export function reactQueryGenerateCommonFile ( generateContext ) {
24
24
const distilledTargetInfo = apiClientDistilledTargetInfo ( generateContext ) ;
25
25
26
- if ( distilledTargetInfo . useGlobalClients ) {
27
- return ;
28
- }
29
-
30
26
const file = fileContextCreateGeneric (
31
27
generateContext ,
32
28
`common/api-client-wrapper.tsx` ,
@@ -39,13 +35,17 @@ export function reactQueryGenerateCommonFile(generateContext) {
39
35
40
36
const importCollector = JavascriptImportCollector . getImportCollector ( file ) ;
41
37
38
+ fileWrite ( file , `export type Pretty<T> = { [K in keyof T]: T[K] } & {};` ) ;
39
+
40
+ if ( distilledTargetInfo . useGlobalClients ) {
41
+ return ;
42
+ }
43
+
42
44
importCollector . raw ( `import React from "react";` ) ;
43
45
importCollector . destructure ( "react" , "createContext" ) ;
44
46
importCollector . destructure ( "react" , "PropsWithChildren" ) ;
45
47
importCollector . destructure ( "react" , "useContext" ) ;
46
48
47
- fileWrite ( file , `export type Pretty<T> = { [K in keyof T]: T[K] } & {};` ) ;
48
-
49
49
if ( distilledTargetInfo . isAxios ) {
50
50
importCollector . destructure ( "axios" , "AxiosInstance" ) ;
51
51
You can’t perform that action at this time.
0 commit comments