perf: improve typescript perf by pre-generating the router types (#15929)

Co-authored-by: zomars <zomars@me.com>
This commit is contained in:
Dolev Hadar
2024-08-05 16:49:19 -07:00
committed by GitHub
co-authored by zomars
parent a268d8743d
commit e7816cfb0c
9 changed files with 1141 additions and 633 deletions
+1
View File
@@ -22,6 +22,7 @@
/* Find a way to not require this - App files don't belong here. */
"../../packages/app-store/routing-forms/env.d.ts",
"next-env.d.ts",
"../../packages/trpc/types/router.d.ts",
"../../packages/types/*.d.ts",
"../../packages/types/next-auth.d.ts",
"**/*.ts",
+1 -2
View File
@@ -157,8 +157,7 @@ export const CLOUDFLARE_SITE_ID = process.env.NEXT_PUBLIC_CLOUDFLARE_SITEKEY;
export const MINIMUM_NUMBER_OF_ORG_SEATS = 30;
export const ORG_SELF_SERVE_ENABLED = process.env.NEXT_PUBLIC_ORG_SELF_SERVE_ENABLED === "1";
export const ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE = 0;
export const ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE =
2;
export const ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE = 2;
export const CALCOM_PRIVATE_API_ROUTE = process.env.CALCOM_PRIVATE_API_ROUTE || "https://goblin.cal.com";
/**
+1 -1
View File
@@ -5,6 +5,6 @@
"jsx": "preserve",
"resolveJsonModule": true
},
"include": [".", "../types/next-auth.d.ts", "../types/window.d.ts"],
"include": [".", "../types/next-auth.d.ts", "../types/window.d.ts", "../trpc/types/router.d.ts"],
"exclude": ["dist", "build", "node_modules"]
}
+1
View File
@@ -0,0 +1 @@
types
+6 -1
View File
@@ -8,7 +8,9 @@
"main": "index.ts",
"scripts": {
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix"
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"build": "yarn trpc:generate || true",
"trpc:generate": "yarn tsc --project tsconfig.json"
},
"dependencies": {
"@tanstack/react-query": "^5.17.15",
@@ -18,5 +20,8 @@
"@trpc/server": "11.0.0-next-beta.222",
"superjson": "1.9.1",
"zod": "^3.22.4"
},
"devDependencies": {
"typescript": "^4.9.4"
}
}
@@ -7,6 +7,7 @@ import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
import getOrgIdFromMemberOrTeamId from "@calcom/lib/getOrgIdFromMemberOrTeamId";
import { getTranslation } from "@calcom/lib/server/i18n";
import sendPayload from "@calcom/lib/server/webhooks/sendPayload";
import { WebhookTriggerEvents } from "@calcom/prisma/enums";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { TRPCError } from "@trpc/server";
+9 -1
View File
@@ -1,4 +1,12 @@
{
"extends": "@calcom/tsconfig/react-library.json",
"include": ["client", "next", "react", "server"]
"include": ["client", "next", "react", "server"],
"compilerOptions": {
"isolatedModules": false,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": false,
"outFile": "types/router.d.ts"
},
}
+3
View File
@@ -21,6 +21,9 @@
"cache": false,
"dependsOn": ["@calcom/prisma#db-migrate"]
},
"@calcom/trpc#build": {
"outputs": ["./types"]
},
"@calcom/web#build": {
"dependsOn": ["^build"],
"outputs": [".next/**"],
+1118 -628
View File
File diff suppressed because it is too large Load Diff