@vizejs/vite-plugin 0.76.0 → 0.78.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
@@ -95,7 +95,7 @@ interface VitePluginConfig {
95
95
  }
96
96
  //#endregion
97
97
  //#region ../vize/src/types/rules.d.ts
98
- declare const LINT_RULE_NAMES: readonly ["a11y/alt-text", "a11y/anchor-has-content", "a11y/anchor-is-valid", "a11y/aria-props", "a11y/aria-role", "a11y/aria-unsupported-elements", "a11y/click-events-have-key-events", "a11y/form-control-has-label", "a11y/heading-has-content", "a11y/heading-levels", "a11y/iframe-has-title", "a11y/img-alt", "a11y/interactive-supports-focus", "a11y/label-has-for", "a11y/landmark-roles", "a11y/media-has-caption", "a11y/mouse-events-have-key-events", "a11y/no-access-key", "a11y/no-aria-hidden-on-focusable", "a11y/no-autofocus", "a11y/no-distracting-elements", "a11y/no-i-for-icon", "a11y/no-redundant-roles", "a11y/no-refer-to-non-existent-id", "a11y/no-role-presentation-on-focusable", "a11y/no-static-element-interactions", "a11y/placeholder-label-option", "a11y/role-has-required-aria-props", "a11y/tabindex-no-positive", "a11y/use-list", "html/deprecated-attr", "html/deprecated-element", "html/id-duplication", "html/no-consecutive-br", "html/no-duplicate-dt", "html/no-empty-palpable-content", "html/require-datetime", "script/no-get-current-instance", "script/no-next-tick", "script/no-options-api", "ssr/no-browser-globals-in-ssr", "ssr/no-hydration-mismatch", "type/no-floating-promises", "type/no-unsafe-template-binding", "type/require-typed-emits", "type/require-typed-props", "vapor/no-inline-template", "vapor/no-suspense", "vapor/no-vue-lifecycle-events", "vapor/prefer-static-class", "vapor/require-vapor-attribute", "vue/attribute-hyphenation", "vue/attribute-order", "vue/component-definition-name-casing", "vue/component-name-in-template-casing", "vue/html-quotes", "vue/html-self-closing", "vue/multi-word-component-names", "vue/mustache-interpolation-spacing", "vue/no-boolean-attr-value", "vue/no-child-content", "vue/no-dupe-v-else-if", "vue/no-duplicate-attributes", "vue/no-inline-style", "vue/no-lone-template", "vue/no-multi-spaces", "vue/no-mutating-props", "vue/no-preprocessor-lang", "vue/no-reserved-component-names", "vue/no-script-non-standard-lang", "vue/no-src-attribute", "vue/no-template-key", "vue/no-template-lang", "vue/no-template-shadow", "vue/no-textarea-mustache", "vue/no-unsafe-url", "vue/no-unused-components", "vue/no-unused-properties", "vue/no-unused-vars", "vue/no-use-v-if-with-v-for", "vue/no-useless-template-attributes", "vue/no-v-html", "vue/no-v-text-v-html-on-component", "vue/permitted-contents", "vue/prefer-props-shorthand", "vue/prop-name-casing", "vue/require-component-is", "vue/require-component-registration", "vue/require-scoped-style", "vue/require-v-for-key", "vue/scoped-event-names", "vue/sfc-element-order", "vue/single-style-block", "vue/use-unique-element-ids", "vue/use-v-on-exact", "vue/v-bind-style", "vue/v-on-style", "vue/v-slot-style", "vue/valid-attribute-name", "vue/valid-v-bind", "vue/valid-v-else", "vue/valid-v-for", "vue/valid-v-if", "vue/valid-v-memo", "vue/valid-v-model", "vue/valid-v-on", "vue/valid-v-show", "vue/valid-v-slot", "vue/warn-custom-block", "vue/warn-custom-directive"];
98
+ declare const LINT_RULE_NAMES: readonly ["a11y/alt-text", "a11y/anchor-has-content", "a11y/anchor-is-valid", "a11y/aria-props", "a11y/aria-role", "a11y/aria-unsupported-elements", "a11y/click-events-have-key-events", "a11y/form-control-has-label", "a11y/heading-has-content", "a11y/heading-levels", "a11y/iframe-has-title", "a11y/img-alt", "a11y/interactive-supports-focus", "a11y/label-has-for", "a11y/landmark-roles", "a11y/media-has-caption", "a11y/mouse-events-have-key-events", "a11y/no-access-key", "a11y/no-aria-hidden-on-focusable", "a11y/no-autofocus", "a11y/no-distracting-elements", "a11y/no-i-for-icon", "a11y/no-redundant-roles", "a11y/no-refer-to-non-existent-id", "a11y/no-role-presentation-on-focusable", "a11y/no-static-element-interactions", "a11y/placeholder-label-option", "a11y/role-has-required-aria-props", "a11y/tabindex-no-positive", "a11y/use-list", "html/deprecated-attr", "html/deprecated-element", "html/id-duplication", "html/no-consecutive-br", "html/no-duplicate-dt", "html/no-empty-palpable-content", "html/require-datetime", "script/no-get-current-instance", "script/no-next-tick", "script/no-options-api", "ssr/no-browser-globals-in-ssr", "ssr/no-hydration-mismatch", "type/no-floating-promises", "type/no-reactivity-loss", "type/no-unsafe-template-binding", "type/require-typed-emits", "type/require-typed-props", "vapor/no-inline-template", "vapor/no-vue-lifecycle-events", "vapor/prefer-static-class", "vapor/require-vapor-attribute", "vue/attribute-hyphenation", "vue/attribute-order", "vue/component-definition-name-casing", "vue/component-name-in-template-casing", "vue/html-quotes", "vue/html-self-closing", "vue/multi-word-component-names", "vue/mustache-interpolation-spacing", "vue/no-boolean-attr-value", "vue/no-child-content", "vue/no-dupe-v-else-if", "vue/no-duplicate-attributes", "vue/no-inline-style", "vue/no-lone-template", "vue/no-multi-spaces", "vue/no-mutating-props", "vue/no-preprocessor-lang", "vue/no-reserved-component-names", "vue/no-script-non-standard-lang", "vue/no-src-attribute", "vue/no-template-key", "vue/no-template-lang", "vue/no-template-shadow", "vue/no-textarea-mustache", "vue/no-unsafe-url", "vue/no-unused-components", "vue/no-unused-properties", "vue/no-unused-vars", "vue/no-use-v-if-with-v-for", "vue/no-useless-template-attributes", "vue/no-v-html", "vue/no-v-text-v-html-on-component", "vue/permitted-contents", "vue/prefer-props-shorthand", "vue/prop-name-casing", "vue/require-component-is", "vue/require-component-registration", "vue/require-scoped-style", "vue/require-v-for-key", "vue/scoped-event-names", "vue/sfc-element-order", "vue/single-style-block", "vue/use-unique-element-ids", "vue/use-v-on-exact", "vue/v-bind-style", "vue/v-on-style", "vue/v-slot-style", "vue/valid-attribute-name", "vue/valid-v-bind", "vue/valid-v-else", "vue/valid-v-for", "vue/valid-v-if", "vue/valid-v-memo", "vue/valid-v-model", "vue/valid-v-on", "vue/valid-v-show", "vue/valid-v-slot", "vue/warn-custom-block", "vue/warn-custom-directive"];
99
99
  type LintRuleName = (typeof LINT_RULE_NAMES)[number];
