Quellcode durchsuchen

feat: update deps 20 12 24 (#887)

* chore: remove nuxt playground due deps instalation hanging

* feat: update deps

* chore: remove temporarely the inspect plugin
Alvaro Saburido vor 4 Monaten
Ursprung
Commit
d377750b01

+ 5 - 5
docs/package.json

@@ -10,13 +10,13 @@
   },
   "dependencies": {
     "@tresjs/core": "workspace:^",
-    "tweakpane": "^4.0.4"
+    "tweakpane": "^4.0.5"
   },
   "devDependencies": {
-    "@iconify-json/logos": "^1.2.3",
-    "@iconify-json/mdi": "^1.2.1",
-    "unocss": "^0.63.4",
+    "@iconify-json/logos": "^1.2.4",
+    "@iconify-json/mdi": "^1.2.2",
+    "unocss": "^0.65.2",
     "vite-svg-loader": "^5.1.0",
-    "vitepress-plugin-group-icons": "^1.3.1"
+    "vitepress-plugin-group-icons": "^1.3.2"
   }
 }

+ 25 - 26
package.json

@@ -2,7 +2,7 @@
   "name": "@tresjs/core",
   "type": "module",
   "version": "4.3.1",
-  "packageManager": "pnpm@9.12.2",
+  "packageManager": "pnpm@9.15.1",
   "description": "Declarative ThreeJS using Vue Components",
   "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
   "license": "MIT",
@@ -49,8 +49,8 @@
     "access": "public"
   },
   "scripts": {
-    "dev": "cd playground/vue && npm run dev",
-    "dev:nuxt": "cd playground/nuxt && npm run dev",
+    "dev": "pnpm --filter='./playground/vue' dev",
+    "dev:nuxt": "pnpm --filter='./playground/nuxt' dev",
     "build": "vite build",
     "test": "vitest",
     "test:ci": "vitest run",
@@ -72,48 +72,47 @@
   "dependencies": {
     "@alvarosabu/utils": "^3.2.0",
     "@vue/devtools-api": "^6.6.3",
-    "@vueuse/core": "^11.1.0"
+    "@vueuse/core": "^12.0.0"
   },
   "devDependencies": {
-    "@release-it/conventional-changelog": "^9.0.0",
+    "@release-it/conventional-changelog": "^9.0.3",
     "@stackblitz/sdk": "^1.11.0",
     "@tresjs/cientos": "4.0.3",
     "@tresjs/eslint-config": "^1.4.0",
-    "@types/three": "^0.169.0",
-    "@typescript-eslint/eslint-plugin": "^8.8.1",
-    "@typescript-eslint/parser": "^8.8.1",
-    "@vitejs/plugin-vue": "^5.1.4",
+    "@types/three": "^0.171.0",
+    "@typescript-eslint/eslint-plugin": "^8.18.1",
+    "@typescript-eslint/parser": "^8.18.1",
+    "@vitejs/plugin-vue": "^5.2.1",
     "@vitest/coverage-c8": "^0.33.0",
-    "@vitest/coverage-v8": "^2.1.2",
-    "@vitest/ui": "^2.1.2",
+    "@vitest/coverage-v8": "^2.1.8",
+    "@vitest/ui": "^2.1.8",
     "@vue/test-utils": "^2.4.6",
-    "eslint": "^9.12.0",
-    "eslint-plugin-vue": "^9.29.0",
+    "eslint": "^9.17.0",
+    "eslint-plugin-vue": "^9.32.0",
     "esno": "^4.8.0",
     "gsap": "^3.12.5",
-    "husky": "^9.1.6",
     "jsdom": "^25.0.1",
     "kolorist": "^1.8.0",
     "ohmyfetch": "^0.4.21",
     "pathe": "^1.1.2",
-    "release-it": "^17.8.2",
+    "release-it": "^17.10.0",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.5.0",
     "rollup-plugin-visualizer": "^5.12.0",
-    "sponsorkit": "^0.15.5",
-    "three": "^0.169.0",
-    "unocss": "^0.63.4",
-    "unplugin": "^1.14.1",
-    "unplugin-vue-components": "^0.27.4",
-    "vite": "^5.4.8",
+    "sponsorkit": "^0.16.2",
+    "three": "^0.171.0",
+    "unocss": "^0.65.2",
+    "unplugin": "^2.1.0",
+    "unplugin-vue-components": "^0.28.0",
+    "vite": "^6.0.5",
     "vite-plugin-banner": "^0.8.0",
-    "vite-plugin-dts": "4.2.4",
-    "vite-plugin-inspect": "^0.8.7",
+    "vite-plugin-dts": "4.4.0",
+    "vite-plugin-inspect": "^0.10.4",
     "vite-plugin-require-transform": "^1.0.21",
     "vite-svg-loader": "^5.1.0",
-    "vitepress": "1.4.1",
-    "vitest": "^2.1.2",
-    "vue": "3.5.12",
+    "vitepress": "1.5.0",
+    "vitest": "2.1.8",
+    "vue": "3.5.13",
     "vue-demi": "^0.14.10"
   }
 }

