From b8b6e67559cfb437a239fa24ad89ef84b9c09e97 Mon Sep 17 00:00:00 2001 From: Deepen Timalsina Date: Tue, 15 Apr 2025 21:37:40 +0545 Subject: [PATCH] build: correct incorrect imports for excalidraw-app build --- excalidraw-app/components/DebugCanvas.tsx | 2 +- packages/excalidraw/src/clipboard.test.ts | 3 ++- .../src/components/DefaultSidebar.test.tsx | 4 ++-- .../src/components/Sidebar/Sidebar.test.tsx | 4 ++-- .../src/components/Sidebar/siderbar.test.helpers.tsx | 2 +- .../excalidraw/src/components/Stats/stats.test.tsx | 12 ++++++------ packages/excalidraw/src/components/Trans.test.tsx | 2 +- .../components/dropdownMenu/DropdownMenu.test.tsx | 6 +++--- .../src/components/hoc/withInternalFallback.test.tsx | 4 ++-- packages/excalidraw/tests/cropElement.test.tsx | 2 +- 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/excalidraw-app/components/DebugCanvas.tsx b/excalidraw-app/components/DebugCanvas.tsx index 3773f66f8..7df85fd23 100644 --- a/excalidraw-app/components/DebugCanvas.tsx +++ b/excalidraw-app/components/DebugCanvas.tsx @@ -18,7 +18,7 @@ import { } from "@excalidraw/math"; import { isCurve } from "@excalidraw/math/curve"; -import type { DebugElement } from "@excalidraw/excalidraw/visualdebug"; +import type { DebugElement } from "@excalidraw/excalidraw/src/visualdebug"; import type { Curve } from "@excalidraw/math"; diff --git a/packages/excalidraw/src/clipboard.test.ts b/packages/excalidraw/src/clipboard.test.ts index 770bcc90e..a3ae9b5ba 100644 --- a/packages/excalidraw/src/clipboard.test.ts +++ b/packages/excalidraw/src/clipboard.test.ts @@ -1,9 +1,10 @@ +import { API } from ".././tests/helpers/api"; + import { createPasteEvent, parseClipboard, serializeAsClipboardJSON, } from "./clipboard"; -import { API } from "./tests/helpers/api"; describe("parseClipboard()", () => { it("should parse JSON as plaintext if not excalidraw-api/clipboard data", async () => { diff --git a/packages/excalidraw/src/components/DefaultSidebar.test.tsx b/packages/excalidraw/src/components/DefaultSidebar.test.tsx index 6977d7109..b293c1fa3 100644 --- a/packages/excalidraw/src/components/DefaultSidebar.test.tsx +++ b/packages/excalidraw/src/components/DefaultSidebar.test.tsx @@ -2,12 +2,12 @@ import React from "react"; import { DEFAULT_SIDEBAR } from "@excalidraw/common"; -import { DefaultSidebar } from "../src/index"; +import { DefaultSidebar } from "../index"; import { fireEvent, waitFor, withExcalidrawDimensions, -} from "../tests/test-utils"; +} from "../../tests/test-utils"; import { assertExcalidrawWithSidebar, diff --git a/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx b/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx index e0c05d3af..2d90564ca 100644 --- a/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx +++ b/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx @@ -3,7 +3,7 @@ import { vi } from "vitest"; import { DEFAULT_SIDEBAR } from "@excalidraw/common"; -import { Excalidraw, Sidebar } from "../../src/index"; +import { Excalidraw, Sidebar } from "../../index"; import { act, fireEvent, @@ -12,7 +12,7 @@ import { render, waitFor, withExcalidrawDimensions, -} from "../../tests/test-utils"; +} from "../../../tests/test-utils"; import { assertExcalidrawWithSidebar, diff --git a/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx b/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx index 650eca6b0..264744a9f 100644 --- a/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx +++ b/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx @@ -6,7 +6,7 @@ import { queryByTestId, render, withExcalidrawDimensions, -} from "../../tests/test-utils"; +} from "../../../tests/test-utils"; export const assertSidebarDockButton = async ( hasDockButton: T, diff --git a/packages/excalidraw/src/components/Stats/stats.test.tsx b/packages/excalidraw/src/components/Stats/stats.test.tsx index 0726898ad..8d204d92c 100644 --- a/packages/excalidraw/src/components/Stats/stats.test.tsx +++ b/packages/excalidraw/src/components/Stats/stats.test.tsx @@ -18,18 +18,18 @@ import type { } from "@excalidraw/element/types"; import { Excalidraw, getCommonBounds, mutateElement } from "../.."; -import { actionGroup } from "../../src/actions"; +import { actionGroup } from "../../../src/actions"; import { t } from "../../i18n"; -import * as StaticScene from "../../src/renderer/staticScene"; -import { API } from "../../tests/helpers/api"; -import { Keyboard, Pointer, UI } from "../../tests/helpers/ui"; -import { getTextEditor, updateTextEditor } from "../../tests/queries/dom"; +import * as StaticScene from "../../../src/renderer/staticScene"; +import { API } from "../../../tests/helpers/api"; +import { Keyboard, Pointer, UI } from "../../../tests/helpers/ui"; +import { getTextEditor, updateTextEditor } from "../../../tests/queries/dom"; import { GlobalTestState, mockBoundingClientRect, render, restoreOriginalGetBoundingClientRect, -} from "../../tests/test-utils"; +} from "../../../tests/test-utils"; import { getStepSizedValue } from "./utils"; diff --git a/packages/excalidraw/src/components/Trans.test.tsx b/packages/excalidraw/src/components/Trans.test.tsx index fca942db2..e0e91888e 100644 --- a/packages/excalidraw/src/components/Trans.test.tsx +++ b/packages/excalidraw/src/components/Trans.test.tsx @@ -1,7 +1,7 @@ import { render } from "@testing-library/react"; import { EditorJotaiProvider } from "../editor-jotai"; -import fallbackLangData from "../src/locales/en.json"; +import fallbackLangData from "../../src/locales/en.json"; import Trans from "./Trans"; diff --git a/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx b/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx index a4c9030c9..c83c6499e 100644 --- a/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx +++ b/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx @@ -2,14 +2,14 @@ import React from "react"; import { KEYS } from "@excalidraw/common"; -import { Excalidraw } from "../../src/index"; -import { Keyboard } from "../../tests/helpers/ui"; +import { Excalidraw } from "../../index"; +import { Keyboard } from "../../../tests/helpers/ui"; import { render, waitFor, getByTestId, fireEvent, -} from "../../tests/test-utils"; +} from "../../../tests/test-utils"; describe("Test ", () => { it("should", async () => { diff --git a/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx b/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx index e12b623bd..119c50be5 100644 --- a/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx +++ b/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx @@ -1,7 +1,7 @@ import React from "react"; -import { Excalidraw, MainMenu } from "../../src/index"; -import { render, queryAllByTestId } from "../../tests/test-utils"; +import { Excalidraw, MainMenu } from "../../../src/index"; +import { render, queryAllByTestId } from "../../../tests/test-utils"; describe("Test internal component fallback rendering", () => { it("should render only one menu per excalidraw instance (custom menu first scenario)", async () => { diff --git a/packages/excalidraw/tests/cropElement.test.tsx b/packages/excalidraw/tests/cropElement.test.tsx index d585c084d..56b9e2643 100644 --- a/packages/excalidraw/tests/cropElement.test.tsx +++ b/packages/excalidraw/tests/cropElement.test.tsx @@ -10,7 +10,7 @@ import type { ImageCrop, } from "@excalidraw/element/types"; -import { Excalidraw, exportToCanvas, exportToSvg } from ".."; +import { Excalidraw, exportToCanvas, exportToSvg } from "../src"; import { actionFlipHorizontal, actionFlipVertical } from "../src/actions"; import { API } from "./helpers/api";