refactor: move app-store dependent seed files from prisma to scripts (#23799)

* move seed.ts

* update package.json

* wip

* revert
This commit is contained in:
Benny Joo authored and GitHub committed 2025-09-12 18:27:20 +01:00
1 parent ee70111c45
commit 1fee90322d
4 files changed
+15 -16

No files matched your search

+2 -2
View File
@@ -16,7 +16,7 @@
"dx": "yarn db-setup",
"generate-schemas": "prisma generate && prisma format",
"post-install": "yarn generate-schemas",
"seed-app-store": "ts-node --transpile-only ./seed-app-store.ts",
"seed-app-store": "ts-node --transpile-only ../../scripts/seed-app-store.ts",
"delete-app": "ts-node --transpile-only ./delete-app.ts",
"seed-insights": "ts-node --transpile-only ./seed-insights.ts",
"seed-pbac": "ts-node --transpile-only ./seed-pbac-organization.ts"
@@ -44,6 +44,6 @@
"zod-utils.ts"
],
"prisma": {
"seed": "ts-node --transpile-only ./seed.ts"
"seed": "ts-node --transpile-only ../../scripts/seed.ts"
}
}
@@ -3,14 +3,14 @@
* This file is deprecated. The only use of this file is to seed the database for E2E tests. Each test should take care of seeding it's own data going forward.
*/
import dotEnv from "dotenv";
import path from "path";
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
import prisma from "@calcom/prisma";
import type { Prisma } from "@calcom/prisma/client";
import { AppCategories } from "@calcom/prisma/enums";
import prisma from ".";
import type { Prisma } from "./client";
import { AppCategories } from "./enums";
dotEnv.config({ path: "../../.env.appStore" });
dotEnv.config({ path: path.resolve(__dirname, "../.env.appStore") });
export const seededForm = {
id: "948ae412-d995-4865-875a-48302588de03",
@@ -11,7 +11,7 @@ import zoomMeta from "@calcom/app-store/zoomvideo/_metadata";
import dayjs from "@calcom/dayjs";
import { BookingStatus } from "@calcom/prisma/enums";
import { createUserAndEventType } from "./seed-utils";
import { createUserAndEventType } from "../packages/prisma/seed-utils";
async function _createManyDifferentUsersWithDifferentEventTypesAndBookings({
tillUser,
@@ -322,4 +322,4 @@ async function createAUserWithManyBookings() {
// startFrom: 10000,
// });
createAUserWithManyBookings();
createAUserWithManyBookings();
+6 -7
View File
@@ -8,17 +8,16 @@ import dayjs from "@calcom/dayjs";
import { getOrgFullOrigin } from "@calcom/ee/organizations/lib/orgDomains";
import { hashPassword } from "@calcom/features/auth/lib/hashPassword";
import { DEFAULT_SCHEDULE, getAvailabilityFromSchedule } from "@calcom/lib/availability";
import prisma from "@calcom/prisma";
import type { Membership, Team, User, UserPermissionRole } from "@calcom/prisma/client";
import { Prisma } from "@calcom/prisma/client";
import { BookingStatus, MembershipRole, RedirectType, SchedulingType } from "@calcom/prisma/enums";
import type { Ensure } from "@calcom/types/utils";
import prisma from ".";
import type { Membership, Team, User } from "./client";
import { Prisma } from "./client";
import type { UserPermissionRole } from "./client";
import mainHugeEventTypesSeed from "../packages/prisma/seed-huge-event-types";
import { createUserAndEventType } from "../packages/prisma/seed-utils";
import type { teamMetadataSchema } from "../packages/prisma/zod-utils";
import mainAppStore from "./seed-app-store";
import mainHugeEventTypesSeed from "./seed-huge-event-types";
import { createUserAndEventType } from "./seed-utils";
import type { teamMetadataSchema } from "./zod-utils";
type PlatformUser = {
email: string;