+ 0 - 2
playground/nuxt/.github/FUNDING.yml

@@ -1,2 +0,0 @@
-github: [alvarosabu]
-ko_fi: alvarosaburido

+ 0 - 27
playground/nuxt/.github/workflows/actions/pnpm/action.yml

@@ -1,27 +0,0 @@
-# From https://github.com/remirror/template/blob/4f8c5f5629a081217672a8cce1df085510f43913/.github/actions/pnpm/action.yml
-name: pnpm installation
-description: Install and audit dependencies for pnpm
-inputs:
-  cache: # id of input
-    description: The location of the pnpm cache
-    required: true
-    default: .pnpm-store
-  version: # id of input
-    description: The version to use
-    required: false
-    default: 6.10.0
-
-runs:
-  using: composite
-  steps:
-    - name: install pnpm
-      run: npm install pnpm@${{ inputs.version }} -g
-      shell: bash
-
-    - name: setup pnpm config
-      run: pnpm config set store-dir ${{ inputs.cache }}
-      shell: bash
-
-    - name: install dependencies
-      run: pnpm install --shamefully-hoist
-      shell: bash

+ 0 - 17
playground/nuxt/.github/workflows/lint-pr.yml

@@ -1,17 +0,0 @@
-name: Lint PR
-
-on:
-  pull_request_target:
-    types:
-      - opened
-      - edited
-      - synchronize
-
-jobs:
-  main:
-    name: Validate PR title
-    runs-on: ubuntu-latest
-    steps:
-      - uses: amannn/action-semantic-pull-request@v5
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 0 - 23
playground/nuxt/.gitignore

@@ -1,23 +0,0 @@
-# Nuxt dev/build outputs
-.output
-.nuxt
-.nitro
-.cache
-dist
-
-# Node dependencies
-node_modules
-
-# Logs
-logs
-*.log
-
-# Misc
-.DS_Store
-.fleet
-.idea
-
-# Local env files
-.env
-.env.*
-!.env.example

+ 0 - 2
playground/nuxt/.npmrc

@@ -1,2 +0,0 @@
-shamefully-hoist=true
-strict-peer-dependencies=false

+ 0 - 3
playground/nuxt/.stackblitzrc

@@ -1,3 +0,0 @@
-{
-  "installDependencies": true
-}

+ 0 - 21
playground/nuxt/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2022-present, (alvarosabu) Alvaro Saburido and Tres contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 67
playground/nuxt/README.md

