diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6e0cb904c..78c1ef8f7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,33 +9,22 @@ jobs: lint: name: Lint runs-on: ubuntu-20.04 + strategy: + matrix: + node-version: [16] steps: - name: Checkout uses: actions/checkout@v3 - - - name: setup caching - uses: actions/cache@v3 - with: - path: ${{ env.PNPM_CACHE_FOLDER }} - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: setup pnpm - uses: pnpm/action-setup@v2.2.4 + - name: Setup pnpm + uses: pnpm/action-setup@v2 with: - version: 7 - - - name: setup node.js + version: 8 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: ${{ matrix.node-version }} cache: 'pnpm' - - - name: setup pnpm config - run: pnpm config set store-dir $PNPM_CACHE_FOLDER - - - run: pnpm install --no-frozen-lockfile --shamefully-hoist - + - name: Install dependencies + run: pnpm install - name: Run Lint run: pnpm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 758d5b029..b7ee9b19a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Run unit tests +name: Run Tests on: [push] env: @@ -6,36 +6,25 @@ env: HUSKY: 0 # Bypass husky commit hook for CI jobs: - lint: - name: Run Unit Tests + test: + name: Unit Test runs-on: ubuntu-20.04 + strategy: + matrix: + node-version: [16] steps: - name: Checkout uses: actions/checkout@v3 - - - name: setup caching - uses: actions/cache@v3 - with: - path: ${{ env.PNPM_CACHE_FOLDER }} - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: setup pnpm - uses: pnpm/action-setup@v2.2.4 + - name: Setup pnpm + uses: pnpm/action-setup@v2 with: - version: 7 - - - name: setup node.js + version: 8 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: ${{ matrix.node-version }} cache: 'pnpm' - - - name: setup pnpm config - run: pnpm config set store-dir $PNPM_CACHE_FOLDER - - - run: pnpm install --no-frozen-lockfile --shamefully-hoist - - - name: Run Tests + - name: Install dependencies + run: pnpm install + - name: Run Unit Tests run: pnpm run test diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ef91b02..e8b01b8fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ +## [2.4.0-next.6](https://github.com/Tresjs/tres/compare/2.4.0-next.5...2.4.0-next.6) (2023-07-19) + +## [2.4.0-next.5](https://github.com/Tresjs/tres/compare/2.4.0-next.4...2.4.0-next.5) (2023-07-19) + +## [2.4.0-next.4](https://github.com/Tresjs/tres/compare/2.4.0...2.4.0-next.4) (2023-07-07) + + +### Features + +* added option to set a camera active by it's uuid and the object itself ([c4d4764](https://github.com/Tresjs/tres/commit/c4d47649aaec6a43f57ad1f2db34dc23febbbb1c)) +* added user data key for active cameras ([82a60e7](https://github.com/Tresjs/tres/commit/82a60e7fe6d04d83b88972d5fa014236cdf515d8)) +* fixed renderer watch for aspectRatio changes ([308ab25](https://github.com/Tresjs/tres/commit/308ab254bd3b0313dbbef100eb79f375bd477a40)) +* made camera handling work properly and fixed event handler problem ([929fb8e](https://github.com/Tresjs/tres/commit/929fb8ef1a8aadf5c26c313444ebd077fe35f507)) +* made multiple cameras work ([b4a1701](https://github.com/Tresjs/tres/commit/b4a17011a2fe7bfd4a6d5ebe1737ec3d43a29a6e)) +* made renderer constructor params reactive ([cd3037e](https://github.com/Tresjs/tres/commit/cd3037e048545d107fd6e1fc9f7cc8fbee0e1c97)) +* made window size reactive ([c42feba](https://github.com/Tresjs/tres/commit/c42febacc02ea410b616e42b1eb75c38f59c6039)) +* refactor raycaster ([fc81aa5](https://github.com/Tresjs/tres/commit/fc81aa5c35fbede8e9b9f6afc04275762a84ee6b)) +* refactored composables; seperated logic from TresCanvas ([2c75b36](https://github.com/Tresjs/tres/commit/2c75b366d2ca2cf5f19a7e6173f112456f7ec0dc)) +* revert width height composables ([bab163f](https://github.com/Tresjs/tres/commit/bab163f2d880158ad87a3ef01b7e1266bf694e39)) +* tres context provider ([2f71c76](https://github.com/Tresjs/tres/commit/2f71c76330de0a32a215d9c0929fbc82012cd8f3)) +* useContextProvider onMounted ([a98ac67](https://github.com/Tresjs/tres/commit/a98ac67f491535f7a68bc6fc8bb67108d3694b7e)) + + +### Bug Fixes + +* change internal Scene component name to force rendering ([#330](https://github.com/Tresjs/tres/issues/330)) ([780743c](https://github.com/Tresjs/tres/commit/780743c62f421677b61f6c9ef9ef3feacd4b37f9)) +* prop types on TresCanvas ([#326](https://github.com/Tresjs/tres/issues/326)) ([309584a](https://github.com/Tresjs/tres/commit/309584a5431b63a63fe541a11a1347de54359dac)) + ## [2.4.0](https://github.com/Tresjs/tres/compare/2.3.0...2.4.0) (2023-06-28) diff --git a/docs/api/renderer.md b/docs/api/renderer.md index 2c4907a17..91a07a1e8 100644 --- a/docs/api/renderer.md +++ b/docs/api/renderer.md @@ -70,20 +70,20 @@ renderer.shadowMap.type: PCFSoftShadowMap ## Props -| Prop | Description | Default | -| :-------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -| **shadows** | Enable shadows in the Renderer | `false` | -| **shadowMapType** | Set the shadow map type | `PCFSoftShadowMap` | -| **physicallyCorrectLights** | Whether to use physically correct lighting mode. See the [lights / physical example](https://threejs.org/examples/#webgl_lights_physical). | `false` | -| **outputColorSpace** | Defines the output encoding | `LinearEncoding` | -| **toneMapping** | Defines the tone mapping exposure used by the renderer. | `NoToneMapping` | -| **context** | This can be used to attach the renderer to an existing [RenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) | | -| **powerPreference** | Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. Can be "high-performance", "low-power" or "default". | `default` | -| **preserveDrawingBuffer** | Whether to preserve the buffers until manually cleared or overwritten.. | `false` | -| **clearColor** | The color the renderer will use to clear the canvas. | `#000000` | -| **windowSize** | Whether to use the window size as the canvas size or the parent element. | `false` | -| **disableRender** | Disable render on requestAnimationFrame, usefull for PostProcessing | `false` | -| **camera** | A manual camera to be used by the renderer. | | +| Prop | Description | Default | +| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | +| **shadows** | Enable shadows in the Renderer | `false` | +| **shadowMapType** | Set the shadow map type | `PCFSoftShadowMap` | +| **useLegacyLights** | Whether to use the legacy lighting mode or not | `true` | +| **outputColorSpace** | Defines the output encoding | `LinearEncoding` | +| **toneMapping** | Defines the tone mapping exposure used by the renderer. | `NoToneMapping` | +| **context** | This can be used to attach the renderer to an existing [RenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) | | +| **powerPreference** | Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. Can be "high-performance", "low-power" or "default". | `default` | +| **preserveDrawingBuffer** | Whether to preserve the buffers until manually cleared or overwritten.. | `false` | +| **clearColor** | The color the renderer will use to clear the canvas. | `#000000` | +| **windowSize** | Whether to use the window size as the canvas size or the parent element. | `false` | +| **disableRender** | Disable render on requestAnimationFrame, usefull for PostProcessing | `false` | +| **camera** | A manual camera to be used by the renderer. | | ## Defaults diff --git a/package.json b/package.json index deade658e..9fadb8b8f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@tresjs/core", "description": "Declarative ThreeJS using Vue Components", - "version": "2.4.0-next.3", + "version": "2.4.0-next.6", "type": "module", "packageManager": "pnpm@8.3.1", "author": "Alvaro Saburido (https://github.com/alvarosabu/)", diff --git a/playground/auto-imports.d.ts b/playground/auto-imports.d.ts index 4259e89c6..9959df651 100644 --- a/playground/auto-imports.d.ts +++ b/playground/auto-imports.d.ts @@ -1,6 +1,7 @@ /* eslint-disable */ /* prettier-ignore */ // @ts-nocheck +// noinspection JSUnusedGlobalSymbols // Generated by unplugin-auto-import export {} declare global { diff --git a/playground/components.d.ts b/playground/components.d.ts index 38ea60bb6..33c0bcd9c 100644 --- a/playground/components.d.ts +++ b/playground/components.d.ts @@ -8,6 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { AnimatedModel: typeof import('./src/components/AnimatedModel.vue')['default'] + CameraOperator: typeof import('./src/components/CameraOperator.vue')['default'] Cameras: typeof import('./src/components/Cameras.vue')['default'] copy: typeof import('./src/components/TheBasic copy.vue')['default'] DanielTest: typeof import('./src/components/DanielTest.vue')['default'] @@ -15,6 +16,7 @@ declare module 'vue' { DeleteMe: typeof import('./src/components/DeleteMe.vue')['default'] FBXModels: typeof import('./src/components/FBXModels.vue')['default'] Gltf: typeof import('./src/components/gltf/index.vue')['default'] + LocalOrbitControls: typeof import('./src/components/LocalOrbitControls.vue')['default'] MeshWobbleMaterial: typeof import('./src/components/meshWobbleMaterial/index.vue')['default'] MultipleCanvas: typeof import('./src/components/MultipleCanvas.vue')['default'] PortalJourney: typeof import('./src/components/portal-journey/index.vue')['default'] @@ -25,6 +27,7 @@ declare module 'vue' { TestSphere: typeof import('./src/components/TestSphere.vue')['default'] Text3D: typeof import('./src/components/Text3D.vue')['default'] TheBasic: typeof import('./src/components/TheBasic.vue')['default'] + TheCameraOperator: typeof import('./src/components/TheCameraOperator.vue')['default'] TheConditional: typeof import('./src/components/TheConditional.vue')['default'] TheEnvironment: typeof import('./src/components/TheEnvironment.vue')['default'] TheEvents: typeof import('./src/components/TheEvents.vue')['default'] diff --git a/playground/package.json b/playground/package.json index a1a2b871a..f3b11734c 100644 --- a/playground/package.json +++ b/playground/package.json @@ -10,13 +10,13 @@ }, "dependencies": { "@tresjs/cientos": "2.1.4", - "@tresjs/core": "workspace:2.4.0-next.2", - "vue-router": "^4.2.2" + "@tresjs/core": "workspace:2.4.0-next.6", + "vue-router": "^4.2.4" }, "devDependencies": { - "@tresjs/leches": "^0.3.1", - "unplugin-auto-import": "^0.16.4", + "@tresjs/leches": "^0.4.0", + "unplugin-auto-import": "^0.16.6", "vite-plugin-glsl": "^1.1.2", - "vue-tsc": "^1.8.1" + "vue-tsc": "^1.8.4" } } diff --git a/playground/src/components/DebugUI.vue b/playground/src/components/DebugUI.vue index d950badcd..142c9ac85 100644 --- a/playground/src/components/DebugUI.vue +++ b/playground/src/components/DebugUI.vue @@ -2,34 +2,32 @@ import { TresCanvas } from '@tresjs/core' import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three' -import { OrbitControls, Box } from '@tresjs/cientos' -import { TresLeches, useControls } from '@tresjs/leches' -import '@tresjs/leches/styles' +// import { OrbitControls, Box } from '@tresjs/cientos' +/* import { TresLeches, useControls } from '@tresjs/leches' */ +/* import '@tresjs/leches/styles' */ -const gl = { +const gl = reactive({ clearColor: '#82DBC5', shadows: true, alpha: false, shadowMapType: BasicShadowMap, outputColorSpace: SRGBColorSpace, toneMapping: NoToneMapping, -} +}) -const boxPosition = ref([0, 0.5, 0]) - -useControls(gl) -useControls('Box', boxPosition.value) +/* useControls('fpsgraph') */ +// useControls(gl) +// useControls('Box', boxPosition.value)