@tresjs/nuxt 5.7.3 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +15 -0
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_fonts/6CXtQpr9VY5Z0zV1xogwmkWDzNR_19zN1NTGulEzmjg-WsyCkc13ufsMs3cm56uQ4fvwXS2YPUb3L7cOLZvfois.woff2 +0 -0
  5. package/dist/client/_fonts/FPImowmXkU1aWgmKsxPu7Akj0JNowdsV90BaJJQN8Dw-_qeYdoJ8kBa8m_0pDNG5lMFFTm76zgepEPaYdhfBdgw.woff2 +0 -0
  6. package/dist/client/_fonts/Im8HkqQ00A1IGqihOqFViX4pj8D3DlxkfI6t6LTbZQg-3JNSbYiwmMn1RB5suLL0VGzoJApLUqf_ALWOPTEH2JQ.woff2 +0 -0
  7. package/dist/client/_fonts/UnngOpW3QUFmW9ustR7f4iJ6HMtsBQrF8MRey6Urw8M-NLYhj87XBE6Sdfvb51sIolb3qUQsPZcMN7G3N4RB7Cs.woff2 +0 -0
  8. package/dist/client/_fonts/bJM9t_QZ4-OukAilpAvXFzrpFWWgeGJ0mI4OoxeTBXA-RPbOMC4zT_xVhMHw_4HWh8SQTWy5dCdDQaT_u2VSsA8.woff2 +0 -0
  9. package/dist/client/_fonts/j2DQVh5iMWeAm2MqpLd4MwbmjfUsIAMYOc7Un8-q1oQ-KPeqrtDe9S4tszkrjdzyjSMn6_0hOMXw03Bk_rTxmk8.woff2 +0 -0
  10. package/dist/client/_nuxt/builds/latest.json +1 -1
  11. package/dist/client/_nuxt/builds/meta/3c133056-4c36-45e1-b6d3-3f975e89de6f.json +1 -0
  12. package/dist/client/_nuxt/{entry.CLaUX4X2.css → entry.CxLioTJ9.css} +1 -1
  13. package/dist/client/favicon.svg +5 -0
  14. package/dist/client/index.html +1 -1
  15. package/dist/module.d.mts +8 -0
  16. package/dist/module.json +1 -1
  17. package/dist/module.mjs +91 -25
  18. package/dist/runtime/TresCanvasWebGPU.client.d.vue.ts +13 -0
  19. package/dist/runtime/TresCanvasWebGPU.client.vue +11 -0
  20. package/dist/runtime/TresCanvasWebGPU.client.vue.d.ts +13 -0
  21. package/dist/runtime/TresCanvasWebGPU.vue.d.ts +2 -0
  22. package/dist/runtime/webgpuStub.d.ts +5 -0
  23. package/dist/runtime/webgpuStub.js +11 -0
  24. package/package.json +24 -2
  25. package/dist/client/_fonts/6CXtQpr9VY5Z0zV1xogwmkWDzNR_19zN1NTGulEzmjg-kCRFKXhkCh0_kGLAckhVN3TP-F_bkwm7Ivy9TdKzUJg.woff2 +0 -0
  26. package/dist/client/_fonts/FPImowmXkU1aWgmKsxPu7Akj0JNowdsV90BaJJQN8Dw-_91jnewDEbv6Ft52Ae56infTiwcwq3HFAAhB_Y7h8Nw.woff2 +0 -0
  27. package/dist/client/_fonts/Im8HkqQ00A1IGqihOqFViX4pj8D3DlxkfI6t6LTbZQg-jR4Prvz_J7I8oA8oUj3_1pTizDgpRYIEI5b7BlHPneU.woff2 +0 -0
  28. package/dist/client/_fonts/UnngOpW3QUFmW9ustR7f4iJ6HMtsBQrF8MRey6Urw8M-bdAyUOEhdSN8LU65JRDWYqdkUIYhM59ZKeszsiAgtAI.woff2 +0 -0
  29. package/dist/client/_fonts/bJM9t_QZ4-OukAilpAvXFzrpFWWgeGJ0mI4OoxeTBXA-T1gZRQnm_CyPlHs2G7o5lSEBc3-0yjeDI6MJ5h7RFr8.woff2 +0 -0
  30. package/dist/client/_fonts/j2DQVh5iMWeAm2MqpLd4MwbmjfUsIAMYOc7Un8-q1oQ-5gkdZw7cVFs_x-rFm49rMnDT-AGGoIvy6_RxE2XbStA.woff2 +0 -0
  31. package/dist/client/_nuxt/builds/meta/15f8fab6-c2dd-4642-9ea9-0f83eba879d9.json +0 -1
  32. /package/dist/client/_nuxt/{BC5Izh9D.js → CMLeC7E3.js} +0 -0