@@ -1,67 +0,0 @@
-![repo-banner](/public/repo-banner.png)
-
-# TresJS 🚀 Starter + Nuxt
-
-> Quick start repo for [Nuxt](https://nuxt.com) projects with [TresJS](https://tresjs.org) integration via  [`@tresjs/nuxt` module](https://tresjs.org/guide/nuxt.html).
-
-Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
-
-## Setup
-
-Make sure to install the dependencies:
-
-```bash
-# npm
-npm install
-
-# pnpm
-pnpm install
-
-# yarn
-yarn install
-```
-
-## Development Server
-
-Start the development server on `http://localhost:3000`:
-
-```bash
-# npm
-npm run dev
-
-# pnpm
-pnpm run dev
-
-# yarn
-yarn dev
-```
-
-## Production
-
-Build the application for production:
-
-```bash
-# npm
-npm run build
-
-# pnpm
-pnpm run build
-
-# yarn
-yarn build
-```
-
-Locally preview production build:
-
-```bash
-# npm
-npm run preview
-
-# pnpm
-pnpm run preview
-
-# yarn
-yarn preview
-```
-
-Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

+ 0 - 29
playground/nuxt/app.vue

@@ -1,29 +0,0 @@
-<script setup lang="ts">
-import { BasicShadowMap, NoToneMapping, SRGBColorSpace } from 'three'
-
-const gl = {
-  clearColor: '#c0ffee',
-  shadows: true,
-  alpha: false,
-  shadowMapType: BasicShadowMap,
-  outputColorSpace: SRGBColorSpace,
-  toneMapping: NoToneMapping,
-}
-</script>
-
-<template>
-  <div style="height: 100vh">
-    <TresCanvas v-bind="gl">
-      <TheExperience />
-    </TresCanvas>
-  </div>
-</template>
-
-<style>
-html,
-body {
-  margin: 0;
-  padding: 0;
-  overflow: hidden;
-}
-</style>

+ 0 - 41
playground/nuxt/components/EnvironmentLocal.vue

@@ -1,41 +0,0 @@
-<script setup lang="ts">
-import type { LoaderProto } from '@tresjs/core'
-import { useLoader, useTresContext } from '@tresjs/core'
-import { CubeReflectionMapping, type CubeTexture, CubeTextureLoader, EquirectangularReflectionMapping, type Texture } from 'three'
-import { RGBELoader } from 'three-stdlib'
-
-/* const files = ref(['/px.jpg', '/nx.jpg', '/py.jpg', '/ny.jpg', '/pz.jpg', '/nz.jpg']) */
-const files = ref('venice/venice_sunset_1k.hdr')
-const path = 'https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/'
-const texture: Ref<Texture | CubeTexture | null> = ref(null)
-
-const { scene } = useTresContext()
-
-const isCubeMap = computed(() => Array.isArray((files as Ref<string[]>).value))
-const result = ref()
-const loader = computed(() => isCubeMap.value ? CubeTextureLoader as unknown as LoaderProto<CubeTexture | RGBELoader> : RGBELoader as unknown as LoaderProto<CubeTexture | RGBELoader>)
-
-result.value = await useLoader<CubeTexture | RGBELoader>(
-  loader.value,
-  isCubeMap.value ? [...unref(files)] : unref(files),
-  (loader: any) => {
-    if (path) { loader.setPath(unref(path)) }
-    /* if (colorSpace) loader.colorSpace = colorSpace */
-  },
-)
-if (result.value) {
-  texture.value = result.value
-  if (texture.value) {
-    texture.value.mapping = isCubeMap.value ? CubeReflectionMapping : EquirectangularReflectionMapping
-    scene.value.environment = texture.value
-    scene.value.background = texture.value
-  }
-}
-</script>
-
-<template>
-  <TresMesh>
-    <TresSphereGeometry args="[1, 64, 32]" />
-    <TresMeshStandardMaterial :envMap="texture" />
-  </TresMesh>
-</template>

+ 0 - 19
playground/nuxt/components/TheExperience.vue

@@ -1,19 +0,0 @@
-<script setup lang="ts">
-
-</script>
-
-<template>
-  <TresPerspectiveCamera
-    :position="[-5.3, 8.3, 10.6]"
-    :look-at="[0, 0, 0]"
-  />
-  <Suspense>
-    <EnvironmentLocal />
-  </Suspense>
-  <TresMesh :position="[0, 2, 0]">
-    <TresBoxGeometry />
-    <TresMeshNormalMaterial />
-  </TresMesh>
-  <TresGridHelper />
-  <OrbitControls />
-</template>

+ 0 - 21
playground/nuxt/nuxt.config.ts

@@ -1,21 +0,0 @@
-// https://nuxt.com/docs/api/configuration/nuxt-config
-import { resolve } from 'pathe'
-
-export default defineNuxtConfig({
-  modules: ['@tresjs/nuxt'],
-  devtools: { enabled: true },
-
-  vite: {
-    resolve: {
-      alias: {
-        '@tresjs/core': resolve(__dirname, '../../src/'),
-      },
-    },
-  },
-
-  tres: {
-    glsl: true,
-  },
-
-  compatibilityDate: '2024-08-30',
-})

+ 0 - 36
playground/nuxt/package.json

@@ -1,36 +0,0 @@
-{
-  "name": "@tresjs/nuxt-starter",
-  "type": "module",
-  "version": "1.0.0",
-  "description": "Quick Nuxt starter template for TresJS",
-  "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
-  "license": "MIT",
-  "keywords": [
-    "vue",
-    "tresjs",
-    "webgl",
-    "vite",
-    "3d",
-    "threejs",
-    "three",
-    "threejs-vue"
-  ],
-  "scripts": {
-    "build": "nuxt build",
-    "dev": "nuxt dev",
-    "generate": "nuxt generate",
-    "preview": "nuxt preview",
-    "postinstall": "nuxt prepare"
-  },
-  "devDependencies": {
-    "@nuxt/devtools": "latest",
-    "@tresjs/cientos": "^4.0.0",
-    "@tresjs/core": "workspace:^",
-    "@tresjs/nuxt": "3.0.4",
-    "@tresjs/post-processing": "^0.7.1",
-    "@types/node": "^22.5.1",
-    "@types/three": "^0.169.0",
-    "nuxt": "^3.5.2",
-    "three": "^0.169.0"
-  }
-}

BIN
playground/nuxt/public/LittleRocksBaked.png


BIN
playground/nuxt/public/RockBaked.png


BIN
playground/nuxt/public/favicon-16x16.png


BIN
playground/nuxt/public/favicon-32x32.png


+ 0 - 6
playground/nuxt/public/favicon-dark.svg

@@ -1,6 +0,0 @@
-<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect width="32" height="32" fill="white"/>
-<path d="M11.6854 4.42916C12.0738 3.78182 13.012 3.78182 13.4004 4.42915L19.1771 14.0569C19.577 14.7235 19.0969 15.5714 18.3196 15.5714H6.76624C5.98894 15.5714 5.50883 14.7235 5.90875 14.0569L11.6854 4.42916Z" fill="#82DBC5"/>
-<path d="M15.6857 11.5429C15.6857 10.9906 16.1334 10.5429 16.6857 10.5429H26C26.5522 10.5429 27 10.9906 27 11.5429V20.8572C27 21.4094 26.5522 21.8572 26 21.8572H16.6857C16.1334 21.8572 15.6857 21.4094 15.6857 20.8572V11.5429Z" fill="#4F4F4F"/>
-<circle cx="16" cy="23" r="6" fill="#EFAC35"/>
-</svg>

BIN
playground/nuxt/public/favicon.ico


+ 0 - 5
playground/nuxt/public/favicon.svg

@@ -1,5 +0,0 @@
-<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M11.6854 3.42916C12.0738 2.78182 13.012 2.78182 13.4004 3.42915L19.1771 13.0569C19.577 13.7235 19.0969 14.5714 18.3196 14.5714H6.76624C5.98894 14.5714 5.50883 13.7235 5.90875 13.0569L11.6854 3.42916Z" fill="#82DBC5"/>
-<path d="M15.6857 10.5429C15.6857 9.99059 16.1334 9.54288 16.6857 9.54288H26C26.5522 9.54288 27 9.99059 27 10.5429V19.8572C27 20.4094 26.5522 20.8572 26 20.8572H16.6857C16.1334 20.8572 15.6857 20.4094 15.6857 19.8572V10.5429Z" fill="#4F4F4F"/>
-<circle cx="16" cy="22" r="6" fill="#EFAC35"/>
-</svg>

BIN
playground/nuxt/public/nuxt-stones.glb


BIN
playground/nuxt/public/repo-banner.png


+ 0 - 6
playground/nuxt/renovate.json

@@ -1,6 +0,0 @@
-{
-  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
-  "extends": [
-    "config:base"
-  ]
-}

+ 0 - 3
playground/nuxt/server/tsconfig.json

@@ -1,3 +0,0 @@
-{
-  "extends": "../.nuxt/tsconfig.server.json"
-}

+ 0 - 4
playground/nuxt/tsconfig.json

@@ -1,4 +0,0 @@
-{
-  // https://nuxt.com/docs/guide/concepts/typescript
-  "extends": "./.nuxt/tsconfig.json"
-}

+ 0 - 11
playground/vue/components.d.ts

@@ -7,29 +7,18 @@ export {}
 /* prettier-ignore */
 declare module 'vue' {
   export interface GlobalComponents {
-    AkuAku: typeof import('./src/components/AkuAku.vue')['default']
     AnimatedObjectUseUpdate: typeof import('./src/components/AnimatedObjectUseUpdate.vue')['default']
     BlenderCube: typeof import('./src/components/BlenderCube.vue')['default']
-    Box: typeof import('./src/components/Box.vue')['default']
-    DirectiveSubComponent: typeof import('./src/components/DirectiveSubComponent.vue')['default']
     DynamicModel: typeof import('./src/components/DynamicModel.vue')['default']
-    FBOCube: typeof import('./src/components/FBOCube.vue')['default']
     GraphPane: typeof import('./src/components/GraphPane.vue')['default']
-    LocalOrbitControls: typeof import('./src/components/LocalOrbitControls.vue')['default']
-    Overlay: typeof import('./src/components/Overlay.vue')['default']
     OverlayInfo: typeof import('./src/components/OverlayInfo.vue')['default']
     PbrSphere: typeof import('./src/components/PbrSphere.vue')['default']
     ProvideBridge: typeof import('./src/components/ProvideBridge.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
-    TakeOverLoopExperience: typeof import('./src/components/TakeOverLoopExperience.vue')['default']
     TestResult: typeof import('./src/components/TestResult.vue')['default']
     Tests: typeof import('./src/components/Tests.vue')['default']
-    TestSphere: typeof import('./src/components/TestSphere.vue')['default']
-    Text3D: typeof import('./src/components/Text3D.vue')['default']
-    TheCameraOperator: typeof import('./src/components/TheCameraOperator.vue')['default']
     TheExperience: typeof import('./src/components/TheExperience.vue')['default']
     TheSphere: typeof import('./src/components/TheSphere.vue')['default']
-    UgglyBunny: typeof import('./src/components/UgglyBunny.vue')['default']
   }
 }

+ 5 - 5
playground/vue/package.json

@@ -11,15 +11,15 @@
   "dependencies": {
     "@tresjs/cientos": "4.0.3",
     "@tresjs/core": "workspace:^",
-    "vue-router": "^4.4.5"
+    "vue-router": "^4.5.0"
   },
   "devDependencies": {
     "@tresjs/leches": "0.15.0-next.3",
     "@tweakpane/plugin-essentials": "^0.2.0",
-    "unplugin-auto-import": "^0.18.3",
-    "vite-plugin-glsl": "^1.2.1",
+    "unplugin-auto-import": "^0.19.0",
+    "vite-plugin-glsl": "^1.3.1",
     "vite-plugin-qrcode": "^0.2.3",
-    "vite-plugin-vue-devtools": "7.4.6",
-    "vue-tsc": "^2.1.6"
+    "vite-plugin-vue-devtools": "7.6.8",
+    "vue-tsc": "^2.1.10"
   }
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 221 - 509
pnpm-lock.yaml


+ 1 - 1
src/utils/index.ts

@@ -462,7 +462,7 @@ export function setPixelRatio(renderer: { setPixelRatio?: (dpr: number) => void,
 
   let newDpr = 0
 
-  if (is.arr(userDpr) && userDpr.length >= 2) {
+  if (userDpr && is.arr(userDpr) && userDpr.length >= 2) {
     const [min, max] = userDpr
     newDpr = MathUtils.clamp(systemDpr, min, max)
   }

+ 1 - 0
tsconfig.node.json

@@ -4,6 +4,7 @@
     "baseUrl": ".",
     "module": "ESNext",
     "moduleResolution": "Node",
+    "resolveJsonModule": true,
     "types": ["vitest/globals"],
     "allowSyntheticDefaultImports": true
   },

+ 1 - 5
vite.config.ts

@@ -7,15 +7,11 @@ import { defineConfig } from 'vite'
 import banner from 'vite-plugin-banner'
 import dts from 'vite-plugin-dts'
 
-import Inspect from 'vite-plugin-inspect'
-
 /* import analyze from 'rollup-plugin-analyzer' */
 
 import { bold, gray, lightGreen, yellow } from 'kolorist'
 import { resolve } from 'pathe'
 
-/* ß */
-
 import pkg from './package.json'
 
 // eslint-disable-next-line no-console
@@ -42,7 +38,7 @@ export default defineConfig({
         pkg.version
       }\n * (c) ${new Date().getFullYear()}\n * description: ${pkg.description}\n * author: ${pkg.author}\n */`,
     }),
-    Inspect(),
+    // Inspect(),
   ],
   test: {
     environment: 'jsdom',

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.