2
0

🚧 Use TS project references

This commit is contained in:
Baptiste Arnaud
2024-08-28 18:09:35 +02:00
parent 0c7d2afd51
commit fdd6cc6fee
627 changed files with 3043 additions and 1696 deletions

View File

@@ -2,12 +2,11 @@ import {
Plan,
Prisma,
PrismaClient,
User,
Workspace,
WorkspaceRole,
} from '@typebot.io/prisma'
import { createId } from '@typebot.io/lib/createId'
import { Typebot, TypebotV6, HttpRequest } from '@typebot.io/schemas'
import { Typebot, TypebotV6 } from '@typebot.io/schemas'
import { readFileSync } from 'fs'
import { proWorkspaceId, userId } from './databaseSetup'
import {
@@ -138,19 +137,6 @@ export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
return workspaceIds
}
export const updateUser = (data: Partial<User>) =>
prisma.user.update({
data: {
...data,
onboardingCategories: data.onboardingCategories ?? [],
displayedInAppNotifications:
data.displayedInAppNotifications ?? Prisma.DbNull,
},
where: {
id: userId,
},
})
export const createTypebots = async (partialTypebots: Partial<TypebotV6>[]) => {
const typebotsWithId = partialTypebots.map((typebot) => {
const typebotId = typebot.id ?? createId()

View File

@@ -14,7 +14,6 @@
"@typebot.io/env": "workspace:*"
},
"devDependencies": {
"@types/node": "20.4.2",
"@typebot.io/tsconfig": "workspace:*"
"@types/node": "20.4.2"
}
}

View File

@@ -1,8 +1,21 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../tsconfig/base.json",
"include": ["**/*.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ES2021", "DOM"]
}
"outDir": "dist"
},
"references": [
{
"path": "../env"
},
{
"path": "../lib"
},
{
"path": "../prisma"
},
{
"path": "../schemas"
}
]
}