@@ -0,0 +1,5 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <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"/>
3
+ <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"/>
4
+ <circle cx="16" cy="22" r="6" fill="#EFAC35"/>
5
+ </svg>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__tres_nuxt_devtools/_nuxt/BC5Izh9D.js"}}</script><link rel="stylesheet" href="/__tres_nuxt_devtools/_nuxt/entry.CLaUX4X2.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/BC5Izh9D.js"><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/B7oceTSY.js"><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/DlyN-BeH.js"><script type="module" src="/__tres_nuxt_devtools/_nuxt/BC5Izh9D.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__tres_nuxt_devtools/_nuxt/error-404.a_6S_W9T.css"><link rel="prefetch" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/7VW5Q03I.js"><link rel="prefetch" as="style" crossorigin href="/__tres_nuxt_devtools/_nuxt/error-500.0YBD5JWJ.css"><link rel="prefetch" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/d-7YrwQl.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__tres_nuxt_devtools",buildId:"15f8fab6-c2dd-4642-9ea9-0f83eba879d9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1791265574548,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__tres_nuxt_devtools/_nuxt/CMLeC7E3.js"}}</script><link rel="stylesheet" href="/__tres_nuxt_devtools/_nuxt/entry.CxLioTJ9.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/CMLeC7E3.js"><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/B7oceTSY.js"><link rel="modulepreload" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/DlyN-BeH.js"><script type="module" src="/__tres_nuxt_devtools/_nuxt/CMLeC7E3.js" crossorigin></script><link rel="prefetch" as="style" crossorigin href="/__tres_nuxt_devtools/_nuxt/error-404.a_6S_W9T.css"><link rel="prefetch" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/7VW5Q03I.js"><link rel="prefetch" as="style" crossorigin href="/__tres_nuxt_devtools/_nuxt/error-500.0YBD5JWJ.css"><link rel="prefetch" as="script" crossorigin href="/__tres_nuxt_devtools/_nuxt/d-7YrwQl.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__tres_nuxt_devtools",buildId:"3c133056-4c36-45e1-b6d3-3f975e89de6f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1793232229872,false]</script></body></html>
package/dist/module.d.mts CHANGED
@@ -1,9 +1,17 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
+ type TresRenderer = 'webgl' | 'webgpu';
4
+
3
5
  interface ModuleOptions {
4
6
  modules: string[];
5
7
  devtools: boolean;
6
8
  glsl: boolean;
9
+ /**
10
+ * The renderer that auto-imports target. `'webgpu'` imports from the `/webgpu` entries
11
+ * (`@tresjs/core/webgpu`, `@tresjs/cientos/webgpu`). It applies to the whole app.
12
+ * @default 'webgl'
13
+ */
14
+ renderer: TresRenderer;
7
15
  }
8
16
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
9
17
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "5.7.3",
7
+ "version": "5.8.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,22 +1,21 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { defineNuxtModule, createResolver, addImports, resolvePath, addComponent, addVitePlugin } from '@nuxt/kit';
3
- import * as core from '@tresjs/core';
1
+ import { defineNuxtModule, createResolver, useLogger, addImports, resolvePath, addComponent, addTemplate, addVitePlugin } from '@nuxt/kit';
4
2
  import { templateCompilerOptions } from '@tresjs/core';
5
3
  import { defu } from 'defu';
6
- import { findExportNames } from 'mlly';
7
4
  import { readPackageJSON } from 'pkg-types';
