feat: upgrade typescript to 5.8.3 (#21449)

* feat: upgrade typescript to 5.8.3

Co-Authored-By: joe@cal.com <joe@cal.com>

* chore: fix TypeScript 5.8.3 compatibility issues

Co-Authored-By: joe@cal.com <joe@cal.com>

* Uncomment `optmizeImage`

* Type fix

* Type fix

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: joe@cal.com <joe@cal.com>
Co-authored-by: Joe <j.auyeung419@gmail.com>
This commit is contained in:
devin-ai-integration[bot]
2025-05-23 13:57:37 +01:00
committed by GitHub
co-authored by joe@cal.com <joe@cal.com> joe@cal.com <joe@cal.com> Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> joe@cal.com <joe@cal.com> Joe
parent d15b24b8ea
commit bca46228e7
23 changed files with 52 additions and 43 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
"next-axiom": "^0.17.0",
"next-swagger-doc": "^0.3.6",
"next-validations": "^0.2.0",
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"tzdata": "^1.0.30",
"uuid": "^8.3.2",
"zod": "^3.22.4"
@@ -38,7 +38,8 @@ describe("GET /api/bookings", async () => {
expect(responseData.bookings.find((b) => b.userId === memberUser.id)).toBeDefined();
expect(groupedUsers.size).toBe(1);
expect(groupedUsers.entries().next().value[0]).toBe(memberUser.id);
const firstEntry = groupedUsers.entries().next().value;
expect(firstEntry?.[0]).toBe(memberUser.id);
});
it("Returns bookings for regular user", async () => {
+1 -1
View File
@@ -108,7 +108,7 @@
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"typescript": "^5.8.2"
"typescript": "^5.8.3"
},
"prisma": {
"schema": "../../../packages/prisma/schema.prisma"
+2 -1
View File
@@ -192,11 +192,12 @@ async function getHandler(request: NextRequest) {
try {
const response = await fetch(filteredLogo);
const arrayBuffer = await response.arrayBuffer();
let buffer = Buffer.from(arrayBuffer);
let buffer: Buffer = Buffer.from(arrayBuffer);
// If we need to resize the team logos (via Next.js' built-in image processing)
if (teamLogos[logoDefinition.source] && logoDefinition.w) {
const { detectContentType, optimizeImage } = await import("next/dist/server/image-optimizer");
buffer = await optimizeImage({
buffer,
contentType: detectContentType(buffer) ?? "image/jpeg",
+1 -1
View File
@@ -194,7 +194,7 @@
"tailwindcss": "^3.3.3",
"tailwindcss-animate": "^1.0.6",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
},
"nextBundleAnalysis": {
"budget": 358400,
+1 -1
View File
@@ -108,7 +108,7 @@
"prismock": "^1.33.4",
"resize-observer-polyfill": "^1.5.1",
"tsc-absolute": "^1.0.0",
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"vitest": "^2.1.1",
"vitest-fetch-mock": "^0.3.0",
"vitest-mock-extended": "^2.0.2"
+1 -1
View File
@@ -31,6 +31,6 @@
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
}
}
+6
View File
@@ -0,0 +1,6 @@
declare module "@calcom/config/next-i18next.config" {
export const i18n: {
locales: string[];
defaultLocale: string;
};
}
+1 -1
View File
@@ -33,6 +33,6 @@
"prettier-plugin-tailwindcss": "^0.2.5",
"tailwind-scrollbar": "^2.0.1",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
}
}
+1 -1
View File
@@ -54,7 +54,7 @@
"npm-run-all": "^4.1.5",
"postcss": "^8.4.18",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"vite": "^4.1.2",
"vite-plugin-environment": "^1.1.3"
}
+1 -1
View File
@@ -50,7 +50,7 @@
"@vitejs/plugin-react": "^2.2.0",
"eslint": "^8.34.0",
"npm-run-all": "^4.1.5",
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"vite": "^4.5.2"
},
"dependencies": {
+1 -1
View File
@@ -25,7 +25,7 @@
],
"types": "./dist/index.d.ts",
"devDependencies": {
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"vite": "^4.1.2"
},
"dependencies": {
+1 -1
View File
@@ -8,7 +8,7 @@
"@typescript-eslint/parser": "^5.52.0",
"@typescript-eslint/utils": "^5.52.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
},
"devDependencies": {
"@types/eslint": "^8.4.5"
-1
View File
@@ -5,7 +5,6 @@ import { getToken } from "next-auth/jwt";
import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
import { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
// @ts-expect-error no type definitions
import { i18n } from "@calcom/config/next-i18next.config";
/**
@@ -28,8 +28,8 @@ import { useOnboarding } from "../lib/onboardingStore";
function extractDomainFromEmail(email: string) {
let out = "";
try {
const match = email.match(/^(?:.*?:\/\/)?.*?(?<root>[\w\-]*(?:\.\w{2,}|\.\w{2,}\.\w{2}))(?:[\/?#:]|$)/);
out = (match && match.groups?.root) ?? "";
const match = email.match(/^(?:.*?:\/\/)?.*?([\w\-]*(?:\.\w{2,}|\.\w{2,}\.\w{2}))(?:[\/?#:]|$)/);
out = (match && match[1]) ?? "";
} catch (ignore) {}
return out.split(".")[0];
}
@@ -2,8 +2,8 @@ import { useState } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { showToast } from "@calcom/ui/components/toast";
import { SettingsToggle } from "@calcom/ui/components/form";
import { showToast } from "@calcom/ui/components/toast";
const DisableTeamImpersonation = ({
teamId,
@@ -26,7 +26,9 @@ const DisableTeamImpersonation = ({
await utils.viewer.teams.getMembershipbyUser.invalidate();
},
});
const [allowImpersonation, setAllowImpersonation] = useState(!query.data?.disableImpersonation ?? true);
const [allowImpersonation, setAllowImpersonation] = useState(
query.data ? !query.data.disableImpersonation : true
);
if (query.isPending) return <></>;
return (
+1 -1
View File
@@ -34,6 +34,6 @@
"@calcom/tsconfig": "*",
"@calcom/types": "*",
"@faker-js/faker": "^7.3.0",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
}
}
+1 -1
View File
@@ -28,7 +28,7 @@
"postcss-prefixwrap": "1.46.0",
"rollup-plugin-node-builtins": "^2.1.2",
"ts-jest": "^29.1.2",
"typescript": "^4.9.4",
"typescript": "^5.8.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.7.3",
"vite-plugin-inspect": "^0.8.4",
+1 -1
View File
@@ -26,6 +26,6 @@
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^4.9.4"
"typescript": "^5.8.3"
}
}
+1 -1
View File
@@ -23,7 +23,7 @@
"devDependencies": {
"@types/node": "^20.3.1",
"@vitejs/plugin-react": "^4.2.1",
"typescript": "^5.8.2",
"typescript": "^5.8.3",
"vite": "^5.0.12",
"vite-plugin-dts": "^3.7.2",
"vite-plugin-environment": "^1.1.3"
+1 -1
View File
@@ -22,6 +22,6 @@
"zod": "^3.22.4"
},
"devDependencies": {
"typescript": "^5.8.2"
"typescript": "^5.8.3"
}
}
+1 -1
View File
@@ -112,6 +112,6 @@
"fs-extra": "^11.2.0",
"lucide-static": "^0.424.0",
"node-html-parser": "^6.1.13",
"typescript": "^5.8.2"
"typescript": "^5.8.3"
}
}
+20 -20
View File
@@ -2584,7 +2584,7 @@ __metadata:
ts-loader: ^9.4.3
ts-node: ^10.9.1
tsconfig-paths: ^4.1.0
typescript: ^5.8.2
typescript: ^5.8.3
uuid: ^8.3.2
winston: ^3.13.0
winston-transport: ^4.7.0
@@ -2614,7 +2614,7 @@ __metadata:
next-swagger-doc: ^0.3.6
next-validations: ^0.2.0
node-mocks-http: ^1.11.0
typescript: ^4.9.4
typescript: ^5.8.3
tzdata: ^1.0.30
uuid: ^8.3.2
zod: ^3.22.4
@@ -2636,7 +2636,7 @@ __metadata:
meow: ^9.0.0
react: ^18.2.0
ts-node: ^10.9.1
typescript: ^4.9.4
typescript: ^5.8.3
bin:
app-store-cli: dist/cli.js
languageName: unknown
@@ -2706,7 +2706,7 @@ __metadata:
tailwindcss: ^3.3.3
tailwindcss-animate: ^1.0.6
ts-jest: ^29.1.2
typescript: ^4.9.4
typescript: ^5.8.3
vite: ^5.0.10
vite-plugin-dts: ^3.7.3
vite-plugin-inspect: ^0.8.4
@@ -2764,7 +2764,7 @@ __metadata:
react-dom: ^18
react-select: ^5.8.0
tailwindcss: ^3.3.0
typescript: ^4.9.4
typescript: ^5.8.3
languageName: unknown
linkType: soft
@@ -2860,7 +2860,7 @@ __metadata:
prettier-plugin-tailwindcss: ^0.2.5
tailwind-scrollbar: ^2.0.1
tailwindcss: ^3.3.3
typescript: ^4.9.4
typescript: ^5.8.3
languageName: unknown
linkType: soft
@@ -3012,7 +3012,7 @@ __metadata:
npm-run-all: ^4.1.5
postcss: ^8.4.18
tailwindcss: ^3.3.3
typescript: ^4.9.4
typescript: ^5.8.3
vite: ^4.1.2
vite-plugin-environment: ^1.1.3
languageName: unknown
@@ -3030,7 +3030,7 @@ __metadata:
"@vitejs/plugin-react": ^2.2.0
eslint: ^8.34.0
npm-run-all: ^4.1.5
typescript: ^4.9.4
typescript: ^5.8.3
vite: ^4.5.2
peerDependencies:
react: ^18.2.0 || ^19.0.0
@@ -3043,7 +3043,7 @@ __metadata:
resolution: "@calcom/embed-snippet@workspace:packages/embeds/embed-snippet"
dependencies:
"@calcom/embed-core": "workspace:*"
typescript: ^4.9.4
typescript: ^5.8.3
vite: ^4.1.2
languageName: unknown
linkType: soft
@@ -3056,7 +3056,7 @@ __metadata:
"@typescript-eslint/parser": ^5.52.0
"@typescript-eslint/utils": ^5.52.0
ts-node: ^10.9.1
typescript: ^4.9.4
typescript: ^5.8.3
languageName: unknown
linkType: soft
@@ -3392,7 +3392,7 @@ __metadata:
sonner: ^1.7.4
tsdav: 2.0.3
tslog: ^4.9.2
typescript: ^4.9.4
typescript: ^5.8.3
uuid: ^8.3.2
languageName: unknown
linkType: soft
@@ -3596,7 +3596,7 @@ __metadata:
"@calcom/lib": "*"
"@types/node": ^20.3.1
"@vitejs/plugin-react": ^4.2.1
typescript: ^5.8.2
typescript: ^5.8.3
vite: ^5.0.12
vite-plugin-dts: ^3.7.2
vite-plugin-environment: ^1.1.3
@@ -3901,7 +3901,7 @@ __metadata:
"@trpc/react-query": 11.0.0-next-beta.222
"@trpc/server": 11.0.0-next-beta.222
superjson: 1.9.1
typescript: ^5.8.2
typescript: ^5.8.3
zod: ^3.22.4
languageName: unknown
linkType: soft
@@ -3973,7 +3973,7 @@ __metadata:
react-inlinesvg: ^4.1.3
react-select: ^5.7.0
tailwind-merge: ^1.13.2
typescript: ^5.8.2
typescript: ^5.8.3
uuid: ^11.1.0
languageName: unknown
linkType: soft
@@ -4181,7 +4181,7 @@ __metadata:
tailwindcss-radix: ^2.6.0
ts-node: ^10.9.1
turndown: ^7.1.3
typescript: ^4.9.4
typescript: ^5.8.3
uuid: ^8.3.2
zod: ^3.22.4
languageName: unknown
@@ -21854,7 +21854,7 @@ __metadata:
resize-observer-polyfill: ^1.5.1
tsc-absolute: ^1.0.0
turbo: ^1.10.1
typescript: ^4.9.4
typescript: ^5.8.3
vitest: ^2.1.1
vitest-fetch-mock: ^0.3.0
vitest-mock-extended: ^2.0.2
@@ -45866,7 +45866,7 @@ __metadata:
languageName: node
linkType: hard
"typescript@npm:^5, typescript@npm:^5.7.2, typescript@npm:^5.8.2":
"typescript@npm:^5, typescript@npm:^5.7.2":
version: 5.8.2
resolution: "typescript@npm:5.8.2"
bin:
@@ -45876,7 +45876,7 @@ __metadata:
languageName: node
linkType: hard
"typescript@npm:^5.2.2":
"typescript@npm:^5.2.2, typescript@npm:^5.8.3":
version: 5.8.3
resolution: "typescript@npm:5.8.3"
bin:
@@ -45906,7 +45906,7 @@ __metadata:
languageName: node
linkType: hard
"typescript@patch:typescript@^5#~builtin<compat/typescript>, typescript@patch:typescript@^5.7.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.8.2#~builtin<compat/typescript>":
"typescript@patch:typescript@^5#~builtin<compat/typescript>, typescript@patch:typescript@^5.7.2#~builtin<compat/typescript>":
version: 5.8.2
resolution: "typescript@patch:typescript@npm%3A5.8.2#~builtin<compat/typescript>::version=5.8.2&hash=1f5320"
bin:
@@ -45916,7 +45916,7 @@ __metadata:
languageName: node
linkType: hard
"typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
"typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.8.3#~builtin<compat/typescript>":
version: 5.8.3
resolution: "typescript@patch:typescript@npm%3A5.8.3#~builtin<compat/typescript>::version=5.8.3&hash=1f5320"
bin: