@vizejs/vite-plugin 0.426.3 → 0.427.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
@@ -1,4 +1,4 @@
1
- import { a as VizeInspectorLintPlanProvider, c as VizeCompatibilityOptions, d as LoadConfigOptions, f as ResolvedVizeConfig, i as VizeVueFeatures, l as VizeVueVersion, m as UserConfigExport, n as CompiledModule, o as VizeInspectorLintPlanRequest, r as MacroArtifact, s as VizeInspectorOptions, t as VizeOptions, u as ConfigEnv, y as VizeConfig } from "./types-Duz3ywkM.mjs";
1
+ import { a as VizeInspectorLintPlanProvider, c as VizeCompatibilityOptions, d as LoadConfigOptions, f as ResolvedVizeConfig, i as VizeVueFeatures, l as VizeVueVersion, m as UserConfigExport, n as CompiledModule, o as VizeInspectorLintPlanRequest, r as MacroArtifact, s as VizeInspectorOptions, t as VizeOptions, u as ConfigEnv, y as VizeConfig } from "./types-BSmJ5UMW.mjs";
2
2
  import { Plugin } from "vite";
3
3
 
4
4
  //#region src/virtual.d.ts
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as rewriteStaticAssetUrls, t as vize } from "./plugin-CSd18fx0.mjs";
1
+ import { n as rewriteStaticAssetUrls, t as vize } from "./plugin-CkmrBDhz.mjs";
2
2
  import { a as vizeConfigStore, i as resolveConfigExport, n as defineConfig, r as loadConfig, t as VIZE_CONFIG_FILE_ENV } from "./config-PP6EAmWc.mjs";
3
3
  //#region src/index.ts
4
4
  const __internal = { rewriteStaticAssetUrls };
@@ -1,4 +1,4 @@
1
- import { f as ResolvedVizeConfig } from "../types-Duz3ywkM.mjs";
1
+ import { f as ResolvedVizeConfig } from "../types-BSmJ5UMW.mjs";
2
2
  import { ResolvedConfig } from "vite";
3
3
 
4
4
  //#region src/internal/config-bridge.d.ts
@@ -0,0 +1,2 @@
1
+ import { t as vize } from "./plugin-CkmrBDhz.mjs";
2
+ export { vize };
@@ -828,6 +828,7 @@ function getCompileOptionsForRequest(state, ssr) {
828
828
  vapor: !ssr && (state.mergedOptions?.vapor ?? false),
829
829
  customRenderer: state.mergedOptions?.customRenderer ?? false,
830
830
  templateSyntax: state.mergedOptions?.templateSyntax ?? "standard",
831
+ templateComments: !state.isProduction,
831
832
  ...resolvePluginVueCompileOptions(state.mergedOptions ?? {})
832
833
  };
833
834
  if (state.mergedOptions?.customElements !== void 0) options.customElements = state.mergedOptions.customElements;
@@ -2360,6 +2361,12 @@ async function resolveAliasedVueImport(ctx, state, id, importer, isSsrRequest, h
2360
2361
  }
2361
2362
  return null;
2362
2363
  }
