Răsfoiți Sursa

fix: incorrect type imports (#9308)

Marcel Mraz 5 luni în urmă
părinte
comite
0cd5a259ae

+ 3 - 12
packages/common/package.json

@@ -2,18 +2,18 @@
   "name": "@excalidraw/common",
   "version": "0.1.0",
   "type": "module",
-  "types": "./dist/types/common/index.d.ts",
+  "types": "./dist/types/common/src/index.d.ts",
   "main": "./dist/prod/index.js",
   "module": "./dist/prod/index.js",
   "exports": {
     ".": {
-      "types": "./dist/types/common/index.d.ts",
+      "types": "./dist/types/common/src/index.d.ts",
       "development": "./dist/dev/index.js",
       "production": "./dist/prod/index.js",
       "default": "./dist/prod/index.js"
     },
     "./*": {
-      "types": "./../common/dist/types/common/*"
+      "types": "./../common/dist/types/common/src/*.d.ts"
     }
   },
   "files": [
@@ -47,15 +47,6 @@
       "last 1 safari version"
     ]
   },
-  "dependencies": {
-    "es6-promise-pool": "2.5.0",
-    "nanoid": "3.3.3",
-    "open-color": "1.9.1",
-    "roughjs": "4.6.4"
-  },
-  "devDependencies": {
-    "typescript": "4.9.4"
-  },
   "bugs": "https://github.com/excalidraw/excalidraw/issues",
   "repository": "https://github.com/excalidraw/excalidraw",
   "scripts": {

+ 3 - 1
packages/common/tsconfig.json

@@ -2,5 +2,7 @@
   "extends": "../tsconfig.base.json",
   "compilerOptions": {
     "outDir": "./dist/types"
-  }
+  },
+  "include": ["src/**/*", "global.d.ts"],
+  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
 }

+ 3 - 10
packages/element/package.json

@@ -2,18 +2,18 @@
   "name": "@excalidraw/element",
   "version": "0.1.0",
   "type": "module",
-  "types": "./dist/types/element/index.d.ts",
+  "types": "./dist/types/element/src/index.d.ts",
   "main": "./dist/prod/index.js",
   "module": "./dist/prod/index.js",
   "exports": {
     ".": {
-      "types": "./dist/types/element/index.d.ts",
+      "types": "./dist/types/element/src/index.d.ts",
       "development": "./dist/dev/index.js",
       "production": "./dist/prod/index.js",
       "default": "./dist/prod/index.js"
     },
     "./*": {
-      "types": "./../element/dist/types/element/*"
+      "types": "./../element/dist/types/element/src/*.d.ts"
     }
   },
   "files": [
@@ -47,13 +47,6 @@
       "last 1 safari version"
     ]
   },
-  "dependencies": {
-    "fractional-indexing": "3.2.0",
-    "perfect-freehand": "1.2.0",
-    "points-on-curve": "1.0.1",
-    "roughjs": "4.6.4"
-  },
-  "devDependencies": {},
   "bugs": "https://github.com/excalidraw/excalidraw/issues",
   "repository": "https://github.com/excalidraw/excalidraw",
   "scripts": {

+ 3 - 1
packages/element/tsconfig.json

@@ -2,5 +2,7 @@
   "extends": "../tsconfig.base.json",
   "compilerOptions": {
     "outDir": "./dist/types"
-  }
+  },
+  "include": ["src/**/*", "global.d.ts"],
+  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
 }

+ 17 - 0
packages/excalidraw/package.json

