Fix Dev Environment Errors & Docker Deployment (#279)

* fix prisma errors
* add new database build process
* fix js widget needing @prisma/client
This commit is contained in:
Matti Nannt
2023-05-09 20:12:48 +02:00
committed by GitHub
parent 520f282384
commit ef4e5ed17a
23 changed files with 390 additions and 59 deletions
-1
View File
@@ -1 +0,0 @@
export * from "../../../node_modules/.prisma/client/index.d";
-1
View File
@@ -1 +0,0 @@
export * from "../../../node_modules/.prisma/client";
+11 -7
View File
@@ -3,34 +3,38 @@
"private": true,
"version": "1.0.0",
"license": "MIT",
"main": "index.ts",
"types": "index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
"dist/**",
"generated"
],
"scripts": {
"clean": "rimraf .turbo node_modules dist",
"clean": "rimraf .turbo node_modules dist generated",
"build": "tsup",
"dev": "tsup --watch",
"db:migrate:deploy": "prisma migrate deploy",
"db:migrate:dev": "prisma migrate dev",
"db:migrate:vercel": "DATABASE_URL=\"$MIGRATE_DATABASE_URL\" prisma migrate deploy",
"db:push": "prisma db push --accept-data-loss",
"format": "prisma format",
"generate": "prisma generate",
"lint": "eslint ./client --fix",
"lint": "eslint ./src --fix",
"prebuild": "npm run generate",
"predev": "npm run generate",
"studio": "prisma studio"
},
"dependencies": {
"@prisma/client": "^4.13.0"
"@prisma/client": "^4.14.0"
},
"devDependencies": {
"@formbricks/tsconfig": "workspace:*",
"eslint": "^8.40.0",
"eslint-config-formbricks": "workspace:*",
"prisma": "^4.13.0",
"prisma": "^4.14.0",
"prisma-dbml-generator": "^0.10.0",
"rimraf": "^5.0.0",
"tsup": "^6.7.0",
"tsx": "^3.12.7",
"typescript": "^5.0.4"
}
+1 -1
View File
@@ -9,7 +9,7 @@ datasource db {
generator client {
provider = "prisma-client-js"
previewFeatures = ["filteredRelationCount", "extendedWhereUnique"]
output = "../../../node_modules/.prisma/client"
output = "../generated"
//provider = "prisma-dbml-generator"
}
@@ -1,7 +1,7 @@
import { PrismaClient } from "@prisma/client";
import { PrismaClient } from "../generated";
declare global {
var prisma: PrismaClient | undefined;
var prisma: any;
}
export const prisma: PrismaClient =
+1
View File
@@ -9,4 +9,5 @@ export default defineConfig({
format: ["cjs", "esm"],
minify: isProduction,
sourcemap: true,
external: [/generated/],
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@formbricks/js",
"version": "0.1.15",
"version": "0.1.16",
"description": "Formbricks-js allows you to connect your app to Formbricks, display surveys and trigger events.",
"keywords": [
"Formbricks",
+10 -3
View File
@@ -1,4 +1,3 @@
import type { Survey as PrismaSurvey } from "@prisma/client";
import { Question } from "./questions";
export interface ThankYouCard {
@@ -6,11 +5,19 @@ export interface ThankYouCard {
headline?: string;
subheader?: string;
}
export interface Survey extends Omit<PrismaSurvey, "questions" | "triggers" | "thankYouCard"> {
export interface Survey {
id: string;
createdAt: string;
updatedAt: string;
name: string;
type: "web" | "email" | "link" | "mobile";
environmentId: string;
status: "draft" | "inProgress" | "archived" | "paused" | "completed";
recontactDays: number | null;
questions: Question[];
thankYouCard: ThankYouCard;
triggers: string[];
numDisplays: number;
responseRate: number;
displayOptions: "displayOnce" | "displayMultiple" | "respondMultiple";
displayOption: "displayOnce" | "displayMultiple" | "respondMultiple";
}