Skip to content

Commit

Permalink
💅 Renamed prisma package to db
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Dec 8, 2021
1 parent 17665de commit 641ba3d
Show file tree
Hide file tree
Showing 22 changed files with 550 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ cypress.env.json

workspace.code-workspace

.DS_Store



Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@chakra-ui/react'
import { useDraggable } from '@dnd-kit/core'
import { useRouter } from 'next/router'
import { Typebot } from '@typebot/prisma'
import { Typebot } from 'db'
import { isMobile } from 'services/utils'
import { MoreButton } from 'components/MoreButton'
import { ConfirmModal } from 'components/modals/ConfirmModal'
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/libs/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient } from '@typebot/prisma'
import { PrismaClient } from 'db'

declare const global: { prisma: PrismaClient }
let prisma: PrismaClient
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"dev": "dotenv -e ../../.env next dev",
"build": "next build",
"build:prod": "yarn workspace @typebot/prisma deploy && next build",
"build:prod": "yarn workspace db deploy && next build",
"start": "next start",
"lint": "next lint",
"cypress": "cypress open"
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FacebookProvider from 'next-auth/providers/facebook'
import CredentialsProvider from 'next-auth/providers/credentials'
import prisma from 'libs/prisma'
import { Provider } from 'next-auth/providers'
import { User } from '@typebot/prisma'
import { User } from 'db'

const providers: Provider[] = [
EmailProvider({
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/pages/api/folders.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardFolder, User } from '@typebot/prisma'
import { DashboardFolder, User } from 'db'
import prisma from 'libs/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getSession } from 'next-auth/react'
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/pages/api/folders/[id].ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DashboardFolder } from '@typebot/prisma'
import { DashboardFolder } from 'db'
import prisma from 'libs/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getSession } from 'next-auth/react'
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/pages/api/typebots.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typebot, User } from '@typebot/prisma'
import { Typebot, User } from 'db'
import prisma from 'libs/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getSession } from 'next-auth/react'
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/services/typebots.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typebot } from '@typebot/prisma'
import { Typebot } from 'db'
import useSWR from 'swr'
import { fetcher, sendRequest } from './utils'

Expand Down
2 changes: 1 addition & 1 deletion apps/builder/services/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User } from '@typebot/prisma'
import { User } from 'db'
import { useSession } from 'next-auth/react'

export const useUser = (): User | undefined => {
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"apps/*"
],
"scripts": {
"db:up": "docker-compose up -d && yarn workspace @typebot/prisma prisma db push",
"builder": "yarn workspace builder",
"viewer": "yarn workspace viewer",
"db": "yarn workspace db",
"db:up": "docker-compose up -d && yarn db prisma db push",
"db:nuke": "docker-compose down --volumes --remove-orphans",
"dev": "concurrently -n builder,viewer \"yarn dev:builder\" \"yarn dev:viewer\"",
"dev:builder": "yarn workspace builder dev",
"dev:viewer": "yarn workspace viewer dev",
"dx": "run-s db:up dev",
"cypress:builder": "yarn workspace builder cypress",
"cypress:viewer": "yarn workspace builder cypress"
"dev": "concurrently -n builder,viewer \"yarn builder dev\" \"yarn viewer dev\"",
"dx": "run-s db:up dev"
},
"devDependencies": {
"concurrently": "^6.4.0",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/prisma/package.json → packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@typebot/prisma",
"name": "db",
"packageManager": "yarn@3.1.0",
"devDependencies": {
"dotenv-cli": "^4.1.0",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ model Typebot {
results Result[]
folderId String?
folder DashboardFolder? @relation(fields: [folderId], references: [id])
blocks Json[]
}

model PublicTypebot {
Expand All @@ -95,6 +96,7 @@ model PublicTypebot {
typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
steps Json[]
name String
blocks Json[]
}

model Result {
Expand Down
File renamed without changes.
Loading

0 comments on commit 641ba3d

Please sign in to comment.