Procházet zdrojové kódy

Merge branch 'main' into feature/19-docs-for-core-composables

Alvaro před 2 roky
rodič
revize
edb868c739

+ 16 - 0
.github/ISSUE_TEMPLATE/bug.report.yml

@@ -0,0 +1,16 @@
+name: "\U0001F41E Bug report"
+description: Report an issue with TresJS ▲ ■ ● or any of it's packages
+labels: [pending triage]
+body:
+  - type: markdown
+    attributes:
+      value: |
+        Thanks for taking the time to fill out this bug report!
+- type: textarea
+    id: bug-description
+    attributes:
+      label: Describe the bug
+      description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+      placeholder: I am doing ... What I expect is ... What actually happening is ...
+    validations:
+      required: true

+ 1 - 0
.github/ISSUE_TEMPLATE/config.yml

@@ -0,0 +1 @@
+blank_issues_enabled: false

+ 20 - 0
.github/ISSUE_TEMPLATE/feature-request-🪐.md

@@ -0,0 +1,20 @@
+---
+name: "Feature request \U0001FA90"
+about: Suggest an idea for this project
+title: ''
+labels: enhancement
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of the problem. Please make the reason and use-cases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Suggested solution**
+In module [xy] we could provide following implementation....
+
+**Additional context**
+Add any other context or screenshots about the feature request here.

+ 36 - 0
.github/ISSUE_TEMPLATE/🐛-bug-report.md

@@ -0,0 +1,36 @@
+---
+name: "\U0001F41B Bug report"
+about: Create a report to help us improve
+title: ''
+labels: pending-triage
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+
+I am doing ... What I expect is ... What actually happening is
+
+**Reproduction**
+Please provide a link using this template on [Stackblitz](https://stackblitz.com/edit/tresjs-basic?file=README.md) 
+
+**Steps**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**System Info**
+Output of `npx envinfo --system --npmPackages '{vite,@tresjs/*, three, vue}' --binaries --browsers` 
+
+
+**Additional context**
+Add any other context about the problem here.

+ 6 - 2
docs/.vitepress/theme/index.ts

@@ -11,8 +11,12 @@ export default {
     DefaultTheme.enhanceApp(ctx)
     DefaultTheme.enhanceApp(ctx)
     ctx.app.component('FirstScene', FirstScene)
     ctx.app.component('FirstScene', FirstScene)
     ctx.app.component('StackBlitzEmbed', StackBlitzEmbed)
     ctx.app.component('StackBlitzEmbed', StackBlitzEmbed)
-    ctx.app.use(Tres)
-
+    /*  ctx.app.use(Tres)
+     */
+    if (import.meta.env.SSR) {
+      // ... server only logic
+      ctx.app.use(Tres)
+    }
     console.log(ctx)
     console.log(ctx)
   },
   },
 }
 }

+ 5 - 0
docs/examples/load-models.md

@@ -41,7 +41,12 @@ Notice in the example above that we are using the `Suspense` component to wrap t
 
 
 A more convenient way of loading models is using the `useGLTF` composable available from [@tresjs/cientos](https://github.com/Tresjs/tres/tree/main/packages/cientos) package.
 A more convenient way of loading models is using the `useGLTF` composable available from [@tresjs/cientos](https://github.com/Tresjs/tres/tree/main/packages/cientos) package.
 
 
+<<<<<<< HEAD
 To learn more about `useGLTF`, check out the [useGLTF](/cientos/api/composables#use-gltf) documentation.
 To learn more about `useGLTF`, check out the [useGLTF](/cientos/api/composables#use-gltf) documentation.
+=======
+To learn more about `useGLTF`, check out the **useGLTF** documentation.
+
+> > > > > > > main
 
 
 ```ts
 ```ts
 import { useGLTF } from '@tresjs/cientos'
 import { useGLTF } from '@tresjs/cientos'

+ 3 - 2
docs/guide/index.md

@@ -1,7 +1,8 @@
 # Introduction
 # Introduction
 
 
-<FirstScene style="aspect-ratio: 16/9; height: auto; margin: 2rem 0; border-radius: 8px; overflow:hidden;"/>
-
+<ClientOnly>
+    <FirstScene style="aspect-ratio: 16/9; height: auto; margin: 2rem 0; border-radius: 8px; overflow:hidden;"/>
+</ClientOnly>
 ```
 ```
 npm install three @tresjs/core -D
 npm install three @tresjs/core -D
 ```
 ```

+ 5 - 0
netlify.toml

@@ -0,0 +1,5 @@
+[build.environment]
+  NODE_VERSION = "16"
+[build]
+  publish = "docs/.vitepress/dist"
+  command = "pnpm docs:build"

+ 1 - 1
package.json

@@ -48,7 +48,7 @@
     "@changesets/cli": "^2.25.2",
     "@changesets/cli": "^2.25.2",
     "@stackblitz/sdk": "^1.8.1",
     "@stackblitz/sdk": "^1.8.1",
     "@tresjs/cientos": "workspace:^1.1.0",
     "@tresjs/cientos": "workspace:^1.1.0",
-    "@tresjs/core": "workspace:^1.2.0",
+    "@tresjs/core": "workspace:^1.2.1",
     "@typescript-eslint/eslint-plugin": "^5.42.0",
     "@typescript-eslint/eslint-plugin": "^5.42.0",
     "@typescript-eslint/parser": "^5.42.0",
     "@typescript-eslint/parser": "^5.42.0",
     "conventional-changelog-cli": "^2.2.2",
     "conventional-changelog-cli": "^2.2.2",

+ 2 - 2
packages/cientos/package.json

@@ -36,7 +36,7 @@
     "lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue"
     "lint": "eslint . --ext .js,.jsx,.ts,.tsx,.vue"
   },
   },
   "peerDependencies": {
   "peerDependencies": {
-    "@tresjs/core": "workspace:^1.2.0",
+    "@tresjs/core": "workspace:^1.2.1",
     "three": "latest",
     "three": "latest",
     "vue": "^3.2.45"
     "vue": "^3.2.45"
   },
   },
@@ -54,7 +54,7 @@
     "vite-plugin-dts": "^1.7.0"
     "vite-plugin-dts": "^1.7.0"
   },
   },
   "dependencies": {
   "dependencies": {
-    "@tresjs/core": "workspace:^1.2.0",
+    "@tresjs/core": "workspace:^1.2.1",
     "three-stdlib": "^2.17.3"
     "three-stdlib": "^2.17.3"
   }
   }
 }
 }

