@vizejs/vite-plugin 0.49.0 → 0.58.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.49.0",
3
+ "version": "0.58.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -33,16 +33,15 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "tinyglobby": "^0.2.0",
37
- "vize": "0.49.0",
38
- "@vizejs/native": "0.49.0"
36
+ "@vizejs/native": "0.58.0",
37
+ "tinyglobby": "0.2.16",
38
+ "vize": "0.58.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/node": "^22.0.0",
42
- "tsx": "^4.21.0",
43
- "typescript": "~5.6.0",
44
- "vite": "npm:@voidzero-dev/vite-plus-core@latest",
45
- "vite-plus": "latest"
41
+ "@types/node": "25.6.0",
42
+ "typescript": "6.0.3",
43
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.19",
44
+ "vite-plus": "0.1.19"
46
45
  },
47
46
  "peerDependencies": {
48
47
  "vite": "^8.0.0"
@@ -53,6 +52,6 @@
53
52
  "check": "vp check src vite.config.ts",
54
53
  "check:fix": "vp check --fix src vite.config.ts",
55
54
  "fmt": "vp fmt --write src vite.config.ts",
56
- "test": "node --import tsx src/test.ts"
55
+ "test": "node src/test.ts"
57
56
  }
58
57
  }
package/dist/index.d.mts DELETED
@@ -1,558 +0,0 @@
1
- import { defineConfig, loadConfig } from "vize";
2
- import { Plugin } from "vite";
3
-
4
- //#region ../vize/src/types/compiler.d.ts
5
- /**
6
- * Compiler configuration
7
- */
8
- interface CompilerConfig {
9
- /**
10
- * Compilation mode
11
- * @default 'module'
12
- */
13
- mode?: "module" | "function";
14
- /**
15
- * Enable Vapor mode compilation
16
- * @default false
17
- */
18
- vapor?: boolean;
19
- /**
20
- * Enable SSR mode
21
- * @default false
22
- */
23
- ssr?: boolean;
24
- /**
25
- * Enable source map generation
26
- * @default true in development, false in production
27
- */
28
- sourceMap?: boolean;
29
- /**
30
- * Prefix template identifiers with _ctx
31
- * @default false
32
- */
33
- prefixIdentifiers?: boolean;
34
- /**
35
- * Hoist static nodes
36
- * @default true
37
- */
38
- hoistStatic?: boolean;
39
- /**
40
- * Cache v-on handlers
41
- * @default true
42
- */
43
- cacheHandlers?: boolean;
44
- /**
45
- * Enable TypeScript parsing in <script> blocks
46
- * @default true
47
- */
48
- isTs?: boolean;
49
- /**
50
- * Script file extension for generated output
51
- * @default 'ts'
52
- */
53
- scriptExt?: "ts" | "js";
54
- /**
55
- * Module name for runtime imports
56
- * @default 'vue'
57
- */
58
- runtimeModuleName?: string;
59
- /**
60
- * Global variable name for runtime (IIFE builds)
61
- * @default 'Vue'
62
- */
63
- runtimeGlobalName?: string;
64
- }
65
- /**
66
- * Vite plugin configuration
67
- */
68
- interface VitePluginConfig {
69
- /**
70
- * Files to include in compilation
71
- * @default /\.vue$/
72
- */
73
- include?: string | RegExp | (string | RegExp)[];
74
- /**
75
- * Files to exclude from compilation
76
- * @default /node_modules/
77
- */
78
- exclude?: string | RegExp | (string | RegExp)[];
79
- /**
80
- * Glob patterns to scan for .vue files during pre-compilation
81
- * @default ['**\/*.vue']
82
- */
83
- scanPatterns?: string[];
84
- /**
85
- * Glob patterns to ignore during pre-compilation
86
- * @default ['node_modules/**', 'dist/**', '.git/**']
87
- */
88
- ignorePatterns?: string[];
89
- }
90
- //#endregion
91
- //#region ../vize/src/types/rules.d.ts
92
- 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"];
93
- type LintRuleName = (typeof LINT_RULE_NAMES)[number];
94
- type LintRulesConfig = Partial<Record<LintRuleName, RuleSeverity>>;
95
- //#endregion
96
- //#region ../vize/src/types/tools.d.ts
97
- /**
98
- * Linter configuration
99
- */
100
- interface LinterConfig {
101
- /**
102
- * Enable linting
103
- */
104
- enabled?: boolean;
105
- /**
106
- * Built-in lint preset
107
- * @default 'happy-path'
108
- */
109
- preset?: LintPreset;
110
- /**
111
- * Rules to enable/disable
112
- */
113
- rules?: LintRulesConfig;
114
- /**
115
- * Category-level severity overrides
116
- */
117
- categories?: Partial<Record<RuleCategory, RuleSeverity>>;
118
- }
119
- /**
120
- * Type checker configuration
121
- */
122
- interface TypeCheckerConfig {
123
- /**
124
- * Enable type checking
125
- * @default false
126
- */
127
- enabled?: boolean;
128
- /**
129
- * Enable strict mode
130
- * @default false
131
- */
132
- strict?: boolean;
133
- /**
134
- * Check component props
135
- * @default true
136
- */
137
- checkProps?: boolean;
138
- /**
139
- * Check component emits
140
- * @default true
141
- */
142
- checkEmits?: boolean;
143
- /**
144
- * Check template bindings
145
- * @default true
146
- */
147
- checkTemplateBindings?: boolean;
148
- /**
149
- * Path to tsconfig.json
150
- * @default auto-detected
151
- */
152
- tsconfig?: string;
153
- /**
154
- * Path to the Corsa binary
155
- */
156
- corsaPath?: string;
157
- }
158
- /**
159
- * Formatter configuration
160
- */
161
- interface FormatterConfig {
162
- /**
163
- * Max line width
164
- * @default 80
165
- */
166
- printWidth?: number;
167
- /**
168
- * Indentation width
169
- * @default 2
170
- */
171
- tabWidth?: number;
172
- /**
173
- * Use tabs for indentation
174
- * @default false
175
- */
176
- useTabs?: boolean;
177
- /**
178
- * Print semicolons
179
- * @default true
180
- */
181
- semi?: boolean;
182
- /**
183
- * Use single quotes
184
- * @default false
185
- */
186
- singleQuote?: boolean;
187
- /**
188
- * Trailing commas
189
- * @default 'all'
190
- */
191
- trailingComma?: "all" | "none" | "es5";
192
- }
193
- /**
194
- * LSP configuration
195
- */
196
- interface LspConfig {
197
- /**
198
- * Enable LSP
199
- * @default true
200
- */
201
- enabled?: boolean;
202
- /**
203
- * Enable diagnostics
204
- * @default true
205
- */
206
- diagnostics?: boolean;
207
- /**
208
- * Enable completions
209
- * @default true
210
- */
211
- completion?: boolean;
212
- /**
213
- * Enable hover information
214
- * @default true
215
- */
216
- hover?: boolean;
217
- /**
218
- * Enable go-to-definition
219
- * @default true
220
- */
221
- definition?: boolean;
222
- /**
223
- * Enable formatting via LSP
224
- * @default true
225
- */
226
- formatting?: boolean;
227
- /**
228
- * Enable code actions
229
- * @default true
230
- */
231
- codeActions?: boolean;
232
- /**
233
- * Enable type checking diagnostics and type-aware LSP features
234
- * @default true
235
- */
236
- typecheck?: boolean;
237
- /**
238
- * Use Corsa for type checking in LSP
239
- * @default false
240
- */
241
- corsa?: boolean;
242
- }
243
- //#endregion
244
- //#region ../vize/src/types/musea.d.ts
245
- /**
246
- * VRT (Visual Regression Testing) configuration for Musea
247
- */
248
- interface MuseaVrtConfig {
249
- /**
250
- * Threshold for pixel comparison (0-1)
251
- * @default 0.1
252
- */
253
- threshold?: number;
254
- /**
255
- * Output directory for screenshots
256
- * @default '__musea_snapshots__'
257
- */
258
- outDir?: string;
259
- /**
260
- * Viewport sizes
261
- */
262
- viewports?: Array<{
263
- width: number;
264
- height: number;
265
- name?: string;
266
- }>;
267
- }
268
- /**
269
- * A11y configuration for Musea
270
- */
271
- interface MuseaA11yConfig {
272
- /**
273
- * Enable a11y checking
274
- * @default false
275
- */
276
- enabled?: boolean;
277
- /**
278
- * Axe-core rules to enable/disable
279
- */
280
- rules?: Record<string, boolean>;
281
- }
282
- /**
283
- * Autogen configuration for Musea
284
- */
285
- interface MuseaAutogenConfig {
286
- /**
287
- * Enable auto-generation of variants
288
- * @default false
289
- */
290
- enabled?: boolean;
291
- /**
292
- * Max variants to generate per component
293
- * @default 10
294
- */
295
- maxVariants?: number;
296
- }
297
- /**
298
- * Musea component gallery configuration
299
- */
300
- interface MuseaConfig {
301
- /**
302
- * Glob patterns for art files
303
- * @default ['**\/*.art.vue']
304
- */
305
- include?: string[];
306
- /**
307
- * Glob patterns to exclude
308
- * @default ['node_modules/**', 'dist/**']
309
- */
310
- exclude?: string[];
311
- /**
312
- * Base path for gallery
313
- * @default '/__musea__'
314
- */
315
- basePath?: string;
316
- /**
317
- * Enable Storybook compatibility
318
- * @default false
319
- */
320
- storybookCompat?: boolean;
321
- /**
322
- * Enable inline art detection in .vue files
323
- * @default false
324
- */
325
- inlineArt?: boolean;
326
- /**
327
- * VRT configuration
328
- */
329
- vrt?: MuseaVrtConfig;
330
- /**
331
- * A11y configuration
332
- */
333
- a11y?: MuseaA11yConfig;
334
- /**
335
- * Autogen configuration
336
- */
337
- autogen?: MuseaAutogenConfig;
338
- }
339
- //#endregion
340
- //#region ../vize/src/types/loader.d.ts
341
- /**
342
- * Global type declaration
343
- */
344
- interface GlobalTypeDeclaration {
345
- /**
346
- * TypeScript type string
347
- */
348
- type: string;
349
- /**
350
- * Default value
351
- */
352
- defaultValue?: string;
353
- }
354
- /**
355
- * Global types configuration
356
- */
357
- type GlobalTypesConfig = Record<string, GlobalTypeDeclaration | string>;
358
- /**
359
- * Options for loading vize.config file
360
- */
361
- interface LoadConfigOptions {
362
- /**
363
- * Config file search mode
364
- * - 'root': Search only in the specified root directory
365
- * - 'auto': Search from cwd upward until finding a config file
366
- * - 'none': Don't load config file
367
- * @default 'root'
368
- */
369
- mode?: "root" | "auto" | "none";
370
- /**
371
- * Custom config file path (overrides automatic search)
372
- */
373
- configFile?: string;
374
- /**
375
- * Config environment for dynamic config resolution
376
- */
377
- env?: ConfigEnv;
378
- }
379
- //#endregion
380
- //#region ../vize/src/types/core.d.ts
381
- interface ConfigEnv {
382
- mode: string;
383
- command: "serve" | "build" | "check" | "lint" | "fmt";
384
- isSsrBuild?: boolean;
385
- }
386
- type RuleSeverity = "off" | "warn" | "error";
387
- type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
388
- type LintPreset = "happy-path" | "opinionated" | "essential" | "nuxt";
389
- /**
390
- * Vize configuration options
391
- */
392
- interface VizeConfig {
393
- /**
394
- * JSON Schema reference for editor autocompletion.
395
- */
396
- $schema?: string;
397
- /**
398
- * Vue compiler options
399
- */
400
- compiler?: CompilerConfig;
401
- /**
402
- * Vite plugin options
403
- */
404
- vite?: VitePluginConfig;
405
- /**
406
- * Linter options
407
- */
408
- linter?: LinterConfig;
409
- /**
410
- * Type checker options
411
- */
412
- typeChecker?: TypeCheckerConfig;
413
- /**
414
- * Formatter options
415
- */
416
- formatter?: FormatterConfig;
417
- /**
418
- * LSP options
419
- */
420
- lsp?: LspConfig;
421
- /**
422
- * Musea component gallery options
423
- */
424
- musea?: MuseaConfig;
425
- /**
426
- * Global type declarations
427
- */
428
- globalTypes?: GlobalTypesConfig;
429
- }
430
- //#endregion
431
- //#region src/types.d.ts
432
- interface VizeOptions {
433
- /**
434
- * Override the public base used for dev-time asset URLs such as /@fs paths.
435
- * Useful for frameworks like Nuxt that serve Vite from a subpath (e.g. /_nuxt/).
436
- */
437
- devUrlBase?: string;
438
- /**
439
- * Files to include in compilation
440
- * @default /\.vue$/
441
- */
442
- include?: string | RegExp | (string | RegExp)[];
443
- /**
444
- * Files to exclude from compilation
445
- * @default /node_modules/
446
- */
447
- exclude?: string | RegExp | (string | RegExp)[];
448
- /**
449
- * Force production mode
450
- * @default auto-detected from Vite config
451
- */
452
- isProduction?: boolean;
453
- /**
454
- * Enable SSR mode
455
- * @default false
456
- */
457
- ssr?: boolean;
458
- /**
459
- * Enable source map generation
460
- * @default true in development, false in production
461
- */
462
- sourceMap?: boolean;
463
- /**
464
- * Enable Vapor mode compilation
465
- * @default false
466
- */
467
- vapor?: boolean;
468
- /**
469
- * Root directory to scan for .vue files
470
- * @default Vite's root
471
- */
472
- root?: string;
473
- /**
474
- * Glob patterns to scan for .vue files during pre-compilation
475
- * @default ['**\/*.vue']
476
- */
477
- scanPatterns?: string[];
478
- /**
479
- * Glob patterns to ignore during pre-compilation
480
- * @default ['node_modules/**', 'dist/**', '.git/**']
481
- */
482
- ignorePatterns?: string[];
483
- /**
484
- * Config file search mode
485
- * - 'root': Search only in the project root directory
486
- * - 'auto': Search from cwd upward until finding a config file
487
- * - false: Disable config file loading
488
- * @default 'root'
489
- */
490
- configMode?: "root" | "auto" | false;
491
- /**
492
- * Custom config file path (overrides automatic search)
493
- */
494
- configFile?: string;
495
- /**
496
- * Handle .vue files in node_modules (on-demand compilation).
497
- * When true, vize will compile .vue files from node_modules that other plugins
498
- * (like vite-plugin-vue-inspector) may import directly.
499
- * Set to false if another Vue plugin (e.g. Nuxt) handles node_modules .vue files.
500
- * @default true
501
- */
502
- handleNodeModulesVue?: boolean;
503
- /**
504
- * Enable debug logging
505
- * @default false
506
- */
507
- debug?: boolean;
508
- }
509
- interface StyleBlockInfo {
510
- /** Raw style content (uncompiled for preprocessor langs) */
511
- content: string;
512
- /** Language of the style block (e.g., "css", "scss", "less", "sass", "stylus") */
513
- lang: string | null;
514
- /** Whether the style block has the scoped attribute */
515
- scoped: boolean;
516
- /** CSS Modules: true for unnamed `module`, or the binding name for `module="name"` */
517
- module: boolean | string;
518
- /** Index of this style block in the SFC */
519
- index: number;
520
- }
521
- interface CompiledModule {
522
- code: string;
523
- css?: string;
524
- scopeId: string;
525
- hasScoped: boolean;
526
- templateHash?: string;
527
- styleHash?: string;
528
- scriptHash?: string;
529
- /** Per-block style metadata extracted from the source SFC */
530
- styles?: StyleBlockInfo[];
531
- }
532
- //#endregion
533
- //#region src/virtual.d.ts
534
- interface DynamicImportAliasRule {
535
- fromPrefix: string;
536
- toPrefix: string;
537
- }
538
- //#endregion
539
- //#region src/transform.d.ts
540
- declare function rewriteStaticAssetUrls(code: string, aliasRules: DynamicImportAliasRule[]): string;
541
- //#endregion
542
- //#region src/plugin/index.d.ts
543
- declare function vize(options?: VizeOptions): Plugin[];
544
- //#endregion
545
- //#region src/config.d.ts
546
- /**
547
- * Shared config store for inter-plugin communication.
548
- * Key = project root, Value = resolved VizeConfig.
549
- * Used by musea() and other plugins to access the unified config.
550
- */
551
- declare const vizeConfigStore: Map<string, VizeConfig>;
552
- //#endregion
553
- //#region src/index.d.ts
554
- declare const __internal: {
555
- rewriteStaticAssetUrls: typeof rewriteStaticAssetUrls;
556
- };
557
- //#endregion
558
- export { type CompiledModule, type LoadConfigOptions, type VizeConfig, type VizeOptions, __internal, rewriteStaticAssetUrls as __internal_rewriteStaticAssetUrls, vize as default, vize, defineConfig, loadConfig, vizeConfigStore };