@@ -6,6 +6,18 @@
   "main": "./dist/prod/index.js",
   "module": "./dist/prod/index.js",
   "exports": {
+    "./common/*": {
+      "types": "./dist/types/common/src/*.d.ts"
+    },
+    "./element/*": {
+      "types": "./dist/types/element/src/*.d.ts"
+    },
+    "./math/*": {
+      "types": "./dist/types/math/src/*.d.ts"
+    },
+    "./utils/*": {
+      "types": "./dist/types/utils/src/*.d.ts"
+    },
     "./*": {
       "types": "./dist/types/excalidraw/*.d.ts"
     },
@@ -69,6 +81,8 @@
     "canvas-roundrect-polyfill": "0.0.1",
     "clsx": "1.1.1",
     "cross-env": "7.0.3",
+    "es6-promise-pool": "2.5.0",
+    "fractional-indexing": "3.2.0",
     "fuzzy": "0.1.3",
     "image-blob-reduce": "3.0.1",
     "jotai": "2.11.0",
@@ -76,11 +90,14 @@
     "lodash.throttle": "4.1.1",
     "lodash.debounce": "4.0.8",
     "nanoid": "3.3.3",
+    "open-color": "1.9.1",
     "pako": "2.0.3",
+    "perfect-freehand": "1.2.0",
     "pica": "7.1.1",
     "png-chunk-text": "1.0.0",
     "png-chunks-encode": "1.0.0",
     "png-chunks-extract": "1.0.0",
+    "points-on-curve": "1.0.1",
     "pwacompat": "2.0.17",
     "roughjs": "4.6.4",
     "sass": "1.51.0",

+ 3 - 1
packages/excalidraw/tsconfig.json

@@ -2,5 +2,7 @@
   "extends": "../tsconfig.base.json",
   "compilerOptions": {
     "outDir": "./dist/types"
-  }
+  },
+  "include": ["**/*"],
+  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
 }

+ 3 - 2
packages/math/package.json

@@ -2,17 +2,18 @@
   "name": "@excalidraw/math",
   "version": "0.1.0",
   "type": "module",
-  "types": "./dist/types/math/index.d.ts",
+  "types": "./dist/types/math/src/index.d.ts",
   "main": "./dist/prod/index.js",
   "module": "./dist/prod/index.js",
   "exports": {
     ".": {
+      "types": "./dist/types/math/src/index.d.ts",
       "development": "./dist/dev/index.js",
       "production": "./dist/prod/index.js",
       "default": "./dist/prod/index.js"
     },
     "./*": {
-      "types": "./../math/dist/types/math/*"
+      "types": "./../math/dist/types/math/src/*.d.ts"
     }
   },
   "files": [

+ 3 - 1
packages/math/tsconfig.json

@@ -2,5 +2,7 @@
   "extends": "../tsconfig.base.json",
   "compilerOptions": {
     "outDir": "./dist/types"
-  }
+  },
+  "include": ["src/**/*", "global.d.ts"],
+  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
 }

+ 1 - 2
packages/tsconfig.base.json

@@ -22,6 +22,5 @@
       "@excalidraw/utils": ["./utils/src/index.ts"],
       "@excalidraw/utils/*": ["./utils/src/*"]
     }
-  },
-  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
+  }
 }

+ 3 - 3
packages/utils/package.json

@@ -2,18 +2,18 @@
   "name": "@excalidraw/utils",
   "version": "0.1.2",
   "type": "module",
-  "types": "./dist/types/utils/index.d.ts",
+  "types": "./dist/types/utils/src/index.d.ts",
   "main": "./dist/prod/index.js",
   "module": "./dist/prod/index.js",
   "exports": {
     ".": {
-      "types": "./dist/types/utils/index.d.ts",
+      "types": "./dist/types/utils/src/index.d.ts",
       "development": "./dist/dev/index.js",
       "production": "./dist/prod/index.js",
       "default": "./dist/prod/index.js"
     },
     "./*": {
-      "types": "./../utils/dist/types/utils/*"
+      "types": "./../utils/dist/types/utils/src/*.d.ts"
     }
   },
   "files": [

+ 3 - 1
packages/utils/tsconfig.json

@@ -2,5 +2,7 @@
   "extends": "../tsconfig.base.json",
   "compilerOptions": {
     "outDir": "./dist/types"
-  }
+  },
+  "include": ["src/**/*", "global.d.ts"],
+  "exclude": ["**/*.test.*", "tests", "types", "examples", "dist"]
 }