+ 1 - 0
packages/cientos/vite.config.ts

@@ -39,6 +39,7 @@ export default defineConfig({
       name: 'trescientos',
       name: 'trescientos',
       fileName: 'trescientos',
       fileName: 'trescientos',
     },
     },
+    copyPublicDir: false,
     watch: {
     watch: {
       include: [resolve(__dirname, 'src')],
       include: [resolve(__dirname, 'src')],
     },
     },

+ 6 - 0
packages/tres/CHANGELOG.md

@@ -1,3 +1,9 @@
+# 1.2.1 (2022-12-11)
+
+### Bug Fixes
+
+- added copyPublicDir: false to remove static assets on package ([7e8de9c](https://github.com/Tresjs/tres/commit/7e8de9c4b4e63107b79a81a8686ad97256a29017))
+
 # 1.2.0 (2022-12-08)
 # 1.2.0 (2022-12-08)
 
 
 ### Bug Fixes
 ### Bug Fixes

+ 1 - 1
packages/tres/package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "@tresjs/core",
   "name": "@tresjs/core",
   "description": "Declarative ThreeJS using Vue Components",
   "description": "Declarative ThreeJS using Vue Components",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "type": "module",
   "type": "module",
   "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
   "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
   "files": [
   "files": [

+ 3 - 1
packages/tres/vite.config.ts

@@ -50,15 +50,17 @@ export default defineConfig({
     watch: {
     watch: {
       include: [resolve(__dirname, 'src')],
       include: [resolve(__dirname, 'src')],
     },
     },
+    copyPublicDir: false,
     rollupOptions: {
     rollupOptions: {
       plugins: [
       plugins: [
         analyze(),
         analyze(),
-        /*  visualizer({
+        /*    visualizer({
           open: true,
           open: true,
           gzipSize: true,
           gzipSize: true,
           brotliSize: true,
           brotliSize: true,
         }), */
         }), */
       ],
       ],
+
       external: ['vue', '@vueuse/core', 'three'],
       external: ['vue', '@vueuse/core', 'three'],
       output: {
       output: {
         exports: 'named',
         exports: 'named',

+ 4 - 4
pnpm-lock.yaml

@@ -8,8 +8,8 @@ importers:
       '@changesets/changelog-github': ^0.4.7
       '@changesets/changelog-github': ^0.4.7
       '@changesets/cli': ^2.25.2
       '@changesets/cli': ^2.25.2
       '@stackblitz/sdk': ^1.8.1
       '@stackblitz/sdk': ^1.8.1
-      '@tresjs/cientos': workspace:^1.0.0
-      '@tresjs/core': workspace:^1.1.0
+      '@tresjs/cientos': workspace:^1.1.0
+      '@tresjs/core': workspace:^1.2.1
       '@typescript-eslint/eslint-plugin': ^5.42.0
       '@typescript-eslint/eslint-plugin': ^5.42.0
       '@typescript-eslint/parser': ^5.42.0
       '@typescript-eslint/parser': ^5.42.0
       conventional-changelog-cli: ^2.2.2
       conventional-changelog-cli: ^2.2.2
@@ -40,7 +40,7 @@ importers:
 
 
   packages/cientos:
   packages/cientos:
     specifiers:
     specifiers:
-      '@tresjs/core': workspace:^1.1.0
+      '@tresjs/core': workspace:^1.2.1
       '@tweakpane/plugin-essentials': ^0.1.5
       '@tweakpane/plugin-essentials': ^0.1.5
       '@vitejs/plugin-vue': ^3.2.0
       '@vitejs/plugin-vue': ^3.2.0
       kolorist: ^1.6.0
       kolorist: ^1.6.0
@@ -73,7 +73,7 @@ importers:
     specifiers:
     specifiers:
       '@alvarosabu/utils': ^2.2.0
       '@alvarosabu/utils': ^2.2.0
       '@histoire/plugin-vue': 0.11.7
       '@histoire/plugin-vue': 0.11.7
-      '@tresjs/cientos': workspace:^1.0.0
+      '@tresjs/cientos': workspace:^1.1.0
       '@types/three': ^0.146.0
       '@types/three': ^0.146.0
       '@vitejs/plugin-vue': ^3.2.0
       '@vitejs/plugin-vue': ^3.2.0
       '@vitest/coverage-c8': ^0.25.1
       '@vitest/coverage-c8': ^0.25.1