2364
+ function resolvePackageVueModuleId(state, resolvedId, isSsrRequest, isDependencyScan) {
2365
+ const realPath = normalizeResolvedVuePath(resolvedId);
2366
+ if (!realPath || !state.cache.has(realPath) && !fs.existsSync(realPath)) return null;
2367
+ if (state.filter && !realPath.includes("node_modules") && !state.filter(realPath)) return null;
2368
+ return isDependencyScan ? realPath : toPluginVisibleVirtualId(realPath, isSsrRequest);
2369
+ }
2363
2370
  async function resolveIdHook(ctx, state, id, importer, options) {
2364
2371
  if (!isPotentialVizeResolveId(id) && !isPotentialVizeImporter(importer)) return null;
2365
2372
  const importerRequest = classifyImporterRequest(importer);
@@ -2433,9 +2440,10 @@ async function resolveIdHook(ctx, state, id, importer, options) {
2433
2440
  if (id.startsWith("#")) {
2434
2441
  try {
2435
2442
  const resolved = await resolveWithVite(ctx, state, id, cleanImporter, { skipSelf: true });
2436
- if (resolved) return resolved;
2443
+ if (resolved) return !resolved.external && id.endsWith(".vue") ? resolvePackageVueModuleId(state, resolved.id, isSsrRequest, isDependencyScan) ?? resolved : resolved;
2437
2444
  } catch {}
2438
- return resolvePackageJsonImportFromVizeImporter(state, id, cleanImporter);
2445
+ const fallback = resolvePackageJsonImportFromVizeImporter(state, id, cleanImporter);
2446
+ return fallback && id.endsWith(".vue") ? resolvePackageVueModuleId(state, fallback, isSsrRequest, isDependencyScan) ?? fallback : fallback;
2439
2447
  }
2440
2448
  if (!id.endsWith(".vue")) {
2441
2449
  const ssrExternalVueRequest = isSsrRequest ? resolveSsrExternalVueRequest(id) : null;
@@ -45,6 +45,7 @@ interface VizeConfig {
45
45
  lsp?: LanguageServerConfig;
46
46
  musea?: MuseaConfig;
47
47
  globalTypes?: GlobalTypesConfig;
48
+ lib?: LibConfig;
48
49
  /**
49
50
  * Scoped config entries for monorepos and workspaces
50
51
  */
@@ -633,6 +634,42 @@ interface GlobalTypeDeclaration {
633
634
  */
634
635
  defaultValue?: string;
635
636
  }
637
+ /**
638
+ * vize lib source distribution options; paths are relative to the config file
639
+ */
640
+ interface LibConfig {
641
+ /**
642
+ * Destination for every registry kind unless a kind-specific directory is set
643
+ */
644
+ dir?: string;
645
+ /**
646
+ * Destination for @vizejs/ui items (default: src/components/vize)
647
+ */
648
+ uiDir?: string;
649
+ /**
650
+ * Destination for @vizejs/composable items (default: src/composables/vize)
651
+ */
652
+ composableDir?: string;
653
+ /**
654
+ * Lockfile path (default: vize-lib.lock.json)
655
+ */
656
+ lockfile?: string;
657
+ /**
658
+ * Third-party registries by @namespace, pulled as @namespace/<item>
659
+ */
660
+ registries?: {
661
+ [k: string]: string | {
662
+ /**
663
+ * Path to a registry, npm:<package>[@range], or an https:// URL of a registry.json
664
+ */
665
+ source: string;
666
+ /**
667
+ * Destination directory for this namespace's items
668
+ */
669
+ dir?: string;
670
+ };
671
+ };
672
+ }
636
673
  /**
637
674
  * Scoped Vize config entry for monorepos and workspaces
638
675
  */
@@ -1,4 +1,4 @@
1
- import { _ as LinterConfig, g as FormatterConfig, h as CompilerConfig, m as UserConfigExport, p as UserConfig$1, t as VizeOptions, v as TypeCheckerConfig } from "./types-Duz3ywkM.mjs";
1
+ import { _ as LinterConfig, g as FormatterConfig, h as CompilerConfig, m as UserConfigExport, p as UserConfig$1, t as VizeOptions, v as TypeCheckerConfig } from "./types-BSmJ5UMW.mjs";
2
2
  import { ConfigEnv, UserConfig, defineConfig as defineConfig$1 } from "vite-plus";
3
3
 
4
4
  //#region src/vite-plus/types.d.ts
@@ -321,7 +321,7 @@ function defineConfig(config = {}, integration = {}) {
321
321
  const { options } = metadata;
322
322
  const plugins = compiler === false ? [...vp.plugins ?? []] : await withoutVueCompiler(vp.plugins ?? []);
323
323
  if (compiler !== false) {
324
- const { vize } = await import("./plugin-CXOiac2F.mjs");
324
+ const { vize } = await import("./plugin-BZN9h1bb.mjs");
325
325
  plugins.unshift(vize({
326
326
  ...compiler,
327
327
  configMode: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.426.3",
3
+ "version": "0.427.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -51,12 +51,12 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@vizejs/native": "0.426.3",
55
- "@vizejs/unplugin": "0.426.3",
54
+ "@vizejs/native": "0.427.0",
55
+ "@vizejs/unplugin": "0.427.0",
56
56
  "jsonc-parser": "^3.3.1",
57
57
  "oxc-parser": "0.144.0",
58
58
  "tinyglobby": "0.2.17",
59
- "vize": "0.426.3"
59
+ "vize": "0.427.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/node": "25.9.2",
@@ -1,2 +0,0 @@
1
- import { t as vize } from "./plugin-CSd18fx0.mjs";
2
- export { vize };