vize 0.58.0 → 0.59.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/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/dist/cli.mjs ADDED
@@ -0,0 +1,217 @@
1
+ import { loadConfig } from "./config.mjs";
2
+ import { createRequire } from "node:module";
3
+ import { readFileSync } from "node:fs";
4
+ import * as path from "node:path";
5
+ import { spawnSync } from "node:child_process";
6
+ import { pathToFileURL } from "node:url";
7
+ //#region src/cli.ts
8
+ const require = createRequire(import.meta.url);
9
+ const WORKSPACE_BINDING_PATH = "../../vize-native";
10
+ function isMusl() {
11
+ const report = process.report?.getReport();
12
+ if (typeof report === "object" && report !== null && "header" in report) return !report.header.glibcVersionRuntime;
13
+ try {
14
+ return readFileSync(require("child_process").execSync("which ldd").toString().trim(), "utf8").includes("musl");
15
+ } catch {
16
+ return true;
17
+ }
18
+ }
19
+ function getBindingPackageName() {
20
+ const { platform, arch } = process;
21
+ switch (platform) {
22
+ case "darwin": switch (arch) {
23
+ case "x64": return "@vizejs/native-darwin-x64";
24
+ case "arm64": return "@vizejs/native-darwin-arm64";
25
+ default: throw new Error(`Unsupported architecture on macOS: ${arch}`);
26
+ }
27
+ case "win32": switch (arch) {
28
+ case "x64": return "@vizejs/native-win32-x64-msvc";
29
+ case "arm64": return "@vizejs/native-win32-arm64-msvc";
30
+ default: throw new Error(`Unsupported architecture on Windows: ${arch}`);
31
+ }
32
+ case "linux": switch (arch) {
33
+ case "x64": return isMusl() ? "@vizejs/native-linux-x64-musl" : "@vizejs/native-linux-x64-gnu";
34
+ case "arm64": return isMusl() ? "@vizejs/native-linux-arm64-musl" : "@vizejs/native-linux-arm64-gnu";
35
+ default: throw new Error(`Unsupported architecture on Linux: ${arch}`);
36
+ }
37
+ default: throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
38
+ }
39
+ }
40
+ function loadNative() {
41
+ const attemptedPackages = getAttemptedPackages();
42
+ let lastError = null;
43
+ for (const packageName of attemptedPackages) try {
44
+ const binding = require(packageName);
45
+ if (typeof binding.lint !== "function") throw new Error(`${packageName} does not expose the lint binding.`);
46
+ return binding;
47
+ } catch (error) {
48
+ lastError = error;
49
+ }
50
+ console.error(`Failed to load native binding. Tried: ${attemptedPackages.join(", ")}`);
51
+ console.error("Try reinstalling: npm install vize");
52
+ throw lastError instanceof Error ? lastError : /* @__PURE__ */ new Error("Failed to load native binding");
53
+ }
54
+ function getAttemptedPackages() {
55
+ const platformBindingPackage = getBindingPackageName();
56
+ return shouldPreferWorkspaceBinding(resolveWorkspaceBindingPath()) ? [WORKSPACE_BINDING_PATH, platformBindingPackage] : [platformBindingPackage, WORKSPACE_BINDING_PATH];
57
+ }
58
+ function resolveWorkspaceBindingPath() {
59
+ try {
60
+ return require.resolve(WORKSPACE_BINDING_PATH);
61
+ } catch {
62
+ return null;
63
+ }
64
+ }
65
+ function shouldPreferWorkspaceBinding(resolvedPath) {
66
+ const override = process.env.VIZE_PREFER_WORKSPACE_BINDING;
67
+ if (override === "1" || override === "true") return true;
68
+ if (override === "0" || override === "false") return false;
69
+ if (resolvedPath == null) return false;
70
+ return resolvedPath.includes(`${path.sep}npm${path.sep}vize-native${path.sep}`);
71
+ }
72
+ function printUsage() {
73
+ console.error("Usage: vize <command> [options]");
74
+ console.error("Commands: lint, musea");
75
+ }
76
+ function resolvePackageBinaryFromCwd(packageName, binName = packageName) {
77
+ const packageJsonPath = createRequire(pathToFileURL(path.join(process.cwd(), "package.json")).href).resolve(`${packageName}/package.json`);
78
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
79
+ const bin = typeof packageJson.bin === "string" ? packageJson.bin : packageJson.bin?.[binName];
80
+ if (!bin) throw new Error(`Could not resolve binary '${binName}' from package '${packageName}'`);
81
+ return path.resolve(path.dirname(packageJsonPath), bin);
82
+ }
83
+ function runMusea(args) {
84
+ if (args.includes("--help") || args.includes("-h")) {
85
+ console.error("Usage: vize musea [--build] [...vite options]");
86
+ console.error(" --build Run `vite build` instead of `vite dev`");
87
+ return;
88
+ }
89
+ const isBuild = args.includes("--build");
90
+ const viteArgs = args.filter((arg) => arg !== "--build");
91
+ const viteCommand = isBuild ? "build" : "dev";
92
+ const viteBin = resolvePackageBinaryFromCwd("vite");
93
+ const result = spawnSync(process.execPath, [
94
+ viteBin,
95
+ viteCommand,
96
+ ...viteArgs
97
+ ], {
98
+ stdio: "inherit",
99
+ cwd: process.cwd(),
100
+ env: process.env
101
+ });
102
+ if (result.error) throw result.error;
103
+ process.exit(result.status ?? 1);
104
+ }
105
+ function parseLintCommand(args) {
106
+ const patterns = [];
107
+ const options = {};
108
+ const sharedConfig = { configMode: "root" };
109
+ for (let i = 0; i < args.length; i++) {
110
+ const arg = args[i];
111
+ if (arg === "--format" || arg === "-f") options.format = args[++i];
112
+ else if (arg === "--max-warnings") options.maxWarnings = Number.parseInt(args[++i], 10);
113
+ else if (arg === "--quiet" || arg === "-q") options.quiet = true;
114
+ else if (arg === "--fix") options.fix = true;
115
+ else if (arg === "--help-level") options.helpLevel = args[++i];
116
+ else if (arg === "--preset") options.preset = args[++i];
117
+ else if (arg === "--config" || arg === "-c") {
118
+ const configFile = args[++i];
119
+ if (!configFile) throw new Error("Missing path after --config");
120
+ sharedConfig.configFile = configFile;
121
+ } else if (arg === "--no-config") sharedConfig.configMode = "none";
122
+ else if (!arg.startsWith("-")) patterns.push(arg);
123
+ }
124
+ return {
125
+ patterns,
126
+ options,
127
+ sharedConfig
128
+ };
129
+ }
130
+ async function runLint(args) {
131
+ const { patterns, options, sharedConfig } = parseLintCommand(args);
132
+ const config = await loadConfig(process.cwd(), {
133
+ mode: sharedConfig.configMode,
134
+ configFile: sharedConfig.configFile,
135
+ env: {
136
+ mode: process.env.NODE_ENV ?? "development",
137
+ command: "lint"
138
+ }
139
+ });
140
+ if (sharedConfig.configFile && !config) throw new Error(`Could not find config file: ${sharedConfig.configFile}`);
141
+ if (config?.linter?.enabled === false) {
142
+ process.stderr.write("[vize] Skipping lint because linter.enabled is false in vize.config.\n");
143
+ return;
144
+ }
145
+ options.preset ??= config?.linter?.preset;
146
+ if (patterns.length === 0) patterns.push(".");
147
+ const result = loadNative().lint(patterns, {
148
+ format: options.format,
149
+ max_warnings: options.maxWarnings,
150
+ quiet: options.quiet,
151
+ fix: options.fix,
152
+ help_level: options.helpLevel,
153
+ preset: options.preset
154
+ });
155
+ if (result.output) {
156
+ process.stdout.write(result.output);
157
+ if (!result.output.endsWith("\n")) process.stdout.write("\n");
158
+ }
159
+ if (options.fix) process.stderr.write("\nNote: --fix is not yet implemented\n");
160
+ if (result.errorCount > 0) process.exit(1);
161
+ if (options.maxWarnings !== void 0 && result.warningCount > options.maxWarnings) {
162
+ process.stderr.write(`\nToo many warnings (${result.warningCount} > max ${options.maxWarnings})\n`);
163
+ process.exit(1);
164
+ }
165
+ }
166
+ const NAPI_COMMANDS = new Set(["lint"]);
167
+ const JS_COMMANDS = new Set(["musea"]);
168
+ async function main() {
169
+ const args = process.argv.slice(2);
170
+ const command = args[0];
171
+ if (!command || command === "--help" || command === "-h") {
172
+ printUsage();
173
+ process.exit(1);
174
+ }
175
+ if (NAPI_COMMANDS.has(command)) {
176
+ const commandArgs = args.slice(1);
177
+ switch (command) {
178
+ case "lint":
179
+ await runLint(commandArgs);
180
+ break;
181
+ }
182
+ } else if (JS_COMMANDS.has(command)) {
183
+ const commandArgs = args.slice(1);
184
+ switch (command) {
185
+ case "musea":
186
+ runMusea(commandArgs);
187
+ break;
188
+ }
189
+ } else {
190
+ printUsage();
191
+ console.error(`Unknown command: ${command}`);
192
+ console.error("For commands not yet available via NAPI, install from source: cargo install vize");
193
+ process.exit(1);
194
+ }
195
+ }
196
+ if (!import.meta.vitest) main().catch((error) => {
197
+ console.error(error instanceof Error ? error.message : String(error));
198
+ process.exit(1);
199
+ });
200
+ if (import.meta.vitest) {
201
+ const { describe, expect, it } = import.meta.vitest;
202
+ describe("shouldPreferWorkspaceBinding", () => {
203
+ it("detects the local workspace native package", () => {
204
+ expect(shouldPreferWorkspaceBinding(`${path.sep}Users${path.sep}example${path.sep}repo${path.sep}npm${path.sep}vize-native${path.sep}index.js`)).toBe(true);
205
+ });
206
+ it("ignores published platform packages", () => {
207
+ expect(shouldPreferWorkspaceBinding(`${path.sep}repo${path.sep}node_modules${path.sep}.pnpm${path.sep}@vizejs+native-darwin-arm64${path.sep}node_modules${path.sep}@vizejs${path.sep}native-darwin-arm64${path.sep}index.js`)).toBe(false);
208
+ });
209
+ it("returns false when the fallback package cannot be resolved", () => {
210
+ expect(shouldPreferWorkspaceBinding(null)).toBe(false);
211
+ });
212
+ });
213
+ }
214
+ //#endregion
215
+ export {};
216
+
217
+ //# sourceMappingURL=cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { spawnSync } from \"node:child_process\";\nimport * as path from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { loadConfig } from \"./config.js\";\n\nconst require = createRequire(import.meta.url);\nconst WORKSPACE_BINDING_PATH = \"../../vize-native\";\n\n// ============================================================================\n// Native binding loader (oxlint pattern)\n// ============================================================================\n\nfunction isMusl(): boolean {\n const report = process.report?.getReport();\n if (typeof report === \"object\" && report !== null && \"header\" in report) {\n const header = (report as { header: { glibcVersionRuntime?: string } }).header;\n return !header.glibcVersionRuntime;\n }\n try {\n const lddPath = require(\"child_process\").execSync(\"which ldd\").toString().trim();\n return readFileSync(lddPath, \"utf8\").includes(\"musl\");\n } catch {\n return true;\n }\n}\n\nfunction getBindingPackageName(): string {\n const { platform, arch } = process;\n\n switch (platform) {\n case \"darwin\":\n switch (arch) {\n case \"x64\":\n return \"@vizejs/native-darwin-x64\";\n case \"arm64\":\n return \"@vizejs/native-darwin-arm64\";\n default:\n throw new Error(`Unsupported architecture on macOS: ${arch}`);\n }\n case \"win32\":\n switch (arch) {\n case \"x64\":\n return \"@vizejs/native-win32-x64-msvc\";\n case \"arm64\":\n return \"@vizejs/native-win32-arm64-msvc\";\n default:\n throw new Error(`Unsupported architecture on Windows: ${arch}`);\n }\n case \"linux\":\n switch (arch) {\n case \"x64\":\n return isMusl() ? \"@vizejs/native-linux-x64-musl\" : \"@vizejs/native-linux-x64-gnu\";\n case \"arm64\":\n return isMusl() ? \"@vizejs/native-linux-arm64-musl\" : \"@vizejs/native-linux-arm64-gnu\";\n default:\n throw new Error(`Unsupported architecture on Linux: ${arch}`);\n }\n default:\n throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);\n }\n}\n\ninterface NativeBinding {\n lint: (\n patterns: string[],\n options?: {\n format?: string;\n max_warnings?: number;\n quiet?: boolean;\n fix?: boolean;\n help_level?: string;\n preset?: string;\n },\n ) => LintResult;\n}\n\nfunction loadNative(): NativeBinding {\n const attemptedPackages = getAttemptedPackages();\n let lastError: unknown = null;\n\n for (const packageName of attemptedPackages) {\n try {\n const binding = require(packageName) as Partial<NativeBinding>;\n if (typeof binding.lint !== \"function\") {\n throw new Error(`${packageName} does not expose the lint binding.`);\n }\n return binding as NativeBinding;\n } catch (error) {\n lastError = error;\n }\n }\n\n console.error(`Failed to load native binding. Tried: ${attemptedPackages.join(\", \")}`);\n console.error(\"Try reinstalling: npm install vize\");\n throw lastError instanceof Error ? lastError : new Error(\"Failed to load native binding\");\n}\n\nfunction getAttemptedPackages(): readonly string[] {\n const platformBindingPackage = getBindingPackageName();\n return shouldPreferWorkspaceBinding(resolveWorkspaceBindingPath())\n ? [WORKSPACE_BINDING_PATH, platformBindingPackage]\n : [platformBindingPackage, WORKSPACE_BINDING_PATH];\n}\n\nfunction resolveWorkspaceBindingPath(): string | null {\n try {\n return require.resolve(WORKSPACE_BINDING_PATH);\n } catch {\n return null;\n }\n}\n\nfunction shouldPreferWorkspaceBinding(resolvedPath: string | null): boolean {\n const override = process.env.VIZE_PREFER_WORKSPACE_BINDING;\n if (override === \"1\" || override === \"true\") {\n return true;\n }\n if (override === \"0\" || override === \"false\") {\n return false;\n }\n if (resolvedPath == null) {\n return false;\n }\n\n return resolvedPath.includes(`${path.sep}npm${path.sep}vize-native${path.sep}`);\n}\n\n// ============================================================================\n// Lint command\n// ============================================================================\n\ninterface LintOptions {\n format?: string;\n maxWarnings?: number;\n quiet?: boolean;\n fix?: boolean;\n helpLevel?: string;\n preset?: string;\n}\n\ninterface LintResult {\n output: string;\n errorCount: number;\n warningCount: number;\n fileCount: number;\n timeMs: number;\n}\n\ninterface SharedConfigOptions {\n configFile?: string;\n configMode: \"root\" | \"none\";\n}\n\ninterface ParsedLintCommand {\n patterns: string[];\n options: LintOptions;\n sharedConfig: SharedConfigOptions;\n}\n\nfunction printUsage(): void {\n console.error(\"Usage: vize <command> [options]\");\n console.error(\"Commands: lint, musea\");\n}\n\nfunction resolvePackageBinaryFromCwd(packageName: string, binName: string = packageName): string {\n const cwdRequire = createRequire(pathToFileURL(path.join(process.cwd(), \"package.json\")).href);\n const packageJsonPath = cwdRequire.resolve(`${packageName}/package.json`);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as {\n bin?: string | Record<string, string>;\n };\n\n const bin = typeof packageJson.bin === \"string\" ? packageJson.bin : packageJson.bin?.[binName];\n\n if (!bin) {\n throw new Error(`Could not resolve binary '${binName}' from package '${packageName}'`);\n }\n\n return path.resolve(path.dirname(packageJsonPath), bin);\n}\n\nfunction runMusea(args: string[]): void {\n const isHelp = args.includes(\"--help\") || args.includes(\"-h\");\n if (isHelp) {\n console.error(\"Usage: vize musea [--build] [...vite options]\");\n console.error(\" --build Run `vite build` instead of `vite dev`\");\n return;\n }\n\n const isBuild = args.includes(\"--build\");\n const viteArgs = args.filter((arg) => arg !== \"--build\");\n const viteCommand = isBuild ? \"build\" : \"dev\";\n const viteBin = resolvePackageBinaryFromCwd(\"vite\");\n const result = spawnSync(process.execPath, [viteBin, viteCommand, ...viteArgs], {\n stdio: \"inherit\",\n cwd: process.cwd(),\n env: process.env,\n });\n\n if (result.error) {\n throw result.error;\n }\n\n process.exit(result.status ?? 1);\n}\n\nfunction parseLintCommand(args: string[]): ParsedLintCommand {\n const patterns: string[] = [];\n const options: LintOptions = {};\n const sharedConfig: SharedConfigOptions = {\n configMode: \"root\",\n };\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === \"--format\" || arg === \"-f\") {\n options.format = args[++i];\n } else if (arg === \"--max-warnings\") {\n options.maxWarnings = Number.parseInt(args[++i], 10);\n } else if (arg === \"--quiet\" || arg === \"-q\") {\n options.quiet = true;\n } else if (arg === \"--fix\") {\n options.fix = true;\n } else if (arg === \"--help-level\") {\n options.helpLevel = args[++i];\n } else if (arg === \"--preset\") {\n options.preset = args[++i];\n } else if (arg === \"--config\" || arg === \"-c\") {\n const configFile = args[++i];\n if (!configFile) {\n throw new Error(\"Missing path after --config\");\n }\n sharedConfig.configFile = configFile;\n } else if (arg === \"--no-config\") {\n sharedConfig.configMode = \"none\";\n } else if (!arg.startsWith(\"-\")) {\n patterns.push(arg);\n }\n }\n\n return { patterns, options, sharedConfig };\n}\n\nasync function runLint(args: string[]): Promise<void> {\n const { patterns, options, sharedConfig } = parseLintCommand(args);\n const config = await loadConfig(process.cwd(), {\n mode: sharedConfig.configMode,\n configFile: sharedConfig.configFile,\n env: {\n mode: process.env.NODE_ENV ?? \"development\",\n command: \"lint\",\n },\n });\n\n if (sharedConfig.configFile && !config) {\n throw new Error(`Could not find config file: ${sharedConfig.configFile}`);\n }\n\n if (config?.linter?.enabled === false) {\n process.stderr.write(\"[vize] Skipping lint because linter.enabled is false in vize.config.\\n\");\n return;\n }\n\n options.preset ??= config?.linter?.preset;\n\n if (patterns.length === 0) {\n patterns.push(\".\");\n }\n\n const native = loadNative();\n const result = native.lint(patterns, {\n format: options.format,\n max_warnings: options.maxWarnings,\n quiet: options.quiet,\n fix: options.fix,\n help_level: options.helpLevel,\n preset: options.preset,\n });\n\n if (result.output) {\n process.stdout.write(result.output);\n if (!result.output.endsWith(\"\\n\")) {\n process.stdout.write(\"\\n\");\n }\n }\n\n if (options.fix) {\n process.stderr.write(\"\\nNote: --fix is not yet implemented\\n\");\n }\n\n if (result.errorCount > 0) {\n process.exit(1);\n }\n\n if (options.maxWarnings !== undefined && result.warningCount > options.maxWarnings) {\n process.stderr.write(\n `\\nToo many warnings (${result.warningCount} > max ${options.maxWarnings})\\n`,\n );\n process.exit(1);\n }\n}\n\n// ============================================================================\n// Command router\n// ============================================================================\n\nconst NAPI_COMMANDS = new Set([\"lint\"]);\nconst JS_COMMANDS = new Set([\"musea\"]);\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n const command = args[0];\n\n if (!command || command === \"--help\" || command === \"-h\") {\n printUsage();\n process.exit(1);\n }\n\n if (NAPI_COMMANDS.has(command)) {\n const commandArgs = args.slice(1);\n switch (command) {\n case \"lint\":\n await runLint(commandArgs);\n break;\n }\n } else if (JS_COMMANDS.has(command)) {\n const commandArgs = args.slice(1);\n switch (command) {\n case \"musea\":\n runMusea(commandArgs);\n break;\n }\n } else {\n printUsage();\n console.error(`Unknown command: ${command}`);\n console.error(\n \"For commands not yet available via NAPI, install from source: cargo install vize\",\n );\n process.exit(1);\n }\n}\n\nif (!import.meta.vitest) {\n void main().catch((error) => {\n console.error(error instanceof Error ? error.message : String(error));\n process.exit(1);\n });\n}\n\nif (import.meta.vitest) {\n const { describe, expect, it } = import.meta.vitest;\n\n describe(\"shouldPreferWorkspaceBinding\", () => {\n it(\"detects the local workspace native package\", () => {\n expect(\n shouldPreferWorkspaceBinding(\n `${path.sep}Users${path.sep}example${path.sep}repo${path.sep}npm${path.sep}vize-native${path.sep}index.js`,\n ),\n ).toBe(true);\n });\n\n it(\"ignores published platform packages\", () => {\n expect(\n shouldPreferWorkspaceBinding(\n `${path.sep}repo${path.sep}node_modules${path.sep}.pnpm${path.sep}@vizejs+native-darwin-arm64${path.sep}node_modules${path.sep}@vizejs${path.sep}native-darwin-arm64${path.sep}index.js`,\n ),\n ).toBe(false);\n });\n\n it(\"returns false when the fallback package cannot be resolved\", () => {\n expect(shouldPreferWorkspaceBinding(null)).toBe(false);\n });\n });\n}\n"],"mappings":";;;;;;;AAOA,MAAM,UAAU,cAAc,OAAO,KAAK,IAAI;AAC9C,MAAM,yBAAyB;AAM/B,SAAS,SAAkB;CACzB,MAAM,SAAS,QAAQ,QAAQ,WAAW;AAC1C,KAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,YAAY,OAE/D,QAAO,CADS,OAAwD,OACzD;AAEjB,KAAI;AAEF,SAAO,aADS,QAAQ,gBAAgB,CAAC,SAAS,YAAY,CAAC,UAAU,CAAC,MAAM,EACnD,OAAO,CAAC,SAAS,OAAO;SAC/C;AACN,SAAO;;;AAIX,SAAS,wBAAgC;CACvC,MAAM,EAAE,UAAU,SAAS;AAE3B,SAAQ,UAAR;EACE,KAAK,SACH,SAAQ,MAAR;GACE,KAAK,MACH,QAAO;GACT,KAAK,QACH,QAAO;GACT,QACE,OAAM,IAAI,MAAM,sCAAsC,OAAO;;EAEnE,KAAK,QACH,SAAQ,MAAR;GACE,KAAK,MACH,QAAO;GACT,KAAK,QACH,QAAO;GACT,QACE,OAAM,IAAI,MAAM,wCAAwC,OAAO;;EAErE,KAAK,QACH,SAAQ,MAAR;GACE,KAAK,MACH,QAAO,QAAQ,GAAG,kCAAkC;GACtD,KAAK,QACH,QAAO,QAAQ,GAAG,oCAAoC;GACxD,QACE,OAAM,IAAI,MAAM,sCAAsC,OAAO;;EAEnE,QACE,OAAM,IAAI,MAAM,mBAAmB,SAAS,kBAAkB,OAAO;;;AAkB3E,SAAS,aAA4B;CACnC,MAAM,oBAAoB,sBAAsB;CAChD,IAAI,YAAqB;AAEzB,MAAK,MAAM,eAAe,kBACxB,KAAI;EACF,MAAM,UAAU,QAAQ,YAAY;AACpC,MAAI,OAAO,QAAQ,SAAS,WAC1B,OAAM,IAAI,MAAM,GAAG,YAAY,oCAAoC;AAErE,SA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configuration
4
+ */
5
+ interface CompilerConfig {
6
+ /**
7
+ * Compilation mode
8
+ * @default 'module'
9
+ */
10
+ mode?: "module" | "function";
11
+ /**
12
+ * Enable Vapor mode compilation
13
+ * @default false
14
+ */
15
+ vapor?: boolean;
16
+ /**
17
+ * Enable SSR mode
18
+ * @default false
19
+ */
20
+ ssr?: boolean;
21
+ /**
22
+ * Enable source map generation
23
+ * @default true in development, false in production
24
+ */
25
+ sourceMap?: boolean;
26
+ /**
27
+ * Prefix template identifiers with _ctx
28
+ * @default false
29
+ */
30
+ prefixIdentifiers?: boolean;
31
+ /**
32
+ * Hoist static nodes
33
+ * @default true
34
+ */
35
+ hoistStatic?: boolean;
36
+ /**
37
+ * Cache v-on handlers
38
+ * @default true
39
+ */
40
+ cacheHandlers?: boolean;
41
+ /**
42
+ * Enable TypeScript parsing in <script> blocks
43
+ * @default true
44
+ */
45
+ isTs?: boolean;
46
+ /**
47
+ * Script file extension for generated output
48
+ * @default 'ts'
49
+ */
50
+ scriptExt?: "ts" | "js";
51
+ /**
52
+ * Module name for runtime imports
53
+ * @default 'vue'
54
+ */
55
+ runtimeModuleName?: string;
56
+ /**
57
+ * Global variable name for runtime (IIFE builds)
58
+ * @default 'Vue'
59
+ */
60
+ runtimeGlobalName?: string;
61
+ }
62
+ /**
63
+ * Vite plugin configuration
64
+ */
65
+ interface VitePluginConfig {
66
+ /**
67
+ * Files to include in compilation
68
+ * @default /\.vue$/
69
+ */
70
+ include?: string | RegExp | (string | RegExp)[];
71
+ /**
72
+ * Files to exclude from compilation
73
+ * @default /node_modules/
74
+ */
75
+ exclude?: string | RegExp | (string | RegExp)[];
76
+ /**
77
+ * Glob patterns to scan for .vue files during pre-compilation
78
+ * @default ['**\/*.vue']
79
+ */
80
+ scanPatterns?: string[];
81
+ /**
82
+ * Glob patterns to ignore during pre-compilation
83
+ * @default ['node_modules/**', 'dist/**', '.git/**']
84
+ */
85
+ ignorePatterns?: string[];
86
+ }
87
+ //#endregion
88
+ //#region src/types/rules.d.ts
89
+ 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"];
90
+ type LintRuleName = (typeof LINT_RULE_NAMES)[number];
91
+ type LintRulesConfig = Partial<Record<LintRuleName, RuleSeverity>>;
92
+ //#endregion
93
+ //#region src/types/tools.d.ts
94
+ /**
95
+ * Linter configuration
96
+ */
97
+ interface LinterConfig {
98
+ /**
99
+ * Enable linting
100
+ */
101
+ enabled?: boolean;
102
+ /**
103
+ * Built-in lint preset
104
+ * @default 'happy-path'
105
+ */
106
+ preset?: LintPreset;
107
+ /**
108
+ * Rules to enable/disable
109
+ */
110
+ rules?: LintRulesConfig;
111
+ /**
112
+ * Category-level severity overrides
113
+ */
114
+ categories?: Partial<Record<RuleCategory, RuleSeverity>>;
115
+ }
116
+ /**
117
+ * Type checker configuration
118
+ */
119
+ interface TypeCheckerConfig {
120
+ /**
121
+ * Enable type checking
122
+ * @default false
123
+ */
124
+ enabled?: boolean;
125
+ /**
126
+ * Enable strict mode
127
+ * @default false
128
+ */
129
+ strict?: boolean;
130
+ /**
131
+ * Check component props
132
+ * @default true
133
+ */
134
+ checkProps?: boolean;
135
+ /**
136
+ * Check component emits
137
+ * @default true
138
+ */
139
+ checkEmits?: boolean;
140
+ /**
141
+ * Check template bindings
142
+ * @default true
143
+ */
144
+ checkTemplateBindings?: boolean;
145
+ /**
146
+ * Path to tsconfig.json
147
+ * @default auto-detected
148
+ */
149
+ tsconfig?: string;
150
+ /**
151
+ * Path to the Corsa binary
152
+ */
153
+ corsaPath?: string;
154
+ }
155
+ /**
156
+ * Formatter configuration
157
+ */
158
+ interface FormatterConfig {
159
+ /**
160
+ * Max line width
161
+ * @default 80
162
+ */
163
+ printWidth?: number;
164
+ /**
165
+ * Indentation width
166
+ * @default 2
167
+ */
168
+ tabWidth?: number;
169
+ /**
170
+ * Use tabs for indentation
171
+ * @default false
172
+ */
173
+ useTabs?: boolean;
174
+ /**
175
+ * Print semicolons
176
+ * @default true
177
+ */
178
+ semi?: boolean;
179
+ /**
180
+ * Use single quotes
181
+ * @default false
182
+ */
183
+ singleQuote?: boolean;
184
+ /**
185
+ * Trailing commas
186
+ * @default 'all'
187
+ */
188
+ trailingComma?: "all" | "none" | "es5";
189
+ }
190
+ /**
191
+ * LSP configuration
192
+ */
193
+ interface LspConfig {
194
+ /**
195
+ * Enable LSP
196
+ * @default false
197
+ */
198
+ enabled?: boolean;
199
+ /**
200
+ * Enable linter diagnostics.
201
+ * Prefer this over `diagnostics` for new configs.
202
+ * @default false
203
+ */
204
+ lint?: boolean;
205
+ /**
206
+ * Enable linter diagnostics.
207
+ * @deprecated Use `lint` instead.
208
+ * @default false
209
+ */
210
+ diagnostics?: boolean;
211
+ /**
212
+ * Enable type checking diagnostics and type-aware LSP features.
213
+ * @default false
214
+ */
215
+ typecheck?: boolean;
216
+ /**
217
+ * Enable the editor assistance bundle: completion, hover, navigation,
218
+ * symbols, rename, code lens, semantic tokens, links, folding, inlay hints,
219
+ * and file rename handling. Formatting stays separately opt-in.
220
+ * @default false
221
+ */
222
+ editor?: boolean;
223
+ /**
224
+ * Enable completions.
225
+ * @default false
226
+ */
227
+ completion?: boolean;
228
+ /**
229
+ * Enable hover information
230
+ * @default false
231
+ */
232
+ hover?: boolean;
233
+ /**
234
+ * Enable go-to-definition
235
+ * @default false
236
+ */
237
+ definition?: boolean;
238
+ /**
239
+ * Enable find references
240
+ * @default false
241
+ */
242
+ references?: boolean;
243
+ /**
244
+ * Enable document symbols
245
+ * @default false
246
+ */
247
+ documentSymbols?: boolean;
248
+ /**
249
+ * Enable workspace symbols
250
+ * @default false
251
+ */
252
+ workspaceSymbols?: boolean;
253
+ /**
254
+ * Enable formatting via LSP
255
+ * @default false
256
+ */
257
+ formatting?: boolean;
258
+ /**
259
+ * Enable code actions
260
+ * @default false
261
+ */
262
+ codeActions?: boolean;
263
+ /**
264
+ * Enable rename
265
+ * @default false
266
+ */
267
+ rename?: boolean;
268
+ /**
269
+ * Enable code lens
270
+ * @default false
271
+ */
272
+ codeLens?: boolean;
273
+ /**
274
+ * Enable semantic tokens
275
+ * @default false
276
+ */
277
+ semanticTokens?: boolean;
278
+ /**
279
+ * Enable document links
280
+ * @default false
281
+ */
282
+ documentLinks?: boolean;
283
+ /**
284
+ * Enable folding ranges
285
+ * @default false
286
+ */
287
+ foldingRanges?: boolean;
288
+ /**
289
+ * Enable inlay hints
290
+ * @default false
291
+ */
292
+ inlayHints?: boolean;
293
+ /**
294
+ * Enable file rename edits
295
+ * @default false
296
+ */
297
+ fileRename?: boolean;
298
+ /**
299
+ * Use Corsa for type checking in LSP
300
+ * @default false
301
+ */
302
+ corsa?: boolean;
303
+ }
304
+ //#endregion
305
+ //#region src/types/musea.d.ts
306
+ /**
307
+ * VRT (Visual Regression Testing) configuration for Musea
308
+ */
309
+ interface MuseaVrtConfig {
310
+ /**
311
+ * Threshold for pixel comparison (0-1)
312
+ * @default 0.1
313
+ */
314
+ threshold?: number;
315
+ /**
316
+ * Output directory for screenshots
317
+ * @default '__musea_snapshots__'
318
+ */
319
+ outDir?: string;
320
+ /**
321
+ * Viewport sizes
322
+ */
323
+ viewports?: Array<{
324
+ width: number;
325
+ height: number;
326
+ name?: string;
327
+ }>;
328
+ }
329
+ /**
330
+ * A11y configuration for Musea
331
+ */
332
+ interface MuseaA11yConfig {
333
+ /**
334
+ * Enable a11y checking
335
+ * @default false
336
+ */
337
+ enabled?: boolean;
338
+ /**
339
+ * Axe-core rules to enable/disable
340
+ */
341
+ rules?: Record<string, boolean>;
342
+ }
343
+ /**
344
+ * Autogen configuration for Musea
345
+ */
346
+ interface MuseaAutogenConfig {
347
+ /**
348
+ * Enable auto-generation of variants
349
+ * @default false
350
+ */
351
+ enabled?: boolean;
352
+ /**
353
+ * Max variants to generate per component
354
+ * @default 10
355
+ */
356
+ maxVariants?: number;
357
+ }
358
+ /**
359
+ * Musea component gallery configuration
360
+ */
361
+ interface MuseaConfig {
362
+ /**
363
+ * Glob patterns for art files
364
+ * @default ['**\/*.art.vue']
365
+ */
366
+ include?: string[];
367
+ /**
368
+ * Glob patterns to exclude
369
+ * @default ['node_modules/**', 'dist/**']
370
+ */
371
+ exclude?: string[];
372
+ /**
373
+ * Base path for gallery
374
+ * @default '/__musea__'
375
+ */
376
+ basePath?: string;
377
+ /**
378
+ * Enable Storybook compatibility
379
+ * @default false
380
+ */
381
+ storybookCompat?: boolean;
382
+ /**
383
+ * Enable inline art detection in .vue files
384
+ * @default false
385
+ */
386
+ inlineArt?: boolean;
387
+ /**
388
+ * VRT configuration
389
+ */
390
+ vrt?: MuseaVrtConfig;
391
+ /**
392
+ * A11y configuration
393
+ */
394
+ a11y?: MuseaA11yConfig;
395
+ /**
396
+ * Autogen configuration
397
+ */
398
+ autogen?: MuseaAutogenConfig;
399
+ }
400
+ //#endregion
401
+ //#region src/types/loader.d.ts
402
+ /**
403
+ * Global type declaration
404
+ */
405
+ interface GlobalTypeDeclaration {
406
+ /**
407
+ * TypeScript type string
408
+ */
409
+ type: string;
410
+ /**
411
+ * Default value
412
+ */
413
+ defaultValue?: string;
414
+ }
415
+ /**
416
+ * Global types configuration
417
+ */
418
+ type GlobalTypesConfig = Record<string, GlobalTypeDeclaration | string>;
419
+ /**
420
+ * Options for loading vize.config file
421
+ */
422
+ interface LoadConfigOptions {
423
+ /**
424
+ * Config file search mode
425
+ * - 'root': Search only in the specified root directory
426
+ * - 'auto': Search from cwd upward until finding a config file
427
+ * - 'none': Don't load config file
428
+ * @default 'root'
429
+ */
430
+ mode?: "root" | "auto" | "none";
431
+ /**
432
+ * Custom config file path (overrides automatic search)
433
+ */
434
+ configFile?: string;
435
+ /**
436
+ * Config environment for dynamic config resolution
437
+ */
438
+ env?: ConfigEnv;
439
+ }
440
+ //#endregion
441
+ //#region src/types/core.d.ts
442
+ type MaybePromise<T> = T | Promise<T>;
443
+ interface ConfigEnv {
444
+ mode: string;
445
+ command: "serve" | "build" | "check" | "lint" | "fmt";
446
+ isSsrBuild?: boolean;
447
+ }
448
+ type UserConfigExport = VizeConfig | ((env: ConfigEnv) => MaybePromise<VizeConfig>);
449
+ type RuleSeverity = "off" | "warn" | "error";
450
+ type RuleCategory = "correctness" | "suspicious" | "style" | "perf" | "a11y" | "security";
451
+ type LintPreset = "happy-path" | "opinionated" | "essential" | "nuxt";
452
+ /**
453
+ * Vize configuration options
454
+ */
455
+ interface VizeConfig {
456
+ /**
457
+ * JSON Schema reference for editor autocompletion.
458
+ */
459
+ $schema?: string;
460
+ /**
461
+ * Vue compiler options
462
+ */
463
+ compiler?: CompilerConfig;
464
+ /**
465
+ * Vite plugin options
466
+ */
467
+ vite?: VitePluginConfig;
468
+ /**
469
+ * Linter options
470
+ */
471
+ linter?: LinterConfig;
472
+ /**
473
+ * Type checker options
474
+ */
475
+ typeChecker?: TypeCheckerConfig;
476
+ /**
477
+ * Formatter options
478
+ */
479
+ formatter?: FormatterConfig;
480
+ /**
481
+ * LSP options
482
+ */
483
+ lsp?: LspConfig;
484
+ /**
485
+ * Musea component gallery options
486
+ */
487
+ musea?: MuseaConfig;
488
+ /**
489
+ * Global type declarations
490
+ */
491
+ globalTypes?: GlobalTypesConfig;
492
+ }
493
+ //#endregion
494
+ //#region src/config.d.ts
495
+ declare const CONFIG_FILE_NAMES: readonly ["vize.config.ts", "vize.config.js", "vize.config.mjs", "vize.config.pkl", "vize.config.json"];
496
+ declare const VIZE_CONFIG_JSON_SCHEMA_PATH: any;
497
+ declare const VIZE_CONFIG_PKL_SCHEMA_PATH: any;
498
+ /**
499
+ * Define a Vize configuration with type checking.
500
+ * Accepts a plain object or a function that receives ConfigEnv.
501
+ */
502
+ declare function defineConfig(config: UserConfigExport): UserConfigExport;
503
+ /**
504
+ * Load `vize.config.*` from the specified directory.
505
+ */
506
+ declare function loadConfig(root: string, options?: LoadConfigOptions): Promise<VizeConfig | null>;
507
+ /**
508
+ * Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects
509
+ */
510
+ declare function normalizeGlobalTypes(config: GlobalTypesConfig): Record<string, GlobalTypeDeclaration>;
511
+ //#endregion
512
+ export { LspConfig as C, CompilerConfig as D, LintRulesConfig as E, VitePluginConfig as O, LinterConfig as S, LintRuleName as T, MuseaA11yConfig as _, loadConfig as a, MuseaVrtConfig as b, LintPreset as c, RuleSeverity as d, UserConfigExport as f, LoadConfigOptions as g, GlobalTypesConfig as h, defineConfig as i, MaybePromise as l, GlobalTypeDeclaration as m, VIZE_CONFIG_JSON_SCHEMA_PATH as n, normalizeGlobalTypes as o, VizeConfig as p, VIZE_CONFIG_PKL_SCHEMA_PATH as r, ConfigEnv as s, CONFIG_FILE_NAMES as t, RuleCategory as u, MuseaAutogenConfig as v, TypeCheckerConfig as w, FormatterConfig as x, MuseaConfig as y };
513
+ //# sourceMappingURL=config-6hDTqBjZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-6hDTqBjZ.d.mts","names":[],"sources":["../src/types/compiler.ts","../src/types/rules.ts","../src/types/tools.ts","../src/types/musea.ts","../src/types/loader.ts","../src/types/core.ts","../src/config.ts"],"mappings":";;AAOA;;UAAiB,cAAA;EAAc;;;;EAK7B,IAAA;EAwBA;;;;EAlBA,KAAA;EAgDA;;;;EA1CA,GAAA;EA0D+B;;;;EApD/B,SAAA;EA+DsC;;;;EAzDtC,iBAAA;EAmDs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AA,CAAQ,CAAA;AAAA,UAEzB,SAAA;EACf,IAAA;EACA,OAAA;EACA,UAAA;AAAA;AAAA,KAGU,gBAAA,GAAmB,UAAA,KAAe,GAAA,EAAK,SAAA,KAAc,YAAA,CAAa,UAAA;AAAA,KAMlE,YAAA;AAAA,KAEA,YAAA;AAAA,KAEA,UAAA;;;;UASK,UAAA;EL6CgB;;;EKzC/B,OAAA;ELoDmB;;;EK/CnB,QAAA,GAAW,cAAA;ELyCX;;;EKpCA,IAAA,GAAO,gBAAA;EL0CY;;;EKrCnB,MAAA,GAAS,YAAA;ELiDK;;;EK5Cd,WAAA,GAAc,iBAAA;;AJxDhB;;EI6DE,SAAA,GAAY,eAAA;EJkDJ;;AAEV;EI/CE,GAAA,GAAM,SAAA;;;;EAKN,KAAA,GAAQ,WAAA;EJ4CiB;;;EIvCzB,WAAA,GAAc,iBAAA;AAAA;;;cCnEH,iBAAA;AAAA,cAeA,4BAAA;AAAA,cAMA,2BAAA;;;;;iBAMG,YAAA,CAAa,MAAA,EAAQ,gBAAA,GAAmB,gBAAA;;;;iBAOlC,UAAA,CACpB,IAAA,UACA,OAAA,GAAS,iBAAA,GACR,OAAA,CAAQ,UAAA;;;;iBA2LK,oBAAA,CACd,MAAA,EAAQ,iBAAA,GACP,MAAA,SAAe,qBAAA"}
@@ -0,0 +1,2 @@
1
+ import { a as loadConfig, i as defineConfig, n as VIZE_CONFIG_JSON_SCHEMA_PATH, o as normalizeGlobalTypes, r as VIZE_CONFIG_PKL_SCHEMA_PATH, t as CONFIG_FILE_NAMES } from "./config-6hDTqBjZ.mjs";
2
+ export { CONFIG_FILE_NAMES, VIZE_CONFIG_JSON_SCHEMA_PATH, VIZE_CONFIG_PKL_SCHEMA_PATH, defineConfig, loadConfig, normalizeGlobalTypes };
@@ -0,0 +1,156 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { execFileSync } from "node:child_process";
4
+ import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import { transform } from "oxc-transform";
6
+ //#region src/config.ts
7
+ const CONFIG_FILE_NAMES = [
8
+ "vize.config.ts",
9
+ "vize.config.js",
10
+ "vize.config.mjs",
11
+ "vize.config.pkl",
12
+ "vize.config.json"
13
+ ];
14
+ const DEFAULT_CONFIG_ENV = {
15
+ mode: "development",
16
+ command: "serve"
17
+ };
18
+ const PACKAGE_ROOT = path.resolve(fileURLToPath(new URL(".", import.meta.url)), "..");
19
+ const VIZE_CONFIG_JSON_SCHEMA_PATH = path.join(PACKAGE_ROOT, "schemas", "vize.config.schema.json");
20
+ const VIZE_CONFIG_PKL_SCHEMA_PATH = path.join(PACKAGE_ROOT, "pkl", "vize.pkl");
21
+ /**
22
+ * Define a Vize configuration with type checking.
23
+ * Accepts a plain object or a function that receives ConfigEnv.
24
+ */
25
+ function defineConfig(config) {
26
+ return config;
27
+ }
28
+ /**
29
+ * Load `vize.config.*` from the specified directory.
30
+ */
31
+ async function loadConfig(root, options = {}) {
32
+ const { mode = "root", configFile, env } = options;
33
+ if (mode === "none") return null;
34
+ if (configFile) {
35
+ const absolutePath = path.isAbsolute(configFile) ? configFile : path.resolve(root, configFile);
36
+ if (fs.existsSync(absolutePath)) return loadConfigFile(absolutePath, env);
37
+ return null;
38
+ }
39
+ if (mode === "auto") {
40
+ const configPath = findConfigFileAuto(root);
41
+ if (!configPath) return null;
42
+ return loadConfigFile(configPath, env);
43
+ }
44
+ const configPath = findConfigFileInDir(root);
45
+ if (!configPath) return null;
46
+ return loadConfigFile(configPath, env);
47
+ }
48
+ function findConfigFileInDir(dir) {
49
+ for (const name of CONFIG_FILE_NAMES) {
50
+ const filePath = path.join(dir, name);
51
+ if (fs.existsSync(filePath)) return filePath;
52
+ }
53
+ return null;
54
+ }
55
+ function findConfigFileAuto(startDir) {
56
+ let currentDir = path.resolve(startDir);
57
+ while (true) {
58
+ const configPath = findConfigFileInDir(currentDir);
59
+ if (configPath) return configPath;
60
+ const parentDir = path.dirname(currentDir);
61
+ if (parentDir === currentDir) return null;
62
+ currentDir = parentDir;
63
+ }
64
+ }
65
+ async function loadConfigFile(filePath, env) {
66
+ if (!fs.existsSync(filePath)) return null;
67
+ const ext = path.extname(filePath);
68
+ if (ext === ".json") return parseJsonConfig(fs.readFileSync(filePath, "utf-8"), filePath);
69
+ if (ext === ".pkl") return loadPklConfig(filePath);
70
+ if (ext === ".ts") return loadTypeScriptConfig(filePath, env);
71
+ return loadESMConfig(filePath, env);
72
+ }
73
+ async function resolveConfigExport(exported, env) {
74
+ if (typeof exported === "function") return exported(env ?? DEFAULT_CONFIG_ENV);
75
+ return exported;
76
+ }
77
+ async function loadTypeScriptConfig(filePath, env) {
78
+ const result = transform(filePath, fs.readFileSync(filePath, "utf-8"), { typescript: { onlyRemoveTypeImports: true } });
79
+ const tempFile = filePath.replace(/\.ts$/, `.temp.${Date.now()}.mjs`);
80
+ fs.writeFileSync(tempFile, result.code);
81
+ try {
82
+ const module = await importFresh(tempFile);
83
+ return resolveConfigExport(module.default || module, env);
84
+ } finally {
85
+ fs.rmSync(tempFile, { force: true });
86
+ }
87
+ }
88
+ async function loadESMConfig(filePath, env) {
89
+ const module = await importFresh(filePath);
90
+ return resolveConfigExport(module.default || module, env);
91
+ }
92
+ function loadPklConfig(filePath) {
93
+ try {
94
+ return parseJsonConfig(execFileSync("pkl", [
95
+ "eval",
96
+ "--format",
97
+ "json",
98
+ filePath
99
+ ], {
100
+ cwd: path.dirname(filePath),
101
+ encoding: "utf-8",
102
+ stdio: [
103
+ "ignore",
104
+ "pipe",
105
+ "pipe"
106
+ ]
107
+ }), filePath);
108
+ } catch (error) {
109
+ throw new Error(`Failed to evaluate PKL config at ${filePath}. Make sure the 'pkl' CLI is installed and on PATH. ${getErrorMessage(error)}`);
110
+ }
111
+ }
112
+ async function importFresh(filePath) {
113
+ const fileUrl = pathToFileURL(filePath);
114
+ fileUrl.searchParams.set("t", String(fs.statSync(filePath).mtimeMs));
115
+ return import(fileUrl.href);
116
+ }
117
+ function parseJsonConfig(content, filePath) {
118
+ try {
119
+ return normalizeLoadedConfig(JSON.parse(content));
120
+ } catch (error) {
121
+ throw new Error(`Failed to parse vize config JSON at ${filePath}: ${getErrorMessage(error)}`);
122
+ }
123
+ }
124
+ function normalizeLoadedConfig(config) {
125
+ return stripNullish(config) ?? {};
126
+ }
127
+ function stripNullish(value) {
128
+ if (value === null) return;
129
+ if (Array.isArray(value)) return value.map((entry) => stripNullish(entry)).filter((entry) => entry !== void 0);
130
+ if (typeof value === "object" && value !== null) {
131
+ const result = {};
132
+ for (const [key, entry] of Object.entries(value)) {
133
+ const normalizedEntry = stripNullish(entry);
134
+ if (normalizedEntry !== void 0) result[key] = normalizedEntry;
135
+ }
136
+ return result;
137
+ }
138
+ return value;
139
+ }
140
+ function getErrorMessage(error) {
141
+ if (error instanceof Error) return error.message;
142
+ return String(error);
143
+ }
144
+ /**
145
+ * Normalize GlobalTypesConfig shorthand strings to GlobalTypeDeclaration objects
146
+ */
147
+ function normalizeGlobalTypes(config) {
148
+ const result = {};
149
+ for (const [key, value] of Object.entries(config)) if (typeof value === "string") result[key] = { type: value };
150
+ else result[key] = value;
151
+ return result;
152
+ }
153
+ //#endregion
154
+ export { CONFIG_FILE_NAMES, VIZE_CONFIG_JSON_SCHEMA_PATH, VIZE_CONFIG_PKL_SCHEMA_PATH, defineConfig, loadConfig, normalizeGlobalTypes };
155
+
156
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { execFileSync } from \"node:child_process\";\nimport { fileURLToPath, 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\nexport const CONFIG_FILE_NAMES = [\n \"vize.config.ts\",\n \"vize.config.js\",\n \"vize.config.mjs\",\n \"vize.config.pkl\",\n \"vize.config.json\",\n] as const;\n\nconst DEFAULT_CONFIG_ENV: ConfigEnv = {\n mode: \"development\",\n command: \"serve\",\n};\n\nconst PACKAGE_ROOT = path.resolve(fileURLToPath(new URL(\".\", import.meta.url)), \"..\");\n\nexport const VIZE_CONFIG_JSON_SCHEMA_PATH = path.join(\n PACKAGE_ROOT,\n \"schemas\",\n \"vize.config.schema.json\",\n);\n\nexport const VIZE_CONFIG_PKL_SCHEMA_PATH = path.join(PACKAGE_ROOT, \"pkl\", \"vize.pkl\");\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.*` 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 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 if (mode === \"auto\") {\n const configPath = findConfigFileAuto(root);\n if (!configPath) {\n return null;\n }\n return loadConfigFile(configPath, env);\n }\n\n const configPath = findConfigFileInDir(root);\n if (!configPath) {\n return null;\n }\n\n return loadConfigFile(configPath, env);\n}\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\nfunction findConfigFileAuto(startDir: string): string | null {\n let currentDir = path.resolve(startDir);\n\n while (true) {\n const configPath = findConfigFileInDir(currentDir);\n if (configPath) {\n return configPath;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n return null;\n }\n\n currentDir = parentDir;\n }\n}\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 parseJsonConfig(content, filePath);\n }\n\n if (ext === \".pkl\") {\n return loadPklConfig(filePath);\n }\n\n if (ext === \".ts\") {\n return loadTypeScriptConfig(filePath, env);\n }\n\n return loadESMConfig(filePath, env);\n}\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\n return exported;\n}\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 tempFile = filePath.replace(/\\.ts$/, `.temp.${Date.now()}.mjs`);\n fs.writeFileSync(tempFile, result.code);\n\n try {\n const module = await importFresh(tempFile);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n } finally {\n fs.rmSync(tempFile, { force: true });\n }\n}\n\nasync function loadESMConfig(filePath: string, env?: ConfigEnv): Promise<VizeConfig> {\n const module = await importFresh(filePath);\n const exported: UserConfigExport = module.default || module;\n return resolveConfigExport(exported, env);\n}\n\nfunction loadPklConfig(filePath: string): VizeConfig {\n try {\n const output = execFileSync(\"pkl\", [\"eval\", \"--format\", \"json\", filePath], {\n cwd: path.dirname(filePath),\n encoding: \"utf-8\",\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n return parseJsonConfig(output, filePath);\n } catch (error) {\n throw new Error(\n `Failed to evaluate PKL config at ${filePath}. Make sure the 'pkl' CLI is installed and on PATH. ${getErrorMessage(error)}`,\n );\n }\n}\n\nasync function importFresh(filePath: string): Promise<Record<string, unknown>> {\n const fileUrl = pathToFileURL(filePath);\n fileUrl.searchParams.set(\"t\", String(fs.statSync(filePath).mtimeMs));\n return import(fileUrl.href);\n}\n\nfunction parseJsonConfig(content: string, filePath: string): VizeConfig {\n try {\n return normalizeLoadedConfig(JSON.parse(content));\n } catch (error) {\n throw new Error(`Failed to parse vize config JSON at ${filePath}: ${getErrorMessage(error)}`);\n }\n}\n\nfunction normalizeLoadedConfig(config: unknown): VizeConfig {\n const normalized = stripNullish(config);\n return (normalized ?? {}) as VizeConfig;\n}\n\nfunction stripNullish(value: unknown): unknown {\n if (value === null) {\n return undefined;\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => stripNullish(entry)).filter((entry) => entry !== undefined);\n }\n\n if (typeof value === \"object\" && value !== null) {\n const result: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const normalizedEntry = stripNullish(entry);\n if (normalizedEntry !== undefined) {\n result[key] = normalizedEntry;\n }\n }\n return result;\n }\n\n return value;\n}\n\nfunction getErrorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n\n return String(error);\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":";;;;;;AAcA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,qBAAgC;CACpC,MAAM;CACN,SAAS;CACV;AAED,MAAM,eAAe,KAAK,QAAQ,cAAc,IAAI,IAAI,KAAK,OAAO,KAAK,IAAI,CAAC,EAAE,KAAK;AAErF,MAAa,+BAA+B,KAAK,KAC/C,cACA,WACA,0BACD;AAED,MAAa,8BAA8B,KAAK,KAAK,cAAc,OAAO,WAAW;;;;;AAMrF,SAAgB,aAAa,QAA4C;AACvE,QAAO;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QAA6B;AAE1D,QADmB,aAAa,OAAO,IACjB,EAAE;;AAG1B,SAAS,aAAa,OAAyB;AAC7C,KAAI,UAAU,KACZ;AAGF,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,MAAM,KAAK,UAAU,aAAa,MAAM,CAAC,CAAC,QAAQ,UAAU,UAAU,KAAA,EAAU;AAGzF,KAAI,OAAO,UAAU,YAAY,UAAU,MAAM;EAC/C,MAAM,SAAkC,EAAE;AAC1C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,EAAE;GAChD,MAAM,kBAAkB,aAAa,MAAM;AAC3C,OAAI,oBAAoB,KAAA,EACtB,QAAO,OAAO;;AAGlB,SAAO;;AAGT,QAAO;;AAGT,SAAS,gBAAgB,OAAwB;AAC/C,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,QAAO,OAAO,MAAM;;;;;AAMtB,SAAgB,qBACd,QACuC;CACvC,MAAM,SAAgD,EAAE;AACxD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,CAC/C,KAAI,OAAO,UAAU,SACnB,QAAO,OAAO,EAAE,MAAM,OAAO;KAE7B,QAAO,OAAO;AAGlB,QAAO"}
@@ -0,0 +1,2 @@
1
+ import { C as LspConfig, D as CompilerConfig, E as LintRulesConfig, O as VitePluginConfig, S as LinterConfig, T as LintRuleName, _ as MuseaA11yConfig, a as loadConfig, b as MuseaVrtConfig, c as LintPreset, d as RuleSeverity, f as UserConfigExport, g as LoadConfigOptions, h as GlobalTypesConfig, i as defineConfig, l as MaybePromise, m as GlobalTypeDeclaration, n as VIZE_CONFIG_JSON_SCHEMA_PATH, o as normalizeGlobalTypes, p as VizeConfig, r as VIZE_CONFIG_PKL_SCHEMA_PATH, s as ConfigEnv, t as CONFIG_FILE_NAMES, u as RuleCategory, v as MuseaAutogenConfig, w as TypeCheckerConfig, x as FormatterConfig, y as MuseaConfig } from "./config-6hDTqBjZ.mjs";
2
+ export { CONFIG_FILE_NAMES, type CompilerConfig, type ConfigEnv, type FormatterConfig, type GlobalTypeDeclaration, type GlobalTypesConfig, type LintPreset, type LintRuleName, type LintRulesConfig, type LinterConfig, type LoadConfigOptions, type LspConfig, type MaybePromise, type MuseaA11yConfig, type MuseaAutogenConfig, type MuseaConfig, type MuseaVrtConfig, type RuleCategory, type RuleSeverity, type TypeCheckerConfig, type UserConfigExport, VIZE_CONFIG_JSON_SCHEMA_PATH, VIZE_CONFIG_PKL_SCHEMA_PATH, type VitePluginConfig, type VizeConfig, defineConfig, loadConfig, normalizeGlobalTypes };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { CONFIG_FILE_NAMES, VIZE_CONFIG_JSON_SCHEMA_PATH, VIZE_CONFIG_PKL_SCHEMA_PATH, defineConfig, loadConfig, normalizeGlobalTypes } from "./config.mjs";
2
+ export { CONFIG_FILE_NAMES, VIZE_CONFIG_JSON_SCHEMA_PATH, VIZE_CONFIG_PKL_SCHEMA_PATH, defineConfig, loadConfig, normalizeGlobalTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vize",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "description": "Vize - High-performance Vue.js toolchain in Rust",
5
5
  "keywords": [
6
6
  "cli",
@@ -56,14 +56,14 @@
56
56
  "vite-plus": "0.1.19"
57
57
  },
58
58
  "optionalDependencies": {
59
- "@vizejs/native-darwin-arm64": "0.58.0",
60
- "@vizejs/native-darwin-x64": "0.58.0",
61
- "@vizejs/native-linux-arm64-gnu": "0.58.0",
62
- "@vizejs/native-linux-arm64-musl": "0.58.0",
63
- "@vizejs/native-linux-x64-gnu": "0.58.0",
64
- "@vizejs/native-linux-x64-musl": "0.58.0",
65
- "@vizejs/native-win32-arm64-msvc": "0.58.0",
66
- "@vizejs/native-win32-x64-msvc": "0.58.0"
59
+ "@vizejs/native-darwin-arm64": "0.59.0",
60
+ "@vizejs/native-darwin-x64": "0.59.0",
61
+ "@vizejs/native-linux-arm64-gnu": "0.59.0",
62
+ "@vizejs/native-linux-arm64-musl": "0.59.0",
63
+ "@vizejs/native-linux-x64-gnu": "0.59.0",
64
+ "@vizejs/native-linux-x64-musl": "0.59.0",
65
+ "@vizejs/native-win32-arm64-msvc": "0.59.0",
66
+ "@vizejs/native-win32-x64-msvc": "0.59.0"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=18"