vize 0.13.0 → 0.15.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.
@@ -1,50 +1,4 @@
1
- //#region src/types.d.ts
2
- type MaybePromise<T> = T | Promise<T>;
3
- interface ConfigEnv {
4
- mode: string;
5
- command: "serve" | "build" | "check" | "lint" | "fmt";
6
- isSsrBuild?: boolean;
7
- }
8
- type UserConfigExport = VizeConfig | ((env: ConfigEnv) => MaybePromise<VizeConfig>);
9
- type RuleSeverity = "off" | "warn" | "error";
10
- type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
11
- /**
12
- * Vize configuration options
13
- */
14
- interface VizeConfig {
15
- /**
16
- * Vue compiler options
17
- */
18
- compiler?: CompilerConfig;
19
- /**
20
- * Vite plugin options
21
- */
22
- vite?: VitePluginConfig;
23
- /**
24
- * Linter options
25
- */
26
- linter?: LinterConfig;
27
- /**
28
- * Type checker options
29
- */
30
- typeChecker?: TypeCheckerConfig;
31
- /**
32
- * Formatter options
33
- */
34
- formatter?: FormatterConfig;
35
- /**
36
- * LSP options
37
- */
38
- lsp?: LspConfig;
39
- /**
40
- * Musea component gallery options
41
- */
42
- musea?: MuseaConfig;
43
- /**
44
- * Global type declarations
45
- */
46
- globalTypes?: GlobalTypesConfig;
47
- }
1
+ //#region src/types/compiler.d.ts
48
2
  /**
49
3
  * Compiler configuration
50
4
  */
@@ -129,7 +83,10 @@ interface VitePluginConfig {
129
83
  * @default ['node_modules/**', 'dist/**', '.git/**']
130
84
  */
131
85
  ignorePatterns?: string[];
132
- }
86
+ } //#endregion
87
+ //#region src/types/tools.d.ts
88
+
89
+ //# sourceMappingURL=compiler.d.ts.map
133
90
  /**
134
91
  * Linter configuration
135
92
  */
@@ -265,7 +222,10 @@ interface LspConfig {
265
222
  * @default false
266
223
  */
267
224
  tsgo?: boolean;
268
- }
225
+ } //#endregion
226
+ //#region src/types/musea.d.ts
227
+
228
+ //# sourceMappingURL=tools.d.ts.map
269
229
  /**
270
230
  * VRT (Visual Regression Testing) configuration for Musea
271
231
  */
@@ -359,7 +319,10 @@ interface MuseaConfig {
359
319
  * Autogen configuration
360
320
  */
361
321
  autogen?: MuseaAutogenConfig;
362
- }
322
+ } //#endregion
323
+ //#region src/types/loader.d.ts
324
+
325
+ //# sourceMappingURL=musea.d.ts.map
363
326
  /**
364
327
  * Global type declaration
365
328
  */
@@ -397,10 +360,61 @@ interface LoadConfigOptions {
397
360
  * Config environment for dynamic config resolution
398
361
  */
399
362
  env?: ConfigEnv;
400
- } //#endregion
401
- //#region src/config.d.ts
363
+ }
364
+
365
+ //#endregion
366
+ //#region src/types/core.d.ts
367
+ //# sourceMappingURL=loader.d.ts.map
368
+ type MaybePromise<T> = T | Promise<T>;
369
+ interface ConfigEnv {
370
+ mode: string;
371
+ command: "serve" | "build" | "check" | "lint" | "fmt";
372
+ isSsrBuild?: boolean;
373
+ }
374
+ type UserConfigExport = VizeConfig | ((env: ConfigEnv) => MaybePromise<VizeConfig>);
375
+ type RuleSeverity = "off" | "warn" | "error";
376
+ type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
377
+ /**
378
+ * Vize configuration options
379
+ */
380
+ interface VizeConfig {
381
+ /**
382
+ * Vue compiler options
383
+ */
384
+ compiler?: CompilerConfig;
385
+ /**
386
+ * Vite plugin options
387
+ */
388
+ vite?: VitePluginConfig;
389
+ /**
390
+ * Linter options
391
+ */
392
+ linter?: LinterConfig;
393
+ /**
394
+ * Type checker options
395
+ */
396
+ typeChecker?: TypeCheckerConfig;
397
+ /**
398
+ * Formatter options
399
+ */
400
+ formatter?: FormatterConfig;
401
+ /**
402
+ * LSP options
403
+ */
404
+ lsp?: LspConfig;
405
+ /**
406
+ * Musea component gallery options
407
+ */
408
+ musea?: MuseaConfig;
409
+ /**
410
+ * Global type declarations
411
+ */
412
+ globalTypes?: GlobalTypesConfig;
413
+ }
402
414
 
