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: imports

Andras Bacsaifaad294b0fc4
diff --git a/apps/designer/app/canvas/canvas.tsx b/apps/designer/app/canvas/canvas.tsx
index 9d18c7b7a8..772d329130 100644
--- a/apps/designer/app/canvas/canvas.tsx
+++ b/apps/designer/app/canvas/canvas.tsx
@@ -1,6 +1,6 @@
import { useCallback, useMemo, useState } from "react";
import store from "immerhin";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import {
type OnChangeChildren,
type Data,
diff --git a/apps/designer/app/canvas/shared/sync/use-sync.ts b/apps/designer/app/canvas/shared/sync/use-sync.ts
index d2a1e5080d..a2f3959a33 100644
--- a/apps/designer/app/canvas/shared/sync/use-sync.ts
+++ b/apps/designer/app/canvas/shared/sync/use-sync.ts
@@ -1,7 +1,7 @@
import useInterval from "react-use/lib/useInterval";
import { sync } from "immerhin";
import { enqueue } from "./queue";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
export const useSync = ({ project }: { project: db.project.Project }) => {
useInterval(() => {
diff --git a/apps/designer/app/designer/designer.tsx b/apps/designer/app/designer/designer.tsx
index f1b4bb7d7a..7a87db0eeb 100644
--- a/apps/designer/app/designer/designer.tsx
+++ b/apps/designer/app/designer/designer.tsx
@@ -1,6 +1,6 @@
import { useCallback } from "react";
import { useSubscribe, usePublish, type Publish } from "~/shared/pubsub";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import type { Config } from "~/config";
import { Box, Flex, Grid, type CSS } from "@webstudio-is/design-system";
import interStyles from "~/shared/font-faces/inter.css";
diff --git a/apps/designer/app/designer/features/topbar/publish.tsx b/apps/designer/app/designer/features/topbar/publish.tsx
index 411e00ec2a..921a909253 100644
--- a/apps/designer/app/designer/features/topbar/publish.tsx
+++ b/apps/designer/app/designer/features/topbar/publish.tsx
@@ -17,7 +17,7 @@ import {
} from "@webstudio-is/design-system";
import { useIsPublishDialogOpen } from "../../shared/nano-states";
import env from "~/shared/env";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
type PublishButtonProps = { project: db.project.Project };
const getHost = () => {
diff --git a/apps/designer/app/designer/features/topbar/share.tsx b/apps/designer/app/designer/features/topbar/share.tsx
index b7ff2e87e9..4236ee23de 100644
--- a/apps/designer/app/designer/features/topbar/share.tsx
+++ b/apps/designer/app/designer/features/topbar/share.tsx
@@ -9,7 +9,7 @@ import {
TextField,
} from "@webstudio-is/design-system";
import { Share1Icon } from "@webstudio-is/icons";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import { useIsShareDialogOpen } from "../../shared/nano-states";
type ShareButtonProps = { path: string; project: db.project.Project };
diff --git a/apps/designer/app/designer/features/topbar/topbar.tsx b/apps/designer/app/designer/features/topbar/topbar.tsx
index 50bc9333f9..5c0378f439 100644
--- a/apps/designer/app/designer/features/topbar/topbar.tsx
+++ b/apps/designer/app/designer/features/topbar/topbar.tsx
@@ -7,7 +7,7 @@ import { PublishButton } from "./publish";
import { SyncStatus } from "./sync-status";
import { Menu } from "./menu";
import { Breakpoints } from "../breakpoints";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
type TopbarProps = {
config: Config;
diff --git a/apps/designer/app/routes/dashboard/index.tsx b/apps/designer/app/routes/dashboard/index.tsx
index be78276a44..0c24455103 100644
--- a/apps/designer/app/routes/dashboard/index.tsx
+++ b/apps/designer/app/routes/dashboard/index.tsx
@@ -6,7 +6,7 @@ import {
json,
} from "@remix-run/node";
import { Dashboard, links } from "~/dashboard";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
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 a5ac843248..fb2d6017e0 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 * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import config from "~/config";
import env from "~/env.server";
import { ErrorMessage } from "~/shared/error";
diff --git a/apps/designer/app/routes/index.tsx b/apps/designer/app/routes/index.tsx
index 0f9169dbb9..331aa26f62 100644
--- a/apps/designer/app/routes/index.tsx
+++ b/apps/designer/app/routes/index.tsx
@@ -2,7 +2,7 @@ import { redirect, type LoaderFunction } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { Root, type Data } from "@webstudio-is/react-sdk";
import config from "~/config";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import { Canvas as CanvasDocument } from "~/shared/documents/canvas";
import env, { Env } from "~/env.server";
diff --git a/apps/designer/app/routes/rest/patch.ts b/apps/designer/app/routes/rest/patch.ts
index 02ed991ef0..ec5bda589b 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 * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
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 788e1bbaf9..de0c47a258 100644
--- a/apps/designer/app/routes/rest/project/clone.$domain.ts
+++ b/apps/designer/app/routes/rest/project/clone.$domain.ts
@@ -1,6 +1,6 @@
import { type LoaderFunction, redirect } from "@remix-run/node";
import type { User } from "@webstudio-is/prisma-client";
-import * as db from "~/shared/db";
+import * as db from "@webstudio-is/project";
import { ensureUserCookie } from "~/shared/session";
import config from "~/config";
import { authenticator } from "~/services/auth.server";
diff --git a/apps/designer/app/shared/db/canvas.server.ts b/apps/designer/app/shared/db/canvas.server.ts
index 26f9312344..a1345f5536 100644
--- a/apps/designer/app/shared/db/canvas.server.ts
+++ b/apps/designer/app/shared/db/canvas.server.ts
@@ -1,13 +1,13 @@
import { type Data } from "@webstudio-is/react-sdk";
import * as db from "@webstudio-is/project";
-export type CanvasData = Data & { project: db.Project };
+export type CanvasData = Data & { project: db.project.Project };
export type ErrorData = {
errors: string;
};
-const loadData = async (projectId: db.Project["id"]) => {
+const loadData = async (projectId: db.project.Project["id"]) => {
const project = await db.project.loadById(projectId);
if (project === null) throw new Error(`Project "${projectId}" not found`);
@@ -39,7 +39,7 @@ const loadData = async (projectId: db.Project["id"]) => {
export const loadCanvasData = async ({
projectId,
}: {
- projectId: db.Project["id"];
+ projectId: db.project.Project["id"];
}): Promise<CanvasData | ErrorData> => {
return await loadData(projectId);
};
@@ -49,7 +49,7 @@ export type PreviewData = Data;
export const loadPreviewData = async ({
projectId,
}: {
- projectId: db.Project["id"];
+ projectId: db.project.Project["id"];
}): Promise<PreviewData | ErrorData> => {
const { tree, props, breakpoints } = await loadData(projectId);
return { tree, props, breakpoints };