From 64d54a9b2416e07a9c9ed84b8feadec7d425f52e Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Sun, 17 Mar 2024 15:48:20 +1100 Subject: [PATCH] feat(client): regenerate and remove patches that were upstreamed Signed-off-by: Jordan Shatford --- .changeset/clever-rivers-brush.md | 5 +++++ .changeset/many-hounds-drum.md | 5 +++++ .changeset/quick-melons-invite.md | 5 ----- packages/client/package.json | 4 ++-- ...1-fix-client-blob-return-type-support.patch | 18 ------------------ pnpm-lock.yaml | 8 ++++---- 6 files changed, 16 insertions(+), 29 deletions(-) create mode 100644 .changeset/clever-rivers-brush.md create mode 100644 .changeset/many-hounds-drum.md delete mode 100644 .changeset/quick-melons-invite.md delete mode 100644 packages/client/patches/0001-fix-client-blob-return-type-support.patch diff --git a/.changeset/clever-rivers-brush.md b/.changeset/clever-rivers-brush.md new file mode 100644 index 00000000..6762d582 --- /dev/null +++ b/.changeset/clever-rivers-brush.md @@ -0,0 +1,5 @@ +--- +"@yd/client": minor +--- + +feat: regenerate with version 0.27.29 of openapi-typescript-codegen diff --git a/.changeset/many-hounds-drum.md b/.changeset/many-hounds-drum.md new file mode 100644 index 00000000..559383fd --- /dev/null +++ b/.changeset/many-hounds-drum.md @@ -0,0 +1,5 @@ +--- +"@yd/client": minor +--- + +feat: remove blob support patch that was upstreamed diff --git a/.changeset/quick-melons-invite.md b/.changeset/quick-melons-invite.md deleted file mode 100644 index a131c276..00000000 --- a/.changeset/quick-melons-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@yd/client": minor ---- - -feat: regenerate with version 0.27.28 of openapi-typescript-codegen diff --git a/packages/client/package.json b/packages/client/package.json index c3f63331..70c566e6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -7,12 +7,12 @@ "scripts": { "build": "tsc --project tsconfig.json", "check": "tsc --project tsconfig.json --noEmit", - "generate": "openapi -i ../../apps/api/openapi.json -o ./src/generated --client fetch --enums && git apply ./patches/*.patch", + "generate": "openapi-ts -i ../../apps/api/openapi.json -o ./src/generated --client fetch --enums", "lint": "prettier --check . && eslint .", "format": "prettier --write ." }, "devDependencies": { - "@nicolas-chaulet/openapi-typescript-codegen": "^0.27.28", + "@nicolas-chaulet/openapi-typescript-codegen": "^0.27.29", "@yd/config": "workspace:*", "prettier": "^3.2.5", "typescript": "^5.4.2" diff --git a/packages/client/patches/0001-fix-client-blob-return-type-support.patch b/packages/client/patches/0001-fix-client-blob-return-type-support.patch deleted file mode 100644 index a8afa90f..00000000 --- a/packages/client/patches/0001-fix-client-blob-return-type-support.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/packages/client/src/generated/core/request.ts b/packages/client/src/generated/core/request.ts -index ee4aea4..f5aecff 100644 ---- a/packages/client/src/generated/core/request.ts -+++ b/packages/client/src/generated/core/request.ts -@@ -239,9 +239,13 @@ export const getResponseBody = async (response: Response): Promise => { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const jsonTypes = ['application/json', 'application/problem+json']; -+ const binaryTypes = ['audio/', 'image/', 'video/']; - const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type)); -+ const isBinary = binaryTypes.some((type) => contentType.toLowerCase().startsWith(type)); - if (isJSON) { - return await response.json(); -+ } else if (isBinary) { -+ return await response.blob(); - } else { - return await response.text(); - } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a19f777a..93bb9769 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -130,8 +130,8 @@ importers: packages/client: devDependencies: '@nicolas-chaulet/openapi-typescript-codegen': - specifier: ^0.27.28 - version: 0.27.28 + specifier: ^0.27.29 + version: 0.27.29 '@yd/config': specifier: workspace:* version: link:../config @@ -1016,8 +1016,8 @@ packages: read-yaml-file: 1.1.0 dev: true - /@nicolas-chaulet/openapi-typescript-codegen@0.27.28: - resolution: {integrity: sha512-ZvlPIk47F5GyuYHWAg0tDOx/pVLqfUrVW/q34FALjYvMQ5PTShV2gWshV9VCrvA6VjcKGH84/hAPGyvW3yOekQ==} + /@nicolas-chaulet/openapi-typescript-codegen@0.27.29: + resolution: {integrity: sha512-v8bJN4EDlsDehCxYTwNsnLwcMKURDZVYMj0X0aDhpXK+DoLRdZVv/rlqLHSXaz44cbsEfKJiTAQJPq2QSziTKA==} hasBin: true dependencies: '@apidevtools/json-schema-ref-parser': 11.5.4