403
- //# sourceMappingURL=types.d.ts.map
415
+ //#endregion
416
+ //#region src/config.d.ts
417
+ //# sourceMappingURL=core.d.ts.map
404
418
  /**
405
419
  * Define a Vize configuration with type checking.
406
420
  * Accepts a plain object or a function that receives ConfigEnv.
@@ -419,4 +433,4 @@ declare function normalizeGlobalTypes(config: GlobalTypesConfig): Record<string,
419
433
  //# sourceMappingURL=config.d.ts.map
420
434
 
421
435
  export { CompilerConfig, ConfigEnv, FormatterConfig, GlobalTypeDeclaration, GlobalTypesConfig, LinterConfig, LoadConfigOptions, LspConfig, MaybePromise, MuseaA11yConfig, MuseaAutogenConfig, MuseaConfig, MuseaVrtConfig, RuleCategory, RuleSeverity, TypeCheckerConfig, UserConfigExport, VitePluginConfig, VizeConfig, defineConfig as defineConfig$1, loadConfig as loadConfig$1, normalizeGlobalTypes as normalizeGlobalTypes$1 };
422
- //# sourceMappingURL=config-Cu4Hn1JG.d.ts.map
436
+ //# sourceMappingURL=config-CLHLyp2k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-CLHLyp2k.d.ts","names":[],"sources":["../src/types/compiler.ts","../src/types/tools.ts","../src/types/musea.ts","../src/types/loader.ts","../src/types/core.ts","../src/config.ts"],"sourcesContent":null,"mappings":";;;;UAOiB,cAAA;EAAA;;;;EA2EA,IAAA,CAAA,EAAA,QAAA,GAAA,UAAgB;EAAA;;;;EAWN,KAAa,CAAA,EAAA,OAAA;EAAM;;;;;;;ACpF9C;;EAA6B,SASJ,CAAA,EAAA,OAAA;EAAY;;;;EAKR,iBAAd,CAAA,EAAA,OAAA;EAAO;;;;EAUL,WAAA,CAAA,EAAA,OAAiB;;;;AAkDlC;;;;AA6CA;;;;;;;ECzHiB,SAAA,CAAA,EAAA,IAAA,GAAc,IAAA;;;;AAsB/B;;;;AAgBA;;;;AAiBA;;;AAuCS,UFnBQ,gBAAA,CEmBR;EAAe;AAKM;;;qBFnBT,mBAAmB;;;;AG9ExC;qBHoFqB,mBAAmB;;;AGrExC;;EAA6B,YAAkB,CAAA,EAAA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AAA,EGxBH,eHwBkB;;;;EA6Cf,GAAA,CAAA,EGhET,SHgEkB;;;;UG3DhB;;;AF9DV;gBEmEgB;;;;;;;;;AJnEhB;iBKsBgB,YAAA,SAAqB,mBAAmB;;;ALqDxD;AAAiC,iBK9CX,UAAA,CL8CW,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EK5CtB,iBL4CsB,CAAA,EK3C9B,OL2C8B,CK3CtB,UL2CsB,GAAA,IAAA,CAAA;;;;AAWO,iBKsFxB,oBAAA,CLtFwB,MAAA,EKuF9B,iBLvF8B,CAAA,EKwFrC,MLxFqC,CAAA,MAAA,EKwFtB,qBLxFsB,CAAA;;;AAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"config-CVmInrFP.js","names":["DEFAULT_CONFIG_ENV: ConfigEnv","config: UserConfigExport","root: string","options: LoadConfigOptions","configPath","dir: string","startDir: string","filePath: string","env?: ConfigEnv","exported: UserConfigExport","config: GlobalTypesConfig","result: Record<string, GlobalTypeDeclaration>"],"sources":["../src/config.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { transform } from \"oxc-transform\";\nimport type {\n VizeConfig,\n LoadConfigOptions,\n UserConfigExport,\n ConfigEnv,\n GlobalTypesConfig,\n GlobalTypeDeclaration,\n} from \"./types.js\";\n\nconst CONFIG_FILE_NAMES = [\n \"vize.config.ts\",\n \"vize.config.js\",\n \"vize.config.mjs\",\n \"vize.config.json\",\n];\n\nconst DEFAULT_CONFIG_ENV: ConfigEnv = {\n mode: \"development\",\n command: \"serve\",\n};\n\n/**\n * Define a Vize configuration with type checking.\n * Accepts a plain object or a function that receives ConfigEnv.\n */\nexport function defineConfig(config: UserConfigExport): UserConfigExport {\n return config;\n}\n\n/**\n * Load vize.config file from the specified directory\n */\nexport async function loadConfig(\n root: string,\n options: LoadConfigOptions = {},\n): Promise<VizeConfig | null> {\n const { mode = \"root\", configFile, env } = options;\n\n if (mode === \"none\") {\n return null;\n }\n\n // Custom config file path\n if (configFile) {\n const absolutePath = path.isAbsolute(configFile) ? configFile : path.resolve(root, configFile);\n if (fs.existsSync(absolutePath)) {\n return loadConfigFile(absolutePath, env);\n }\n return null;\n }\n\n // Search for config file\n if (mode === \"auto\") {\n const configPath = findConfigFileAuto(root);\n if (!configPath) {\n return null;\n }\n return loadConfigFile(configPath, env);\n }\n\n // mode === \"root\"\n const configPath = findConfigFileInDir(root);\n if (!configPath) {\n return null;\n }\n return loadConfigFile(configPath, env);\n}\n\n/**\n * Find config file in a specific directory\n */\nfunction findConfigFileInDir(dir: string): string | null {\n for (const name of CONFIG_FILE_NAMES) {\n const filePath = path.join(dir, name);\n if (fs.existsSync(filePath)) {\n return filePath;\n }\n }\n return null;\n}\n\n/**\n * Find config file by searching from cwd upward\n */\nfunction findConfigFileAuto(startDir: string): string | null {\n let currentDir = path.resolve(startDir);\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const configPath = findConfigFileInDir(currentDir);\n if (configPath) {\n return configPath;\n }\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n}\n\n/**\n * Load and evaluate a config file\n */\nasync function loadConfigFile(filePath: string, env?: ConfigEnv): Promise<VizeConfig | null> {\n if (!fs.existsSync(filePath)) {\n return null;\n }\n\n const ext = path.extname(filePath);\n\n if (ext === \".json\") {\n const content = fs.readFileSync(filePath, \"utf-8\");\n return JSON.parse(content);\n }\n\n if (ext === \".ts\") {\n return loadTypeScriptConfig(filePath, env);\n }\n\n // .js, .mjs - ESM\n return loadESMConfig(filePath, env);\n}\n\n/**\n * Resolve a UserConfigExport to a VizeConfig\n */\nasync function resolveConfigExport(\n exported: UserConfigExport,\n env?: ConfigEnv,\n): Promise<VizeConfig> {\n if (typeof exported === \"function\") {\n return exported(env ?? DEFAULT_CONFIG_ENV);\n }\n return exported;\n}\n\n/**\n * Load TypeScript config file using oxc-transform\n */\nasync function loadTypeScriptConfig(filePath: string, env?: ConfigEnv): Promise<VizeConfig> {\n const source = fs.readFileSync(filePath, \"utf-8\");\n const result = transform(filePath, source, {\n typescript: {\n onlyRemoveTypeImports: true,\n },\n });\n\n const code = result.code;\n\n // Write to temp file and import (use Date.now() to avoid race conditions)\n const tempFile = filePath.replace(/\\.ts$/, `.temp.${Date.now()}.mjs`);\n fs.writeFileSync(tempFile, code);\n\n try {\n const fileUrl = pathToFileURL(tempFile).href;\n const module = await import(fileUrl);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n } finally {\n fs.unlinkSync(tempFile);\n }\n}\n\n/**\n * Load ESM config file\n */\nasync function loadESMConfig(filePath: string, env?: ConfigEnv): Promise<VizeConfig> {\n const fileUrl = pathToFileURL(filePath).href;\n const module = await import(fileUrl);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n}\n\n/**\n * Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects\n */\nexport function normalizeGlobalTypes(\n config: GlobalTypesConfig,\n): Record<string, GlobalTypeDeclaration> {\n const result: Record<string, GlobalTypeDeclaration> = {};\n for (const [key, value] of Object.entries(config)) {\n if (typeof value === \"string\") {\n result[key] = { type: value };\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n"],"mappings":";;;;;;AAaA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;AACD;AAED,MAAMA,qBAAgC;CACpC,MAAM;CACN,SAAS;AACV;;;;;AAMD,SAAgB,aAAaC,QAA4C;AACvE,QAAO;AACR;;;;AAKD,eAAsB,WACpBC,MACAC,UAA6B,CAAE,GACH;CAC5B,MAAM,EAAE,OAAO,QAAQ,YAAY,KAAK,GAAG;AAE3C,KAAI,SAAS,OACX,QAAO;AAIT,KAAI,YAAY;EACd,MAAM,eAAe,KAAK,WAAW,WAAW,GAAG,aAAa,KAAK,QAAQ,MAAM,WAAW;AAC9F,MAAI,GAAG,WAAW,aAAa,CAC7B,QAAO,eAAe,cAAc,IAAI;AAE1C,SAAO;CACR;AAGD,KAAI,SAAS,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WAAW,SAAS,QAAQ,UAAU,QAAQ,KAAK,KAAK,CAAC,MAAM;AACrE,IAAG,cAAc,UAAU,KAAK;AAEhC,KAAI;EACF,MAAM,UAAU,cAAc,SAAS,CAAC;EACxC,MAAM,SAAS,MAAM,OAAO;EAC5B,MAAMC,WAA6B,OAAO,WAAW;AACrD,SAAO,oBAAoB,UAAU,IAAI;CAC1C,UAAS;AACR,KAAG,WAAW,SAAS;CACxB;AACF;;;;AAKD,eAAe,cAAcF,UAAkBC,KAAsC;CACnF,MAAM,UAAU,cAAc,SAAS,CAAC;CACxC,MAAM,SAAS,MAAM,OAAO;CAC5B,MAAMC,WAA6B,OAAO,WAAW;AACrD,QAAO,oBAAoB,UAAU,IAAI;AAC1C;;;;AAKD,SAAgB,qBACdC,QACuC;CACvC,MAAMC,SAAgD,CAAE;AACxD,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,YAAW,UAAU,SACnB,QAAO,OAAO,EAAE,MAAM,MAAO;KAE7B,QAAO,OAAO;AAGlB,QAAO;AACR"}
1
+ {"version":3,"file":"config-CVmInrFP.js","names":["DEFAULT_CONFIG_ENV: ConfigEnv","config: UserConfigExport","root: string","options: LoadConfigOptions","configPath","dir: string","startDir: string","filePath: string","env?: ConfigEnv","exported: UserConfigExport","config: GlobalTypesConfig","result: Record<string, GlobalTypeDeclaration>"],"sources":["../src/config.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { transform } from \"oxc-transform\";\nimport type {\n VizeConfig,\n LoadConfigOptions,\n UserConfigExport,\n ConfigEnv,\n GlobalTypesConfig,\n GlobalTypeDeclaration,\n} from \"./types/index.js\";\n\nconst CONFIG_FILE_NAMES = [\n \"vize.config.ts\",\n \"vize.config.js\",\n \"vize.config.mjs\",\n \"vize.config.json\",\n];\n\nconst DEFAULT_CONFIG_ENV: ConfigEnv = {\n mode: \"development\",\n command: \"serve\",\n};\n\n/**\n * Define a Vize configuration with type checking.\n * Accepts a plain object or a function that receives ConfigEnv.\n */\nexport function defineConfig(config: UserConfigExport): UserConfigExport {\n return config;\n}\n\n/**\n * Load vize.config file from the specified directory\n */\nexport async function loadConfig(\n root: string,\n options: LoadConfigOptions = {},\n): Promise<VizeConfig | null> {\n const { mode = \"root\", configFile, env } = options;\n\n if (mode === \"none\") {\n return null;\n }\n\n // Custom config file path\n if (configFile) {\n const absolutePath = path.isAbsolute(configFile) ? configFile : path.resolve(root, configFile);\n if (fs.existsSync(absolutePath)) {\n return loadConfigFile(absolutePath, env);\n }\n return null;\n }\n\n // Search for config file\n if (mode === \"auto\") {\n const configPath = findConfigFileAuto(root);\n if (!configPath) {\n return null;\n }\n return loadConfigFile(configPath, env);\n }\n\n // mode === \"root\"\n const configPath = findConfigFileInDir(root);\n if (!configPath) {\n return null;\n }\n return loadConfigFile(configPath, env);\n}\n\n/**\n * Find config file in a specific directory\n */\nfunction findConfigFileInDir(dir: string): string | null {\n for (const name of CONFIG_FILE_NAMES) {\n const filePath = path.join(dir, name);\n if (fs.existsSync(filePath)) {\n return filePath;\n }\n }\n return null;\n}\n\n/**\n * Find config file by searching from cwd upward\n */\nfunction findConfigFileAuto(startDir: string): string | null {\n let currentDir = path.resolve(startDir);\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const configPath = findConfigFileInDir(currentDir);\n if (configPath) {\n return configPath;\n }\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n}\n\n/**\n * Load and evaluate a config file\n */\nasync function loadConfigFile(filePath: string, env?: ConfigEnv): Promise<VizeConfig | null> {\n if (!fs.existsSync(filePath)) {\n return null;\n }\n\n const ext = path.extname(filePath);\n\n if (ext === \".json\") {\n const content = fs.readFileSync(filePath, \"utf-8\");\n return JSON.parse(content);\n }\n\n if (ext === \".ts\") {\n return loadTypeScriptConfig(filePath, env);\n }\n\n // .js, .mjs - ESM\n return loadESMConfig(filePath, env);\n}\n\n/**\n * Resolve a UserConfigExport to a VizeConfig\n */\nasync function resolveConfigExport(\n exported: UserConfigExport,\n env?: ConfigEnv,\n): Promise<VizeConfig> {\n if (typeof exported === \"function\") {\n return exported(env ?? DEFAULT_CONFIG_ENV);\n }\n return exported;\n}\n\n/**\n * Load TypeScript config file using oxc-transform\n */\nasync function loadTypeScriptConfig(filePath: string, env?: ConfigEnv): Promise<VizeConfig> {\n const source = fs.readFileSync(filePath, \"utf-8\");\n const result = transform(filePath, source, {\n typescript: {\n onlyRemoveTypeImports: true,\n },\n });\n\n const code = result.code;\n\n // Write to temp file and import (use Date.now() to avoid race conditions)\n const tempFile = filePath.replace(/\\.ts$/, `.temp.${Date.now()}.mjs`);\n fs.writeFileSync(tempFile, code);\n\n try {\n const fileUrl = pathToFileURL(tempFile).href;\n const module = await import(fileUrl);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n } finally {\n fs.unlinkSync(tempFile);\n }\n}\n\n/**\n * Load ESM config file\n */\nasync function loadESMConfig(filePath: string, env?: ConfigEnv): Promise<VizeConfig> {\n const fileUrl = pathToFileURL(filePath).href;\n const module = await import(fileUrl);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n}\n\n/**\n * Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects\n */\nexport function normalizeGlobalTypes(\n config: GlobalTypesConfig,\n): Record<string, GlobalTypeDeclaration> {\n const result: Record<string, GlobalTypeDeclaration> = {};\n for (const [key, value] of Object.entries(config)) {\n if (typeof value === \"string\") {\n result[key] = { type: value };\n } else {\n result[key] = value;\n }\n }\n return result;\n}\n"],"mappings":";;;;;;AAaA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;AACD;AAED,MAAMA,qBAAgC;CACpC,MAAM;CACN,SAAS;AACV;;;;;AAMD,SAAgB,aAAaC,QAA4C;AACvE,QAAO;AACR;;;;AAKD,eAAsB,WACpBC,MACAC,UAA6B,CAAE,GACH;CAC5B,MAAM,EAAE,OAAO,QAAQ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AS,OAAO,mBAAmB;AAE5C,QAAO;AACR;;;;AAKD,eAAe,qBAAqBD,UAAkBC,KAAsC;CAC1F,MAAM,SAAS,GAAG,aAAa,UAAU,QAAQ;CACjD,MAAM,SAAS,UAAU,UAAU,QAAQ,EACzC,YAAY,EACV,uBAAuB,KACxB,EACF,EAAC;CAEF,MAAM,OAAO,OAAO;CAGpB,MAAM,WAAW,SAAS,QAAQ,UAAU,QAAQ,KAAK,KAAK,CAAC,MAAM;AACrE,IAAG,cAAc,UAAU,KAAK;AAEhC,KAAI;EACF,MAAM,UAAU,cAAc,SAAS,CAAC;EACxC,MAAM,SAAS,MAAM,OAAO;EAC5B,MAAMC,WAA6B,OAAO,WAAW;AACrD,SAAO,oBAAoB,UAAU,IAAI;CAC1C,UAAS;AACR,KAAG,WAAW,SAAS;CACxB;AACF;;;;AAKD,eAAe,cAAcF,UAAkBC,KAAsC;CACnF,MAAM,UAAU,cAAc,SAAS,CAAC;CACxC,MAAM,SAAS,MAAM,OAAO;CAC5B,MAAMC,WAA6B,OAAO,WAAW;AACrD,QAAO,oBAAoB,UAAU,IAAI;AAC1C;;;;AAKD,SAAgB,qBACdC,QACuC;CACvC,MAAMC,SAAgD,CAAE;AACxD,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,YAAW,UAAU,SACnB,QAAO,OAAO,EAAE,MAAM,MAAO;KAE7B,QAAO,OAAO;AAGlB,QAAO;AACR"}
package/dist/config.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { defineConfig$1 as defineConfig, loadConfig$1 as loadConfig, normalizeGlobalTypes$1 as normalizeGlobalTypes } from "./config-Cu4Hn1JG.js";
1
+ import { defineConfig$1 as defineConfig, loadConfig$1 as loadConfig, normalizeGlobalTypes$1 as normalizeGlobalTypes } from "./config-CLHLyp2k.js";
2
2
  export { defineConfig, loadConfig, normalizeGlobalTypes };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { CompilerConfig, ConfigEnv, FormatterConfig, GlobalTypeDeclaration, GlobalTypesConfig, LinterConfig, LoadConfigOptions, LspConfig, MaybePromise, MuseaA11yConfig, MuseaAutogenConfig, MuseaConfig, MuseaVrtConfig, RuleCategory, RuleSeverity, TypeCheckerConfig, UserConfigExport, VitePluginConfig, VizeConfig, defineConfig$1 as defineConfig, loadConfig$1 as loadConfig, normalizeGlobalTypes$1 as normalizeGlobalTypes } from "./config-Cu4Hn1JG.js";
