@7nohe/openapi-react-query-codegen 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,8 @@ export declare function buildQueryOptionsImport(): ImportDeclarationStructure;
25
25
  export declare function buildServiceImport(ctx: GenerationContext): ImportDeclarationStructure;
26
26
  /**
27
27
  * Build import structure for models.
28
+ * Emitted as a type-only import so generated code compiles under
29
+ * `verbatimModuleSyntax` (enabled by default in recent Vite templates).
28
30
  */
29
31
  export declare function buildModelImport(ctx: GenerationContext): ImportDeclarationStructure | null;
30
32
  /**
@@ -43,14 +43,14 @@ export function buildQueryImport() {
43
43
  { name: "useInfiniteQuery" },
44
44
  { name: "useSuspenseInfiniteQuery" },
45
45
  { name: "useMutation" },
46
- { name: "UseQueryResult" },
47
- { name: "UseQueryOptions" },
48
- { name: "UseInfiniteQueryOptions" },
49
- { name: "UseSuspenseInfiniteQueryOptions" },
50
- { name: "UseMutationOptions" },
51
- { name: "UseMutationResult" },
52
- { name: "UseSuspenseQueryOptions" },
53
- { name: "InfiniteData" },
46
+ { name: "UseQueryResult", isTypeOnly: true },
47
+ { name: "UseQueryOptions", isTypeOnly: true },
48
+ { name: "UseInfiniteQueryOptions", isTypeOnly: true },
49
+ { name: "UseSuspenseInfiniteQueryOptions", isTypeOnly: true },
50
+ { name: "UseMutationOptions", isTypeOnly: true },
51
+ { name: "UseMutationResult", isTypeOnly: true },
52
+ { name: "UseSuspenseQueryOptions", isTypeOnly: true },
53
+ { name: "InfiniteData", isTypeOnly: true },
54
54
  { name: "FetchQueryOptions", isTypeOnly: true },
55
55
  { name: "FetchInfiniteQueryOptions", isTypeOnly: true },
56
56
  { name: "EnsureQueryDataOptions", isTypeOnly: true },
@@ -79,6 +79,8 @@ export function buildServiceImport(ctx) {
79
79
  }
80
80
  /**
81
81
  * Build import structure for models.
82
+ * Emitted as a type-only import so generated code compiles under
83
+ * `verbatimModuleSyntax` (enabled by default in recent Vite templates).
82
84
  */
83
85
  export function buildModelImport(ctx) {
84
86
  if (ctx.modelNames.length === 0) {
@@ -87,6 +89,7 @@ export function buildModelImport(ctx) {
87
89
  return {
88
90
  kind: StructureKind.ImportDeclaration,
89
91
  moduleSpecifier: "../requests/types.gen",
92
+ isTypeOnly: true,
90
93
  namedImports: ctx.modelNames.map((name) => ({ name })),
91
94
  };
92
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7nohe/openapi-react-query-codegen",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "OpenAPI React Query Codegen",
5
5
  "bin": {
6
6
  "openapi-rq": "dist/cli.mjs"