@vizejs/nuxt 0.206.0 → 0.210.0

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.
package/dist/index.d.mts CHANGED
@@ -53,6 +53,11 @@ interface VizeNuxtCompilerOptions {
53
53
  sourceMap?: boolean;
54
54
  /** Enable Vapor mode compilation. */
55
55
  vapor?: boolean;
56
+ /**
57
+ * Default output mode for `.jsx`/`.tsx` components without a `"use vue:*"`
58
+ * directive (forwarded to the underlying Vize plugin). @default "vdom"
59
+ */
60
+ jsxMode?: "vdom" | "vapor";
56
61
  /** Treat lowercase non-HTML tags as custom renderer elements. */
57
62
  customRenderer?: boolean;
58
63
  /** Template syntax compatibility mode. */
package/dist/index.mjs CHANGED
@@ -430,6 +430,28 @@ function isVizeGeneratedVueModuleId(id) {
430
430
  else if (normalized.startsWith("__x00__")) normalized = normalized.slice(7);
431
431
  return /\.vue\.ts(?:\?|$)/.test(normalized);
432
432
  }
433
+ /**
434
+ * Recognize raw `.jsx`/`.tsx` Vue component modules compiled by Vize.
435
+ *
436
+ * Unlike `.vue` files, JSX/TSX modules are transformed in place by the
437
+ * underlying Vite plugin (the original `.jsx`/`.tsx` id is preserved, no
438
+ * `\0`-prefixed `.vue.ts` virtual id is created). Nuxt's auto-import,
439
+ * component, and i18n transforms still need to run on these modules, so the
440
+ * Nuxt transform bridge keys off this predicate in addition to
441
+ * `isVizeGeneratedVueModuleId`.
442
+ *
443
+ * A bare query suffix (e.g. `?vue`) is ignored so dev-server requests still
444
+ * match, but `?raw`/`?url`/`?worker` asset imports are rejected since those
445
+ * are not compiled component modules.
446
+ */
447
+ function isVizeJsxModuleId(id) {
448
+ const queryIndex = id.indexOf("?");
449
+ const pathPart = queryIndex === -1 ? id : id.slice(0, queryIndex);
450
+ if (!/\.(?:jsx|tsx)$/.test(pathPart)) return false;
451
+ if (queryIndex === -1) return true;
452
+ const params = new URLSearchParams(id.slice(queryIndex + 1));
453
+ return !(params.has("raw") || params.has("url") || params.has("worker") || params.has("sharedworker"));
454
+ }
433
455
  function normalizeVizeVirtualVueModuleId(id) {
434
456
  return (id.startsWith("\0vize-ssr:") ? id.slice(10) : id.slice(1)).replace(/\.ts(?=\?|$)/, "");
435
457
  }
@@ -888,7 +910,7 @@ var src_default = defineNuxtModule({
888
910
  name: "vizejs:nuxt-transform-bridge",
889
911
  enforce: "post",
890
912
  async transform(code, id, ...args) {
891
- if (!isVizeGeneratedVueModuleId(id)) return;
913
+ if (!isVizeGeneratedVueModuleId(id) && !isVizeJsxModuleId(id)) return;
892
914
  let result = code;
893
915
  let changed = false;
894
916
  if (nuxtComponentResolver) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/nuxt",
3
- "version": "0.206.0",
3
+ "version": "0.210.0",
4
4
  "description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
5
5
  "keywords": [
6
6
  "compiler",
@@ -41,10 +41,10 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@nuxt/kit": "4.4.8",
44
- "@vizejs/musea-nuxt": "0.206.0",
45
- "@vizejs/vite-plugin": "0.206.0",
46
- "@vizejs/vite-plugin-musea": "0.206.0",
47
- "vize": "0.206.0"
44
+ "@vizejs/musea-nuxt": "0.210.0",
45
+ "@vizejs/vite-plugin": "0.210.0",
46
+ "@vizejs/vite-plugin-musea": "0.210.0",
47
+ "vize": "0.210.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "typescript": "6.0.3",