100
100
  type LintRulesConfig = Partial<Record<LintRuleName, RuleSeverity>>;
101
101
  //#endregion
package/dist/index.mjs CHANGED
@@ -870,6 +870,9 @@ function hasMacroQuery$1(id) {
870
870
  function isMacroVirtualId(id) {
871
871
  return id.startsWith("\0") && (hasMacroQuery$1(id) || hasQueryParam$1(id, "definePage"));
872
872
  }
873
+ function isVueSfcPath$1(id) {
874
+ return (id.split("?")[0] ?? id).endsWith(".vue");
875
+ }
873
876
  function normalizeRequireBase(importer) {
874
877
  if (!importer) return null;
875
878
  let normalized = importer;
@@ -930,7 +933,7 @@ async function resolveIdHook(ctx, state, id, importer, options) {
930
933
  }
931
934
  if (id === "virtual:vize-styles") return RESOLVED_CSS_MODULE;
932
935
  if (isBuild && id.startsWith("/@fs/")) return normalizeFsIdForBuild(id);
933
- if (hasMacroQuery$1(id) || hasQueryParam$1(id, "definePage")) {
936
+ if ((hasMacroQuery$1(id) || hasQueryParam$1(id, "definePage")) && isVueSfcPath$1(id)) {
934
937
  const filePath = id.split("?")[0];
935
938
  const querySuffix = id.slice(id.indexOf("?"));
936
939
  const resolved = resolveVuePath(state, filePath, importer);
@@ -1094,6 +1097,9 @@ function hasMacroQuery(id) {
1094
1097
  function normalizeMacroRealPath(realPath) {
1095
1098
  return realPath.endsWith(".vue.ts") ? realPath.slice(0, -3) : realPath;
1096
1099
  }
1100
+ function isVueSfcPath(realPath) {
1101
+ return normalizeMacroRealPath(realPath).endsWith(".vue");
1102
+ }
1097
1103
  function stripVirtualQuery(id) {
1098
1104
  return normalizeMacroRealPath(id.slice(1).split("?")[0] ?? "");
1099
1105
  }
@@ -1160,22 +1166,27 @@ function loadHook(state, id, loadOptions) {
1160
1166
  if (fallbackCompiled?.css) return resolveCssImports(fallbackCompiled.css, realPath, state.cssAliasRules, state.server !== null, currentBase);
1161
1167
  return "";
1162
1168
  }
1163
- if (id.startsWith("\0") && hasQueryParam(id, "definePage")) return loadDefinePageArtifact(state, stripVirtualQuery(id), !!loadOptions?.ssr);
1169
+ if (id.startsWith("\0") && hasQueryParam(id, "definePage")) {
1170
+ const realPath = stripVirtualQuery(id);
1171
+ if (isVueSfcPath(realPath)) return loadDefinePageArtifact(state, realPath, !!loadOptions?.ssr);
1172
+ }
1164
1173
  if (id.startsWith("\0") && hasMacroQuery(id)) {
1165
1174
  const realPath = stripVirtualQuery(id);
1166
- const artifactLoad = loadDefinePageMetaArtifact(state, realPath, !!loadOptions?.ssr);
1167
- if (artifactLoad) return artifactLoad;
1168
- if (fs.existsSync(realPath)) {
1169
- const setupMatch = fs.readFileSync(realPath, "utf-8").match(/<script\s+setup[^>]*>([\s\S]*?)<\/script>/);
1170
- if (setupMatch) return {
1171
- code: `${setupMatch[1]}\nexport default {}`,
1175
+ if (isVueSfcPath(realPath)) {
1176
+ const artifactLoad = loadDefinePageMetaArtifact(state, realPath, !!loadOptions?.ssr);
1177
+ if (artifactLoad) return artifactLoad;
1178
+ if (fs.existsSync(realPath)) {
1179
+ const setupMatch = fs.readFileSync(realPath, "utf-8").match(/<script\s+setup[^>]*>([\s\S]*?)<\/script>/);
1180
+ if (setupMatch) return {
1181
+ code: `${setupMatch[1]}\nexport default {}`,
1182
+ map: null
1183
+ };
1184
+ }
1185
+ return {
1186
+ code: "export default {}",
1172
1187
  map: null
1173
1188
  };
1174
1189
  }
1175
- return {
1176
- code: "export default {}",
1177
- map: null
1178
- };
1179
1190
  }
1180
1191
  if (isVizeVirtual(id)) {
1181
1192
  const realPath = fromVirtualId(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.76.0",
3
+ "version": "0.78.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -33,9 +33,9 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@vizejs/native": "0.76.0",
36
+ "@vizejs/native": "0.78.0",
37
37
  "tinyglobby": "0.2.16",
38
- "vize": "0.76.0"
38
+ "vize": "0.78.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "25.6.0",