1
+ import { CompilerConfig, ConfigEnv, FormatterConfig, GlobalTypeDeclaration, GlobalTypesConfig, LinterConfig, LoadConfigOptions, LspConfig, MaybePromise, MuseaA11yConfig, MuseaAutogenConfig, MuseaConfig, MuseaVrtConfig, RuleCategory, RuleSeverity, TypeCheckerConfig, UserConfigExport, VitePluginConfig, VizeConfig, defineConfig$1 as defineConfig, loadConfig$1 as loadConfig, normalizeGlobalTypes$1 as normalizeGlobalTypes } from "./config-CLHLyp2k.js";
2
2
  export { CompilerConfig, ConfigEnv, FormatterConfig, GlobalTypeDeclaration, GlobalTypesConfig, LinterConfig, LoadConfigOptions, LspConfig, MaybePromise, MuseaA11yConfig, MuseaAutogenConfig, MuseaConfig, MuseaVrtConfig, RuleCategory, RuleSeverity, TypeCheckerConfig, UserConfigExport, VitePluginConfig, VizeConfig, defineConfig, loadConfig, normalizeGlobalTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vize",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Vize - High-performance Vue.js toolchain in Rust",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,14 +44,14 @@
44
44
  "node": ">=18"
45
45
  },
46
46
  "optionalDependencies": {
47
- "@vizejs/native-darwin-x64": "0.13.0",
48
- "@vizejs/native-darwin-arm64": "0.13.0",
49
- "@vizejs/native-win32-x64-msvc": "0.13.0",
50
- "@vizejs/native-win32-arm64-msvc": "0.13.0",
51
- "@vizejs/native-linux-x64-gnu": "0.13.0",
52
- "@vizejs/native-linux-x64-musl": "0.13.0",
53
- "@vizejs/native-linux-arm64-gnu": "0.13.0",
54
- "@vizejs/native-linux-arm64-musl": "0.13.0"
47
+ "@vizejs/native-darwin-x64": "0.15.0",
48
+ "@vizejs/native-darwin-arm64": "0.15.0",
49
+ "@vizejs/native-win32-x64-msvc": "0.15.0",
50
+ "@vizejs/native-win32-arm64-msvc": "0.15.0",
51
+ "@vizejs/native-linux-x64-gnu": "0.15.0",
52
+ "@vizejs/native-linux-x64-musl": "0.15.0",
53
+ "@vizejs/native-linux-arm64-gnu": "0.15.0",
54
+ "@vizejs/native-linux-arm64-musl": "0.15.0"
55
55
  },