8
5
  import glsl from 'vite-plugin-glsl';
9
6
  import { existsSync } from 'node:fs';
10
7
  import { addCustomTab } from '@nuxt/devtools-kit';
8
+ import { readFile } from 'node:fs/promises';
9
+ import { findExportNames } from 'mlly';
11
10
  import { dirname, join } from 'node:path';
12
11
 
13
- const version = "5.7.3";
12
+ const version = "5.8.1";
14
13
 
15
14
  const DEVTOOLS_UI_ROUTE = "/__tres_nuxt_devtools";
16
15
  const DEVTOOLS_UI_LOCAL_PORT = 3300;
17
16
  function setupDevToolsUI(nuxt, resolver) {
18
17
  const clientPath = resolver.resolve("./client");
19
- const isProductionBuild = existsSync(clientPath);
18
+ const isProductionBuild = existsSync(resolver.resolve("./client/index.html"));
20
19
  if (isProductionBuild) {
21
20
  nuxt.hook("vite:serverCreated", async (server) => {
22
21
  const sirv = await import('sirv').then((r) => r.default || r);
@@ -40,7 +39,7 @@ function setupDevToolsUI(nuxt, resolver) {
40
39
  addCustomTab(() => ({
41
40
  name: "tres-nuxt-devtools",
42
41
  title: "TresJS",
43
- icon: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
42
+ icon: `${DEVTOOLS_UI_ROUTE}/favicon.svg`,
44
43
  view: {
45
44
  type: "iframe",
46
45
  src: DEVTOOLS_UI_ROUTE
@@ -48,6 +47,39 @@ function setupDevToolsUI(nuxt, resolver) {
48
47
  }));
49
48
  }
50
49
 
50
+ const WEBGL_ONLY_PACKAGES = ["@tresjs/post-processing"];
51
+ function coreEntry(renderer) {
52
+ return renderer === "webgpu" ? "@tresjs/core/webgpu" : "@tresjs/core";
53
+ }
54
+ function hasWebGPUEntry(pkg) {
55
+ return typeof pkg.exports === "object" && pkg.exports !== null && "./webgpu" in pkg.exports;
56
+ }
57
+ function selectEntry(mod, renderer, pkg) {
58
+ if (renderer === "webgl") {
59
+ return mod;
60
+ }
61
+ if (hasWebGPUEntry(pkg)) {
62
+ return `${mod}/webgpu`;
63
+ }
64
+ return WEBGL_ONLY_PACKAGES.includes(mod) ? null : mod;
65
+ }
66
+ async function readExportNames(entryPath) {
67
+ return findExportNames(await readFile(entryPath, "utf8"));
68
+ }
69
+ function isComponentExport(name) {
70
+ return /^[A-Z]/.test(name);
71
+ }
72
+ function findUnportedComponents(rootNames, webgpuNames) {
73
+ const ported = new Set(webgpuNames);
74
+ return rootNames.filter((name) => isComponentExport(name) && !ported.has(name));
75
+ }
76
+ function renderWebGPUStubs(runtimePath, stubs) {
77
+ return [
78
+ `import { createWebGPUStub } from ${JSON.stringify(runtimePath)}`,
79
+ ...stubs.map(({ name, from }) => `export const ${name} = /* #__PURE__ */ createWebGPUStub(${JSON.stringify(name)}, ${JSON.stringify(from)})`)
80
+ ].join("\n");
81
+ }
82
+
51
83
  async function getAllPackageDeps(nuxtRootDir) {
52
84
  const localPkg = await readPackageJSON(nuxtRootDir);
53
85
  let rootPkg = localPkg;
@@ -75,71 +107,105 @@ const module$1 = defineNuxtModule({
75
107
  defaults: {
76
108
  modules: [],
77
109
  devtools: true,
78
- glsl: false
110
+ glsl: false,
111
+ renderer: "webgl"
79
112
  },
80
113
  async setup(options, nuxt) {
81
114
  const resolver = createResolver(import.meta.url);
115
+ const logger = useLogger("@tresjs/nuxt");
116
+ const isWebGPU = options.renderer === "webgpu";
117
+ const coreEntryId = coreEntry(options.renderer);
82
118
  nuxt.options.build.transpile.push(/@tresjs/);
83
- for (const name in core) {
119
+ const coreNames = await readExportNames(await resolver.resolvePath(coreEntryId));
120
+ for (const name of coreNames) {
84
121
  if (name.match(/^use/)) {
85
122
  addImports({
86
- from: "@tresjs/core",
123
+ from: coreEntryId,
87
124
  name
88
125
  });
89
126
  }
90
127
  }
91
128
  addImports([
92
129
  {
93
- from: "@tresjs/core",
130
+ from: coreEntryId,
94
131
  name: "extend",
95
132
  as: "extendTres"
96
133
  },
97
134
  {
98
- from: "@tresjs/core",
135
+ from: coreEntryId,
99
136
  type: true,
100
137
  name: "TresObject"
101
138
  }
102
139
  ]);
103
140
  nuxt.hook("prepare:types", ({ references }) => {
104
- references.push({ types: "@tresjs/core" });
141
+ references.push({ types: coreEntryId });
105
142
  });
106
143
  nuxt.options.vue.compilerOptions.isCustomElement = templateCompilerOptions.template.compilerOptions.isCustomElement;
107
144
  const allDeps = await getAllPackageDeps(nuxt.options.rootDir);
108
145
  const coreDeps = Object.keys(allDeps).filter((d) => d.startsWith("@tresjs/"));
146
+ const webgpuStubs = [];
109
147
  for (const mod of /* @__PURE__ */ new Set([...options.modules, ...coreDeps])) {
110
148
  if (mod === "@tresjs/core" || mod === "@tresjs/nuxt") {
111
149
  continue;
112
150
  }
113
- const entry = await resolvePath(mod);
114
- if (entry === mod) {
151
+ const rootEntry = await resolvePath(mod);
152
+ if (rootEntry === mod) {
153
+ continue;
154
+ }
155
+ const entryId = selectEntry(mod, options.renderer, await readPackageJSON(rootEntry));
156
+ if (!entryId) {
157
+ logger.warn(`\`${mod}\` has no WebGPU entry yet, so it is not auto-imported with \`renderer: 'webgpu'\`.`);
158
+ continue;
159
+ }
160
+ const entryPath = entryId === mod ? rootEntry : await resolvePath(entryId);
161
+ if (!existsSync(entryPath)) {
162
+ logger.warn(`Cannot find the \`${entryId}\` build (${entryPath}), so \`${mod}\` is not auto-imported. Rebuild \`${mod}\`.`);
115
163
  continue;
116
164
  }
117
- const imports = findExportNames(await readFile(entry, "utf8"));
165
+ const imports = await readExportNames(entryPath);
118
166
  for (const name of imports) {
119
- if (name.match(/^[a-z]/)) {
120
- addImports({
121
- from: mod,
122
- name
123
- });
124
- } else {
167
+ if (isComponentExport(name)) {
125
168
  addComponent({
126
169
  name,
127
- filePath: mod,
170
+ filePath: entryId,
128
171
  export: name
129
172
  });
173
+ } else {
174
+ addImports({
175
+ from: entryId,
176
+ name
177
+ });
130
178
  }
131
179
  }
180
+ if (entryId !== mod) {
181
+ const unported = findUnportedComponents(await readExportNames(rootEntry), imports);
182
+ webgpuStubs.push(...unported.map((name) => ({ name, from: mod })));
183
+ }
184
+ }
185
+ if (webgpuStubs.length) {
186
+ const stubsTemplate = addTemplate({
187
+ filename: "tres/webgpu-stubs.mjs",
188
+ getContents: () => renderWebGPUStubs(resolver.resolve("./runtime/webgpuStub"), webgpuStubs),
189
+ write: true
190
+ });
191
+ for (const { name } of webgpuStubs) {
192
+ addComponent({
193
+ name,
194
+ filePath: stubsTemplate.dst,
195
+ export: name
196
+ });
197
+ }
132
198
  }
133
199
  nuxt.options.vite.resolve = defu(nuxt.options.vite.resolve, {
134
200
  dedupe: ["three"]
135
201
  });
136
202
  nuxt.options.vite.optimizeDeps = defu(nuxt.options.vite.optimizeDeps, {
137
- include: ["three"]
203
+ include: isWebGPU ? ["three", "three/webgpu", "three/tsl"] : ["three"]
138
204
  });
139
205
  await Promise.all([
140
206
  addComponent({
141
207
  name: "TresCanvas",
142
- filePath: resolver.resolve("./runtime/TresCanvas.client.vue")
208
+ filePath: resolver.resolve(isWebGPU ? "./runtime/TresCanvasWebGPU.client.vue" : "./runtime/TresCanvas.client.vue")
143
209
  }),
144
210
  addComponent({
145
211
  name: "TresCanvas",
@@ -0,0 +1,13 @@
1
+ declare var __VLS_8: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,11 @@
1
+ <script setup>
2
+ import { useAttrs } from "#imports";
3
+ import { TresCanvas as CoreTresCanvas } from "@tresjs/core/webgpu";
4
+ const attrs = useAttrs();
5
+ </script>
6
+
7
+ <template>
8
+ <CoreTresCanvas v-bind="attrs">
9
+ <slot />
10
+ </CoreTresCanvas>
11
+ </template>
@@ -0,0 +1,13 @@
1
+ declare var __VLS_8: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,2 @@
1
+ const _default: typeof import('@tresjs/core/webgpu')['TresCanvas']
2
+ export default _default
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Stands in for a component that has no WebGPU version yet. Without it, auto-imports only
3
+ * give Vue's generic "Failed to resolve component" warning.
4
+ */
5
+ export declare function createWebGPUStub(name: string, from: string): import("vue").DefineComponent<{}, never, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,11 @@
1
+ import { defineComponent } from "vue";
2
+ export function createWebGPUStub(name, from) {
3
+ return defineComponent({
4
+ name,
5
+ setup() {
6
+ throw new Error(
7
+ `[@tresjs/nuxt] \`${name}\` from ${from} is not available for WebGPU yet. Use it with \`tres: { renderer: 'webgl' }\`, or remove it from this scene.`
8
+ );
9
+ }
10
+ });
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tresjs/nuxt",
3
3
  "type": "module",
4
- "version": "5.7.3",
4
+ "version": "5.8.1",
5
5
  "description": "TresJS integration for Nuxt.",
6
6
  "author": "Daniel Roe (https://github.com/danielroe/)",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "pkg-types": "^2.3.2",
48
48
  "sirv": "^3.0.2",
49
49
  "vite-plugin-glsl": "^1.6.1",
50
- "@tresjs/core": "5.9.3"
50
+ "@tresjs/core": "5.10.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@nuxt/devtools": "^3.2.4",
@@ -88,6 +88,27 @@
88
88
  "@nuxt/devtools-kit"
89
89
  ]
90
90
  },
91
+ "nx": {
92
+ "targets": {
93
+ "build": {
94
+ "outputs": [
95
+ "{projectRoot}/dist",
96
+ "{projectRoot}/.nuxt"
97
+ ]
98
+ },
99
+ "test:ci": {
100
+ "dependsOn": [
101
+ "^build",
102
+ {
103
+ "projects": [
104
+ "@tresjs/cientos"
105
+ ],
106
+ "target": "build"
107
+ }
108
+ ]
109
+ }
110
+ }
111
+ },
91
112
  "scripts": {
92
113
  "build": "pnpm run module:build && pnpm run client:build",
93
114
  "module:build": "nuxt-module-build prepare && nuxt-module-build build",
@@ -99,6 +120,7 @@
99
120
  "lint": "eslint .",
100
121
  "lint:fix": "eslint . --fix",
101
122
  "test": "vitest run",
123
+ "test:ci": "vitest run",
102
124
  "test:watch": "vitest watch"
103
125
  }
104
126
  }
@@ -1 +0,0 @@
1
- {"id":"15f8fab6-c2dd-4642-9ea9-0f83eba879d9","timestamp":1791265567598,"prerendered":[]}
File without changes