فهرست منبع

deps: update vue3.3 and fix types issues

alvarosabu 2 سال پیش
والد
کامیت
d2676ac0fd
5فایلهای تغییر یافته به همراه314 افزوده شده و 244 حذف شده
  1. 15 14
      package.json
  2. 2 2
      playground/package.json
  3. 291 224
      pnpm-lock.yaml
  4. 4 3
      src/components/TresCanvas.ts
  5. 2 1
      src/components/TresScene.ts

+ 15 - 14
package.json

@@ -6,7 +6,8 @@
   "packageManager": "pnpm@8.3.1",
   "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
   "files": [
-    "dist"
+    "dist",
+    "*.d.ts"
   ],
   "license": "MIT",
   "main": "./dist/tres.umd.cjs",
@@ -67,17 +68,17 @@
     "@stackblitz/sdk": "^1.9.0",
     "@tresjs/cientos": "2.0.0",
     "@types/three": "^0.152.0",
-    "@typescript-eslint/eslint-plugin": "^5.59.2",
-    "@typescript-eslint/parser": "^5.59.2",
-    "@vitejs/plugin-vue": "^4.2.1",
-    "@vitest/coverage-c8": "^0.30.1",
-    "@vitest/ui": "^0.30.1",
+    "@typescript-eslint/eslint-plugin": "^5.59.6",
+    "@typescript-eslint/parser": "^5.59.6",
+    "@vitejs/plugin-vue": "^4.2.3",
+    "@vitest/coverage-c8": "^0.31.1",
+    "@vitest/ui": "^0.31.1",
     "@vue/test-utils": "^2.3.2",
-    "eslint": "^8.39.0",
+    "eslint": "^8.40.0",
     "eslint-config-prettier": "^8.8.0",
-    "eslint-plugin-vue": "^9.11.0",
+    "eslint-plugin-vue": "^9.13.0",
     "gsap": "^3.11.5",
-    "happy-dom": "^9.10.7",
+    "happy-dom": "^9.18.3",
     "jsdom": "^22.0.0",
     "kolorist": "^1.8.0",
     "pathe": "^1.1.0",
@@ -87,17 +88,17 @@
     "rollup-plugin-copy": "^3.4.0",
     "rollup-plugin-visualizer": "^5.9.0",
     "three": "^0.152.2",
-    "unocss": "^0.51.8",
+    "unocss": "^0.51.13",
     "unplugin": "^1.3.1",
     "unplugin-vue-components": "^0.24.1",
-    "vite": "^4.3.4",
+    "vite": "^4.3.7",
     "vite-plugin-banner": "^0.7.0",
     "vite-plugin-dts": "2.3.0",
-    "vite-plugin-inspect": "^0.7.24",
+    "vite-plugin-inspect": "^0.7.26",
     "vite-plugin-require-transform": "^1.0.12",
     "vite-svg-loader": "^4.0.0",
     "vitepress": "1.0.0-alpha.75",
-    "vitest": "^0.30.1",
-    "vue-demi": "^0.14.0"
+    "vitest": "^0.31.1",
+    "vue-demi": "^0.14.4"
   }
 }

+ 2 - 2
playground/package.json

@@ -10,11 +10,11 @@
   },
   "dependencies": {
     "@tresjs/core": "workspace:^2.0.0-rc.2",
-    "vue-router": "^4.1.6"
+    "vue-router": "^4.2.0"
   },
   "devDependencies": {
     "@tresjs/core": "workspace:^2.0.0-rc.2",
-    "unplugin-auto-import": "^0.15.3",
+    "unplugin-auto-import": "^0.16.0",
     "vite-plugin-glsl": "^1.1.2"
   }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 291 - 224
pnpm-lock.yaml


+ 4 - 3
src/components/TresCanvas.ts

@@ -1,15 +1,16 @@
 import { TresScene } from './TresScene'
 import { defineComponent, h } from 'vue'
-import { ShadowMapType, TextureEncoding, ToneMapping } from 'three'
+import { ColorSpace, ShadowMapType, ToneMapping } from 'three'
 import { CameraType, useTresProvider } from '/@/composables'
 import { RendererPresetsType } from '/@/composables/useRenderer/const'
+import { Component } from 'vue'
 
 export interface TresCanvasProps {
   shadows?: boolean
   shadowMapType?: ShadowMapType
   physicallyCorrectLights?: boolean
   useLegacyLights?: boolean
-  outputColorSpace?: TextureEncoding
+  outputColorSpace?: ColorSpace
   toneMapping?: ToneMapping
   toneMappingExposure?: number
   context?: WebGLRenderingContext
@@ -49,7 +50,7 @@ export const TresCanvas = defineComponent<TresCanvasProps>({
 
     expose(tres)
 
-    return () => h(TresScene, props, slots)
+    return () => h(TresScene as Component, props, slots)
   },
 })
 

+ 2 - 1
src/components/TresScene.ts

@@ -9,6 +9,7 @@ import { RendererPresetsType } from '/@/composables/useRenderer/const'
 import { TresEvent, TresObject } from '../types'
 import { useEventListener } from '@vueuse/core'
 import { isString } from '@alvarosabu/utils'
+import { VNode } from 'vue'
 
 export interface TresSceneProps {
   shadows?: boolean
@@ -72,7 +73,7 @@ export const TresScene = defineComponent<TresSceneProps>({
 
     if (internal && internal?.length > 0) {
       isCameraAvailable.value =
-        internal.some((node: TresObject) => isString(node.type) && node.type.includes('Camera')) || props.camera
+        internal.some((node: VNode) => isString(node.type) && node.type.includes('Camera')) || props.camera
       if (!isCameraAvailable.value) {
         logWarning('No camera found in the scene, please add one!')
       }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است