@vizejs/vite-plugin 0.434.0 → 0.439.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-CW8YdI0Y.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-Crqftsxh.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-BFLLSOo5.mjs";
1
+ import { n as rewriteStaticAssetUrls, t as vize } from "./plugin-BtoQBp_k.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-CW8YdI0Y.mjs";
1
+ import { f as ResolvedVizeConfig } from "../types-Crqftsxh.mjs";
2
2
  import { ResolvedConfig } from "vite";
3
3
 
4
4
  //#region src/internal/config-bridge.d.ts
@@ -368,6 +368,34 @@ var MappedModule = class {
368
368
  }
369
369
  };
370
370
  //#endregion
371
+ //#region src/utils/component-output.ts
372
+ /** Assemble the compiler's component export before CSS and HMR decoration. */
373
+ function assembleComponentOutput(compiled) {
374
+ const emitted = new MappedModule(compiled.code, parseSourceMap(compiled.map));
375
+ const moduleInfo = compiled.moduleShape ?? analyzeModuleOutput(emitted.code);
376
+ const hasExportDefault = moduleInfo.hasDefaultExport;
377
+ const hasNamedRenderExport = moduleInfo.hasNamedRenderExport;
378
+ const hasNamedSsrRenderExport = moduleInfo.hasNamedSsrRenderExport;
379
+ const hasSfcMainDefined = moduleInfo.hasSfcMainDefined;
380
+ if (hasExportDefault && !hasSfcMainDefined) {
381
+ emitted.edit(rewriteDefaultExportToSfcMain(emitted.code, moduleInfo));
382
+ if (compiled.hasScoped && compiled.scopeId) emitted.edit(`${emitted.code}\n_sfc_main.__scopeId = "data-v-${compiled.scopeId}";`);
383
+ emitted.edit(`${emitted.code}\nexport default _sfc_main;`);
384
+ } else if (hasExportDefault && hasSfcMainDefined) {
385
+ if (compiled.hasScoped && compiled.scopeId) emitted.edit(insertBeforeSfcMainDefaultExport(emitted.code, `_sfc_main.__scopeId = "data-v-${compiled.scopeId}";`, { moduleInfo }));
386
+ } else if (!hasExportDefault && !hasSfcMainDefined && hasNamedRenderExport) {
387
+ const scope = compiled.hasScoped && compiled.scopeId ? `, __scopeId: "data-v-${compiled.scopeId}"` : "";
388
+ emitted.edit(`${emitted.code}\nconst _sfc_main = { render${scope} };\nexport default _sfc_main;`);
389
+ } else if (!hasExportDefault && !hasSfcMainDefined && hasNamedSsrRenderExport) {
390
+ const scope = compiled.hasScoped && compiled.scopeId ? `, __scopeId: "data-v-${compiled.scopeId}"` : "";
391
+ emitted.edit(`${emitted.code}\nconst _sfc_main = { ssrRender${scope} };\nexport default _sfc_main;`);
392
+ }
393
+ return {
394
+ emitted,
395
+ hasExportDefault
396
+ };
397
+ }
398
+ //#endregion
371
399
  //#region src/plugin/style-request.ts
372
400
  const STYLE_MARKER = ".__vize_style_";
373
401
  /** Keep the CSS extension in the path, outside Vue/Nuxt's query metadata. */
