From d95c474bc3eab790e93029ac802e18b79a311fba Mon Sep 17 00:00:00 2001 From: Hunter Tunnicliff Date: Wed, 6 Nov 2024 12:59:15 -0800 Subject: [PATCH] Update swr-openapi dependencies --- .changeset/gentle-snails-sort.md | 5 +++ packages/swr-openapi/package.json | 10 ++--- .../swr-openapi/src/__test__/types.test-d.ts | 8 ++-- packages/swr-openapi/src/types.ts | 4 +- pnpm-lock.yaml | 42 +++---------------- 5 files changed, 22 insertions(+), 47 deletions(-) create mode 100644 .changeset/gentle-snails-sort.md diff --git a/.changeset/gentle-snails-sort.md b/.changeset/gentle-snails-sort.md new file mode 100644 index 00000000..29da8141 --- /dev/null +++ b/.changeset/gentle-snails-sort.md @@ -0,0 +1,5 @@ +--- +"swr-openapi": minor +--- + +Update dependencies diff --git a/packages/swr-openapi/package.json b/packages/swr-openapi/package.json index 28ac4140..4237516a 100644 --- a/packages/swr-openapi/package.json +++ b/packages/swr-openapi/package.json @@ -56,8 +56,8 @@ "version": "pnpm run build" }, "peerDependencies": { - "openapi-fetch": "0.12", - "openapi-typescript": "7", + "openapi-fetch": "workspace:*", + "openapi-typescript": "workspace:7.x", "react": "18 || 19", "swr": "2", "typescript": "^5.x" @@ -68,7 +68,7 @@ } }, "dependencies": { - "openapi-typescript-helpers": "0.0.13", + "openapi-typescript-helpers": "workspace:*", "type-fest": "4.26.1" }, "devDependencies": { @@ -79,8 +79,8 @@ "husky": "9.1.5", "lint-staged": "15.2.10", "lodash": "4.17.21", - "openapi-fetch": "0.12.0", - "openapi-typescript": "7.4.0", + "openapi-fetch": "workspace:*", + "openapi-typescript": "workspace:7.x", "react": "18.3.1", "swr": "2.2.5", "typescript": "5.5.4", diff --git a/packages/swr-openapi/src/__test__/types.test-d.ts b/packages/swr-openapi/src/__test__/types.test-d.ts index 6a047039..1ea997c3 100644 --- a/packages/swr-openapi/src/__test__/types.test-d.ts +++ b/packages/swr-openapi/src/__test__/types.test-d.ts @@ -22,7 +22,7 @@ type Pet = components["schemas"]["Pet"]; type PetInvalid = ErrorResponseJSON; type PetStatusInvalid = ErrorResponseJSON; expectTypeOf().toMatchTypeOf<{ name: string }>(); -expectTypeOf().toMatchTypeOf<{ message: string }>(); +expectTypeOf().toMatchTypeOf<{ message: string } | undefined>(); expectTypeOf().toMatchTypeOf<{ message: string }>(); // Set up hooks @@ -383,7 +383,7 @@ describe("TypesForRequest", () => { it("returns correct error", () => { expectTypeOf().toEqualTypeOf(); expectTypeOf().toEqualTypeOf(); - expectTypeOf().toEqualTypeOf(); + expectTypeOf().toEqualTypeOf(); }); it("returns correct path params", () => { @@ -430,7 +430,7 @@ describe("TypesForRequest", () => { it("returns correct SWR config", () => { expectTypeOf().toEqualTypeOf>(); expectTypeOf().toEqualTypeOf>(); - expectTypeOf().toEqualTypeOf>(); + expectTypeOf().toEqualTypeOf>(); }); it("returns correct SWR response", () => { @@ -441,7 +441,7 @@ describe("TypesForRequest", () => { SWR.SWRResponse> >(); expectTypeOf().toEqualTypeOf< - SWR.SWRResponse> + SWR.SWRResponse> >(); }); }); diff --git a/packages/swr-openapi/src/types.ts b/packages/swr-openapi/src/types.ts index f775fbe1..3e36cb9f 100644 --- a/packages/swr-openapi/src/types.ts +++ b/packages/swr-openapi/src/types.ts @@ -10,7 +10,7 @@ type TryKey = T extends { [Key in K]?: unknown } ? T[K * Provides specific types used within a given request */ export type TypesForRequest< - Paths extends {}, + Paths extends Record, Method extends Extract, Path extends PathsWithMethod, // --- @@ -42,6 +42,6 @@ export type TypesForRequest< * Uses {@link TypesForRequest} */ export type TypesForGetRequest< - Paths extends {}, + Paths extends Record, Path extends PathsWithMethod>, > = TypesForRequest, Path>; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f54c22b..d8f282ff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -316,8 +316,8 @@ importers: packages/swr-openapi: dependencies: openapi-typescript-helpers: - specifier: 0.0.13 - version: 0.0.13 + specifier: workspace:* + version: link:../openapi-typescript-helpers type-fest: specifier: 4.26.1 version: 4.26.1 @@ -344,11 +344,11 @@ importers: specifier: 4.17.21 version: 4.17.21 openapi-fetch: - specifier: 0.12.0 - version: 0.12.0 + specifier: workspace:* + version: link:../openapi-fetch openapi-typescript: - specifier: 7.4.0 - version: 7.4.0(typescript@5.5.4) + specifier: workspace:7.x + version: link:../openapi-typescript react: specifier: 18.3.1 version: 18.3.1 @@ -3296,9 +3296,6 @@ packages: oniguruma-to-js@0.4.3: resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==} - openapi-fetch@0.12.0: - resolution: {integrity: sha512-D/g5BUGiOAKqivR5s02veJ2+cMHzrkFJKberKP4Z8Vl2VhE6MMirI6wWOgpp8wlsYCRRK7CX0NCGVL/mt6l1fA==} - openapi-typescript-codegen@0.25.0: resolution: {integrity: sha512-nN/TnIcGbP58qYgwEEy5FrAAjePcYgfMaCe3tsmYyTgI3v4RR9v8os14L+LEWDvV50+CmqiyTzRkKKtJeb6Ybg==} hasBin: true @@ -3307,15 +3304,6 @@ packages: resolution: {integrity: sha512-9YkzVKIx9RVIET0lFjJOuf15VjI9AUsoNByBk5WYM66xVlAKDNy8anj08Ci3zZA+HgTwdDamYz5FCVYt2VoHkA==} engines: {node: '>= 12.0.0', npm: '>= 7.0.0'} - openapi-typescript-helpers@0.0.13: - resolution: {integrity: sha512-z44WK2e7ygW3aUtAtiurfEACohf/Qt9g6BsejmIYgEoY4REHeRzgFJmO3ium0libsuzPc145I+8lE9aiiZrQvQ==} - - openapi-typescript@7.4.0: - resolution: {integrity: sha512-u4iVuTGkzKG4rHFUMA/IFXTks9tYVQzkowZsScMOdzJSvIF10qSNySWHTwnN2fD+MEeWFAM8i1f3IUBlgS92eQ==} - hasBin: true - peerDependencies: - typescript: ^5.x - os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -7262,10 +7250,6 @@ snapshots: dependencies: regex: 4.3.3 - openapi-fetch@0.12.0: - dependencies: - openapi-typescript-helpers: 0.0.13 - openapi-typescript-codegen@0.25.0: dependencies: camelcase: 6.3.0 @@ -7276,20 +7260,6 @@ snapshots: openapi-typescript-fetch@2.0.0: {} - openapi-typescript-helpers@0.0.13: {} - - openapi-typescript@7.4.0(typescript@5.5.4): - dependencies: - '@redocly/openapi-core': 1.25.9(supports-color@9.4.0) - ansi-colors: 4.1.3 - change-case: 5.4.4 - parse-json: 8.1.0 - supports-color: 9.4.0 - typescript: 5.5.4 - yargs-parser: 21.1.1 - transitivePeerDependencies: - - encoding - os-tmpdir@1.0.2: {} outdent@0.5.0: {}