Fix Vite build: import constants via relative path for esbuild compat

bridge.ts is bundled by esbuild as a Vite plugin — it can't resolve
workspace package entries (@open-pencil/core) at config time because
dist/ is not built yet. Use relative import to the source file instead.
This commit is contained in:
Danila Poyarkov 2026-03-07 17:17:48 +03:00
parent 2ec382fc9d
commit 2a9d47a761
2 changed files with 8 additions and 2 deletions

4
components.d.ts vendored
View file

@ -43,6 +43,8 @@ declare module 'vue' {
IconLucideAlignVerticalJustifyCenter: typeof import('~icons/lucide/align-vertical-justify-center')['default']
IconLucideAlignVerticalJustifyEnd: typeof import('~icons/lucide/align-vertical-justify-end')['default']
IconLucideAlignVerticalJustifyStart: typeof import('~icons/lucide/align-vertical-justify-start')['default']
IconLucideArrowDown: typeof import('~icons/lucide/arrow-down')['default']
IconLucideArrowRight: typeof import('~icons/lucide/arrow-right')['default']
IconLucideBaseline: typeof import('~icons/lucide/baseline')['default']
IconLucideBlend: typeof import('~icons/lucide/blend')['default']
IconLucideBold: typeof import('~icons/lucide/bold')['default']
@ -85,13 +87,13 @@ declare module 'vue' {
IconLucideUndo2: typeof import('~icons/lucide/undo2')['default']
IconLucideUnlink: typeof import('~icons/lucide/unlink')['default']
IconLucideUsers: typeof import('~icons/lucide/users')['default']
IconLucideWrapText: typeof import('~icons/lucide/wrap-text')['default']
IconLucideX: typeof import('~icons/lucide/x')['default']
LayersPanel: typeof import('./src/components/LayersPanel.vue')['default']
LayerTree: typeof import('./src/components/LayerTree.vue')['default']
LayoutSection: typeof import('./src/components/properties/LayoutSection.vue')['default']
MobileDrawer: typeof import('./src/components/MobileDrawer.vue')['default']
MobileHud: typeof import('./src/components/MobileHud.vue')['default']
MobileRibbon: typeof import('./src/components/MobileRibbon.vue')['default']
NodeContextMenuContent: typeof import('./src/components/NodeContextMenuContent.vue')['default']
PageSection: typeof import('./src/components/properties/PageSection.vue')['default']
PagesPanel: typeof import('./src/components/PagesPanel.vue')['default']

View file

@ -16,7 +16,11 @@ import { Hono } from 'hono'
import { cors } from 'hono/cors'
import { WebSocketServer, type WebSocket } from 'ws'
import { AUTOMATION_HTTP_PORT, AUTOMATION_WS_PORT } from '@open-pencil/core'
// Can't import from @open-pencil/core here — this file is bundled by esbuild
// as part of the Vite config, and workspace packages are externalized then
// loaded by Node's ESM resolver which can't handle .ts source imports.
const AUTOMATION_HTTP_PORT = 7600
const AUTOMATION_WS_PORT = 7601
const RPC_TIMEOUT = 30_000
interface PendingRequest {