Scheduling infrastructure for absolutely everyone.
fix: admin wizard crash and prisma enum generator path resolution (#28244)
Alex van Andel1b21ead01158
diff --git a/apps/web/modules/auth/setup-view.tsx b/apps/web/modules/auth/setup-view.tsxindex 0e12dc1d159..f3b3358ad4c 100644--- a/apps/web/modules/auth/setup-view.tsx+++ b/apps/web/modules/auth/setup-view.tsx@@ -30,16 +30,19 @@ export function Setup(props: PageProps) {props.hasValidLicense ? "EXISTING" : "FREE");+ const hasLicenseStep = !props.hasValidLicense && !hasPickedAGPLv3;+const defaultStep = useMemo(() => {if (props.userCount > 0) {- if (!props.hasValidLicense && !hasPickedAGPLv3) {+ if (hasLicenseStep) {return SETUP_VIEW_SETPS.LICENSE;} else {- return SETUP_VIEW_SETPS.APPS;+ // License step is not shown, so apps step is at position 2 instead of 3+ return SETUP_VIEW_SETPS.APPS - 1;}}return SETUP_VIEW_SETPS.ADMIN_USER;- }, [props.userCount, props.hasValidLicense, hasPickedAGPLv3]);+ }, [props.userCount, hasLicenseStep]);const steps: WizardStep[] = [{@@ -52,13 +55,7 @@ export function Setup(props: PageProps) {setIsPending(true);}}onSuccess={() => {- // If there's already a valid license or user picked AGPLv3, skip to apps step- if (props.hasValidLicense || hasPickedAGPLv3) {- nav.onNext();- nav.onNext(); // Skip license step- } else {- nav.onNext();- }+ nav.onNext();}}onError={() => {setIsPending(false);@@ -71,7 +68,7 @@ export function Setup(props: PageProps) {];// Only show license selection step if there's no valid license already and AGPLv3 wasn't picked- if (!props.hasValidLicense && !hasPickedAGPLv3) {+ if (hasLicenseStep) {steps.push({title: t("choose_a_license"),description: t("choose_license_description"),diff --git a/packages/prisma/package.json b/packages/prisma/package.jsonindex e4c66d6ca3d..7a612efef70 100644--- a/packages/prisma/package.json+++ b/packages/prisma/package.json@@ -2,6 +2,9 @@"name": "@calcom/prisma","version": "0.0.0","private": true,+ "bin": {+ "prisma-enum-generator": "./run-enum-generator.js"+ },"scripts": {"clean": "rm -rf .turbo && rm -rf node_modules","build": "ts-node --transpile-only ./auto-migrations.ts",diff --git a/packages/prisma/run-enum-generator.js b/packages/prisma/run-enum-generator.jsnew file mode 100755index 00000000000..3e88e1b64c0--- /dev/null+++ b/packages/prisma/run-enum-generator.js@@ -0,0 +1,6 @@+#!/usr/bin/env node+// Wrapper script for the enum generator that ensures correct path resolution+// regardless of the current working directory (e.g., running prisma from repo root).+// Prisma resolves providers starting with "./" relative to the schema file directory.+require("ts-node").register({ transpileOnly: true });+require("./enum-generator.ts");diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prismaindex c683a40a765..1e8930156a7 100644--- a/packages/prisma/schema.prisma+++ b/packages/prisma/schema.prisma@@ -36,7 +36,7 @@ generator kysely {}generator enums {- provider = "ts-node --transpile-only ./enum-generator.ts"+ provider = "prisma-enum-generator"}enum SchedulingType {diff --git a/yarn.lock b/yarn.lockindex 98bb36cb871..22d5112629a 100644--- a/yarn.lock+++ b/yarn.lock@@ -2977,6 +2977,8 @@ __metadata:uuid: "npm:8.3.2"zod: "npm:3.25.76"zod-prisma-types: "npm:3.2.4"+ bin:+ prisma-enum-generator: ./run-enum-generator.jslanguageName: unknownlinkType: soft