@@ -621,25 +649,7 @@ function generateOutput(compiled, options) {
621
649
  */
622
650
  function generateOutputWithMap(compiled, options) {
623
651
  const { customElement, isProduction, isDev, ssr, hmrUpdateType, extractCss, filePath } = options;
624
- const emitted = new MappedModule(compiled.code, parseSourceMap(compiled.map));
625
- const moduleInfo = compiled.moduleShape ?? analyzeModuleOutput(emitted.code);
626
- const hasExportDefault = moduleInfo.hasDefaultExport;
627
- const hasNamedRenderExport = moduleInfo.hasNamedRenderExport;
628
- const hasNamedSsrRenderExport = moduleInfo.hasNamedSsrRenderExport;
629
- const hasSfcMainDefined = moduleInfo.hasSfcMainDefined;
630
- if (hasExportDefault && !hasSfcMainDefined) {
631
- emitted.edit(rewriteDefaultExportToSfcMain(emitted.code, moduleInfo));
632
- if (compiled.hasScoped && compiled.scopeId) emitted.edit(`${emitted.code}\n_sfc_main.__scopeId = "data-v-${compiled.scopeId}";`);
633
- emitted.edit(`${emitted.code}\nexport default _sfc_main;`);
634
- } else if (hasExportDefault && hasSfcMainDefined) {
635
- if (compiled.hasScoped && compiled.scopeId) emitted.edit(insertBeforeSfcMainDefaultExport(emitted.code, `_sfc_main.__scopeId = "data-v-${compiled.scopeId}";`, { moduleInfo }));
636
- } else if (!hasExportDefault && !hasSfcMainDefined && hasNamedRenderExport) {
637
- const scope = compiled.hasScoped && compiled.scopeId ? `, __scopeId: "data-v-${compiled.scopeId}"` : "";
638
- emitted.edit(`${emitted.code}\nconst _sfc_main = { render${scope} };\nexport default _sfc_main;`);
639
- } else if (!hasExportDefault && !hasSfcMainDefined && hasNamedSsrRenderExport) {
640
- const scope = compiled.hasScoped && compiled.scopeId ? `, __scopeId: "data-v-${compiled.scopeId}"` : "";
641
- emitted.edit(`${emitted.code}\nconst _sfc_main = { ssrRender${scope} };\nexport default _sfc_main;`);
642
- }
652
+ const { emitted, hasExportDefault } = assembleComponentOutput(compiled);
643
653
  if (usesStyleImports(compiled, options)) {
644
654
  const styleImports = [];
645
655
  const cssModuleImports = [];
@@ -0,0 +1,2 @@
1
+ import { t as vize } from "./plugin-BtoQBp_k.mjs";
2
+ export { vize };
@@ -225,6 +225,9 @@ interface LinterConfig {
225
225
  };
226
226
  }
227
227
  interface LintRuleOptions {
228
+ "script/define-props-destructuring"?: {
229
+ destructure?: "only-when-assigned" | "always" | "never";
230
+ };
228
231
  "html/no-empty-palpable-content"?: {
229
232
  contentDirectives?: string[];
230
233
  };
@@ -242,6 +245,8 @@ interface LintRuleOptions {
242
245
  "script/no-restricted-members"?: NoRestrictedMembersOptions;
243
246
  "vue/component-name-in-template-casing"?: {
244
247
  casing?: "PascalCase" | "kebab-case";
248
+ registeredComponentsOnly?: boolean;
249
+ globals?: string[];
245
250
  };
246
251
  "script/custom-event-name-casing"?: {
247
252
  casing?: "camelCase" | "kebab-case";
@@ -249,6 +254,9 @@ interface LintRuleOptions {
249
254
  "vue/no-mutating-props"?: {
250
255
  shallowOnly?: boolean;
251
256
  };
257
+ "vue/require-component-registration"?: {
258
+ globals?: string[];
259
+ };
252
260
  "vue/sfc-element-order"?: {
253
261
  order?: (string | string[])[];
254
262
  };
@@ -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-CW8YdI0Y.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-Crqftsxh.mjs";
2
2
  import { ConfigEnv, UserConfig, defineConfig as defineConfig$1 } from "vite-plus";
3
3
 
4
4
  //#region src/vite-plus/types.d.ts
@@ -326,7 +326,7 @@ function defineConfig(config = {}, integration = {}) {
326
326
  const { options } = metadata;
327
327
  const plugins = compiler === false ? [...vp.plugins ?? []] : await withoutVueCompiler(vp.plugins ?? []);
328
328
  if (compiler !== false) {
329
- const { vize } = await import("./plugin-C8JA-lhE.mjs");
329
+ const { vize } = await import("./plugin-vVIKbM_1.mjs");
330
330
  plugins.push(vize({
331
331
  ...compiler,
332
332
  configMode: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.434.0",
3
+ "version": "0.439.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -51,13 +51,13 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@vizejs/native": "0.434.0",
55
- "@vizejs/unplugin": "0.434.0",
54
+ "@vizejs/native": "0.439.0",
55
+ "@vizejs/unplugin": "0.439.0",
56
56
  "jsonc-parser": "^3.3.1",
57
57
  "oxc-parser": "0.144.0",
58
58
  "picomatch": "4.0.5",
59
59
  "tinyglobby": "0.2.17",
60
- "vize": "0.434.0"
60
+ "vize": "0.439.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "25.9.2",
@@ -92,6 +92,6 @@
92
92
  "fmt": "vp fmt --write src vite.config.ts",
93
93
  "test": "node scripts/run-tests.mjs",
94
94
  "test:prepared": "node scripts/run-tests.mjs --require-prepared && node src/test.ts && node --test src/vite-plus/*.test.ts",
95
- "test:types:real-vite": "vp exec node type-tests/plugin-vue/check.mjs"
95
+ "test:types:real-vite": "vp exec node type-tests/plugin-vue/check.ts"
96
96
  }
97
97
  }
@@ -1,2 +0,0 @@
1
- import { t as vize } from "./plugin-BFLLSOo5.mjs";
2
- export { vize };