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.

Move project build schema into separate package (#864)

Bogdan Chadkinbf50c0c5475c
diff --git a/apps/designer/app/canvas/features/text-editor/interop.ts b/apps/designer/app/canvas/features/text-editor/interop.ts
index fd94c71a9a..6fa1035979 100644
--- a/apps/designer/app/canvas/features/text-editor/interop.ts
+++ b/apps/designer/app/canvas/features/text-editor/interop.ts
@@ -11,7 +11,8 @@ import {
$isLineBreakNode,
} from "lexical";
import { $createLinkNode, $isLinkNode } from "@lexical/link";
-import type { ChildrenUpdates, Instance, Text } from "@webstudio-is/react-sdk";
+import type { Instance, Text } from "@webstudio-is/project-build";
+import type { ChildrenUpdates } from "@webstudio-is/react-sdk";
import { utils } from "@webstudio-is/project";
import { $isSpanNode, $setNodeSpan } from "./toolbar-connector";
diff --git a/apps/designer/app/canvas/features/text-editor/text-editor.tsx b/apps/designer/app/canvas/features/text-editor/text-editor.tsx
index 7722ce133d..8b59fa8cad 100644
--- a/apps/designer/app/canvas/features/text-editor/text-editor.tsx
+++ b/apps/designer/app/canvas/features/text-editor/text-editor.tsx
@@ -19,7 +19,8 @@ import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
import { nanoid } from "nanoid";
import { createCssEngine } from "@webstudio-is/css-engine";
-import type { ChildrenUpdates, Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import type { ChildrenUpdates } from "@webstudio-is/react-sdk";
import { idAttribute } from "@webstudio-is/react-sdk";
import { ToolbarConnectorPlugin } from "./toolbar-connector";
import { type Refs, $convertToLexical, $convertToUpdates } from "./interop";
diff --git a/apps/designer/app/canvas/features/wrapper-component/selected-instance-connector.ts b/apps/designer/app/canvas/features/wrapper-component/selected-instance-connector.ts
index 5512a36975..f1273bbdd7 100644
--- a/apps/designer/app/canvas/features/wrapper-component/selected-instance-connector.ts
+++ b/apps/designer/app/canvas/features/wrapper-component/selected-instance-connector.ts
@@ -1,5 +1,5 @@
import { useEffect } from "react";
-import type { Instance, PropsItem, Styles } from "@webstudio-is/react-sdk";
+import type { Instance, PropsItem, Styles } from "@webstudio-is/project-build";
import { getBrowserStyle } from "@webstudio-is/react-sdk";
import { publish, subscribe, subscribeAll } from "~/shared/pubsub";
import {
diff --git a/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx b/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
index d3b04627d2..d6567fa4fa 100644
--- a/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
+++ b/apps/designer/app/canvas/features/wrapper-component/wrapper-component.tsx
@@ -2,10 +2,9 @@ import type { MouseEvent, FormEvent } from "react";
import { Suspense, lazy, useCallback, useMemo, useRef } from "react";
import { useStore } from "@nanostores/react";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
import {
- type Instance,
type OnChangeChildren,
- type PropsItem,
renderWrapperComponentChildren,
getComponent,
idAttribute,
diff --git a/apps/designer/app/canvas/shared/instance.test.ts b/apps/designer/app/canvas/shared/instance.test.ts
index e19d0f9dde..f4d73c490a 100644
--- a/apps/designer/app/canvas/shared/instance.test.ts
+++ b/apps/designer/app/canvas/shared/instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { findInsertLocation } from "./instance";
const tree: Instance = {
diff --git a/apps/designer/app/canvas/shared/instance.ts b/apps/designer/app/canvas/shared/instance.ts
index 749942b826..a8b2d8e393 100644
--- a/apps/designer/app/canvas/shared/instance.ts
+++ b/apps/designer/app/canvas/shared/instance.ts
@@ -1,7 +1,6 @@
import { useEffect } from "react";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
import {
- type Instance,
- type PropsItem,
getComponentMeta,
allUserPropsContainer,
} from "@webstudio-is/react-sdk";
diff --git a/apps/designer/app/canvas/shared/styles.ts b/apps/designer/app/canvas/shared/styles.ts
index 4e7f4917d1..f41695e6cd 100644
--- a/apps/designer/app/canvas/shared/styles.ts
+++ b/apps/designer/app/canvas/shared/styles.ts
@@ -6,8 +6,8 @@ import {
useBreakpoints,
useDesignTokens,
} from "~/shared/nano-states";
+import type { Styles } from "@webstudio-is/project-build";
import {
- type Styles,
getComponentMeta,
getComponentNames,
idAttribute,
diff --git a/apps/designer/app/canvas/shared/use-drag-drop.ts b/apps/designer/app/canvas/shared/use-drag-drop.ts
index 30314ff4b1..b4a03de879 100644
--- a/apps/designer/app/canvas/shared/use-drag-drop.ts
+++ b/apps/designer/app/canvas/shared/use-drag-drop.ts
@@ -18,10 +18,10 @@ import {
} from "@webstudio-is/design-system";
import {
type Instance,
- getComponentMeta,
- BaseInstance,
+ type BaseInstance,
toBaseInstance,
-} from "@webstudio-is/react-sdk";
+} from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { publish, useSubscribe } from "~/shared/pubsub";
declare module "~/shared/pubsub" {
diff --git a/apps/designer/app/canvas/shared/use-shortcuts.ts b/apps/designer/app/canvas/shared/use-shortcuts.ts
index 1544b21006..9753fdaf18 100644
--- a/apps/designer/app/canvas/shared/use-shortcuts.ts
+++ b/apps/designer/app/canvas/shared/use-shortcuts.ts
@@ -1,6 +1,7 @@
import { useHotkeys } from "react-hotkeys-hook";
import store from "immerhin";
-import { type Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { shortcuts, options } from "~/shared/shortcuts";
import { publish, useSubscribe } from "~/shared/pubsub";
import {
diff --git a/apps/designer/app/canvas/shared/use-track-selected-element.ts b/apps/designer/app/canvas/shared/use-track-selected-element.ts
index 0792ec8b63..ff88bc1fe3 100644
--- a/apps/designer/app/canvas/shared/use-track-selected-element.ts
+++ b/apps/designer/app/canvas/shared/use-track-selected-element.ts
@@ -1,6 +1,7 @@
import { useEffect, useRef } from "react";
import { useStore } from "@nanostores/react";
-import { type Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import {
selectedInstanceIdStore,
useRootInstance,
diff --git a/apps/designer/app/designer/features/props-panel/control.tsx b/apps/designer/app/designer/features/props-panel/control.tsx
index 251fc5f68a..0ece62ab9d 100644
--- a/apps/designer/app/designer/features/props-panel/control.tsx
+++ b/apps/designer/app/designer/features/props-panel/control.tsx
@@ -1,8 +1,5 @@
-import {
- getComponentMetaProps,
- type Instance,
- type PropsItem,
-} from "@webstudio-is/react-sdk";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
+import { getComponentMetaProps } from "@webstudio-is/react-sdk";
import warnOnce from "warn-once";
import {
Flex,
diff --git a/apps/designer/app/designer/features/props-panel/props-panel.stories.tsx b/apps/designer/app/designer/features/props-panel/props-panel.stories.tsx
index cb31cb0e8f..cf70adc2b8 100644
--- a/apps/designer/app/designer/features/props-panel/props-panel.stories.tsx
+++ b/apps/designer/app/designer/features/props-panel/props-panel.stories.tsx
@@ -1,8 +1,8 @@
import type { ComponentStory } from "@storybook/react";
+import type { PropsItem } from "@webstudio-is/project-build";
import {
allUserPropsContainer,
getComponentMetaProps,
- type PropsItem,
} from "@webstudio-is/react-sdk";
import { PropsPanel } from "./props-panel";
diff --git a/apps/designer/app/designer/features/props-panel/props-panel.tsx b/apps/designer/app/designer/features/props-panel/props-panel.tsx
index c5e267256c..adefe184be 100644
--- a/apps/designer/app/designer/features/props-panel/props-panel.tsx
+++ b/apps/designer/app/designer/features/props-panel/props-panel.tsx
@@ -1,11 +1,10 @@
import { useState } from "react";
import store from "immerhin";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
import {
allUserPropsContainer,
getComponentMetaProps,
useAllUserProps,
- type Instance,
- type PropsItem,
} from "@webstudio-is/react-sdk";
import { type Publish } from "~/shared/pubsub";
import { Control } from "./control";
diff --git a/apps/designer/app/designer/features/props-panel/use-props-logic.test.ts b/apps/designer/app/designer/features/props-panel/use-props-logic.test.ts
index 8a714f2fcc..146274f6bb 100644
--- a/apps/designer/app/designer/features/props-panel/use-props-logic.test.ts
+++ b/apps/designer/app/designer/features/props-panel/use-props-logic.test.ts
@@ -1,6 +1,7 @@
import { jest, describe, test, expect } from "@jest/globals";
import { renderHook, act } from "@testing-library/react-hooks";
-import { getComponentMeta, type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { nanoid } from "nanoid";
import { usePropsLogic } from "./use-props-logic";
diff --git a/apps/designer/app/designer/features/props-panel/use-props-logic.ts b/apps/designer/app/designer/features/props-panel/use-props-logic.ts
index fd8a283d10..0f881f9620 100644
--- a/apps/designer/app/designer/features/props-panel/use-props-logic.ts
+++ b/apps/designer/app/designer/features/props-panel/use-props-logic.ts
@@ -1,7 +1,8 @@
import { useMemo, useState } from "react";
import ObjectId from "bson-objectid";
import warnOnce from "warn-once";
-import type { Instance, PropsItem, MetaProps } from "@webstudio-is/react-sdk";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
+import type { MetaProps } from "@webstudio-is/react-sdk";
import {
getComponentMeta,
getComponentMetaProps,
diff --git a/apps/designer/app/designer/features/sidebar-left/lib/navigator/navigator.tsx b/apps/designer/app/designer/features/sidebar-left/lib/navigator/navigator.tsx
index f1dcfb3428..bf3014241e 100644
--- a/apps/designer/app/designer/features/sidebar-left/lib/navigator/navigator.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/lib/navigator/navigator.tsx
@@ -1,7 +1,7 @@
import { useCallback } from "react";
import { useStore } from "@nanostores/react";
import { Flex } from "@webstudio-is/design-system";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { type Publish } from "~/shared/pubsub";
import {
selectedInstanceIdStore,
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx b/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx
index 3bb21d8a23..59b4d04872 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/components/component-thumb.tsx
@@ -1,4 +1,5 @@
-import { type Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { forwardRef, type ElementRef, type ComponentProps } from "react";
import { Flex, Text, styled } from "@webstudio-is/design-system";
import { theme } from "@webstudio-is/design-system";
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/components/components.tsx b/apps/designer/app/designer/features/sidebar-left/panels/components/components.tsx
index 766fbbc7eb..4e88dc9cb0 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/components/components.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/components/components.tsx
@@ -1,7 +1,7 @@
import { type MouseEventHandler, useState } from "react";
import { createPortal } from "react-dom";
+import type { Instance } from "@webstudio-is/project-build";
import {
- type Instance,
type ComponentName,
getComponentMeta,
getComponentNames,
diff --git a/apps/designer/app/designer/features/style-panel/shared/style-info.test.ts b/apps/designer/app/designer/features/style-panel/shared/style-info.test.ts
index 10257ba23e..84d4034a18 100644
--- a/apps/designer/app/designer/features/style-panel/shared/style-info.test.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/style-info.test.ts
@@ -1,5 +1,5 @@
import type { Breakpoint } from "@webstudio-is/css-data";
-import type { Instance, Styles } from "@webstudio-is/react-sdk";
+import type { Instance, Styles } from "@webstudio-is/project-build";
import {
getCascadedBreakpointIds,
getCascadedInfo,
diff --git a/apps/designer/app/designer/features/style-panel/shared/style-info.ts b/apps/designer/app/designer/features/style-panel/shared/style-info.ts
index 7364b03494..5edc3e6832 100644
--- a/apps/designer/app/designer/features/style-panel/shared/style-info.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/style-info.ts
@@ -8,7 +8,7 @@ import type {
} from "@webstudio-is/css-data";
import { properties } from "@webstudio-is/css-data";
import { utils } from "@webstudio-is/project";
-import type { Instance, Styles } from "@webstudio-is/react-sdk";
+import type { Instance, Styles } from "@webstudio-is/project-build";
import {
selectedInstanceBrowserStyleStore,
selectedInstanceIdStore,
diff --git a/apps/designer/app/designer/features/style-panel/shared/use-style-data.ts b/apps/designer/app/designer/features/style-panel/shared/use-style-data.ts
index d9cb44742b..6ed34118d3 100644
--- a/apps/designer/app/designer/features/style-panel/shared/use-style-data.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/use-style-data.ts
@@ -1,7 +1,7 @@
import { useCallback } from "react";
import store from "immerhin";
import warnOnce from "warn-once";
-import type { Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import type { StyleUpdates } from "@webstudio-is/project";
import type { StyleProperty, StyleValue } from "@webstudio-is/css-data";
import { type Publish } from "~/shared/pubsub";
diff --git a/apps/designer/app/designer/features/style-panel/style-panel.tsx b/apps/designer/app/designer/features/style-panel/style-panel.tsx
index 138366a767..2536c5aee6 100644
--- a/apps/designer/app/designer/features/style-panel/style-panel.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-panel.tsx
@@ -1,7 +1,7 @@
import type { Publish } from "~/shared/pubsub";
import { willRender } from "~/designer/shared/breakpoints";
import { Box, Card, Paragraph, SearchField } from "@webstudio-is/design-system";
-import type { Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { useStyleData } from "./shared/use-style-data";
import { StyleSettings } from "./style-settings";
import { useState } from "react";
diff --git a/apps/designer/app/designer/features/tree-preview/tree-preview.tsx b/apps/designer/app/designer/features/tree-preview/tree-preview.tsx
index 5f82e01992..fbca323ee0 100644
--- a/apps/designer/app/designer/features/tree-preview/tree-preview.tsx
+++ b/apps/designer/app/designer/features/tree-preview/tree-preview.tsx
@@ -1,5 +1,5 @@
import produce from "immer";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { useMemo } from "react";
import { Flex } from "@webstudio-is/design-system";
import { useRootInstance, useDragAndDropState } from "~/shared/nano-states";
diff --git a/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx b/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx
index afe8611c64..f55328549b 100644
--- a/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx
+++ b/apps/designer/app/designer/features/workspace/canvas-tools/outline/label.tsx
@@ -1,6 +1,7 @@
import { useCallback, useState } from "react";
import { styled, type Rect } from "@webstudio-is/design-system";
-import { type Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { theme } from "@webstudio-is/design-system";
type LabelPosition = "top" | "inside" | "bottom";
diff --git a/apps/designer/app/designer/shared/inspector/component-info.tsx b/apps/designer/app/designer/shared/inspector/component-info.tsx
index b8586b3d18..7665940d09 100644
--- a/apps/designer/app/designer/shared/inspector/component-info.tsx
+++ b/apps/designer/app/designer/shared/inspector/component-info.tsx
@@ -1,4 +1,5 @@
-import { getComponentMeta, type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { Flex, Text } from "@webstudio-is/design-system";
import { theme } from "@webstudio-is/design-system";
diff --git a/apps/designer/app/designer/shared/instance/use-selected-instance-path.ts b/apps/designer/app/designer/shared/instance/use-selected-instance-path.ts
index 686724e05e..590bdafb52 100644
--- a/apps/designer/app/designer/shared/instance/use-selected-instance-path.ts
+++ b/apps/designer/app/designer/shared/instance/use-selected-instance-path.ts
@@ -1,4 +1,4 @@
-import { Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { useMemo } from "react";
import { useRootInstance } from "~/shared/nano-states";
import { utils } from "@webstudio-is/project";
diff --git a/apps/designer/app/designer/shared/sync-server.ts b/apps/designer/app/designer/shared/sync-server.ts
index f30bfc962e..c8066f8016 100644
--- a/apps/designer/app/designer/shared/sync-server.ts
+++ b/apps/designer/app/designer/shared/sync-server.ts
@@ -1,7 +1,7 @@
import { atom } from "nanostores";
import { sync } from "immerhin";
import type { Build } from "@webstudio-is/project";
-import type { Tree } from "@webstudio-is/react-sdk";
+import type { Tree } from "@webstudio-is/project-build";
import { restPatchPath } from "~/shared/router-utils";
import { useEffect } from "react";
diff --git a/apps/designer/app/designer/shared/tree/index.tsx b/apps/designer/app/designer/shared/tree/index.tsx
index 6b3ddb145e..10fd0163bf 100644
--- a/apps/designer/app/designer/shared/tree/index.tsx
+++ b/apps/designer/app/designer/shared/tree/index.tsx
@@ -7,7 +7,8 @@ import {
type TreeProps,
type TreeItemRenderProps,
} from "@webstudio-is/design-system";
-import { getComponentMeta, Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { utils } from "@webstudio-is/project";
const instanceRelatedProps = {
diff --git a/apps/designer/app/routes/rest/patch.ts b/apps/designer/app/routes/rest/patch.ts
index 063e3fcfc5..3cb0024bf2 100644
--- a/apps/designer/app/routes/rest/patch.ts
+++ b/apps/designer/app/routes/rest/patch.ts
@@ -3,7 +3,7 @@ import type { Build } from "@webstudio-is/project";
import { db as projectDb } from "@webstudio-is/project/server";
import { db as designTokensDb } from "@webstudio-is/design-tokens/server";
import { type SyncItem } from "immerhin";
-import { type Tree } from "@webstudio-is/react-sdk";
+import type { Tree } from "@webstudio-is/project-build";
type PatchData = {
transactions: Array<SyncItem>;
diff --git a/apps/designer/app/shared/copy-paste/serialize.ts b/apps/designer/app/shared/copy-paste/serialize.ts
index e69c9db8ff..1a0033749e 100644
--- a/apps/designer/app/shared/copy-paste/serialize.ts
+++ b/apps/designer/app/shared/copy-paste/serialize.ts
@@ -1,5 +1,5 @@
-import { Instance, Props } from "@webstudio-is/react-sdk";
import { z } from "zod";
+import { Instance, Props } from "@webstudio-is/project-build";
const TYPE = "@webstudio/instance/v0.1" as const;
diff --git a/apps/designer/app/shared/copy-paste/use-instance-copy-paste.ts b/apps/designer/app/shared/copy-paste/use-instance-copy-paste.ts
index 51bb85ce52..c98094bc1c 100644
--- a/apps/designer/app/shared/copy-paste/use-instance-copy-paste.ts
+++ b/apps/designer/app/shared/copy-paste/use-instance-copy-paste.ts
@@ -1,6 +1,6 @@
import { utils } from "@webstudio-is/project";
-import type { Instance, PropsItem } from "@webstudio-is/react-sdk";
import { useEffect, useMemo } from "react";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
import { type InstanceCopyData, serialize, deserialize } from "./serialize";
const isInstanceClipboardEvent = (
diff --git a/apps/designer/app/shared/dom-utils/instance.ts b/apps/designer/app/shared/dom-utils/instance.ts
index 6b64eda237..baaf3c702c 100644
--- a/apps/designer/app/shared/dom-utils/instance.ts
+++ b/apps/designer/app/shared/dom-utils/instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { utils } from "@webstudio-is/project";
export const getInstanceElementById = (id: Instance["id"]) => {
diff --git a/apps/designer/app/shared/nano-states/nano-states.ts b/apps/designer/app/shared/nano-states/nano-states.ts
index 0890818a4e..a9a3a36989 100644
--- a/apps/designer/app/shared/nano-states/nano-states.ts
+++ b/apps/designer/app/shared/nano-states/nano-states.ts
@@ -1,6 +1,6 @@
import { atom, computed, type WritableAtom } from "nanostores";
import { useStore } from "@nanostores/react";
-import type { Instance, Styles } from "@webstudio-is/react-sdk";
+import type { Instance, Styles } from "@webstudio-is/project-build";
import type {
DropTargetChangePayload,
DragStartPayload,
diff --git a/apps/designer/package.json b/apps/designer/package.json
index d39ca41094..e9c0af8586 100644
--- a/apps/designer/package.json
+++ b/apps/designer/package.json
@@ -49,6 +49,7 @@
"@webstudio-is/image": "workspace:^",
"@webstudio-is/prisma-client": "workspace:^",
"@webstudio-is/project": "workspace:^",
+ "@webstudio-is/project-build": "workspace:^",
"@webstudio-is/react-sdk": "workspace:^",
"@webstudio-is/trpc-interface": "workspace:^",
"bson-objectid": "^2.0.4",
diff --git a/packages/project-build/package.json b/packages/project-build/package.json
new file mode 100644
index 0000000000..006c72ec8e
--- /dev/null
+++ b/packages/project-build/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "@webstudio-is/project-build",
+ "version": "0.22.0",
+ "description": "Webstudio Project Build",
+ "author": "Webstudio <[email protected]>",
+ "homepage": "https://webstudio.is",
+ "license": "MIT",
+ "type": "module",
+ "exports": {
+ ".": {
+ "import": "./lib/index.js",
+ "require": "./lib/cjs/index.cjs"
+ }
+ },
+ "types": "src/index.ts",
+ "files": [
+ "lib/*",
+ "src/*"
+ ],
+ "sideEffects": false,
+ "scripts": {
+ "typecheck": "tsc --noEmit",
+ "lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",
+ "checks": "pnpm typecheck && pnpm lint",
+ "dev": "build-package --watch",
+ "build": "build-package"
+ },
+ "dependencies": {
+ "@webstudio-is/asset-uploader": "workspace:^",
+ "@webstudio-is/css-data": "workspace:^",
+ "zod": "^3.19.1"
+ },
+ "devDependencies": {
+ "@webstudio-is/scripts": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:^",
+ "typescript": "4.7.4"
+ }
+}
diff --git a/packages/project-build/src/index.ts b/packages/project-build/src/index.ts
new file mode 100644
index 0000000000..f4872ca7df
--- /dev/null
+++ b/packages/project-build/src/index.ts
@@ -0,0 +1,4 @@
+export * from "./schema/instances";
+export * from "./schema/props";
+export * from "./schema/styles";
+export * from "./types";
diff --git a/packages/react-sdk/src/db/instance.ts b/packages/project-build/src/schema/instances.ts
similarity index 100%
rename from packages/react-sdk/src/db/instance.ts
rename to packages/project-build/src/schema/instances.ts
diff --git a/packages/react-sdk/src/db/props.ts b/packages/project-build/src/schema/props.ts
similarity index 100%
rename from packages/react-sdk/src/db/props.ts
rename to packages/project-build/src/schema/props.ts
diff --git a/packages/react-sdk/src/db/style.ts b/packages/project-build/src/schema/styles.ts
similarity index 100%
rename from packages/react-sdk/src/db/style.ts
rename to packages/project-build/src/schema/styles.ts
diff --git a/packages/project-build/src/types.ts b/packages/project-build/src/types.ts
new file mode 100644
index 0000000000..9123e9547b
--- /dev/null
+++ b/packages/project-build/src/types.ts
@@ -0,0 +1,10 @@
+import type { Instance } from "./schema/instances";
+import type { Props } from "./schema/props";
+import type { Styles } from "./schema/styles";
+
+export type Tree = {
+ id: string;
+ root: Instance;
+ props: Props;
+ styles: Styles;
+};
diff --git a/packages/project-build/tsconfig.json b/packages/project-build/tsconfig.json
new file mode 100644
index 0000000000..8b148a5ede
--- /dev/null
+++ b/packages/project-build/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "@webstudio-is/tsconfig/base.json",
+ "compilerOptions": {
+ "module": "ES2020",
+ "target": "ES2020"
+ }
+}
diff --git a/packages/project/package.json b/packages/project/package.json
index 981f36d32c..2c98b2cc8e 100644
--- a/packages/project/package.json
+++ b/packages/project/package.json
@@ -20,6 +20,7 @@
"@webstudio-is/design-tokens": "workspace:^",
"@webstudio-is/fonts": "workspace:^",
"@webstudio-is/prisma-client": "workspace:^",
+ "@webstudio-is/project-build": "workspace:^",
"@webstudio-is/react-sdk": "workspace:^",
"bson-objectid": "^2.0.4",
"immer": "^9.0.12",
diff --git a/packages/project/src/db/props.ts b/packages/project/src/db/props.ts
index dbc5467f76..3cbfd49300 100644
--- a/packages/project/src/db/props.ts
+++ b/packages/project/src/db/props.ts
@@ -1,10 +1,6 @@
import warnOnce from "warn-once";
-import {
- type Tree,
- type AllUserProps,
- type InstanceProps,
- StoredProps,
-} from "@webstudio-is/react-sdk";
+import { type Tree, StoredProps } from "@webstudio-is/project-build";
+import { type AllUserProps, type InstanceProps } from "@webstudio-is/react-sdk";
import { applyPatches, type Patch } from "immer";
import { prisma } from "@webstudio-is/prisma-client";
import { formatAsset } from "@webstudio-is/asset-uploader/server";
diff --git a/packages/project/src/db/styles.ts b/packages/project/src/db/styles.ts
index a147e21aac..3001eabbe5 100644
--- a/packages/project/src/db/styles.ts
+++ b/packages/project/src/db/styles.ts
@@ -3,7 +3,7 @@ import { type Patch, applyPatches } from "immer";
import { prisma } from "@webstudio-is/prisma-client";
import type { Asset } from "@webstudio-is/asset-uploader";
import { formatAsset } from "@webstudio-is/asset-uploader/server";
-import { StoredStyles, Styles } from "@webstudio-is/react-sdk";
+import { StoredStyles, Styles } from "@webstudio-is/project-build";
const parseValue = (
styleValue: StoredStyles[number]["value"],
diff --git a/packages/project/src/db/tree.ts b/packages/project/src/db/tree.ts
index 076374320f..85c8321bc1 100644
--- a/packages/project/src/db/tree.ts
+++ b/packages/project/src/db/tree.ts
@@ -7,7 +7,7 @@ import {
Styles,
Instances,
Props,
-} from "@webstudio-is/react-sdk";
+} from "@webstudio-is/project-build";
import {
prisma,
type Prisma,
diff --git a/packages/project/src/shared/canvas-components/instance-data.ts b/packages/project/src/shared/canvas-components/instance-data.ts
index 962c57dd5c..0cc4579a70 100644
--- a/packages/project/src/shared/canvas-components/instance-data.ts
+++ b/packages/project/src/shared/canvas-components/instance-data.ts
@@ -1,4 +1,4 @@
-import type { Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import type {
StyleProperty,
StyleValue,
diff --git a/packages/project/src/shared/props/clone-user-props.ts b/packages/project/src/shared/props/clone-user-props.ts
index 251622bba3..3a459060de 100644
--- a/packages/project/src/shared/props/clone-user-props.ts
+++ b/packages/project/src/shared/props/clone-user-props.ts
@@ -1,5 +1,5 @@
-import type { PropsItem } from "@webstudio-is/react-sdk";
import ObjectId from "bson-objectid";
+import type { PropsItem } from "@webstudio-is/project-build";
export const cloneUserProps = (props: Array<PropsItem>): Array<PropsItem> =>
props.map((prop) => ({ ...prop, id: ObjectId().toString() }));
diff --git a/packages/project/src/shared/styles/style-rules.test.ts b/packages/project/src/shared/styles/style-rules.test.ts
index b773941b50..2b73fd448b 100644
--- a/packages/project/src/shared/styles/style-rules.test.ts
+++ b/packages/project/src/shared/styles/style-rules.test.ts
@@ -1,5 +1,5 @@
import { test, expect } from "@jest/globals";
-import type { Styles } from "@webstudio-is/react-sdk";
+import type { Styles } from "@webstudio-is/project-build";
import { getStyleRules } from "./style-rules";
test("get a list of style rules grouped by instance and breakpoint", () => {
diff --git a/packages/project/src/shared/styles/style-rules.ts b/packages/project/src/shared/styles/style-rules.ts
index 952b1930ad..4b89fc0518 100644
--- a/packages/project/src/shared/styles/style-rules.ts
+++ b/packages/project/src/shared/styles/style-rules.ts
@@ -1,5 +1,5 @@
import type { Style } from "@webstudio-is/css-data";
-import type { Styles } from "@webstudio-is/react-sdk";
+import type { Styles } from "@webstudio-is/project-build";
type StyleRule = {
instanceId: string;
diff --git a/packages/project/src/shared/tree-utils/clone-instance.test.ts b/packages/project/src/shared/tree-utils/clone-instance.test.ts
index 8a31c1cdd4..87a3743b43 100644
--- a/packages/project/src/shared/tree-utils/clone-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/clone-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { cloneInstance } from "./clone-instance";
const getIds = (instance: Instance, ids: Array<Instance["id"]> = []) => {
diff --git a/packages/project/src/shared/tree-utils/clone-instance.ts b/packages/project/src/shared/tree-utils/clone-instance.ts
index f479f8c86f..7293014db6 100644
--- a/packages/project/src/shared/tree-utils/clone-instance.ts
+++ b/packages/project/src/shared/tree-utils/clone-instance.ts
@@ -1,6 +1,6 @@
import ObjectId from "bson-objectid";
import produce from "immer";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
const updateIds = (instance: Instance) => {
instance.id = ObjectId().toString();
diff --git a/packages/project/src/shared/tree-utils/create-instance.ts b/packages/project/src/shared/tree-utils/create-instance.ts
index e989636dcc..caddd7cedd 100644
--- a/packages/project/src/shared/tree-utils/create-instance.ts
+++ b/packages/project/src/shared/tree-utils/create-instance.ts
@@ -1,5 +1,6 @@
import ObjectId from "bson-objectid";
-import { type Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
export const createInstanceId = () => {
return ObjectId().toString();
diff --git a/packages/project/src/shared/tree-utils/delete-instance.test.ts b/packages/project/src/shared/tree-utils/delete-instance.test.ts
index d927629fa1..efc6300cd6 100644
--- a/packages/project/src/shared/tree-utils/delete-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/delete-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { deleteInstanceMutable } from "./delete-instance";
describe("Delete instance", () => {
diff --git a/packages/project/src/shared/tree-utils/delete-instance.ts b/packages/project/src/shared/tree-utils/delete-instance.ts
index b2f0e43e12..f17d796ed6 100644
--- a/packages/project/src/shared/tree-utils/delete-instance.ts
+++ b/packages/project/src/shared/tree-utils/delete-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
export const deleteInstanceMutable = (
instance: Instance,
diff --git a/packages/project/src/shared/tree-utils/find-closest-non-inline-parent.ts b/packages/project/src/shared/tree-utils/find-closest-non-inline-parent.ts
index e3dd4c049e..22342175d4 100644
--- a/packages/project/src/shared/tree-utils/find-closest-non-inline-parent.ts
+++ b/packages/project/src/shared/tree-utils/find-closest-non-inline-parent.ts
@@ -1,4 +1,5 @@
-import { Instance, getComponentMeta } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
+import { getComponentMeta } from "@webstudio-is/react-sdk";
import { getInstancePath } from "./get-instance-path";
export const findClosestNonInlineParent = (
diff --git a/packages/project/src/shared/tree-utils/find-closest-sibling-instance.test.ts b/packages/project/src/shared/tree-utils/find-closest-sibling-instance.test.ts
index 67ccee8285..a3c7cbf50a 100644
--- a/packages/project/src/shared/tree-utils/find-closest-sibling-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/find-closest-sibling-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { findClosestSiblingInstance } from "./find-closest-sibling-instance";
describe("Find closest sibling instance", () => {
diff --git a/packages/project/src/shared/tree-utils/find-closest-sibling-instance.ts b/packages/project/src/shared/tree-utils/find-closest-sibling-instance.ts
index 4e92dee947..f1c2017ee7 100644
--- a/packages/project/src/shared/tree-utils/find-closest-sibling-instance.ts
+++ b/packages/project/src/shared/tree-utils/find-closest-sibling-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
export const findClosestSiblingInstance = (
instance: Instance,
diff --git a/packages/project/src/shared/tree-utils/find-instance.ts b/packages/project/src/shared/tree-utils/find-instance.ts
index 86759ac5ce..916ac078bf 100644
--- a/packages/project/src/shared/tree-utils/find-instance.ts
+++ b/packages/project/src/shared/tree-utils/find-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
// @todo should be optimized because it will be a frequent operation on a potentially large tree.
export const findInstanceById = (
diff --git a/packages/project/src/shared/tree-utils/find-parent-instance.test.ts b/packages/project/src/shared/tree-utils/find-parent-instance.test.ts
index e78fe8d3de..4884ac4a3a 100644
--- a/packages/project/src/shared/tree-utils/find-parent-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/find-parent-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { findParentInstance } from "./find-parent-instance";
describe("Find parent instance", () => {
diff --git a/packages/project/src/shared/tree-utils/find-parent-instance.ts b/packages/project/src/shared/tree-utils/find-parent-instance.ts
index f5e4303403..a0de3c7f0c 100644
--- a/packages/project/src/shared/tree-utils/find-parent-instance.ts
+++ b/packages/project/src/shared/tree-utils/find-parent-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
export const findParentInstance = (
instance: Instance,
diff --git a/packages/project/src/shared/tree-utils/get-instance-path.test.ts b/packages/project/src/shared/tree-utils/get-instance-path.test.ts
index 1dbdd8da27..41a80c02f8 100644
--- a/packages/project/src/shared/tree-utils/get-instance-path.test.ts
+++ b/packages/project/src/shared/tree-utils/get-instance-path.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import {
getInstancePath,
getInstancePathWithPositions,
diff --git a/packages/project/src/shared/tree-utils/get-instance-path.ts b/packages/project/src/shared/tree-utils/get-instance-path.ts
index 9ba6542fcf..93bcbb3537 100644
--- a/packages/project/src/shared/tree-utils/get-instance-path.ts
+++ b/packages/project/src/shared/tree-utils/get-instance-path.ts
@@ -1,4 +1,4 @@
-import { Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
export const getInstancePath = (
instance: Instance,
diff --git a/packages/project/src/shared/tree-utils/insert-instance.test.ts b/packages/project/src/shared/tree-utils/insert-instance.test.ts
index 9ea0e23f8f..438db05cb1 100644
--- a/packages/project/src/shared/tree-utils/insert-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/insert-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { insertInstanceMutable } from "./insert-instance";
import { createInstance } from "./create-instance";
diff --git a/packages/project/src/shared/tree-utils/insert-instance.ts b/packages/project/src/shared/tree-utils/insert-instance.ts
index 5f02867c99..d3e745c0c8 100644
--- a/packages/project/src/shared/tree-utils/insert-instance.ts
+++ b/packages/project/src/shared/tree-utils/insert-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
export type InstanceInsertionSpec = {
parentId: Instance["id"];
diff --git a/packages/project/src/shared/tree-utils/reparent-instance.test.ts b/packages/project/src/shared/tree-utils/reparent-instance.test.ts
index e6d8ba100c..ad27f0f136 100644
--- a/packages/project/src/shared/tree-utils/reparent-instance.test.ts
+++ b/packages/project/src/shared/tree-utils/reparent-instance.test.ts
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals";
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { reparentInstanceMutable } from "./reparent-instance";
describe("Reparent instance", () => {
diff --git a/packages/project/src/shared/tree-utils/reparent-instance.ts b/packages/project/src/shared/tree-utils/reparent-instance.ts
index 6a08ec0e06..c3a3ba31f7 100644
--- a/packages/project/src/shared/tree-utils/reparent-instance.ts
+++ b/packages/project/src/shared/tree-utils/reparent-instance.ts
@@ -1,4 +1,4 @@
-import { type Instance } from "@webstudio-is/react-sdk";
+import type { Instance } from "@webstudio-is/project-build";
import { findInstanceById } from "./find-instance";
import { findParentInstance } from "./find-parent-instance";
import { deleteInstanceMutable } from "./delete-instance";
diff --git a/packages/project/src/shared/tree-utils/set-instance-children.ts b/packages/project/src/shared/tree-utils/set-instance-children.ts
index 745f43929a..ce14269bca 100644
--- a/packages/project/src/shared/tree-utils/set-instance-children.ts
+++ b/packages/project/src/shared/tree-utils/set-instance-children.ts
@@ -1,5 +1,6 @@
import type { Breakpoint } from "@webstudio-is/css-data";
-import type { ChildrenUpdates, Instance, Text } from "@webstudio-is/react-sdk";
+import type { Instance, Text } from "@webstudio-is/project-build";
+import type { ChildrenUpdates } from "@webstudio-is/react-sdk";
import { createInstance, createInstanceId } from "./create-instance";
import { findInstanceById } from "./find-instance";
diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json
index e79c351918..2e6ce6a58a 100644
--- a/packages/react-sdk/package.json
+++ b/packages/react-sdk/package.json
@@ -60,6 +60,7 @@
"@webstudio-is/icons": "workspace:^",
"@webstudio-is/image": "workspace:^",
"@webstudio-is/prisma-client": "workspace:^",
+ "@webstudio-is/project-build": "workspace:^",
"detect-font": "^0.1.5",
"mitt": "^3.0.0",
"nanostores": "^0.7.1",
diff --git a/packages/react-sdk/src/db/index.ts b/packages/react-sdk/src/db/index.ts
index 0d944b9f6d..eea524d655 100644
--- a/packages/react-sdk/src/db/index.ts
+++ b/packages/react-sdk/src/db/index.ts
@@ -1,4 +1 @@
export * from "./types";
-export * from "./instance";
-export * from "./props";
-export * from "./style";
diff --git a/packages/react-sdk/src/db/types.ts b/packages/react-sdk/src/db/types.ts
index 6d2d6be743..2592f08675 100644
--- a/packages/react-sdk/src/db/types.ts
+++ b/packages/react-sdk/src/db/types.ts
@@ -1,14 +1,5 @@
import type { InstanceProps as DbInstanceProps } from "@webstudio-is/prisma-client";
-import type { Instance } from "./instance";
-import type { Props, PropsItem } from "./props";
-import type { Styles } from "./style";
-
-export type Tree = {
- id: string;
- root: Instance;
- props: Props;
- styles: Styles;
-};
+import type { PropsItem } from "@webstudio-is/project-build";
export type InstanceProps = Omit<DbInstanceProps, "props"> & {
props: Array<PropsItem>;
diff --git a/packages/react-sdk/src/tree/create-elements-tree.tsx b/packages/react-sdk/src/tree/create-elements-tree.tsx
index 8eead836e0..fb029e2939 100644
--- a/packages/react-sdk/src/tree/create-elements-tree.tsx
+++ b/packages/react-sdk/src/tree/create-elements-tree.tsx
@@ -1,7 +1,7 @@
import { type ComponentProps, Fragment } from "react";
-import type { Instance } from "../db";
-import { WrapperComponent } from "./wrapper-component";
import { Scripts, ScrollRestoration } from "@remix-run/react";
+import type { Instance } from "@webstudio-is/project-build";
+import { WrapperComponent } from "./wrapper-component";
import { SessionStoragePolyfill } from "./session-storage-polyfill";
export type ChildrenUpdates = Array<
diff --git a/packages/react-sdk/src/tree/root.ts b/packages/react-sdk/src/tree/root.ts
index 77fbd568ee..434106fa95 100644
--- a/packages/react-sdk/src/tree/root.ts
+++ b/packages/react-sdk/src/tree/root.ts
@@ -1,14 +1,15 @@
+import type { ComponentProps } from "react";
+import type { Breakpoint } from "@webstudio-is/css-data";
+import type { DesignToken } from "@webstudio-is/design-tokens";
+import type { Tree } from "@webstudio-is/project-build";
+import type { Asset } from "@webstudio-is/asset-uploader";
import { useAllUserProps } from "../user-props/";
-import type { Tree, InstanceProps } from "../db";
+import type { InstanceProps } from "../db";
import { createElementsTree } from "./create-elements-tree";
import { WrapperComponent } from "./wrapper-component";
-import type { Asset } from "@webstudio-is/asset-uploader";
-import { type ComponentProps } from "react";
-import type { Breakpoint } from "@webstudio-is/css-data";
import { registerComponents } from "../components";
import { customComponents as defaultCustomComponents } from "../app/custom-components";
import { setParams, type Params } from "../app/params";
-import type { DesignToken } from "@webstudio-is/design-tokens";
export type Data = {
tree: Tree | null;
diff --git a/packages/react-sdk/src/tree/wrapper-component.tsx b/packages/react-sdk/src/tree/wrapper-component.tsx
index 609c54626d..af6a22c41c 100644
--- a/packages/react-sdk/src/tree/wrapper-component.tsx
+++ b/packages/react-sdk/src/tree/wrapper-component.tsx
@@ -1,5 +1,5 @@
import { Fragment } from "react";
-import type { Instance } from "../db";
+import type { Instance } from "@webstudio-is/project-build";
import { getComponent } from "../components";
import { useUserProps } from "../user-props/use-user-props";
import type { OnChangeChildren } from "./create-elements-tree";
diff --git a/packages/react-sdk/src/user-props/all-user-props.ts b/packages/react-sdk/src/user-props/all-user-props.ts
index 4ae128e4cc..c7d4cef36e 100644
--- a/packages/react-sdk/src/user-props/all-user-props.ts
+++ b/packages/react-sdk/src/user-props/all-user-props.ts
@@ -1,7 +1,8 @@
import { useRef } from "react";
import { atom } from "nanostores";
import { useStore } from "@nanostores/react";
-import type { InstanceProps, Instance, PropsItem } from "../db";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
+import type { InstanceProps } from "../db";
export type AllUserProps = {
[id: Instance["id"]]: PropsItem[];
diff --git a/packages/react-sdk/src/user-props/use-user-props-asset.ts b/packages/react-sdk/src/user-props/use-user-props-asset.ts
index 5f7810430b..140726ed08 100644
--- a/packages/react-sdk/src/user-props/use-user-props-asset.ts
+++ b/packages/react-sdk/src/user-props/use-user-props-asset.ts
@@ -1,7 +1,7 @@
import { useMemo } from "react";
-import { PropsItem, type Instance } from "../db";
-import { useAllUserProps } from "./all-user-props";
import type { Asset } from "@webstudio-is/asset-uploader";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
+import { useAllUserProps } from "./all-user-props";
/**
* Get asset for prop, like src on the Image component
diff --git a/packages/react-sdk/src/user-props/use-user-props.ts b/packages/react-sdk/src/user-props/use-user-props.ts
index 2d3a903555..172e4ffd23 100644
--- a/packages/react-sdk/src/user-props/use-user-props.ts
+++ b/packages/react-sdk/src/user-props/use-user-props.ts
@@ -1,5 +1,5 @@
import { useMemo } from "react";
-import type { Instance, PropsItem } from "../db";
+import type { Instance, PropsItem } from "@webstudio-is/project-build";
import { useAllUserProps } from "./all-user-props";
type UserProps = { [name: PropsItem["name"]]: string | number | boolean };
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f07ded0f26..27f20a77f9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -98,6 +98,7 @@ importers:
'@webstudio-is/jest-config': workspace:^
'@webstudio-is/prisma-client': workspace:^
'@webstudio-is/project': workspace:^
+ '@webstudio-is/project-build': workspace:^
'@webstudio-is/react-sdk': workspace:^
'@webstudio-is/storybook-config': workspace:^
'@webstudio-is/trpc-interface': workspace:^
@@ -186,6 +187,7 @@ importers:
'@webstudio-is/image': link:../../packages/image
'@webstudio-is/prisma-client': link:../../packages/prisma-client
'@webstudio-is/project': link:../../packages/project
+ '@webstudio-is/project-build': link:../../packages/project-build
'@webstudio-is/react-sdk': link:../../packages/react-sdk
'@webstudio-is/trpc-interface': link:../../packages/trpc-interface
bson-objectid: 2.0.4
@@ -769,6 +771,7 @@ importers:
'@webstudio-is/fonts': workspace:^
'@webstudio-is/jest-config': workspace:^
'@webstudio-is/prisma-client': workspace:^
+ '@webstudio-is/project-build': workspace:^
'@webstudio-is/react-sdk': workspace:^
'@webstudio-is/scripts': workspace:^
'@webstudio-is/tsconfig': workspace:^
@@ -790,6 +793,7 @@ importers:
'@webstudio-is/design-tokens': link:../design-tokens
'@webstudio-is/fonts': link:../fonts
'@webstudio-is/prisma-client': link:../prisma-client
+ '@webstudio-is/project-build': link:../project-build
'@webstudio-is/react-sdk': link:../react-sdk
bson-objectid: 2.0.4
immer: 9.0.15
@@ -808,6 +812,23 @@ importers:
jest: 29.3.1
typescript: 4.7.4
+ packages/project-build:
+ specifiers:
+ '@webstudio-is/asset-uploader': workspace:^
+ '@webstudio-is/css-data': workspace:^
+ '@webstudio-is/scripts': workspace:^
+ '@webstudio-is/tsconfig': workspace:^
+ typescript: 4.7.4
+ zod: ^3.19.1
+ dependencies:
+ '@webstudio-is/asset-uploader': link:../asset-uploader
+ '@webstudio-is/css-data': link:../css-data
+ zod: 3.19.1
+ devDependencies:
+ '@webstudio-is/scripts': link:../scripts
+ '@webstudio-is/tsconfig': link:../tsconfig
+ typescript: 4.7.4
+
packages/react-sdk:
specifiers:
'@babel/core': ^7.20.2
@@ -830,6 +851,7 @@ importers:
'@webstudio-is/image': workspace:^
'@webstudio-is/jest-config': workspace:^
'@webstudio-is/prisma-client': workspace:^
+ '@webstudio-is/project-build': workspace:^
'@webstudio-is/scripts': workspace:^
'@webstudio-is/storybook-config': workspace:^
'@webstudio-is/tsconfig': workspace:^
@@ -855,6 +877,7 @@ importers:
'@webstudio-is/icons': link:../icons
'@webstudio-is/image': link:../image
'@webstudio-is/prisma-client': link:../prisma-client
+ '@webstudio-is/project-build': link:../project-build
detect-font: 0.1.5
mitt: 3.0.0
nanostores: 0.7.1