Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix project package imports

Andras Bacsai0e266bf8a62d
diff --git a/apps/designer/app/designer/features/breakpoints/breakpoints.tsx b/apps/designer/app/designer/features/breakpoints/breakpoints.tsx
index 99437785bc..e5201a0ec9 100644
--- a/apps/designer/app/designer/features/breakpoints/breakpoints.tsx
+++ b/apps/designer/app/designer/features/breakpoints/breakpoints.tsx
@@ -25,7 +25,7 @@ import {
} from "./use-subscribe-shortcuts";
import { ConfirmationDialog } from "./confirmation-dialog";
import { useBreakpoints } from "~/shared/nano-states";
-import { utils } from "@webstudio-is/project";
+import { utils } from "@webstudio-is/project/index.server";
declare module "~/shared/pubsub" {
export interface PubsubMap {
diff --git a/apps/designer/app/designer/features/breakpoints/use-subscribe-breakpoints.ts b/apps/designer/app/designer/features/breakpoints/use-subscribe-breakpoints.ts
index e989d856ef..d4349cb38c 100644
--- a/apps/designer/app/designer/features/breakpoints/use-subscribe-breakpoints.ts
+++ b/apps/designer/app/designer/features/breakpoints/use-subscribe-breakpoints.ts
@@ -2,7 +2,7 @@ import { useEffect } from "react";
import { useSubscribe } from "~/shared/pubsub";
import { useSelectedBreakpoint } from "~/designer/shared/nano-states";
import { useBreakpoints } from "~/shared/nano-states";
-import { utils } from "@webstudio-is/project";
+import { utils } from "@webstudio-is/project/index.server";
export const useSubscribeBreakpoints = () => {
const [breakpoints, setBreakpoints] = useBreakpoints();
const [selectedBreakpoint, setSelectedBreakpoint] = useSelectedBreakpoint();
diff --git a/apps/designer/app/designer/features/breakpoints/use-subscribe-shortcuts.ts b/apps/designer/app/designer/features/breakpoints/use-subscribe-shortcuts.ts
index 8849e6a5ad..5c7c7c9a82 100644
--- a/apps/designer/app/designer/features/breakpoints/use-subscribe-shortcuts.ts
+++ b/apps/designer/app/designer/features/breakpoints/use-subscribe-shortcuts.ts
@@ -2,7 +2,7 @@ import { useSubscribe } from "~/shared/pubsub";
import { useBreakpoints } from "~/shared/nano-states";
import { useZoom, useSelectedBreakpoint } from "../../shared/nano-states";
import { minZoom } from "./zoom-setting";
-import { utils } from "@webstudio-is/project";
+import { utils } from "@webstudio-is/project/index.server";
export const useSubscribeSelectBreakpointFromShortcut = () => {
const [breakpoints] = useBreakpoints();
diff --git a/apps/designer/app/designer/features/breakpoints/width-setting.tsx b/apps/designer/app/designer/features/breakpoints/width-setting.tsx
index 4d69bab986..fbdc194126 100644
--- a/apps/designer/app/designer/features/breakpoints/width-setting.tsx
+++ b/apps/designer/app/designer/features/breakpoints/width-setting.tsx
@@ -5,7 +5,7 @@ import {
} from "~/designer/shared/nano-states";
import { __DEPRECATED__Text, Flex, Slider } from "@webstudio-is/design-system";
import { useBreakpoints, useIsPreviewMode } from "~/shared/nano-states";
-import { utils } from "@webstudio-is/project";
+import { utils } from "@webstudio-is/project/index.server";
// Doesn't make sense to allow resizing the canvas lower/higher than this.
export const minWidth = 50;
diff --git a/apps/designer/app/routes/dashboard/index.tsx b/apps/designer/app/routes/dashboard/index.tsx
index 4cd69bafc3..65bd2c066e 100644
--- a/apps/designer/app/routes/dashboard/index.tsx
+++ b/apps/designer/app/routes/dashboard/index.tsx
@@ -6,7 +6,7 @@ import {
redirect,
} from "@remix-run/node";
import { Dashboard, links } from "~/dashboard";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
import config, { type Config } from "~/config";
import { ensureUserCookie } from "~/shared/session";
import { authenticator } from "~/services/auth.server";
diff --git a/apps/designer/app/routes/designer/$id.tsx b/apps/designer/app/routes/designer/$id.tsx
index d9ec4d91c8..5c28bb95fa 100644
--- a/apps/designer/app/routes/designer/$id.tsx
+++ b/apps/designer/app/routes/designer/$id.tsx
@@ -1,7 +1,7 @@
import { useLoaderData } from "@remix-run/react";
import { LoaderFunction } from "@remix-run/node";
import { Designer, links } from "~/designer";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
import type { Project } from "@webstudio-is/project";
import config from "~/config";
import env from "~/env.server";
diff --git a/apps/designer/app/routes/index.tsx b/apps/designer/app/routes/index.tsx
index 7b0e662eee..2374667e69 100644
--- a/apps/designer/app/routes/index.tsx
+++ b/apps/designer/app/routes/index.tsx
@@ -2,7 +2,7 @@ import { type LoaderFunction, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { type Data, InstanceRoot, Root } from "@webstudio-is/react-sdk";
import config from "~/config";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
import env, { Env } from "~/env.server";
// @todo all this subdomain logic is very hacky
diff --git a/apps/designer/app/routes/rest/breakpoints.$projectId.ts b/apps/designer/app/routes/rest/breakpoints.$projectId.ts
index 5074f48411..9fbef0acfc 100644
--- a/apps/designer/app/routes/rest/breakpoints.$projectId.ts
+++ b/apps/designer/app/routes/rest/breakpoints.$projectId.ts
@@ -1,6 +1,6 @@
import type { LoaderFunction } from "@remix-run/node";
import { Breakpoint } from "@webstudio-is/react-sdk";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
export type ErrorData = {
errors: string;
diff --git a/apps/designer/app/routes/rest/pages.$projectId.ts b/apps/designer/app/routes/rest/pages.$projectId.ts
index 39dced94fe..4c3995df6a 100644
--- a/apps/designer/app/routes/rest/pages.$projectId.ts
+++ b/apps/designer/app/routes/rest/pages.$projectId.ts
@@ -1,6 +1,6 @@
import type { LoaderFunction } from "@remix-run/node";
import type { Breakpoint } from "@webstudio-is/react-sdk";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
export type ErrorData = {
errors: string;
diff --git a/apps/designer/app/routes/rest/patch.ts b/apps/designer/app/routes/rest/patch.ts
index abc739d53b..d11b8acd59 100644
--- a/apps/designer/app/routes/rest/patch.ts
+++ b/apps/designer/app/routes/rest/patch.ts
@@ -1,5 +1,5 @@
import { type ActionFunction } from "@remix-run/node";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
import { type SyncItem } from "immerhin";
import { type Tree } from "@webstudio-is/react-sdk";
import { type Project } from "@webstudio-is/prisma-client";
diff --git a/apps/designer/app/routes/rest/project/clone.$domain.ts b/apps/designer/app/routes/rest/project/clone.$domain.ts
index ad77915d64..583d02a779 100644
--- a/apps/designer/app/routes/rest/project/clone.$domain.ts
+++ b/apps/designer/app/routes/rest/project/clone.$domain.ts
@@ -1,6 +1,7 @@
import { type LoaderFunction, redirect } from "@remix-run/node";
import type { User } from "@webstudio-is/prisma-client";
-import { db as projectDb, type Project } from "@webstudio-is/project";
+import { db as projectDb } from "@webstudio-is/project/index.server";
+import { type Project } from "@webstudio-is/project";
import * as userDb from "~/shared/db";
import { ensureUserCookie } from "~/shared/session";
import config from "~/config";
diff --git a/apps/designer/app/routes/rest/props.$projectId.ts b/apps/designer/app/routes/rest/props.$projectId.ts
index 8422272748..75f7596919 100644
--- a/apps/designer/app/routes/rest/props.$projectId.ts
+++ b/apps/designer/app/routes/rest/props.$projectId.ts
@@ -1,6 +1,6 @@
import { type LoaderFunction } from "@remix-run/node";
import { type InstanceProps } from "@webstudio-is/react-sdk";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
type ErrorData = {
errors: string;
};
diff --git a/apps/designer/app/routes/rest/tree.$projectId.ts b/apps/designer/app/routes/rest/tree.$projectId.ts
index 46da582ada..14dd94e2e0 100644
--- a/apps/designer/app/routes/rest/tree.$projectId.ts
+++ b/apps/designer/app/routes/rest/tree.$projectId.ts
@@ -1,6 +1,6 @@
import { type LoaderFunction } from "@remix-run/node";
import type { Tree } from "@webstudio-is/react-sdk";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
export type ErrorData = {
errors: string;
};
diff --git a/apps/designer/app/shared/db/canvas.server.ts b/apps/designer/app/shared/db/canvas.server.ts
index 26db70052f..7c556c8c3c 100644
--- a/apps/designer/app/shared/db/canvas.server.ts
+++ b/apps/designer/app/shared/db/canvas.server.ts
@@ -1,5 +1,5 @@
import { type Data } from "@webstudio-is/react-sdk";
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
import type { Project } from "@webstudio-is/project";
export type CanvasData = Data & { project: Project };
diff --git a/apps/designer/app/shared/db/misc.server.ts b/apps/designer/app/shared/db/misc.server.ts
index 9238ec88ad..a149cd3959 100644
--- a/apps/designer/app/shared/db/misc.server.ts
+++ b/apps/designer/app/shared/db/misc.server.ts
@@ -1,4 +1,4 @@
-import { db } from "@webstudio-is/project";
+import { db } from "@webstudio-is/project/index.server";
/**
* Conceptually publishing is cloning all data that affects user site
diff --git a/packages/project/src/db/project.ts b/packages/project/src/db/project.ts
index e67c58fc71..e95eef15f2 100644
--- a/packages/project/src/db/project.ts
+++ b/packages/project/src/db/project.ts
@@ -7,7 +7,7 @@ import {
Prisma,
Project as BaseProject,
} from "@webstudio-is/prisma-client";
-import { formatAsset } from "@webstudio-is/asset-uploader";
+import { formatAsset } from "@webstudio-is/asset-uploader/index.server";
import * as db from "./index";
import type { Project } from "../index";
const TreeHistorySchema = z.array(z.string());