56
56
  "dependencies": {
57
57
  "oxc-transform": "^0.56.0"
package/src/config.ts CHANGED
@@ -9,7 +9,7 @@ import type {
9
9
  ConfigEnv,
10
10
  GlobalTypesConfig,
11
11
  GlobalTypeDeclaration,
12
- } from "./types.js";
12
+ } from "./types/index.js";
13
13
 
14
14
  const CONFIG_FILE_NAMES = [
15
15
  "vize.config.ts",
package/src/index.ts CHANGED
@@ -27,7 +27,7 @@ export type {
27
27
  MaybePromise,
28
28
  RuleSeverity,
29
29
  RuleCategory,
30
- } from "./types.js";
30
+ } from "./types/index.js";
31
31
 
32
32
  // Config utilities
33
33
  export { defineConfig, loadConfig, normalizeGlobalTypes } from "./config.js";
@@ -0,0 +1,107 @@
1
+ // ============================================================================
2
+ // CompilerConfig
3
+ // ============================================================================
4
+
5
+ /**
6
+ * Compiler configuration
7
+ */
8
+ export interface CompilerConfig {
9
+ /**
10
+ * Compilation mode
11
+ * @default 'module'
12
+ */
13
+ mode?: "module" | "function";
14
+
15
+ /**
16
+ * Enable Vapor mode compilation
17
+ * @default false
18
+ */
19
+ vapor?: boolean;
20
+
21
+ /**
22
+ * Enable SSR mode
23
+ * @default false
24
+ */
25
+ ssr?: boolean;
26
+
27
+ /**
28
+ * Enable source map generation
29
+ * @default true in development, false in production
30
+ */
31
+ sourceMap?: boolean;
32
+
33
+ /**
34
+ * Prefix template identifiers with _ctx
35
+ * @default false
36
+ */
37
+ prefixIdentifiers?: boolean;
38
+
39
+ /**
40
+ * Hoist static nodes
41
+ * @default true
42
+ */
43
+ hoistStatic?: boolean;
44
+
45
+ /**
46
+ * Cache v-on handlers
47
+ * @default true
48
+ */
49
+ cacheHandlers?: boolean;
50
+
51
+ /**
52
+ * Enable TypeScript parsing in <script> blocks
53
+ * @default true
54
+ */
55
+ isTs?: boolean;
56
+
57
+ /**
58
+ * Script file extension for generated output
59
+ * @default 'ts'
60
+ */
61
+ scriptExt?: "ts" | "js";
62
+
63
+ /**
64
+ * Module name for runtime imports
65
+ * @default 'vue'
66
+ */
67
+ runtimeModuleName?: string;
68
+
69
+ /**
70
+ * Global variable name for runtime (IIFE builds)
71
+ * @default 'Vue'
72
+ */
73
+ runtimeGlobalName?: string;
74
+ }
75
+
76
+ // ============================================================================
77
+ // VitePluginConfig
78
+ // ============================================================================
79
+
80
+ /**
81
+ * Vite plugin configuration
82
+ */
83
+ export interface VitePluginConfig {
84
+ /**
85
+ * Files to include in compilation
86
+ * @default /\.vue$/
87
+ */
88
+ include?: string | RegExp | (string | RegExp)[];
89
+
90
+ /**
91
+ * Files to exclude from compilation
92
+ * @default /node_modules/
93
+ */
94
+ exclude?: string | RegExp | (string | RegExp)[];
95
+
96
+ /**
97
+ * Glob patterns to scan for .vue files during pre-compilation
98
+ * @default ['**\/*.vue']
99
+ */
100
+ scanPatterns?: string[];
101
+
102
+ /**
103
+ * Glob patterns to ignore during pre-compilation
104
+ * @default ['node_modules/**', 'dist/**', '.git/**']
105
+ */
106
+ ignorePatterns?: string[];
107
+ }
@@ -0,0 +1,76 @@
1
+ import type { CompilerConfig } from "./compiler.js";
2
+ import type { VitePluginConfig } from "./compiler.js";
3
+ import type { LinterConfig, TypeCheckerConfig, FormatterConfig, LspConfig } from "./tools.js";
4
+ import type { MuseaConfig } from "./musea.js";
5
+ import type { GlobalTypesConfig } from "./loader.js";
6
+
7
+ // ============================================================================
8
+ // Dynamic config support
9
+ // ============================================================================
10
+
11
+ export type MaybePromise<T> = T | Promise<T>;
12
+
13
+ export interface ConfigEnv {
14
+ mode: string;
15
+ command: "serve" | "build" | "check" | "lint" | "fmt";
16
+ isSsrBuild?: boolean;
17
+ }
18
+
19
+ export type UserConfigExport = VizeConfig | ((env: ConfigEnv) => MaybePromise<VizeConfig>);
20
+
21
+ // ============================================================================
22
+ // Rule severity
23
+ // ============================================================================
24
+
25
+ export type RuleSeverity = "off" | "warn" | "error";
26
+
27
+ export type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
28
+
29
+ // ============================================================================
30
+ // VizeConfig
31
+ // ============================================================================
32
+
33
+ /**
34
+ * Vize configuration options
35
+ */
36
+ export interface VizeConfig {
37
+ /**
38
+ * Vue compiler options
39
+ */
40
+ compiler?: CompilerConfig;
41
+
42
+ /**
43
+ * Vite plugin options
44
+ */
45
+ vite?: VitePluginConfig;
46
+
47
+ /**
48
+ * Linter options
49
+ */
50
+ linter?: LinterConfig;
51
+
52
+ /**
53
+ * Type checker options
54
+ */
55
+ typeChecker?: TypeCheckerConfig;
56
+
57
+ /**
58
+ * Formatter options
59
+ */
60
+ formatter?: FormatterConfig;
61
+
62
+ /**
63
+ * LSP options
64
+ */
65
+ lsp?: LspConfig;
66
+
67
+ /**
68
+ * Musea component gallery options
69
+ */
70
+ musea?: MuseaConfig;
71
+
72
+ /**
73
+ * Global type declarations
74
+ */
75
+ globalTypes?: GlobalTypesConfig;
76
+ }
@@ -0,0 +1,16 @@
1
+ export type {
2
+ MaybePromise,
3
+ ConfigEnv,
4
+ UserConfigExport,
5
+ RuleSeverity,
6
+ RuleCategory,
7
+ VizeConfig,
8
+ } from "./core.js";
9
+
10
+ export type { CompilerConfig, VitePluginConfig } from "./compiler.js";
11
+
12
+ export type { LinterConfig, TypeCheckerConfig, FormatterConfig, LspConfig } from "./tools.js";
13
+
14
+ export type { MuseaVrtConfig, MuseaA11yConfig, MuseaAutogenConfig, MuseaConfig } from "./musea.js";
15
+
16
+ export type { GlobalTypeDeclaration, GlobalTypesConfig, LoadConfigOptions } from "./loader.js";
@@ -0,0 +1,53 @@
1
+ import type { ConfigEnv } from "./core.js";
2
+
3
+ // ============================================================================
4
+ // GlobalTypesConfig
5
+ // ============================================================================
6
+
7
+ /**
8
+ * Global type declaration
9
+ */
10
+ export interface GlobalTypeDeclaration {
11
+ /**
12
+ * TypeScript type string
13
+ */
14
+ type: string;
15
+
16
+ /**
17
+ * Default value
18
+ */
19
+ defaultValue?: string;
20
+ }
21
+
22
+ /**
23
+ * Global types configuration
24
+ */
25
+ export type GlobalTypesConfig = Record<string, GlobalTypeDeclaration | string>;
26
+
27
+ // ============================================================================
28
+ // LoadConfigOptions
29
+ // ============================================================================
30
+
31
+ /**
32
+ * Options for loading vize.config file
33
+ */
34
+ export interface LoadConfigOptions {
35
+ /**
36
+ * Config file search mode
37
+ * - 'root': Search only in the specified root directory
38
+ * - 'auto': Search from cwd upward until finding a config file
39
+ * - 'none': Don't load config file
40
+ * @default 'root'
41
+ */
42
+ mode?: "root" | "auto" | "none";
43
+
44
+ /**
45
+ * Custom config file path (overrides automatic search)
46
+ */
47
+ configFile?: string;
48
+
49
+ /**
50
+ * Config environment for dynamic config resolution
51
+ */
52
+ env?: ConfigEnv;
53
+ }
@@ -0,0 +1,108 @@
1
+ // ============================================================================
2
+ // MuseaConfig
3
+ // ============================================================================
4
+
5
+ /**
6
+ * VRT (Visual Regression Testing) configuration for Musea
7
+ */
8
+ export interface MuseaVrtConfig {
9
+ /**
10
+ * Threshold for pixel comparison (0-1)
11
+ * @default 0.1
12
+ */
13
+ threshold?: number;
14
+
15
+ /**
16
+ * Output directory for screenshots
17
+ * @default '__musea_snapshots__'
18
+ */
19
+ outDir?: string;
20
+
21
+ /**
22
+ * Viewport sizes
23
+ */
24
+ viewports?: Array<{ width: number; height: number; name?: string }>;
25
+ }
26
+
27
+ /**
28
+ * A11y configuration for Musea
29
+ */
30
+ export interface MuseaA11yConfig {
31
+ /**
32
+ * Enable a11y checking
33
+ * @default false
34
+ */
35
+ enabled?: boolean;
36
+
37
+ /**
38
+ * Axe-core rules to enable/disable
39
+ */
40
+ rules?: Record<string, boolean>;
41
+ }
42
+
43
+ /**
44
+ * Autogen configuration for Musea
45
+ */
46
+ export interface MuseaAutogenConfig {
47
+ /**
48
+ * Enable auto-generation of variants
49
+ * @default false
50
+ */
51
+ enabled?: boolean;
52
+
53
+ /**
54
+ * Max variants to generate per component
55
+ * @default 10
56
+ */
57
+ maxVariants?: number;
58
+ }
59
+
60
+ /**
61
+ * Musea component gallery configuration
62
+ */
63
+ export interface MuseaConfig {
64
+ /**
65
+ * Glob patterns for art files
66
+ * @default ['**\/*.art.vue']
67
+ */
68
+ include?: string[];
69
+
70
+ /**
71
+ * Glob patterns to exclude
72
+ * @default ['node_modules/**', 'dist/**']
73
+ */
74
+ exclude?: string[];
75
+
76
+ /**
77
+ * Base path for gallery
78
+ * @default '/__musea__'
79
+ */
80
+ basePath?: string;
81
+
82
+ /**
83
+ * Enable Storybook compatibility
84
+ * @default false
85
+ */
86
+ storybookCompat?: boolean;
87
+
88
+ /**
89
+ * Enable inline art detection in .vue files
90
+ * @default false
91
+ */
92
+ inlineArt?: boolean;
93
+
94
+ /**
95
+ * VRT configuration
96
+ */
97
+ vrt?: MuseaVrtConfig;
98
+
99
+ /**
100
+ * A11y configuration
101
+ */
102
+ a11y?: MuseaA11yConfig;
103
+
104
+ /**
105
+ * Autogen configuration
106
+ */
107
+ autogen?: MuseaAutogenConfig;
108
+ }
@@ -0,0 +1,177 @@
1
+ import type { RuleSeverity, RuleCategory } from "./core.js";
2
+
3
+ // ============================================================================
4
+ // LinterConfig
5
+ // ============================================================================
6
+
7
+ /**
8
+ * Linter configuration
9
+ */
10
+ export interface LinterConfig {
11
+ /**
12
+ * Enable linting
13
+ */
14
+ enabled?: boolean;
15
+
16
+ /**
17
+ * Rules to enable/disable
18
+ */
19
+ rules?: Record<string, RuleSeverity>;
20
+
21
+ /**
22
+ * Category-level severity overrides
23
+ */
24
+ categories?: Partial<Record<RuleCategory, RuleSeverity>>;
25
+ }
26
+
27
+ // ============================================================================
28
+ // TypeCheckerConfig
29
+ // ============================================================================
30
+
31
+ /**
32
+ * Type checker configuration
33
+ */
34
+ export interface TypeCheckerConfig {
35
+ /**
36
+ * Enable type checking
37
+ * @default false
38
+ */
39
+ enabled?: boolean;
40
+
41
+ /**
42
+ * Enable strict mode
43
+ * @default false
44
+ */
45
+ strict?: boolean;
46
+
47
+ /**
48
+ * Check component props
49
+ * @default true
50
+ */
51
+ checkProps?: boolean;
52
+
53
+ /**
54
+ * Check component emits
55
+ * @default true
56
+ */
57
+ checkEmits?: boolean;
58
+
59
+ /**
60
+ * Check template bindings
61
+ * @default true
62
+ */
63
+ checkTemplateBindings?: boolean;
64
+
65
+ /**
66
+ * Path to tsconfig.json
67
+ * @default auto-detected
68
+ */
69
+ tsconfig?: string;
70
+
71
+ /**
72
+ * Path to tsgo binary
73
+ */
74
+ tsgoPath?: string;
75
+ }
76
+
77
+ // ============================================================================
78
+ // FormatterConfig
79
+ // ============================================================================
80
+
81
+ /**
82
+ * Formatter configuration
83
+ */
84
+ export interface FormatterConfig {
85
+ /**
86
+ * Max line width
87
+ * @default 80
88
+ */
89
+ printWidth?: number;
90
+
91
+ /**
92
+ * Indentation width
93
+ * @default 2
94
+ */
95
+ tabWidth?: number;
96
+
97
+ /**
98
+ * Use tabs for indentation
99
+ * @default false
100
+ */
101
+ useTabs?: boolean;
102
+
103
+ /**
104
+ * Print semicolons
105
+ * @default true
106
+ */
107
+ semi?: boolean;
108
+
109
+ /**
110
+ * Use single quotes
111
+ * @default false
112
+ */
113
+ singleQuote?: boolean;
114
+
115
+ /**
116
+ * Trailing commas
117
+ * @default 'all'
118
+ */
119
+ trailingComma?: "all" | "none" | "es5";
120
+ }
121
+
122
+ // ============================================================================
123
+ // LspConfig
124
+ // ============================================================================
125
+
126
+ /**
127
+ * LSP configuration
128
+ */
129
+ export interface LspConfig {
130
+ /**
131
+ * Enable LSP
132
+ * @default true
133
+ */
134
+ enabled?: boolean;
135
+
136
+ /**
137
+ * Enable diagnostics
138
+ * @default true
139
+ */
140
+ diagnostics?: boolean;
141
+
142
+ /**
143
+ * Enable completions
144
+ * @default true
145
+ */
146
+ completion?: boolean;
147
+
148
+ /**
149
+ * Enable hover information
150
+ * @default true
151
+ */
152
+ hover?: boolean;
153
+
154
+ /**
155
+ * Enable go-to-definition
156
+ * @default true
157
+ */
158
+ definition?: boolean;
159
+
160
+ /**
161
+ * Enable formatting via LSP
162
+ * @default true
163
+ */
164
+ formatting?: boolean;
165
+
166
+ /**
167
+ * Enable code actions
168
+ * @default true
169
+ */
170
+ codeActions?: boolean;
171
+
172
+ /**
173
+ * Use tsgo for type checking in LSP
174
+ * @default false
175
+ */
176
+ tsgo?: boolean;
177
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-Cu4Hn1JG.d.ts","names":[],"sources":["../src/types.ts","../src/config.ts"],"sourcesContent":null,"mappings":";KAIY,kBAAkB,IAAI,QAAQ;AAA9B,UAEK,SAAA,CAFO;EAAA,IAAA,EAAA,MAAA;EAAA,OAAM,EAAA,OAAA,GAAA,OAAA,GAAA,OAAA,GAAA,MAAA,GAAA,KAAA;EAAC,UAAW,CAAA,EAAA,OAAA;;AAAD,KAQ7B,gBAAA,GAAmB,UARU,GAAA,CAAA,CAAA,GAAA,EAQU,SARV,EAAA,GAQwB,YARxB,CAQqC,UARrC,CAAA,CAAA;AAExB,KAYL,YAAA,GAZc,KAAA,GAAA,MAAA,GAAA,OAAA;AAMd,KAQA,YAAA,GARgB,aAAA,GAAA,YAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA,GAAA,UAAA;;;;AAAkD,UAiB7D,UAAA,CAjB6D;EAAU;AAAX;AAM7E;EAEY,QAAA,CAAA,EAaC,cAbW;;;;EASP,IAAA,CAAA,EASR,gBATkB;EAAA;;;EASF,MAKd,CAAA,E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;;;;KAeL,iBAAA,GAAoB,eAAe;;;;UAS9B,iBAAA;;;;;;;;;;;;;;;;QAkBT;;;;;AA7fR;;;;AAAkC,iBCyBlB,YAAA,CDzBkB,MAAA,ECyBG,gBDzBH,CAAA,ECyBsB,gBDzBtB;AAAO;AAEzC;AAMA;AAA4B,iBCwBN,UAAA,CDxBM,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EC0BjB,iBD1BiB,CAAA,EC2BzB,OD3ByB,CC2BjB,UD3BiB,GAAA,IAAA,CAAA;;;;AAAqC,iBCuKjD,oBAAA,CDvKiD,MAAA,ECwKvD,iBDxKuD,CAAA,ECyK9D,MDzK8D,CAAA,MAAA,ECyK/C,qBDzK+C,CAAA;;;AAAY"}
package/src/types.ts DELETED
@@ -1,515 +0,0 @@
1
- // ============================================================================
2
- // Dynamic config support
3
- // ============================================================================
4
-
5
- export type MaybePromise<T> = T | Promise<T>;
6
-
7
- export interface ConfigEnv {
8
- mode: string;
9
- command: "serve" | "build" | "check" | "lint" | "fmt";
10
- isSsrBuild?: boolean;
11
- }
12
-
13
- export type UserConfigExport = VizeConfig | ((env: ConfigEnv) => MaybePromise<VizeConfig>);
14
-
15
- // ============================================================================
16
- // Rule severity
17
- // ============================================================================
18
-
19
- export type RuleSeverity = "off" | "warn" | "error";
20
-
21
- export type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
22
-
23
- // ============================================================================
24
- // VizeConfig
25
- // ============================================================================
26
-
27
- /**
28
- * Vize configuration options
29
- */
30
- export interface VizeConfig {
31
- /**
32
- * Vue compiler options
33
- */
34
- compiler?: CompilerConfig;
35
-
36
- /**
37
- * Vite plugin options
38
- */
39
- vite?: VitePluginConfig;
40
-
41
- /**
42
- * Linter options
43
- */
44
- linter?: LinterConfig;
45
-
46
- /**
47
- * Type checker options
48
- */
49
- typeChecker?: TypeCheckerConfig;
50
-
51
- /**
52
- * Formatter options
53
- */
54
- formatter?: FormatterConfig;
55
-
56
- /**
57
- * LSP options
58
- */
59
- lsp?: LspConfig;
60
-
61
- /**
62
- * Musea component gallery options
63
- */
64
- musea?: MuseaConfig;
65
-
66
- /**
67
- * Global type declarations
68
- */
69
- globalTypes?: GlobalTypesConfig;
70
- }
71
-
72
- // ============================================================================
73
- // CompilerConfig
74
- // ============================================================================
75
-
76
- /**
77
- * Compiler configuration
78
- */
79
- export interface CompilerConfig {
80
- /**
81
- * Compilation mode
82
- * @default 'module'
83
- */
84
- mode?: "module" | "function";
85
-
86
- /**
87
- * Enable Vapor mode compilation
88
- * @default false
89
- */
90
- vapor?: boolean;
91
-
92
- /**
93
- * Enable SSR mode
94
- * @default false
95
- */
96
- ssr?: boolean;
97
-
98
- /**
99
- * Enable source map generation
100
- * @default true in development, false in production
101
- */
102
- sourceMap?: boolean;
103
-
104
- /**
105
- * Prefix template identifiers with _ctx
106
- * @default false
107
- */
108
- prefixIdentifiers?: boolean;
109
-
110
- /**
111
- * Hoist static nodes
112
- * @default true
113
- */
114
- hoistStatic?: boolean;
115
-
116
- /**
117
- * Cache v-on handlers
118
- * @default true
119
- */
120
- cacheHandlers?: boolean;
121
-
122
- /**
123
- * Enable TypeScript parsing in <script> blocks
124
- * @default true
125
- */
126
- isTs?: boolean;
127
-
128
- /**
129
- * Script file extension for generated output
130
- * @default 'ts'
131
- */
132
- scriptExt?: "ts" | "js";
133
-
134
- /**
135
- * Module name for runtime imports
136
- * @default 'vue'
137
- */
138
- runtimeModuleName?: string;
139
-
140
- /**
141
- * Global variable name for runtime (IIFE builds)
142
- * @default 'Vue'
143
- */
144
- runtimeGlobalName?: string;
145
- }
146
-
147
- // ============================================================================
148
- // VitePluginConfig
149
- // ============================================================================
150
-
151
- /**
152
- * Vite plugin configuration
153
- */
154
- export interface VitePluginConfig {
155
- /**
156
- * Files to include in compilation
157
- * @default /\.vue$/
158
- */
159
- include?: string | RegExp | (string | RegExp)[];
160
-
161
- /**
162
- * Files to exclude from compilation
163
- * @default /node_modules/
164
- */
165
- exclude?: string | RegExp | (string | RegExp)[];
166
-
167
- /**
168
- * Glob patterns to scan for .vue files during pre-compilation
169
- * @default ['**\/*.vue']
170
- */
171
- scanPatterns?: string[];
172
-
173
- /**
174
- * Glob patterns to ignore during pre-compilation
175
- * @default ['node_modules/**', 'dist/**', '.git/**']
176
- */
177
- ignorePatterns?: string[];
178
- }
179
-
180
- // ============================================================================
181
- // LinterConfig
182
- // ============================================================================
183
-
184
- /**
185
- * Linter configuration
186
- */
187
- export interface LinterConfig {
188
- /**
189
- * Enable linting
190
- */
191
- enabled?: boolean;
192
-
193
- /**
194
- * Rules to enable/disable
195
- */
196
- rules?: Record<string, RuleSeverity>;
197
-
198
- /**
199
- * Category-level severity overrides
200
- */
201
- categories?: Partial<Record<RuleCategory, RuleSeverity>>;
202
- }
203
-
204
- // ============================================================================
205
- // TypeCheckerConfig
206
- // ============================================================================
207
-
208
- /**
209
- * Type checker configuration
210
- */
211
- export interface TypeCheckerConfig {
212
- /**
213
- * Enable type checking
214
- * @default false
215
- */
216
- enabled?: boolean;
217
-
218
- /**
219
- * Enable strict mode
220
- * @default false
221
- */
222
- strict?: boolean;
223
-
224
- /**
225
- * Check component props
226
- * @default true
227
- */
228
- checkProps?: boolean;
229
-
230
- /**
231
- * Check component emits
232
- * @default true
233
- */
234
- checkEmits?: boolean;
235
-
236
- /**
237
- * Check template bindings
238
- * @default true
239
- */
240
- checkTemplateBindings?: boolean;
241
-
242
- /**
243
- * Path to tsconfig.json
244
- * @default auto-detected
245
- */
246
- tsconfig?: string;
247
-
248
- /**
249
- * Path to tsgo binary
250
- */
251
- tsgoPath?: string;
252
- }
253
-
254
- // ============================================================================
255
- // FormatterConfig
256
- // ============================================================================
257
-
258
- /**
259
- * Formatter configuration
260
- */
261
- export interface FormatterConfig {
262
- /**
263
- * Max line width
264
- * @default 80
265
- */
266
- printWidth?: number;
267
-
268
- /**
269
- * Indentation width
270
- * @default 2
271
- */
272
- tabWidth?: number;
273
-
274
- /**
275
- * Use tabs for indentation
276
- * @default false
277
- */
278
- useTabs?: boolean;
279
-
280
- /**
281
- * Print semicolons
282
- * @default true
283
- */
284
- semi?: boolean;
285
-
286
- /**
287
- * Use single quotes
288
- * @default false
289
- */
290
- singleQuote?: boolean;
291
-
292
- /**
293
- * Trailing commas
294
- * @default 'all'
295
- */
296
- trailingComma?: "all" | "none" | "es5";
297
- }
298
-
299
- // ============================================================================
300
- // LspConfig
301
- // ============================================================================
302
-
303
- /**
304
- * LSP configuration
305
- */
306
- export interface LspConfig {
307
- /**
308
- * Enable LSP
309
- * @default true
310
- */
311
- enabled?: boolean;
312
-
313
- /**
314
- * Enable diagnostics
315
- * @default true
316
- */
317
- diagnostics?: boolean;
318
-
319
- /**
320
- * Enable completions
321
- * @default true
322
- */
323
- completion?: boolean;
324
-
325
- /**
326
- * Enable hover information
327
- * @default true
328
- */
329
- hover?: boolean;
330
-
331
- /**
332
- * Enable go-to-definition
333
- * @default true
334
- */
335
- definition?: boolean;
336
-
337
- /**
338
- * Enable formatting via LSP
339
- * @default true
340
- */
341
- formatting?: boolean;
342
-
343
- /**
344
- * Enable code actions
345
- * @default true
346
- */
347
- codeActions?: boolean;
348
-
349
- /**
350
- * Use tsgo for type checking in LSP
351
- * @default false
352
- */
353
- tsgo?: boolean;
354
- }
355
-
356
- // ============================================================================
357
- // MuseaConfig
358
- // ============================================================================
359
-
360
- /**
361
- * VRT (Visual Regression Testing) configuration for Musea
362
- */
363
- export interface MuseaVrtConfig {
364
- /**
365
- * Threshold for pixel comparison (0-1)
366
- * @default 0.1
367
- */
368
- threshold?: number;
369
-
370
- /**
371
- * Output directory for screenshots
372
- * @default '__musea_snapshots__'
373
- */
374
- outDir?: string;
375
-
376
- /**
377
- * Viewport sizes
378
- */
379
- viewports?: Array<{ width: number; height: number; name?: string }>;
380
- }
381
-
382
- /**
383
- * A11y configuration for Musea
384
- */
385
- export interface MuseaA11yConfig {
386
- /**
387
- * Enable a11y checking
388
- * @default false
389
- */
390
- enabled?: boolean;
391
-
392
- /**
393
- * Axe-core rules to enable/disable
394
- */
395
- rules?: Record<string, boolean>;
396
- }
397
-
398
- /**
399
- * Autogen configuration for Musea
400
- */
401
- export interface MuseaAutogenConfig {
402
- /**
403
- * Enable auto-generation of variants
404
- * @default false
405
- */
406
- enabled?: boolean;
407
-
408
- /**
409
- * Max variants to generate per component
410
- * @default 10
411
- */
412
- maxVariants?: number;
413
- }
414
-
415
- /**
416
- * Musea component gallery configuration
417
- */
418
- export interface MuseaConfig {
419
- /**
420
- * Glob patterns for art files
421
- * @default ['**\/*.art.vue']
422
- */
423
- include?: string[];
424
-
425
- /**
426
- * Glob patterns to exclude
427
- * @default ['node_modules/**', 'dist/**']
428
- */
429
- exclude?: string[];
430
-
431
- /**
432
- * Base path for gallery
433
- * @default '/__musea__'
434
- */
435
- basePath?: string;
436
-
437
- /**
438
- * Enable Storybook compatibility
439
- * @default false
440
- */
441
- storybookCompat?: boolean;
442
-
443
- /**
444
- * Enable inline art detection in .vue files
445
- * @default false
446
- */
447
- inlineArt?: boolean;
448
-
449
- /**
450
- * VRT configuration
451
- */
452
- vrt?: MuseaVrtConfig;
453
-
454
- /**
455
- * A11y configuration
456
- */
457
- a11y?: MuseaA11yConfig;
458
-
459
- /**
460
- * Autogen configuration
461
- */
462
- autogen?: MuseaAutogenConfig;
463
- }
464
-
465
- // ============================================================================
466
- // GlobalTypesConfig
467
- // ============================================================================
468
-
469
- /**
470
- * Global type declaration
471
- */
472
- export interface GlobalTypeDeclaration {
473
- /**
474
- * TypeScript type string
475
- */
476
- type: string;
477
-
478
- /**
479
- * Default value
480
- */
481
- defaultValue?: string;
482
- }
483
-
484
- /**
485
- * Global types configuration
486
- */
487
- export type GlobalTypesConfig = Record<string, GlobalTypeDeclaration | string>;
488
-
489
- // ============================================================================
490
- // LoadConfigOptions
491
- // ============================================================================
492
-
493
- /**
494
- * Options for loading vize.config file
495
- */
496
- export interface LoadConfigOptions {
497
- /**
498
- * Config file search mode
499
- * - 'root': Search only in the specified root directory
500
- * - 'auto': Search from cwd upward until finding a config file
501
- * - 'none': Don't load config file
502
- * @default 'root'
503
- */
504
- mode?: "root" | "auto" | "none";
505
-
506
- /**
507
- * Custom config file path (overrides automatic search)
508
- */
509
- configFile?: string;
510
-
511
- /**
512
- * Config environment for dynamic config resolution
513
- */
514
- env?: ConfigEnv;
515
- }