@dudousxd/nestjs-inertia-codegen 2.0.0 → 2.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.
package/dist/index.cjs CHANGED
@@ -346,11 +346,10 @@ function emitApiObjectBlock(tree, indent) {
346
346
  const typeAccess = buildRouterTypeAccess(c.name);
347
347
  lines.push(`${pad}${objKey}: {`);
348
348
  lines.push(`${pad} queryKey: (query?: ${typeAccess}['query']) => query !== undefined ? [${flatName}, query] as const : [${flatName}] as const,`);
349
- lines.push(`${pad} queryOptions: (query?: ${typeAccess}['query']) =>`);
350
- lines.push(`${pad} queryOptions({`);
351
- lines.push(`${pad} queryKey: query !== undefined ? [${flatName}, query] : [${flatName}],`);
352
- lines.push(`${pad} queryFn: () => fetcher.get<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { query }),`);
353
- lines.push(`${pad} }),`);
349
+ lines.push(`${pad} queryOptions: (query?: ${typeAccess}['query']) => ({`);
350
+ lines.push(`${pad} queryKey: query !== undefined ? [${flatName}, query] as const : [${flatName}] as const,`);
351
+ lines.push(`${pad} queryFn: () => fetcher.get<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { query }),`);
352
+ lines.push(`${pad} }),`);
354
353
  lines.push(`${pad}},`);
355
354
  } else {
356
355
  const typeAccess = buildRouterTypeAccess(c.name);
@@ -377,14 +376,10 @@ function buildRouterTypeAccess(name) {
377
376
  __name(buildRouterTypeAccess, "buildRouterTypeAccess");
378
377
  function buildApiFile(routes) {
379
378
  const contracted = routes.filter((r) => r.contract);
380
- const hasGetRoutes = contracted.some((r) => r.method === "GET");
381
379
  const lines = [
382
380
  "// Generated by @dudousxd/nestjs-inertia-codegen. Do not edit.",
383
381
  ""
384
382
  ];
385
- if (hasGetRoutes) {
386
- lines.push("import { queryOptions } from '@tanstack/query-core';");
387
- }
388
383
  lines.push("import { route } from './routes.js';");
389
384
  lines.push("import { createFetcher } from '@dudousxd/nestjs-inertia-client';");
390
385
  lines.push("");
@@ -1455,7 +1450,7 @@ async function watch(config, onChange) {
1455
1450
  __name(watch, "watch");
1456
1451
 
1457
1452
  // src/index.ts
1458
- var VERSION = "2.0.0";
1453
+ var VERSION = "2.0.1";
1459
1454
  // Annotate the CommonJS export names for ESM import in node:
1460
1455
  0 && (module.exports = {
1461
1456
  CodegenError,