Selaa lähdekoodia

update remaining paths to use utils workspace

Aakansha Doshi 1 vuosi sitten
vanhempi
commit
53a0428705

+ 1 - 1
package.json

@@ -72,7 +72,7 @@
     "locales-coverage:description": "node scripts/locales-coverage-description.js",
     "prepare": "husky install",
     "prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
-    "start": "yarn workspace @excalidraw/utils run build:esm && yarn --cwd ./excalidraw-app start",
+    "start": "yarn clear:workspaces && yarn workspace @excalidraw/utils run build:esm && yarn --cwd ./excalidraw-app start",
     "start:app:production": "npm run build && npx http-server build -a localhost -p 5001 -o",
     "test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watch=false",
     "test:app": "vitest",

+ 2 - 2
packages/excalidraw/components/App.tsx

@@ -231,8 +231,8 @@ import {
   getFreedrawShape,
   getPolygonShape,
   getSelectionBoxShape,
-} from "../../utils/geometry/shape";
-import { isPointInShape } from "../../utils/collision";
+} from "@excalidraw/utils";
+import { isPointInShape } from "@excalidraw/utils";
 import {
   AppClassProperties,
   AppProps,

+ 1 - 1
packages/excalidraw/element/collision.ts

@@ -12,7 +12,7 @@ import {
   Polygon,
   GeometricShape,
   getPolygonShape,
-} from "../../utils/geometry/shape";
+} from "@excalidraw/utils";
 import { isPointInShape, isPointOnShape } from "@excalidraw/utils";
 import { isTransparent } from "../utils";
 import {

+ 2 - 6
packages/excalidraw/element/resizeTest.ts

@@ -17,12 +17,8 @@ import {
 import { AppState, Device, Zoom } from "../types";
 import { Bounds, getElementAbsoluteCoords } from "./bounds";
 import { SIDE_RESIZING_THRESHOLD } from "../constants";
-import {
-  angleToDegrees,
-  pointOnLine,
-  pointRotate,
-} from "../../utils/geometry/geometry";
-import { Line, Point } from "../../utils/geometry/shape";
+import { angleToDegrees, pointOnLine, pointRotate } from "@excalidraw/utils";
+import { Line, Point } from "@excalidraw/utils";
 import { isLinearElement } from "./typeChecks";
 
 const isInsideTransformHandle = (

+ 2 - 0
packages/utils/index.ts

@@ -2,3 +2,5 @@ export * from "./export";
 export * from "./withinBounds";
 export * from "./bbox";
 export * from "./collision";
+export * from "./geometry/shape";
+export * from "./geometry/geometry";