Skip to content

Commit eb39931

Browse files
committed
Fix openapi-react-query builds scripts
1 parent 19e9cc0 commit eb39931

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/openapi-react-query/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
"tanstack"
4848
],
4949
"scripts": {
50-
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:js-min && pnpm run build:cjs",
50+
"build": "pnpm run build:clean && pnpm run build:esm && pnpm run build:cjs",
5151
"build:clean": "del-cli dist",
52-
"build:js": "mkdir -p dist && cp src/* dist",
53-
"build:js-min": "esbuild --bundle src/index.js --format=esm --minify --outfile=dist/index.min.js && cp dist/index.d.ts dist/index.min.d.ts",
54-
"build:cjs": "esbuild --bundle src/index.js --format=cjs --outfile=dist/cjs/index.cjs && cp dist/index.d.ts dist/cjs/index.d.cts",
52+
"build:esm": "tsc -p tsconfig.build.json",
53+
"build:cjs": "esbuild --bundle --platform=node --target=es2019 --outfile=dist/index.cjs --external:@redocly/ajv --external:@redocly/openapi-core --external:typescript src/index.ts",
54+
"dev": "tsc -p tsconfig.build.json --watch",
5555
"format": "biome format . --write",
5656
"lint": "biome check .",
5757
"generate-types": "openapi-typescript test/fixtures/api.yaml -o test/fixtures/api.d.ts",

packages/openapi-react-query/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useMutation,
99
useQuery,
1010
} from "@tanstack/react-query";
11-
import type { ClientMethod, FetchResponse, MaybeOptionalInit, OpenapiClient } from "openapi-fetch";
11+
import type { ClientMethod, FetchResponse, MaybeOptionalInit, Client as FetchClient } from "openapi-fetch";
1212
import type { HasRequiredKeys, HttpMethod, MediaType, PathsWithMethod } from "openapi-typescript-helpers";
1313

1414
export type UseQueryMethod<Paths extends Record<string, Record<HttpMethod, {}>>, Media extends MediaType> = <
@@ -58,7 +58,7 @@ export interface OpenapiQueryClient<Paths extends {}, Media extends MediaType =
5858
}
5959

6060
export default function createClient<Paths extends {}, Media extends MediaType = MediaType>(
61-
client: OpenapiClient<Paths, Media>,
61+
client: FetchClient<Paths, Media>,
6262
): OpenapiQueryClient<Paths, Media> {
6363
return {
6464
useQuery: (method, path, ...[init, options]) => {

0 commit comments

Comments
 (0)