@vizejs/vite-plugin-musea 0.474.0 → 0.475.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/README.md +4 -3
- package/dist/cli/index.mjs +1 -0
- package/dist/cli/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -45,12 +45,13 @@ Musea middleware is intended for the local Vite dev server and trusted developme
|
|
|
45
45
|
not expose `/__musea__` directly on the public internet unless it is protected by your own network
|
|
46
46
|
controls or authentication layer.
|
|
47
47
|
|
|
48
|
-
Shared defaults
|
|
48
|
+
Shared defaults live in `vue.musea` in your existing `vite.config.*`. With Vite+, retain
|
|
49
|
+
your existing options and add Vue settings through the helper:
|
|
49
50
|
|
|
50
51
|
```ts
|
|
51
|
-
import { defineConfig } from "
|
|
52
|
+
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
|
|
52
53
|
|
|
53
|
-
export default defineConfig({
|
|
54
|
+
export default defineConfig({}).withVue({
|
|
54
55
|
musea: {
|
|
55
56
|
include: ["src/**/*.art.vue"],
|
|
56
57
|
exclude: ["node_modules/**", "dist/**"],
|
package/dist/cli/index.mjs
CHANGED
|
@@ -269,6 +269,7 @@ async function loadMuseaConfiguration(configPath, cwd = process.cwd()) {
|
|
|
269
269
|
}
|
|
270
270
|
async function loadViteConfig(configPath, cwd) {
|
|
271
271
|
const resolvedConfigPath = configPath ? path.resolve(cwd, configPath) : void 0;
|
|
272
|
+
if (resolvedConfigPath && /^vize\.config\.(?:pkl|[cm]?[jt]s|json)$/.test(path.basename(resolvedConfigPath))) throw new Error("vize.config.* is no longer supported; move Musea settings to vue.musea in vite.config.*");
|
|
272
273
|
if (resolvedConfigPath && !await fileExists(resolvedConfigPath)) return void 0;
|
|
273
274
|
const loaded = await loadConfigFromFile({
|
|
274
275
|
command: "serve",
|
package/dist/cli/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/cli/utils.ts","../../src/cli/commands.ts","../../src/cli/config.ts","../../src/cli/hosted.ts","../../src/cli/service/auth.ts","../../src/cli/service/artifacts.ts","../../src/cli/service/reports.ts","../../src/cli/serve.ts","../../src/cli/index.ts"],"sourcesContent":["/**\n * CLI utility functions for art file scanning and parsing.\n *\n * Extracted from cli.ts to keep file sizes manageable.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { processMuseaArtFile } from \"../plugin/art-processing.js\";\nimport type { ArtFileInfo } from \"../types/index.js\";\n\n/** Recursively scan a directory for .art.vue files. */\nexport async function scanArtFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n\n async function scan(dir: string): Promise<void> {\n let entries: fs.Dirent[];\n try {\n entries = await fs.promises.readdir(dir, { withFileTypes: true });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"EACCES\") {\n return;\n }\n throw error;\n }\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n // Skip node_modules and dist\n if (entry.name === \"node_modules\" || entry.name === \"dist\") {\n continue;\n }\n\n if (entry.isDirectory()) {\n await scan(fullPath);\n } else if (entry.isFile() && entry.name.endsWith(\".art.vue\")) {\n files.push(fullPath);\n }\n }\n }\n\n await scan(root);\n return files;\n}\n\n/** Parse a single .art.vue file into an ArtFileInfo structure. */\nexport async function parseArtFile(filePath: string): Promise<ArtFileInfo | null> {\n return processMuseaArtFile(filePath, {\n root: path.dirname(filePath),\n command: \"serve\",\n });\n}\n\nexport function parseWorkers(value: string | undefined): number {\n const workers = Number.parseInt(value ?? \"\", 10);\n return Number.isFinite(workers) ? Math.max(1, workers) : 1;\n}\n","/**\n * CLI command handlers for the Musea VRT tool.\n *\n * Extracted from cli.ts to keep file sizes manageable.\n * Contains the runVrt, runApprove, runClean, and runGenerate command implementations.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { MuseaVrtRunner, generateVrtReport, generateVrtJsonReport } from \"../vrt.js\";\nimport type { ExtendedVrtOptions, VrtSummary } from \"../vrt.js\";\nimport { normalizeVrtWorkerCount } from \"../vrt.js\";\nimport type { A11yOptions, ArtFileInfo, MuseaVrtOptions } from \"../types/index.js\";\n\nimport type { CliOptions } from \"./index.js\";\n\nexport function hasCiBlockingVrtResult(summary: VrtSummary): boolean {\n return summary.failed > 0 || (summary.errors ?? 0) > 0;\n}\n\nexport function isArtFileInput(filePath: string): boolean {\n return filePath.endsWith(\".art.vue\");\n}\n\nexport function createVrtOptions(options: CliOptions): ExtendedVrtOptions {\n // `vrt.a11y` is MuseaA11yRunner config. ExtendedVrtOptions.a11y is a boolean.\n const configured = withoutA11y(options.vrt);\n const vrtOptions: ExtendedVrtOptions = {\n ...configured,\n ...(options.projectRoot !== undefined ? { projectRoot: options.projectRoot } : {}),\n ...(options.snapshotIdentities !== undefined\n ? { snapshotIdentities: options.snapshotIdentities }\n : {}),\n ...(options.adoptLegacySnapshots !== undefined\n ? { adoptLegacySnapshots: options.adoptLegacySnapshots }\n : {}),\n capture: { waitForPreviewReady: true, ...configured.capture },\n ...(options.previewBasePath !== undefined ? { previewBasePath: options.previewBasePath } : {}),\n ...(options.previewUrls !== undefined ? { previewUrls: options.previewUrls } : {}),\n // run, approve, and clean all read this directory.\n snapshotDir: resolveVrtSnapshotDir(options, configured.snapshotDir),\n threshold: options.thresholdProvided\n ? options.threshold\n : (configured.threshold ?? options.threshold),\n };\n const workers = options.workersProvided ? options.workers : configured.workers;\n if (workers !== undefined) {\n vrtOptions.workers = normalizeVrtWorkerCount(workers);\n }\n return vrtOptions;\n}\n\n/**\n * `vrt.snapshotDir` is resolved against the config file's directory.\n * When it is unset, baselines stay under `<--output>/snapshots`.\n */\nfunction resolveVrtSnapshotDir(options: CliOptions, snapshotDir: string | undefined): string {\n if (!snapshotDir) return path.join(options.output, \"snapshots\");\n const configDir =\n options.configDir ??\n (options.config ? path.dirname(path.resolve(options.config)) : process.cwd());\n return path.resolve(configDir, snapshotDir);\n}\n\nfunction withoutA11y(vrt: MuseaVrtOptions | undefined): Omit<MuseaVrtOptions, \"a11y\"> {\n if (!vrt) return {};\n const configured: MuseaVrtOptions = { ...vrt };\n delete configured.a11y;\n return configured;\n}\n\n/** Options object `musea-vrt --a11y` passes to `MuseaA11yRunner`. */\nexport function createA11yRunner<T>(options: CliOptions, Runner: new (a11y?: A11yOptions) => T): T {\n return new Runner(options.vrt?.a11y);\n}\n\nexport async function runVrt(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const totalVariants = artFiles.reduce(\n (sum, art) => sum + art.variants.filter((v) => !v.skipVrt).length,\n 0,\n );\n\n console.log(` Testing ${totalVariants} variant(s) across ${artFiles.length} art file(s)\\n`);\n\n const runner = new MuseaVrtRunner({\n ...createVrtOptions(options),\n ci: options.ci ? { failOnDiff: true, jsonReport: options.json } : undefined,\n });\n\n try {\n console.log(\" Launching browser...\");\n await runner.init();\n\n console.log(\" Running visual regression tests...\\n\");\n\n // Run tests\n const results = await runner.runAllTests(artFiles, options.baseUrl);\n const summary = runner.getSummary(results);\n\n // Print results\n console.log(\" Results:\");\n console.log(\" ---------\");\n console.log(` Passed: ${summary.passed}`);\n console.log(` Failed: ${summary.failed}`);\n console.log(` New: ${summary.new}`);\n console.log(` Errors: ${summary.errors ?? 0}`);\n console.log(` Skipped: ${summary.skipped}`);\n console.log(` Total: ${summary.total}`);\n console.log(` Duration: ${(summary.duration / 1000).toFixed(2)}s\\n`);\n\n // Run a11y audits if requested\n if (options.a11y) {\n console.log(\" Running accessibility audits...\\n\");\n try {\n const { MuseaA11yRunner } = await import(\"../a11y/index.js\");\n const a11yRunner = createA11yRunner(options, MuseaA11yRunner);\n const a11yResults = await a11yRunner.runAudits(artFiles, options.baseUrl, runner);\n const a11ySummary = a11yRunner.getSummary(a11yResults);\n\n console.log(\" A11y Results:\");\n console.log(\" -------------\");\n console.log(` Components: ${a11ySummary.totalComponents}`);\n console.log(` Variants: ${a11ySummary.totalVariants}`);\n console.log(` Violations: ${a11ySummary.totalViolations}`);\n console.log(` Critical: ${a11ySummary.criticalCount}`);\n console.log(` Serious: ${a11ySummary.seriousCount}`);\n console.log(` Not audited: ${a11ySummary.erroredVariants}\\n`);\n\n // Generate a11y report\n const reportDir = options.output;\n await fs.promises.mkdir(reportDir, { recursive: true });\n\n if (options.json) {\n const a11yJson = a11yRunner.generateJsonReport(a11yResults);\n const a11yPath = path.join(reportDir, \"a11y-report.json\");\n await fs.promises.writeFile(a11yPath, a11yJson);\n console.log(` A11y JSON report: ${a11yPath}\\n`);\n } else {\n const a11yHtml = a11yRunner.generateHtmlReport(a11yResults);\n const a11yPath = path.join(reportDir, \"a11y-report.html\");\n await fs.promises.writeFile(a11yPath, a11yHtml);\n console.log(` A11y HTML report: ${a11yPath}\\n`);\n }\n\n // CI mode - exit with error on critical/serious violations. A variant\n // whose audit never ran fails too, but under its own message: it is\n // not an accessibility finding, and reporting it as one sends people\n // looking for a component defect that does not exist.\n if (options.ci && a11ySummary.erroredVariants > 0) {\n console.log(\n ` CI mode: ${a11ySummary.erroredVariants} variant(s) could not be audited\\n`,\n );\n process.exitCode = 1;\n return;\n }\n if (options.ci && (a11ySummary.criticalCount > 0 || a11ySummary.seriousCount > 0)) {\n console.log(\" CI mode: Accessibility violations found\\n\");\n process.exitCode = 1;\n return;\n }\n } catch (e) {\n console.warn(\" A11y audits skipped:\", e instanceof Error ? e.message : String(e));\n console.warn(\" Make sure axe-core is installed: npm install axe-core\\n\");\n }\n }\n\n // Update baselines if requested\n if (options.update) {\n console.log(\" Updating baselines...\");\n const updated = await runner.updateBaselines(results);\n console.log(` Updated ${updated} baseline(s)\\n`);\n }\n\n // Generate VRT report\n const reportDir = options.output;\n await fs.promises.mkdir(reportDir, { recursive: true });\n\n if (options.json) {\n const jsonReport = generateVrtJsonReport(results, summary);\n const jsonPath = path.join(reportDir, \"vrt-report.json\");\n await fs.promises.writeFile(jsonPath, jsonReport);\n console.log(` JSON report: ${jsonPath}\\n`);\n } else {\n const htmlReport = generateVrtReport(results, summary);\n const htmlPath = path.join(reportDir, \"vrt-report.html\");\n await fs.promises.writeFile(htmlPath, htmlReport);\n console.log(` HTML report: ${htmlPath}\\n`);\n }\n\n // CI mode - exit with error if visual diffs or runner errors occurred.\n if (options.ci && hasCiBlockingVrtResult(summary)) {\n console.log(\" CI mode: Exiting with error due to failures or errors\\n\");\n process.exitCode = 1;\n }\n } finally {\n await runner.close();\n }\n}\n\nexport async function runApprove(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const runner = new MuseaVrtRunner(createVrtOptions(options));\n\n try {\n console.log(\" Launching browser...\");\n await runner.init();\n\n console.log(\" Running tests to find diffs...\\n\");\n\n const results = await runner.runAllTests(artFiles, options.baseUrl);\n const failed = results.filter((r) => !r.passed && !r.error);\n\n if (failed.length === 0) {\n console.log(\" No failed tests to approve.\\n\");\n return;\n }\n\n const pattern = options.pattern;\n if (pattern) {\n console.log(` Approving snapshots matching: ${pattern}\\n`);\n } else {\n console.log(` Approving all ${failed.length} failed snapshot(s)...\\n`);\n }\n\n const approved = await runner.approveResults(results, pattern);\n console.log(` Approved ${approved} snapshot(s)\\n`);\n } finally {\n await runner.close();\n }\n}\n\nexport async function runClean(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const runner = new MuseaVrtRunner(createVrtOptions(options));\n\n console.log(\" Scanning for orphaned snapshots...\\n\");\n\n let cleaned: number;\n try {\n cleaned = await runner.cleanOrphans(artFiles);\n } finally {\n await runner.close();\n }\n\n if (cleaned === 0) {\n console.log(\" No orphaned snapshots found.\\n\");\n } else {\n console.log(`\\n Cleaned ${cleaned} orphaned snapshot(s)\\n`);\n }\n}\n\nexport async function runGenerate(options: CliOptions): Promise<void> {\n if (!options.componentPath) {\n console.error(\" Error: Missing component path.\");\n console.error(\" Usage: musea-vrt generate <component.vue>\\n\");\n process.exit(1);\n }\n\n const componentPath = path.resolve(options.componentPath);\n if (isArtFileInput(componentPath)) {\n console.error(\n \" Error: musea-vrt generate expects a source .vue component, not a .art.vue file.\",\n );\n console.error(\" Pass the component file that the art file should wrap.\\n\");\n process.exit(1);\n }\n\n // Check file exists\n try {\n await fs.promises.access(componentPath);\n } catch {\n console.error(` Error: File not found: ${componentPath}\\n`);\n process.exit(1);\n }\n\n console.log(` Generating art file for: ${path.relative(process.cwd(), componentPath)}\\n`);\n\n try {\n const { writeArtFile } = await import(\"../autogen/index.js\");\n const outputPath = await writeArtFile(componentPath);\n const relOutput = path.relative(process.cwd(), outputPath);\n\n console.log(` Generated: ${relOutput}\\n`);\n } catch (e) {\n console.error(\" Generation failed:\", e instanceof Error ? e.message : String(e));\n process.exit(1);\n }\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { loadConfigFromFile, type PluginOption, type UserConfig } from \"vite\";\nimport { loadConfig, resolveViteConfigExport } from \"@vizejs/vite-plugin\";\n\nimport type { MuseaOptions, MuseaVrtOptions } from \"../types/index.js\";\nimport { readMuseaOptions } from \"../plugin/options.js\";\nimport { publicBasePathFromViteBase } from \"../static-base.js\";\n\nconst DEFAULT_INCLUDE = [\"**/*.art.vue\"];\nconst DEFAULT_EXCLUDE = [\"node_modules/**\", \"dist/**\"];\nconst CONFIG_ENV = { command: \"serve\", mode: \"development\", isSsrBuild: false } as const;\n\ninterface LoadedViteConfig {\n root: string;\n configDir: string;\n config: UserConfig;\n plugins: unknown[];\n}\n\nexport interface MuseaFileSet {\n root: string;\n projectRoot: string;\n include: string[];\n exclude: string[];\n}\n\nexport async function loadMuseaVrtOptions(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<MuseaVrtOptions | undefined> {\n return (await loadMuseaConfiguration(configPath, cwd)).vrt;\n}\n\nexport async function loadMuseaFileSet(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<MuseaFileSet> {\n return (await loadMuseaConfiguration(configPath, cwd)).fileSet;\n}\n\nexport async function loadMuseaPreviewBasePath(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<string> {\n return (await loadMuseaConfiguration(configPath, cwd)).previewBasePath;\n}\n\n/** Resolve all CLI gallery metadata from one evaluation of the Vite config. */\nexport async function loadMuseaConfiguration(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<{\n fileSet: MuseaFileSet;\n vrt: MuseaVrtOptions | undefined;\n configDir: string;\n previewBasePath: string;\n}> {\n const loaded = await loadViteConfig(configPath, cwd);\n const pluginOptions = loaded ? readPluginMuseaOptions(loaded.plugins) : undefined;\n const vizeOptions = await readSharedMuseaOptions(loaded, cwd, configPath);\n const include = pluginOptions?.include ?? vizeOptions?.include ?? DEFAULT_INCLUDE;\n const exclude = pluginOptions?.exclude ?? vizeOptions?.exclude ?? DEFAULT_EXCLUDE;\n const sharedVrt = vizeOptions?.vrt;\n const { outDir, ...sharedVrtOptions } = sharedVrt ?? {};\n const vrt = sharedVrt\n ? {\n ...sharedVrtOptions,\n ...(outDir === undefined ? {} : { snapshotDir: outDir }),\n ...pluginOptions?.vrt,\n }\n : pluginOptions?.vrt;\n const root = loaded?.root ?? cwd;\n return {\n fileSet: {\n root,\n projectRoot: path.resolve(root, pluginOptions?.projectRoot ?? \".\"),\n include,\n exclude,\n },\n vrt,\n configDir: loaded?.configDir ?? cwd,\n previewBasePath: publicBasePathFromViteBase(\n loaded?.config.base,\n pluginOptions?.basePath ?? vizeOptions?.basePath ?? \"/__musea__\",\n ),\n };\n}\n\nasync function loadViteConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<LoadedViteConfig | undefined> {\n const resolvedConfigPath = configPath ? path.resolve(cwd, configPath) : undefined;\n if (resolvedConfigPath && !(await fileExists(resolvedConfigPath))) return undefined;\n\n const loaded = await loadConfigFromFile(\n {\n command: \"serve\",\n mode: \"development\",\n isPreview: false,\n isSsrBuild: false,\n },\n resolvedConfigPath,\n cwd,\n );\n if (!loaded) return undefined;\n\n const plugins: unknown[] = [];\n await collectPlugins(loaded.config.plugins, plugins);\n const configDir = path.dirname(loaded.path);\n const configuredRoot = loaded.config.root;\n return {\n root: configuredRoot ? path.resolve(configDir, configuredRoot) : configDir,\n configDir,\n config: loaded.config,\n plugins,\n };\n}\n\nfunction readPluginMuseaOptions(plugins: unknown[]): MuseaOptions | undefined {\n for (const plugin of plugins) {\n const options = readMuseaOptions(plugin);\n if (options) return options;\n }\n return undefined;\n}\n\nasync function readSharedMuseaOptions(\n loaded: LoadedViteConfig | undefined,\n cwd: string,\n configPath: string | undefined,\n) {\n // Preserve existing defaults for a missing explicit file, without selecting a\n // different project's authored configuration behind that explicit request.\n if (!loaded && configPath !== undefined) return undefined;\n // Project the config Vite already evaluated, including custom --config paths.\n // Re-importing it could repeat plugin factories and other user side effects.\n const config = loaded\n ? ((await loadConfig(loaded.configDir, { viteConfig: false, env: CONFIG_ENV })) ??\n (await resolveViteConfigExport(loaded.config, CONFIG_ENV)))\n : await loadConfig(cwd, { mode: \"auto\", env: CONFIG_ENV });\n return config?.musea;\n}\n\nasync function collectPlugins(\n input: PluginOption | Promise<PluginOption> | undefined,\n plugins: unknown[],\n) {\n const resolved = await input;\n if (!resolved) return;\n\n if (Array.isArray(resolved)) {\n for (const item of resolved) {\n await collectPlugins(item, plugins);\n }\n return;\n }\n\n plugins.push(resolved);\n}\n\nasync function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.promises.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n","import { normalizeSnapshotIdentity } from \"../vrt/snapshot-identity.js\";\nimport type { ArtFileInfo } from \"../types/index.js\";\n\nexport interface HostedGallery {\n arts: ArtFileInfo[];\n snapshotIdentities: Record<string, string>;\n previewUrls: Record<string, Record<string, string>>;\n}\n\n/** Read a built gallery without requiring its build machine's source files. */\nexport async function loadHostedGallery(galleryUrl: string): Promise<HostedGallery> {\n const base = new URL(galleryUrl);\n if (![\"http:\", \"https:\"].includes(base.protocol) || base.username || base.password)\n throw new Error(\"--gallery-url must be an HTTP(S) URL without embedded credentials\");\n base.pathname = `${base.pathname.replace(/\\/+$/, \"\")}/`;\n base.search = \"\";\n base.hash = \"\";\n const manifestUrl = new URL(\"api/static.json\", base);\n const response = await fetch(manifestUrl, {\n redirect: \"error\",\n signal: AbortSignal.timeout(30000),\n });\n if (!response.ok) throw new Error(`Hosted gallery manifest: HTTP ${response.status}`);\n const payload: unknown = await response.json();\n if (!isRecord(payload) || !Array.isArray(payload.arts) || !isRecord(payload.previews))\n throw new Error(\"Hosted gallery manifest must contain arts and previews\");\n if (payload.snapshotIdentityVersion !== 1 || !isRecord(payload.snapshotIdentities))\n throw new Error(\n \"Hosted gallery requires snapshot identity version 1; rebuild the gallery with a current Musea version\",\n );\n const snapshotIdentities: Record<string, string> = Object.create(null);\n const uniqueIdentities = new Set<string>();\n const arts: ArtFileInfo[] = [];\n const previewUrls: HostedGallery[\"previewUrls\"] = Object.create(null);\n for (const item of payload.arts) {\n if (\n !isRecord(item) ||\n typeof item.path !== \"string\" ||\n !isRecord(item.metadata) ||\n typeof item.metadata.title !== \"string\" ||\n !Array.isArray(item.variants)\n )\n throw new Error(\"Invalid hosted art metadata\");\n if (Object.hasOwn(previewUrls, item.path))\n throw new Error(`Duplicate hosted art: ${item.path}`);\n const identity = payload.snapshotIdentities[item.path];\n if (typeof identity !== \"string\")\n throw new Error(`Missing hosted snapshot identity: ${item.path}`);\n const normalized = normalizeSnapshotIdentity(identity);\n if (uniqueIdentities.has(normalized))\n throw new Error(`Duplicate hosted snapshot identity: ${normalized}`);\n uniqueIdentities.add(normalized);\n snapshotIdentities[item.path] = normalized;\n const variants = item.variants;\n const urls: Record<string, string> = Object.create(null);\n const sourceUrls = payload.previews[item.path];\n if (!isRecord(sourceUrls)) throw new Error(`Missing hosted previews: ${item.path}`);\n for (const variant of variants) {\n if (\n !isRecord(variant) ||\n typeof variant.name !== \"string\" ||\n typeof variant.skipVrt !== \"boolean\"\n )\n throw new Error(\"Invalid hosted variant metadata\");\n if (Object.hasOwn(urls, variant.name))\n throw new Error(`Duplicate hosted variant: ${variant.name}`);\n const value = sourceUrls[variant.name];\n if (typeof value !== \"string\") throw new Error(`Missing hosted preview: ${variant.name}`);\n const url = new URL(value, base);\n if (\n url.origin !== base.origin ||\n !url.pathname.startsWith(base.pathname) ||\n url.username ||\n url.password\n )\n throw new Error(`Hosted preview is outside its gallery: ${variant.name}`);\n urls[variant.name] = url.href;\n }\n // The static emitter owns the complete ArtFileInfo shape. Above validates\n // the fields used by capture/approve/clean; unrelated source fields are inert.\n arts.push(item as unknown as ArtFileInfo);\n previewUrls[item.path] = urls;\n }\n return { arts, previewUrls, snapshotIdentities };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n","import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { timingSafeEqual } from \"node:crypto\";\n\nexport function authorizeSession(\n request: IncomingMessage,\n response: ServerResponse,\n origin: string,\n host: string,\n token: string,\n): boolean {\n response.setHeader(\"Cache-Control\", \"no-store\");\n response.setHeader(\"Vary\", \"Origin\");\n if (request.headers.origin !== origin || request.headers.host !== host) {\n response.writeHead(403).end();\n return false;\n }\n response.setHeader(\"Access-Control-Allow-Origin\", origin);\n if (request.method === \"OPTIONS\") {\n const method = request.headers[\"access-control-request-method\"];\n const headers = String(request.headers[\"access-control-request-headers\"] ?? \"\")\n .toLowerCase()\n .split(\",\")\n .map((item) => item.trim());\n if (\n ![\"GET\", \"POST\"].includes(String(method)) ||\n !headers.includes(\"authorization\") ||\n headers.some((item) => ![\"authorization\", \"content-type\"].includes(item))\n ) {\n response.writeHead(403).end();\n return false;\n }\n response.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST\");\n response.setHeader(\"Access-Control-Allow-Headers\", \"Authorization, Content-Type\");\n response.writeHead(204).end();\n return false;\n }\n const actual = Buffer.from(request.headers.authorization ?? \"\");\n const expected = Buffer.from(`Bearer ${token}`);\n if (actual.length !== expected.length || !timingSafeEqual(actual, expected)) {\n response.writeHead(401).end();\n return false;\n }\n return true;\n}\n\nexport async function captureInput(\n request: IncomingMessage,\n): Promise<{ artPath: string; update: boolean }> {\n const type = (request.headers[\"content-type\"] ?? \"\").split(\";\")[0].trim().toLowerCase();\n if (type !== \"application/json\") throw new Error(\"Expected JSON\");\n const chunks: Buffer[] = [];\n let size = 0;\n for await (const chunk of request) {\n if (!Buffer.isBuffer(chunk)) throw new Error(\"Expected HTTP bytes\");\n size += chunk.length;\n if (size > 4096) throw new Error(\"Capture input is too large\");\n chunks.push(chunk);\n }\n let input: unknown;\n try {\n input = JSON.parse(Buffer.concat(chunks).toString(\"utf8\"));\n } catch {\n throw new Error(\"Capture input must contain valid JSON\");\n }\n if (\n !input ||\n typeof input !== \"object\" ||\n Array.isArray(input) ||\n Object.keys(input).sort().join(\",\") !== \"artPath,update\" ||\n typeof (input as { artPath: unknown }).artPath !== \"string\" ||\n typeof (input as { update: unknown }).update !== \"boolean\"\n )\n throw new Error(\"Capture requires a known artPath and boolean update\");\n return input as { artPath: string; update: boolean };\n}\n","import { randomUUID } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport type { VrtResult } from \"../../vrt/types.js\";\n\n/** Registrations contain frozen capture bytes, never request-derived filesystem paths. */\nexport class SessionArtifacts {\n private files = new Map<string, { bytes: Buffer; type: string }>();\n\n add(bytes: Buffer | string, type: string): string {\n const url = `/artifacts/${randomUUID()}`;\n this.files.set(url, { bytes: Buffer.from(bytes), type });\n return url;\n }\n\n clear(): void {\n this.files.clear();\n }\n\n send(url: string, response: ServerResponse): boolean {\n const artifact = this.files.get(url);\n if (!artifact) return false;\n response.setHeader(\"Content-Type\", artifact.type);\n response.setHeader(\"X-Content-Type-Options\", \"nosniff\");\n response.setHeader(\n \"Content-Security-Policy\",\n \"default-src 'none'; style-src 'unsafe-inline'; img-src data:; sandbox\",\n );\n response.end(artifact.bytes);\n return true;\n }\n\n async results(results: VrtResult[]) {\n return Promise.all(\n results.map(async (result) => {\n const urls: { snapshot?: string; current?: string; diff?: string } = {};\n for (const [key, file] of [\n [\"snapshot\", result.snapshotPath],\n [\"current\", result.currentPath],\n [\"diff\", result.diffPath],\n ] as const) {\n if (file && !result.error) urls[key] = this.add(await readFile(file), \"image/png\");\n }\n return {\n artPath: result.artPath,\n variantName: result.variantName,\n viewport: result.viewport.name,\n passed: result.passed,\n isNew: result.isNew,\n diffPercentage: result.diffPercentage,\n error: result.error,\n images: urls,\n };\n }),\n );\n }\n}\n","import { randomUUID } from \"node:crypto\";\nimport { rename, rm, writeFile } from \"node:fs/promises\";\n\n/** Publish one complete owned report; JSON/HTML retain independent file atomicity. */\nexport async function writeSessionReport(file: string, bytes: string): Promise<void> {\n const temporary = `${file}.${randomUUID()}.tmp`;\n try {\n await writeFile(temporary, bytes, { flag: \"wx\" });\n await rename(temporary, file);\n } finally {\n await rm(temporary, { force: true });\n }\n}\n","import { randomBytes } from \"node:crypto\";\nimport { createServer, type ServerResponse } from \"node:http\";\nimport { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { MuseaVrtRunner, generateVrtJsonReport, generateVrtReport } from \"../vrt.js\";\nimport {\n assertArtReportOwnership,\n attachArtReportOwner,\n resolveArtReportTarget,\n} from \"../vrt/report-identity.js\";\nimport { loadHostedGallery } from \"./hosted.js\";\nimport { createVrtOptions } from \"./commands.js\";\nimport type { CliOptions } from \"./index.js\";\nimport { authorizeSession, captureInput } from \"./service/auth.js\";\nimport { SessionArtifacts } from \"./service/artifacts.js\";\nimport { writeSessionReport } from \"./service/reports.js\";\n\nfunction json(response: ServerResponse, value: unknown, status = 200): void {\n response.setHeader(\"Content-Type\", \"application/json\");\n response.writeHead(status).end(JSON.stringify(value));\n}\n\n/** Local lifecycle authority; callers must keep credentials out of reports and artifacts. */\nexport async function startHostedVrtSession(options: CliOptions, certificateSpki?: string) {\n if (!options.galleryUrl) throw new Error(\"serve requires --gallery-url\");\n const gallery = new URL(options.galleryUrl);\n gallery.pathname = `${gallery.pathname.replace(/\\/+$/, \"\")}/`;\n gallery.search = \"\";\n gallery.hash = \"\";\n if (gallery.protocol !== \"https:\" || gallery.username || gallery.password)\n throw new Error(\"serve requires an HTTPS gallery without embedded credentials\");\n await loadHostedGallery(gallery.href);\n const token = randomBytes(32).toString(\"base64url\");\n const artifacts = new SessionArtifacts();\n let host = \"\";\n let busy: Promise<void> | undefined;\n let closing = false;\n let closeTask: Promise<void> | undefined;\n const server = createServer((request, response) => {\n if (!authorizeSession(request, response, gallery.origin, host, token)) return;\n if (closing) {\n json(response, { error: \"Session is closing\" }, 503);\n return;\n }\n if (request.method === \"GET\" && request.url === \"/session\") {\n json(response, { version: 1, galleryUrl: gallery.href });\n return;\n }\n if (request.method === \"GET\" && request.url && artifacts.send(request.url, response)) return;\n if (request.method !== \"POST\" || request.url !== \"/capture\") {\n json(response, { error: \"Not found\" }, 404);\n return;\n }\n if (busy) {\n json(response, { error: \"Capture already running\" }, 409);\n return;\n }\n busy = (async () => {\n let runner: MuseaVrtRunner | undefined;\n let outcome: { body: unknown; status: number } = {\n body: { error: \"Capture incomplete\" },\n status: 500,\n };\n try {\n const input = await captureInput(request);\n const hosted = await loadHostedGallery(gallery.href);\n const art = hosted.arts.find((item) => item.path === input.artPath);\n if (!art) {\n outcome = { body: { error: \"Art not found\" }, status: 404 };\n return;\n }\n // HTTP redirects are refused before planning; browser redirects are guarded before PNG writes.\n for (const variant of art.variants.filter((item) => !item.skipVrt)) {\n const preview = await fetch(hosted.previewUrls[art.path][variant.name], {\n redirect: \"error\",\n signal: AbortSignal.timeout(30000),\n });\n if (!preview.ok) throw new Error(`Hosted preview: HTTP ${preview.status}`);\n await preview.body?.cancel();\n }\n const reportDir = path.resolve(options.output, \"reports\");\n const identity = hosted.snapshotIdentities[art.path];\n const target = resolveArtReportTarget(\n identity,\n Object.values(hosted.snapshotIdentities),\n process.cwd(),\n reportDir,\n );\n await assertArtReportOwnership(target, process.cwd());\n runner = new MuseaVrtRunner({\n ...createVrtOptions(options),\n capture: { ...createVrtOptions(options).capture, waitForPreviewReady: true },\n previewUrls: hosted.previewUrls,\n snapshotIdentities: hosted.snapshotIdentities,\n hostedNavigation: gallery.href,\n });\n await runner.init({ hostedCertificateSpki: certificateSpki });\n const results = await runner.runAllTests([art], gallery.origin);\n const summary = runner.getSummary(results);\n // A hosted request fails closed on any runner error, including blocked navigation.\n if ((summary.errors ?? 0) > 0) throw new Error(results.find((item) => item.error)!.error);\n if (input.update) await runner.updateBaselines(results);\n const rawJson = attachArtReportOwner(generateVrtJsonReport(results, summary), target);\n const html = generateVrtReport(results, summary);\n await mkdir(reportDir, { recursive: true });\n await writeSessionReport(target.jsonReportPath, rawJson);\n await writeSessionReport(target.htmlReportPath, html);\n artifacts.clear();\n const uiResults = await artifacts.results(results);\n outcome = {\n status: 200,\n body: {\n success: true,\n results: uiResults,\n summary,\n reports: {\n json: artifacts.add(rawJson, \"application/json\"),\n html: artifacts.add(html, \"text/html\"),\n },\n },\n };\n } catch (error) {\n outcome = {\n status: 400,\n body: { error: error instanceof Error ? error.message : String(error) },\n };\n } finally {\n try {\n await runner?.close();\n } catch (error) {\n outcome = { status: 500, body: { error: `Capture cleanup failed: ${String(error)}` } };\n }\n busy = undefined;\n if (!response.destroyed) json(response, outcome.body, outcome.status);\n }\n })().catch((error) => {\n busy = undefined;\n if (!response.destroyed && !response.headersSent)\n json(response, { error: String(error) }, 500);\n });\n });\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(0, \"127.0.0.1\", resolve);\n });\n const address = server.address();\n if (!address || typeof address === \"string\") throw new Error(\"Missing loopback listener\");\n host = `127.0.0.1:${address.port}`;\n return {\n endpoint: `http://${host}`,\n token,\n close() {\n return (closeTask ??= (async () => {\n closing = true;\n await busy;\n artifacts.clear();\n await new Promise<void>((resolve, reject) =>\n server.close((error) => (error ? reject(error) : resolve())),\n );\n })());\n },\n };\n}\n\nexport async function runServe(options: CliOptions): Promise<void> {\n const session = await startHostedVrtSession(options);\n console.log(\n \" This session token is a live credential; do not share it or retain it in captured logs.\",\n );\n console.log(` VRT endpoint: ${session.endpoint}\\n Session token: ${session.token}\\n`);\n const stop = () => {\n void session.close().then(\n () => {\n process.exitCode = 0;\n },\n (error) => {\n console.error(\"VRT session cleanup failed:\", error);\n process.exitCode = 1;\n },\n );\n };\n process.once(\"SIGINT\", stop);\n process.once(\"SIGTERM\", stop);\n}\n","#!/usr/bin/env node\n/**\n * Musea CLI\n *\n * Usage:\n * musea-vrt [command] [options]\n *\n * Commands:\n * (default) Run VRT tests\n * approve [pat] Approve failed snapshots (optionally filtered by pattern)\n * clean Remove orphaned snapshots\n *\n * Options:\n * -u, --update Update baseline snapshots\n * -c, --config Path to Vite config (default: Vite config discovery)\n * -o, --output Output directory for reports (default: .vize)\n * -t, --threshold Diff threshold percentage (default: 0.1)\n * -w, --workers Number of concurrent captures (default: 1)\n * --json Output JSON report instead of HTML\n * --ci CI mode - exit with non-zero code on failures\n * --a11y Run accessibility audits alongside VRT\n * -h, --help Show help\n */\n\nimport path from \"node:path\";\nimport { realpathSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport type { ArtFileInfo } from \"../types/index.js\";\nimport { parseArtFile, parseWorkers } from \"./utils.js\";\nimport { scanArtFiles } from \"../utils.js\";\nimport { runVrt, runApprove, runClean, runGenerate } from \"./commands.js\";\nimport { loadMuseaConfiguration } from \"./config.js\";\nimport { loadHostedGallery } from \"./hosted.js\";\nimport { runServe } from \"./serve.js\";\nimport type { MuseaVrtOptions } from \"../types/index.js\";\n\ntype Command = \"run\" | \"approve\" | \"clean\" | \"generate\" | \"serve\";\n\nexport interface CliOptions {\n command: Command;\n update: boolean;\n config?: string;\n configDir?: string;\n output: string;\n threshold: number;\n thresholdProvided: boolean;\n workers: number;\n workersProvided: boolean;\n json: boolean;\n ci: boolean;\n a11y: boolean;\n help: boolean;\n baseUrl: string;\n pattern?: string;\n componentPath?: string;\n vrt?: MuseaVrtOptions;\n galleryUrl?: string;\n previewBasePath?: string;\n previewUrls?: Record<string, Record<string, string>>;\n projectRoot?: string;\n snapshotIdentities?: Record<string, string>;\n adoptLegacySnapshots?: boolean;\n}\n\nexport function parseArgs(args: string[]): CliOptions {\n const options: CliOptions = {\n command: \"run\",\n update: false,\n output: \".vize\",\n threshold: 0.1,\n thresholdProvided: false,\n workers: 1,\n workersProvided: false,\n json: false,\n ci: false,\n a11y: false,\n help: false,\n baseUrl: \"http://localhost:5173\",\n };\n\n let i = 0;\n\n // Check for subcommand as first arg\n if (args.length > 0 && !args[0].startsWith(\"-\")) {\n const sub = args[0];\n if (sub === \"serve\") {\n options.command = \"serve\";\n i = 1;\n } else if (sub === \"approve\") {\n options.command = \"approve\";\n i = 1;\n // Optional pattern argument after approve\n if (args.length > 1 && !args[1].startsWith(\"-\")) {\n options.pattern = args[1];\n i = 2;\n }\n } else if (sub === \"clean\") {\n options.command = \"clean\";\n i = 1;\n } else if (sub === \"generate\") {\n options.command = \"generate\";\n i = 1;\n // Required component path argument\n if (args.length > 1 && !args[1].startsWith(\"-\")) {\n options.componentPath = args[1];\n i = 2;\n }\n }\n }\n\n for (; i < args.length; i++) {\n const arg = args[i];\n switch (arg) {\n case \"-u\":\n case \"--update\":\n options.update = true;\n break;\n case \"-c\":\n case \"--config\":\n options.config = args[++i] || undefined;\n break;\n case \"-o\":\n case \"--output\":\n options.output = args[++i] || \".vize\";\n break;\n case \"-t\":\n case \"--threshold\":\n options.threshold = parseThreshold(args[++i]);\n options.thresholdProvided = true;\n break;\n case \"-w\":\n case \"--workers\":\n options.workers = parseWorkers(args[++i]);\n options.workersProvided = true;\n break;\n case \"--json\":\n options.json = true;\n break;\n case \"--ci\":\n options.ci = true;\n break;\n case \"--a11y\":\n options.a11y = true;\n break;\n case \"-b\":\n case \"--base-url\":\n options.baseUrl = args[++i] || \"http://localhost:5173\";\n break;\n case \"-h\":\n case \"--help\":\n options.help = true;\n break;\n case \"--adopt-legacy-snapshots\":\n options.adoptLegacySnapshots = true;\n break;\n case \"--gallery-url\":\n options.galleryUrl = args[++i];\n if (!options.galleryUrl || options.galleryUrl.startsWith(\"-\"))\n throw new Error(\"--gallery-url requires a URL\");\n break;\n }\n }\n\n return options;\n}\n\nfunction parseThreshold(value: string | undefined): number {\n const threshold = Number.parseFloat(value ?? \"\");\n return Number.isFinite(threshold) ? threshold : 0.1;\n}\n\nfunction printHelp(): void {\n console.log(`\nMusea VRT - Visual Regression Testing for Component Gallery\n\nUsage:\n musea-vrt [command] [options]\n\nCommands:\n (default) Run VRT tests\n approve [pattern] Approve failed snapshots and update baselines\n Optional pattern filters which snapshots to approve\n clean Remove orphaned snapshots (no matching art/variant)\n serve --gallery-url Connect a secure hosted gallery to a local VRT session\n generate <component> Auto-generate .art.vue from a Vue component\n\nOptions:\n -u, --update Update baseline snapshots with current screenshots\n -c, --config <path> Path to Vite config file (default: Vite config discovery)\n -o, --output <dir> Output directory for reports (default: .vize)\n -t, --threshold <n> Diff threshold percentage (default: 0.1)\n -b, --base-url <url> Base URL for dev server (default: http://localhost:5173)\n --gallery-url <url> Capture a built hosted gallery using its static manifest\n --adopt-legacy-snapshots Adopt reviewed, unambiguous legacy PNG baselines once\n -w, --workers <n> Number of concurrent captures (default: 1)\n --json Output JSON report instead of HTML\n --ci CI mode - exit with non-zero code on failures\n --a11y Run accessibility audits alongside VRT\n -h, --help Show this help message\n\nExamples:\n # Run VRT tests\n musea-vrt\n\n # Update baseline snapshots\n musea-vrt -u\n\n # Run with custom threshold\n musea-vrt -t 0.5\n\n # CI mode with JSON output\n musea-vrt --ci --json\n\n # Run with accessibility audits\n musea-vrt --a11y\n\n # Capture variants concurrently\n musea-vrt --workers 8\n\n # Approve all failed snapshots\n musea-vrt approve\n\n # Approve specific snapshots by pattern\n musea-vrt approve \"Button/*\"\n\n # Clean orphaned snapshots\n musea-vrt clean\n\n # Auto-generate .art.vue from component\n musea-vrt generate src/components/Button.vue\n\n # Custom base URL\n musea-vrt -b http://localhost:3000\n`);\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n const options = parseArgs(args);\n\n if (options.help) {\n printHelp();\n process.exit(0);\n }\n\n const cwd = process.cwd();\n\n console.log(\"\\n Musea VRT\");\n console.log(\" =========\\n\");\n\n // Handle generate command early (doesn't need art file scanning)\n if (options.command === \"generate\") {\n try {\n await runGenerate(options);\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n return;\n }\n\n const { fileSet, vrt, configDir, previewBasePath } = await loadMuseaConfiguration(\n options.config,\n cwd,\n );\n options.vrt = vrt;\n options.configDir = configDir;\n if (options.command === \"serve\") {\n try {\n await runServe(options);\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n return;\n }\n options.previewBasePath = vrt?.previewBasePath ?? previewBasePath;\n if (options.galleryUrl) {\n const hosted = await loadHostedGallery(options.galleryUrl);\n options.previewUrls = hosted.previewUrls;\n options.snapshotIdentities = hosted.snapshotIdentities;\n if (options.command === \"run\") await runVrt(options, hosted.arts);\n else if (options.command === \"approve\") await runApprove(options, hosted.arts);\n else if (options.command === \"clean\") await runClean(options, hosted.arts);\n return;\n }\n options.projectRoot = fileSet.projectRoot;\n\n // Scan for art files\n console.log(\" Scanning for art files...\");\n const artFilePaths = await scanArtFiles(fileSet.root, fileSet.include, fileSet.exclude);\n\n if (artFilePaths.length === 0) {\n console.log(\" No art files found.\\n\");\n process.exit(0);\n }\n\n console.log(` Found ${artFilePaths.length} art file(s)\\n`);\n\n // Parse art files\n const artFiles: ArtFileInfo[] = [];\n for (const filePath of artFilePaths) {\n const art = await parseArtFile(filePath);\n if (art) {\n artFiles.push(art);\n }\n }\n\n try {\n switch (options.command) {\n case \"run\":\n await runVrt(options, artFiles);\n break;\n case \"approve\":\n await runApprove(options, artFiles);\n break;\n case \"clean\":\n await runClean(options, artFiles);\n break;\n case \"generate\":\n // Handled above before art file scanning\n break;\n }\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n}\n\nif (isDirectRun()) {\n main().catch((error) => {\n console.error(\"Fatal error:\", error);\n process.exit(1);\n });\n}\n\nfunction isDirectRun(): boolean {\n const entrypoint = process.argv[1];\n if (!entrypoint) {\n return false;\n }\n\n try {\n return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(path.resolve(entrypoint));\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgDA,eAAsB,aAAa,UAA+C;CAChF,OAAO,oBAAoB,UAAU;EACnC,MAAM,KAAK,QAAQ,QAAQ;EAC3B,SAAS;CACX,CAAC;AACH;AAEA,SAAgB,aAAa,OAAmC;CAC9D,MAAM,UAAU,OAAO,SAAS,SAAS,IAAI,EAAE;CAC/C,OAAO,OAAO,SAAS,OAAO,IAAI,KAAK,IAAI,GAAG,OAAO,IAAI;AAC3D;;;;;;;;;ACzCA,SAAgB,uBAAuB,SAA8B;CACnE,OAAO,QAAQ,SAAS,MAAM,QAAQ,UAAU,KAAK;AACvD;AAEA,SAAgB,eAAe,UAA2B;CACxD,OAAO,SAAS,SAAS,UAAU;AACrC;AAEA,SAAgB,iBAAiB,SAAyC;CAExE,MAAM,aAAa,YAAY,QAAQ,GAAG;CAC1C,MAAM,aAAiC;EACrC,GAAG;EACH,GAAI,QAAQ,gBAAgB,KAAA,IAAY,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;EAChF,GAAI,QAAQ,uBAAuB,KAAA,IAC/B,EAAE,oBAAoB,QAAQ,mBAAmB,IACjD,CAAC;EACL,GAAI,QAAQ,yBAAyB,KAAA,IACjC,EAAE,sBAAsB,QAAQ,qBAAqB,IACrD,CAAC;EACL,SAAS;GAAE,qBAAqB;GAAM,GAAG,WAAW;EAAQ;EAC5D,GAAI,QAAQ,oBAAoB,KAAA,IAAY,EAAE,iBAAiB,QAAQ,gBAAgB,IAAI,CAAC;EAC5F,GAAI,QAAQ,gBAAgB,KAAA,IAAY,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;EAEhF,aAAa,sBAAsB,SAAS,WAAW,WAAW;EAClE,WAAW,QAAQ,oBACf,QAAQ,YACP,WAAW,aAAa,QAAQ;CACvC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SAAS,QAAQ;IAChC;GACF,KAAK,YAEH;EACJ;CACF,SAAS,OAAO;EACd,QAAQ,MAAM,cAAc,KAAK;EACjC,QAAQ,KAAK,CAAC;CAChB;AACF;AAEA,IAAI,YAAY,GACd,KAAK,EAAE,OAAO,UAAU;CACtB,QAAQ,MAAM,gBAAgB,KAAK;CACnC,QAAQ,KAAK,CAAC;AAChB,CAAC;AAGH,SAAS,cAAuB;CAC9B,MAAM,aAAa,QAAQ,KAAK;CAChC,IAAI,CAAC,YACH,OAAO;CAGT,IAAI;EACF,OAAO,aAAa,cAAc,OAAO,KAAK,GAAG,CAAC,MAAM,aAAa,KAAK,QAAQ,UAAU,CAAC;CAC/F,QAAQ;EACN,OAAO;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/cli/utils.ts","../../src/cli/commands.ts","../../src/cli/config.ts","../../src/cli/hosted.ts","../../src/cli/service/auth.ts","../../src/cli/service/artifacts.ts","../../src/cli/service/reports.ts","../../src/cli/serve.ts","../../src/cli/index.ts"],"sourcesContent":["/**\n * CLI utility functions for art file scanning and parsing.\n *\n * Extracted from cli.ts to keep file sizes manageable.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { processMuseaArtFile } from \"../plugin/art-processing.js\";\nimport type { ArtFileInfo } from \"../types/index.js\";\n\n/** Recursively scan a directory for .art.vue files. */\nexport async function scanArtFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n\n async function scan(dir: string): Promise<void> {\n let entries: fs.Dirent[];\n try {\n entries = await fs.promises.readdir(dir, { withFileTypes: true });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"EACCES\") {\n return;\n }\n throw error;\n }\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n // Skip node_modules and dist\n if (entry.name === \"node_modules\" || entry.name === \"dist\") {\n continue;\n }\n\n if (entry.isDirectory()) {\n await scan(fullPath);\n } else if (entry.isFile() && entry.name.endsWith(\".art.vue\")) {\n files.push(fullPath);\n }\n }\n }\n\n await scan(root);\n return files;\n}\n\n/** Parse a single .art.vue file into an ArtFileInfo structure. */\nexport async function parseArtFile(filePath: string): Promise<ArtFileInfo | null> {\n return processMuseaArtFile(filePath, {\n root: path.dirname(filePath),\n command: \"serve\",\n });\n}\n\nexport function parseWorkers(value: string | undefined): number {\n const workers = Number.parseInt(value ?? \"\", 10);\n return Number.isFinite(workers) ? Math.max(1, workers) : 1;\n}\n","/**\n * CLI command handlers for the Musea VRT tool.\n *\n * Extracted from cli.ts to keep file sizes manageable.\n * Contains the runVrt, runApprove, runClean, and runGenerate command implementations.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { MuseaVrtRunner, generateVrtReport, generateVrtJsonReport } from \"../vrt.js\";\nimport type { ExtendedVrtOptions, VrtSummary } from \"../vrt.js\";\nimport { normalizeVrtWorkerCount } from \"../vrt.js\";\nimport type { A11yOptions, ArtFileInfo, MuseaVrtOptions } from \"../types/index.js\";\n\nimport type { CliOptions } from \"./index.js\";\n\nexport function hasCiBlockingVrtResult(summary: VrtSummary): boolean {\n return summary.failed > 0 || (summary.errors ?? 0) > 0;\n}\n\nexport function isArtFileInput(filePath: string): boolean {\n return filePath.endsWith(\".art.vue\");\n}\n\nexport function createVrtOptions(options: CliOptions): ExtendedVrtOptions {\n // `vrt.a11y` is MuseaA11yRunner config. ExtendedVrtOptions.a11y is a boolean.\n const configured = withoutA11y(options.vrt);\n const vrtOptions: ExtendedVrtOptions = {\n ...configured,\n ...(options.projectRoot !== undefined ? { projectRoot: options.projectRoot } : {}),\n ...(options.snapshotIdentities !== undefined\n ? { snapshotIdentities: options.snapshotIdentities }\n : {}),\n ...(options.adoptLegacySnapshots !== undefined\n ? { adoptLegacySnapshots: options.adoptLegacySnapshots }\n : {}),\n capture: { waitForPreviewReady: true, ...configured.capture },\n ...(options.previewBasePath !== undefined ? { previewBasePath: options.previewBasePath } : {}),\n ...(options.previewUrls !== undefined ? { previewUrls: options.previewUrls } : {}),\n // run, approve, and clean all read this directory.\n snapshotDir: resolveVrtSnapshotDir(options, configured.snapshotDir),\n threshold: options.thresholdProvided\n ? options.threshold\n : (configured.threshold ?? options.threshold),\n };\n const workers = options.workersProvided ? options.workers : configured.workers;\n if (workers !== undefined) {\n vrtOptions.workers = normalizeVrtWorkerCount(workers);\n }\n return vrtOptions;\n}\n\n/**\n * `vrt.snapshotDir` is resolved against the config file's directory.\n * When it is unset, baselines stay under `<--output>/snapshots`.\n */\nfunction resolveVrtSnapshotDir(options: CliOptions, snapshotDir: string | undefined): string {\n if (!snapshotDir) return path.join(options.output, \"snapshots\");\n const configDir =\n options.configDir ??\n (options.config ? path.dirname(path.resolve(options.config)) : process.cwd());\n return path.resolve(configDir, snapshotDir);\n}\n\nfunction withoutA11y(vrt: MuseaVrtOptions | undefined): Omit<MuseaVrtOptions, \"a11y\"> {\n if (!vrt) return {};\n const configured: MuseaVrtOptions = { ...vrt };\n delete configured.a11y;\n return configured;\n}\n\n/** Options object `musea-vrt --a11y` passes to `MuseaA11yRunner`. */\nexport function createA11yRunner<T>(options: CliOptions, Runner: new (a11y?: A11yOptions) => T): T {\n return new Runner(options.vrt?.a11y);\n}\n\nexport async function runVrt(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const totalVariants = artFiles.reduce(\n (sum, art) => sum + art.variants.filter((v) => !v.skipVrt).length,\n 0,\n );\n\n console.log(` Testing ${totalVariants} variant(s) across ${artFiles.length} art file(s)\\n`);\n\n const runner = new MuseaVrtRunner({\n ...createVrtOptions(options),\n ci: options.ci ? { failOnDiff: true, jsonReport: options.json } : undefined,\n });\n\n try {\n console.log(\" Launching browser...\");\n await runner.init();\n\n console.log(\" Running visual regression tests...\\n\");\n\n // Run tests\n const results = await runner.runAllTests(artFiles, options.baseUrl);\n const summary = runner.getSummary(results);\n\n // Print results\n console.log(\" Results:\");\n console.log(\" ---------\");\n console.log(` Passed: ${summary.passed}`);\n console.log(` Failed: ${summary.failed}`);\n console.log(` New: ${summary.new}`);\n console.log(` Errors: ${summary.errors ?? 0}`);\n console.log(` Skipped: ${summary.skipped}`);\n console.log(` Total: ${summary.total}`);\n console.log(` Duration: ${(summary.duration / 1000).toFixed(2)}s\\n`);\n\n // Run a11y audits if requested\n if (options.a11y) {\n console.log(\" Running accessibility audits...\\n\");\n try {\n const { MuseaA11yRunner } = await import(\"../a11y/index.js\");\n const a11yRunner = createA11yRunner(options, MuseaA11yRunner);\n const a11yResults = await a11yRunner.runAudits(artFiles, options.baseUrl, runner);\n const a11ySummary = a11yRunner.getSummary(a11yResults);\n\n console.log(\" A11y Results:\");\n console.log(\" -------------\");\n console.log(` Components: ${a11ySummary.totalComponents}`);\n console.log(` Variants: ${a11ySummary.totalVariants}`);\n console.log(` Violations: ${a11ySummary.totalViolations}`);\n console.log(` Critical: ${a11ySummary.criticalCount}`);\n console.log(` Serious: ${a11ySummary.seriousCount}`);\n console.log(` Not audited: ${a11ySummary.erroredVariants}\\n`);\n\n // Generate a11y report\n const reportDir = options.output;\n await fs.promises.mkdir(reportDir, { recursive: true });\n\n if (options.json) {\n const a11yJson = a11yRunner.generateJsonReport(a11yResults);\n const a11yPath = path.join(reportDir, \"a11y-report.json\");\n await fs.promises.writeFile(a11yPath, a11yJson);\n console.log(` A11y JSON report: ${a11yPath}\\n`);\n } else {\n const a11yHtml = a11yRunner.generateHtmlReport(a11yResults);\n const a11yPath = path.join(reportDir, \"a11y-report.html\");\n await fs.promises.writeFile(a11yPath, a11yHtml);\n console.log(` A11y HTML report: ${a11yPath}\\n`);\n }\n\n // CI mode - exit with error on critical/serious violations. A variant\n // whose audit never ran fails too, but under its own message: it is\n // not an accessibility finding, and reporting it as one sends people\n // looking for a component defect that does not exist.\n if (options.ci && a11ySummary.erroredVariants > 0) {\n console.log(\n ` CI mode: ${a11ySummary.erroredVariants} variant(s) could not be audited\\n`,\n );\n process.exitCode = 1;\n return;\n }\n if (options.ci && (a11ySummary.criticalCount > 0 || a11ySummary.seriousCount > 0)) {\n console.log(\" CI mode: Accessibility violations found\\n\");\n process.exitCode = 1;\n return;\n }\n } catch (e) {\n console.warn(\" A11y audits skipped:\", e instanceof Error ? e.message : String(e));\n console.warn(\" Make sure axe-core is installed: npm install axe-core\\n\");\n }\n }\n\n // Update baselines if requested\n if (options.update) {\n console.log(\" Updating baselines...\");\n const updated = await runner.updateBaselines(results);\n console.log(` Updated ${updated} baseline(s)\\n`);\n }\n\n // Generate VRT report\n const reportDir = options.output;\n await fs.promises.mkdir(reportDir, { recursive: true });\n\n if (options.json) {\n const jsonReport = generateVrtJsonReport(results, summary);\n const jsonPath = path.join(reportDir, \"vrt-report.json\");\n await fs.promises.writeFile(jsonPath, jsonReport);\n console.log(` JSON report: ${jsonPath}\\n`);\n } else {\n const htmlReport = generateVrtReport(results, summary);\n const htmlPath = path.join(reportDir, \"vrt-report.html\");\n await fs.promises.writeFile(htmlPath, htmlReport);\n console.log(` HTML report: ${htmlPath}\\n`);\n }\n\n // CI mode - exit with error if visual diffs or runner errors occurred.\n if (options.ci && hasCiBlockingVrtResult(summary)) {\n console.log(\" CI mode: Exiting with error due to failures or errors\\n\");\n process.exitCode = 1;\n }\n } finally {\n await runner.close();\n }\n}\n\nexport async function runApprove(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const runner = new MuseaVrtRunner(createVrtOptions(options));\n\n try {\n console.log(\" Launching browser...\");\n await runner.init();\n\n console.log(\" Running tests to find diffs...\\n\");\n\n const results = await runner.runAllTests(artFiles, options.baseUrl);\n const failed = results.filter((r) => !r.passed && !r.error);\n\n if (failed.length === 0) {\n console.log(\" No failed tests to approve.\\n\");\n return;\n }\n\n const pattern = options.pattern;\n if (pattern) {\n console.log(` Approving snapshots matching: ${pattern}\\n`);\n } else {\n console.log(` Approving all ${failed.length} failed snapshot(s)...\\n`);\n }\n\n const approved = await runner.approveResults(results, pattern);\n console.log(` Approved ${approved} snapshot(s)\\n`);\n } finally {\n await runner.close();\n }\n}\n\nexport async function runClean(options: CliOptions, artFiles: ArtFileInfo[]): Promise<void> {\n const runner = new MuseaVrtRunner(createVrtOptions(options));\n\n console.log(\" Scanning for orphaned snapshots...\\n\");\n\n let cleaned: number;\n try {\n cleaned = await runner.cleanOrphans(artFiles);\n } finally {\n await runner.close();\n }\n\n if (cleaned === 0) {\n console.log(\" No orphaned snapshots found.\\n\");\n } else {\n console.log(`\\n Cleaned ${cleaned} orphaned snapshot(s)\\n`);\n }\n}\n\nexport async function runGenerate(options: CliOptions): Promise<void> {\n if (!options.componentPath) {\n console.error(\" Error: Missing component path.\");\n console.error(\" Usage: musea-vrt generate <component.vue>\\n\");\n process.exit(1);\n }\n\n const componentPath = path.resolve(options.componentPath);\n if (isArtFileInput(componentPath)) {\n console.error(\n \" Error: musea-vrt generate expects a source .vue component, not a .art.vue file.\",\n );\n console.error(\" Pass the component file that the art file should wrap.\\n\");\n process.exit(1);\n }\n\n // Check file exists\n try {\n await fs.promises.access(componentPath);\n } catch {\n console.error(` Error: File not found: ${componentPath}\\n`);\n process.exit(1);\n }\n\n console.log(` Generating art file for: ${path.relative(process.cwd(), componentPath)}\\n`);\n\n try {\n const { writeArtFile } = await import(\"../autogen/index.js\");\n const outputPath = await writeArtFile(componentPath);\n const relOutput = path.relative(process.cwd(), outputPath);\n\n console.log(` Generated: ${relOutput}\\n`);\n } catch (e) {\n console.error(\" Generation failed:\", e instanceof Error ? e.message : String(e));\n process.exit(1);\n }\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { loadConfigFromFile, type PluginOption, type UserConfig } from \"vite\";\nimport { loadConfig, resolveViteConfigExport } from \"@vizejs/vite-plugin\";\n\nimport type { MuseaOptions, MuseaVrtOptions } from \"../types/index.js\";\nimport { readMuseaOptions } from \"../plugin/options.js\";\nimport { publicBasePathFromViteBase } from \"../static-base.js\";\n\nconst DEFAULT_INCLUDE = [\"**/*.art.vue\"];\nconst DEFAULT_EXCLUDE = [\"node_modules/**\", \"dist/**\"];\nconst CONFIG_ENV = { command: \"serve\", mode: \"development\", isSsrBuild: false } as const;\n\ninterface LoadedViteConfig {\n root: string;\n configDir: string;\n config: UserConfig;\n plugins: unknown[];\n}\n\nexport interface MuseaFileSet {\n root: string;\n projectRoot: string;\n include: string[];\n exclude: string[];\n}\n\nexport async function loadMuseaVrtOptions(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<MuseaVrtOptions | undefined> {\n return (await loadMuseaConfiguration(configPath, cwd)).vrt;\n}\n\nexport async function loadMuseaFileSet(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<MuseaFileSet> {\n return (await loadMuseaConfiguration(configPath, cwd)).fileSet;\n}\n\nexport async function loadMuseaPreviewBasePath(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<string> {\n return (await loadMuseaConfiguration(configPath, cwd)).previewBasePath;\n}\n\n/** Resolve all CLI gallery metadata from one evaluation of the Vite config. */\nexport async function loadMuseaConfiguration(\n configPath?: string,\n cwd = process.cwd(),\n): Promise<{\n fileSet: MuseaFileSet;\n vrt: MuseaVrtOptions | undefined;\n configDir: string;\n previewBasePath: string;\n}> {\n const loaded = await loadViteConfig(configPath, cwd);\n const pluginOptions = loaded ? readPluginMuseaOptions(loaded.plugins) : undefined;\n const vizeOptions = await readSharedMuseaOptions(loaded, cwd, configPath);\n const include = pluginOptions?.include ?? vizeOptions?.include ?? DEFAULT_INCLUDE;\n const exclude = pluginOptions?.exclude ?? vizeOptions?.exclude ?? DEFAULT_EXCLUDE;\n const sharedVrt = vizeOptions?.vrt;\n const { outDir, ...sharedVrtOptions } = sharedVrt ?? {};\n const vrt = sharedVrt\n ? {\n ...sharedVrtOptions,\n ...(outDir === undefined ? {} : { snapshotDir: outDir }),\n ...pluginOptions?.vrt,\n }\n : pluginOptions?.vrt;\n const root = loaded?.root ?? cwd;\n return {\n fileSet: {\n root,\n projectRoot: path.resolve(root, pluginOptions?.projectRoot ?? \".\"),\n include,\n exclude,\n },\n vrt,\n configDir: loaded?.configDir ?? cwd,\n previewBasePath: publicBasePathFromViteBase(\n loaded?.config.base,\n pluginOptions?.basePath ?? vizeOptions?.basePath ?? \"/__musea__\",\n ),\n };\n}\n\nasync function loadViteConfig(\n configPath: string | undefined,\n cwd: string,\n): Promise<LoadedViteConfig | undefined> {\n const resolvedConfigPath = configPath ? path.resolve(cwd, configPath) : undefined;\n if (\n resolvedConfigPath &&\n /^vize\\.config\\.(?:pkl|[cm]?[jt]s|json)$/.test(path.basename(resolvedConfigPath))\n ) {\n throw new Error(\n \"vize.config.* is no longer supported; move Musea settings to vue.musea in vite.config.*\",\n );\n }\n if (resolvedConfigPath && !(await fileExists(resolvedConfigPath))) return undefined;\n\n const loaded = await loadConfigFromFile(\n {\n command: \"serve\",\n mode: \"development\",\n isPreview: false,\n isSsrBuild: false,\n },\n resolvedConfigPath,\n cwd,\n );\n if (!loaded) return undefined;\n\n const plugins: unknown[] = [];\n await collectPlugins(loaded.config.plugins, plugins);\n const configDir = path.dirname(loaded.path);\n const configuredRoot = loaded.config.root;\n return {\n root: configuredRoot ? path.resolve(configDir, configuredRoot) : configDir,\n configDir,\n config: loaded.config,\n plugins,\n };\n}\n\nfunction readPluginMuseaOptions(plugins: unknown[]): MuseaOptions | undefined {\n for (const plugin of plugins) {\n const options = readMuseaOptions(plugin);\n if (options) return options;\n }\n return undefined;\n}\n\nasync function readSharedMuseaOptions(\n loaded: LoadedViteConfig | undefined,\n cwd: string,\n configPath: string | undefined,\n) {\n // Preserve existing defaults for a missing explicit file, without selecting a\n // different project's authored configuration behind that explicit request.\n if (!loaded && configPath !== undefined) return undefined;\n // Project the config Vite already evaluated, including custom --config paths.\n // Re-importing it could repeat plugin factories and other user side effects.\n const config = loaded\n ? ((await loadConfig(loaded.configDir, { viteConfig: false, env: CONFIG_ENV })) ??\n (await resolveViteConfigExport(loaded.config, CONFIG_ENV)))\n : await loadConfig(cwd, { mode: \"auto\", env: CONFIG_ENV });\n return config?.musea;\n}\n\nasync function collectPlugins(\n input: PluginOption | Promise<PluginOption> | undefined,\n plugins: unknown[],\n) {\n const resolved = await input;\n if (!resolved) return;\n\n if (Array.isArray(resolved)) {\n for (const item of resolved) {\n await collectPlugins(item, plugins);\n }\n return;\n }\n\n plugins.push(resolved);\n}\n\nasync function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.promises.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n","import { normalizeSnapshotIdentity } from \"../vrt/snapshot-identity.js\";\nimport type { ArtFileInfo } from \"../types/index.js\";\n\nexport interface HostedGallery {\n arts: ArtFileInfo[];\n snapshotIdentities: Record<string, string>;\n previewUrls: Record<string, Record<string, string>>;\n}\n\n/** Read a built gallery without requiring its build machine's source files. */\nexport async function loadHostedGallery(galleryUrl: string): Promise<HostedGallery> {\n const base = new URL(galleryUrl);\n if (![\"http:\", \"https:\"].includes(base.protocol) || base.username || base.password)\n throw new Error(\"--gallery-url must be an HTTP(S) URL without embedded credentials\");\n base.pathname = `${base.pathname.replace(/\\/+$/, \"\")}/`;\n base.search = \"\";\n base.hash = \"\";\n const manifestUrl = new URL(\"api/static.json\", base);\n const response = await fetch(manifestUrl, {\n redirect: \"error\",\n signal: AbortSignal.timeout(30000),\n });\n if (!response.ok) throw new Error(`Hosted gallery manifest: HTTP ${response.status}`);\n const payload: unknown = await response.json();\n if (!isRecord(payload) || !Array.isArray(payload.arts) || !isRecord(payload.previews))\n throw new Error(\"Hosted gallery manifest must contain arts and previews\");\n if (payload.snapshotIdentityVersion !== 1 || !isRecord(payload.snapshotIdentities))\n throw new Error(\n \"Hosted gallery requires snapshot identity version 1; rebuild the gallery with a current Musea version\",\n );\n const snapshotIdentities: Record<string, string> = Object.create(null);\n const uniqueIdentities = new Set<string>();\n const arts: ArtFileInfo[] = [];\n const previewUrls: HostedGallery[\"previewUrls\"] = Object.create(null);\n for (const item of payload.arts) {\n if (\n !isRecord(item) ||\n typeof item.path !== \"string\" ||\n !isRecord(item.metadata) ||\n typeof item.metadata.title !== \"string\" ||\n !Array.isArray(item.variants)\n )\n throw new Error(\"Invalid hosted art metadata\");\n if (Object.hasOwn(previewUrls, item.path))\n throw new Error(`Duplicate hosted art: ${item.path}`);\n const identity = payload.snapshotIdentities[item.path];\n if (typeof identity !== \"string\")\n throw new Error(`Missing hosted snapshot identity: ${item.path}`);\n const normalized = normalizeSnapshotIdentity(identity);\n if (uniqueIdentities.has(normalized))\n throw new Error(`Duplicate hosted snapshot identity: ${normalized}`);\n uniqueIdentities.add(normalized);\n snapshotIdentities[item.path] = normalized;\n const variants = item.variants;\n const urls: Record<string, string> = Object.create(null);\n const sourceUrls = payload.previews[item.path];\n if (!isRecord(sourceUrls)) throw new Error(`Missing hosted previews: ${item.path}`);\n for (const variant of variants) {\n if (\n !isRecord(variant) ||\n typeof variant.name !== \"string\" ||\n typeof variant.skipVrt !== \"boolean\"\n )\n throw new Error(\"Invalid hosted variant metadata\");\n if (Object.hasOwn(urls, variant.name))\n throw new Error(`Duplicate hosted variant: ${variant.name}`);\n const value = sourceUrls[variant.name];\n if (typeof value !== \"string\") throw new Error(`Missing hosted preview: ${variant.name}`);\n const url = new URL(value, base);\n if (\n url.origin !== base.origin ||\n !url.pathname.startsWith(base.pathname) ||\n url.username ||\n url.password\n )\n throw new Error(`Hosted preview is outside its gallery: ${variant.name}`);\n urls[variant.name] = url.href;\n }\n // The static emitter owns the complete ArtFileInfo shape. Above validates\n // the fields used by capture/approve/clean; unrelated source fields are inert.\n arts.push(item as unknown as ArtFileInfo);\n previewUrls[item.path] = urls;\n }\n return { arts, previewUrls, snapshotIdentities };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n","import type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { timingSafeEqual } from \"node:crypto\";\n\nexport function authorizeSession(\n request: IncomingMessage,\n response: ServerResponse,\n origin: string,\n host: string,\n token: string,\n): boolean {\n response.setHeader(\"Cache-Control\", \"no-store\");\n response.setHeader(\"Vary\", \"Origin\");\n if (request.headers.origin !== origin || request.headers.host !== host) {\n response.writeHead(403).end();\n return false;\n }\n response.setHeader(\"Access-Control-Allow-Origin\", origin);\n if (request.method === \"OPTIONS\") {\n const method = request.headers[\"access-control-request-method\"];\n const headers = String(request.headers[\"access-control-request-headers\"] ?? \"\")\n .toLowerCase()\n .split(\",\")\n .map((item) => item.trim());\n if (\n ![\"GET\", \"POST\"].includes(String(method)) ||\n !headers.includes(\"authorization\") ||\n headers.some((item) => ![\"authorization\", \"content-type\"].includes(item))\n ) {\n response.writeHead(403).end();\n return false;\n }\n response.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST\");\n response.setHeader(\"Access-Control-Allow-Headers\", \"Authorization, Content-Type\");\n response.writeHead(204).end();\n return false;\n }\n const actual = Buffer.from(request.headers.authorization ?? \"\");\n const expected = Buffer.from(`Bearer ${token}`);\n if (actual.length !== expected.length || !timingSafeEqual(actual, expected)) {\n response.writeHead(401).end();\n return false;\n }\n return true;\n}\n\nexport async function captureInput(\n request: IncomingMessage,\n): Promise<{ artPath: string; update: boolean }> {\n const type = (request.headers[\"content-type\"] ?? \"\").split(\";\")[0].trim().toLowerCase();\n if (type !== \"application/json\") throw new Error(\"Expected JSON\");\n const chunks: Buffer[] = [];\n let size = 0;\n for await (const chunk of request) {\n if (!Buffer.isBuffer(chunk)) throw new Error(\"Expected HTTP bytes\");\n size += chunk.length;\n if (size > 4096) throw new Error(\"Capture input is too large\");\n chunks.push(chunk);\n }\n let input: unknown;\n try {\n input = JSON.parse(Buffer.concat(chunks).toString(\"utf8\"));\n } catch {\n throw new Error(\"Capture input must contain valid JSON\");\n }\n if (\n !input ||\n typeof input !== \"object\" ||\n Array.isArray(input) ||\n Object.keys(input).sort().join(\",\") !== \"artPath,update\" ||\n typeof (input as { artPath: unknown }).artPath !== \"string\" ||\n typeof (input as { update: unknown }).update !== \"boolean\"\n )\n throw new Error(\"Capture requires a known artPath and boolean update\");\n return input as { artPath: string; update: boolean };\n}\n","import { randomUUID } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport type { VrtResult } from \"../../vrt/types.js\";\n\n/** Registrations contain frozen capture bytes, never request-derived filesystem paths. */\nexport class SessionArtifacts {\n private files = new Map<string, { bytes: Buffer; type: string }>();\n\n add(bytes: Buffer | string, type: string): string {\n const url = `/artifacts/${randomUUID()}`;\n this.files.set(url, { bytes: Buffer.from(bytes), type });\n return url;\n }\n\n clear(): void {\n this.files.clear();\n }\n\n send(url: string, response: ServerResponse): boolean {\n const artifact = this.files.get(url);\n if (!artifact) return false;\n response.setHeader(\"Content-Type\", artifact.type);\n response.setHeader(\"X-Content-Type-Options\", \"nosniff\");\n response.setHeader(\n \"Content-Security-Policy\",\n \"default-src 'none'; style-src 'unsafe-inline'; img-src data:; sandbox\",\n );\n response.end(artifact.bytes);\n return true;\n }\n\n async results(results: VrtResult[]) {\n return Promise.all(\n results.map(async (result) => {\n const urls: { snapshot?: string; current?: string; diff?: string } = {};\n for (const [key, file] of [\n [\"snapshot\", result.snapshotPath],\n [\"current\", result.currentPath],\n [\"diff\", result.diffPath],\n ] as const) {\n if (file && !result.error) urls[key] = this.add(await readFile(file), \"image/png\");\n }\n return {\n artPath: result.artPath,\n variantName: result.variantName,\n viewport: result.viewport.name,\n passed: result.passed,\n isNew: result.isNew,\n diffPercentage: result.diffPercentage,\n error: result.error,\n images: urls,\n };\n }),\n );\n }\n}\n","import { randomUUID } from \"node:crypto\";\nimport { rename, rm, writeFile } from \"node:fs/promises\";\n\n/** Publish one complete owned report; JSON/HTML retain independent file atomicity. */\nexport async function writeSessionReport(file: string, bytes: string): Promise<void> {\n const temporary = `${file}.${randomUUID()}.tmp`;\n try {\n await writeFile(temporary, bytes, { flag: \"wx\" });\n await rename(temporary, file);\n } finally {\n await rm(temporary, { force: true });\n }\n}\n","import { randomBytes } from \"node:crypto\";\nimport { createServer, type ServerResponse } from \"node:http\";\nimport { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { MuseaVrtRunner, generateVrtJsonReport, generateVrtReport } from \"../vrt.js\";\nimport {\n assertArtReportOwnership,\n attachArtReportOwner,\n resolveArtReportTarget,\n} from \"../vrt/report-identity.js\";\nimport { loadHostedGallery } from \"./hosted.js\";\nimport { createVrtOptions } from \"./commands.js\";\nimport type { CliOptions } from \"./index.js\";\nimport { authorizeSession, captureInput } from \"./service/auth.js\";\nimport { SessionArtifacts } from \"./service/artifacts.js\";\nimport { writeSessionReport } from \"./service/reports.js\";\n\nfunction json(response: ServerResponse, value: unknown, status = 200): void {\n response.setHeader(\"Content-Type\", \"application/json\");\n response.writeHead(status).end(JSON.stringify(value));\n}\n\n/** Local lifecycle authority; callers must keep credentials out of reports and artifacts. */\nexport async function startHostedVrtSession(options: CliOptions, certificateSpki?: string) {\n if (!options.galleryUrl) throw new Error(\"serve requires --gallery-url\");\n const gallery = new URL(options.galleryUrl);\n gallery.pathname = `${gallery.pathname.replace(/\\/+$/, \"\")}/`;\n gallery.search = \"\";\n gallery.hash = \"\";\n if (gallery.protocol !== \"https:\" || gallery.username || gallery.password)\n throw new Error(\"serve requires an HTTPS gallery without embedded credentials\");\n await loadHostedGallery(gallery.href);\n const token = randomBytes(32).toString(\"base64url\");\n const artifacts = new SessionArtifacts();\n let host = \"\";\n let busy: Promise<void> | undefined;\n let closing = false;\n let closeTask: Promise<void> | undefined;\n const server = createServer((request, response) => {\n if (!authorizeSession(request, response, gallery.origin, host, token)) return;\n if (closing) {\n json(response, { error: \"Session is closing\" }, 503);\n return;\n }\n if (request.method === \"GET\" && request.url === \"/session\") {\n json(response, { version: 1, galleryUrl: gallery.href });\n return;\n }\n if (request.method === \"GET\" && request.url && artifacts.send(request.url, response)) return;\n if (request.method !== \"POST\" || request.url !== \"/capture\") {\n json(response, { error: \"Not found\" }, 404);\n return;\n }\n if (busy) {\n json(response, { error: \"Capture already running\" }, 409);\n return;\n }\n busy = (async () => {\n let runner: MuseaVrtRunner | undefined;\n let outcome: { body: unknown; status: number } = {\n body: { error: \"Capture incomplete\" },\n status: 500,\n };\n try {\n const input = await captureInput(request);\n const hosted = await loadHostedGallery(gallery.href);\n const art = hosted.arts.find((item) => item.path === input.artPath);\n if (!art) {\n outcome = { body: { error: \"Art not found\" }, status: 404 };\n return;\n }\n // HTTP redirects are refused before planning; browser redirects are guarded before PNG writes.\n for (const variant of art.variants.filter((item) => !item.skipVrt)) {\n const preview = await fetch(hosted.previewUrls[art.path][variant.name], {\n redirect: \"error\",\n signal: AbortSignal.timeout(30000),\n });\n if (!preview.ok) throw new Error(`Hosted preview: HTTP ${preview.status}`);\n await preview.body?.cancel();\n }\n const reportDir = path.resolve(options.output, \"reports\");\n const identity = hosted.snapshotIdentities[art.path];\n const target = resolveArtReportTarget(\n identity,\n Object.values(hosted.snapshotIdentities),\n process.cwd(),\n reportDir,\n );\n await assertArtReportOwnership(target, process.cwd());\n runner = new MuseaVrtRunner({\n ...createVrtOptions(options),\n capture: { ...createVrtOptions(options).capture, waitForPreviewReady: true },\n previewUrls: hosted.previewUrls,\n snapshotIdentities: hosted.snapshotIdentities,\n hostedNavigation: gallery.href,\n });\n await runner.init({ hostedCertificateSpki: certificateSpki });\n const results = await runner.runAllTests([art], gallery.origin);\n const summary = runner.getSummary(results);\n // A hosted request fails closed on any runner error, including blocked navigation.\n if ((summary.errors ?? 0) > 0) throw new Error(results.find((item) => item.error)!.error);\n if (input.update) await runner.updateBaselines(results);\n const rawJson = attachArtReportOwner(generateVrtJsonReport(results, summary), target);\n const html = generateVrtReport(results, summary);\n await mkdir(reportDir, { recursive: true });\n await writeSessionReport(target.jsonReportPath, rawJson);\n await writeSessionReport(target.htmlReportPath, html);\n artifacts.clear();\n const uiResults = await artifacts.results(results);\n outcome = {\n status: 200,\n body: {\n success: true,\n results: uiResults,\n summary,\n reports: {\n json: artifacts.add(rawJson, \"application/json\"),\n html: artifacts.add(html, \"text/html\"),\n },\n },\n };\n } catch (error) {\n outcome = {\n status: 400,\n body: { error: error instanceof Error ? error.message : String(error) },\n };\n } finally {\n try {\n await runner?.close();\n } catch (error) {\n outcome = { status: 500, body: { error: `Capture cleanup failed: ${String(error)}` } };\n }\n busy = undefined;\n if (!response.destroyed) json(response, outcome.body, outcome.status);\n }\n })().catch((error) => {\n busy = undefined;\n if (!response.destroyed && !response.headersSent)\n json(response, { error: String(error) }, 500);\n });\n });\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(0, \"127.0.0.1\", resolve);\n });\n const address = server.address();\n if (!address || typeof address === \"string\") throw new Error(\"Missing loopback listener\");\n host = `127.0.0.1:${address.port}`;\n return {\n endpoint: `http://${host}`,\n token,\n close() {\n return (closeTask ??= (async () => {\n closing = true;\n await busy;\n artifacts.clear();\n await new Promise<void>((resolve, reject) =>\n server.close((error) => (error ? reject(error) : resolve())),\n );\n })());\n },\n };\n}\n\nexport async function runServe(options: CliOptions): Promise<void> {\n const session = await startHostedVrtSession(options);\n console.log(\n \" This session token is a live credential; do not share it or retain it in captured logs.\",\n );\n console.log(` VRT endpoint: ${session.endpoint}\\n Session token: ${session.token}\\n`);\n const stop = () => {\n void session.close().then(\n () => {\n process.exitCode = 0;\n },\n (error) => {\n console.error(\"VRT session cleanup failed:\", error);\n process.exitCode = 1;\n },\n );\n };\n process.once(\"SIGINT\", stop);\n process.once(\"SIGTERM\", stop);\n}\n","#!/usr/bin/env node\n/**\n * Musea CLI\n *\n * Usage:\n * musea-vrt [command] [options]\n *\n * Commands:\n * (default) Run VRT tests\n * approve [pat] Approve failed snapshots (optionally filtered by pattern)\n * clean Remove orphaned snapshots\n *\n * Options:\n * -u, --update Update baseline snapshots\n * -c, --config Path to Vite config (default: Vite config discovery)\n * -o, --output Output directory for reports (default: .vize)\n * -t, --threshold Diff threshold percentage (default: 0.1)\n * -w, --workers Number of concurrent captures (default: 1)\n * --json Output JSON report instead of HTML\n * --ci CI mode - exit with non-zero code on failures\n * --a11y Run accessibility audits alongside VRT\n * -h, --help Show help\n */\n\nimport path from \"node:path\";\nimport { realpathSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport type { ArtFileInfo } from \"../types/index.js\";\nimport { parseArtFile, parseWorkers } from \"./utils.js\";\nimport { scanArtFiles } from \"../utils.js\";\nimport { runVrt, runApprove, runClean, runGenerate } from \"./commands.js\";\nimport { loadMuseaConfiguration } from \"./config.js\";\nimport { loadHostedGallery } from \"./hosted.js\";\nimport { runServe } from \"./serve.js\";\nimport type { MuseaVrtOptions } from \"../types/index.js\";\n\ntype Command = \"run\" | \"approve\" | \"clean\" | \"generate\" | \"serve\";\n\nexport interface CliOptions {\n command: Command;\n update: boolean;\n config?: string;\n configDir?: string;\n output: string;\n threshold: number;\n thresholdProvided: boolean;\n workers: number;\n workersProvided: boolean;\n json: boolean;\n ci: boolean;\n a11y: boolean;\n help: boolean;\n baseUrl: string;\n pattern?: string;\n componentPath?: string;\n vrt?: MuseaVrtOptions;\n galleryUrl?: string;\n previewBasePath?: string;\n previewUrls?: Record<string, Record<string, string>>;\n projectRoot?: string;\n snapshotIdentities?: Record<string, string>;\n adoptLegacySnapshots?: boolean;\n}\n\nexport function parseArgs(args: string[]): CliOptions {\n const options: CliOptions = {\n command: \"run\",\n update: false,\n output: \".vize\",\n threshold: 0.1,\n thresholdProvided: false,\n workers: 1,\n workersProvided: false,\n json: false,\n ci: false,\n a11y: false,\n help: false,\n baseUrl: \"http://localhost:5173\",\n };\n\n let i = 0;\n\n // Check for subcommand as first arg\n if (args.length > 0 && !args[0].startsWith(\"-\")) {\n const sub = args[0];\n if (sub === \"serve\") {\n options.command = \"serve\";\n i = 1;\n } else if (sub === \"approve\") {\n options.command = \"approve\";\n i = 1;\n // Optional pattern argument after approve\n if (args.length > 1 && !args[1].startsWith(\"-\")) {\n options.pattern = args[1];\n i = 2;\n }\n } else if (sub === \"clean\") {\n options.command = \"clean\";\n i = 1;\n } else if (sub === \"generate\") {\n options.command = \"generate\";\n i = 1;\n // Required component path argument\n if (args.length > 1 && !args[1].startsWith(\"-\")) {\n options.componentPath = args[1];\n i = 2;\n }\n }\n }\n\n for (; i < args.length; i++) {\n const arg = args[i];\n switch (arg) {\n case \"-u\":\n case \"--update\":\n options.update = true;\n break;\n case \"-c\":\n case \"--config\":\n options.config = args[++i] || undefined;\n break;\n case \"-o\":\n case \"--output\":\n options.output = args[++i] || \".vize\";\n break;\n case \"-t\":\n case \"--threshold\":\n options.threshold = parseThreshold(args[++i]);\n options.thresholdProvided = true;\n break;\n case \"-w\":\n case \"--workers\":\n options.workers = parseWorkers(args[++i]);\n options.workersProvided = true;\n break;\n case \"--json\":\n options.json = true;\n break;\n case \"--ci\":\n options.ci = true;\n break;\n case \"--a11y\":\n options.a11y = true;\n break;\n case \"-b\":\n case \"--base-url\":\n options.baseUrl = args[++i] || \"http://localhost:5173\";\n break;\n case \"-h\":\n case \"--help\":\n options.help = true;\n break;\n case \"--adopt-legacy-snapshots\":\n options.adoptLegacySnapshots = true;\n break;\n case \"--gallery-url\":\n options.galleryUrl = args[++i];\n if (!options.galleryUrl || options.galleryUrl.startsWith(\"-\"))\n throw new Error(\"--gallery-url requires a URL\");\n break;\n }\n }\n\n return options;\n}\n\nfunction parseThreshold(value: string | undefined): number {\n const threshold = Number.parseFloat(value ?? \"\");\n return Number.isFinite(threshold) ? threshold : 0.1;\n}\n\nfunction printHelp(): void {\n console.log(`\nMusea VRT - Visual Regression Testing for Component Gallery\n\nUsage:\n musea-vrt [command] [options]\n\nCommands:\n (default) Run VRT tests\n approve [pattern] Approve failed snapshots and update baselines\n Optional pattern filters which snapshots to approve\n clean Remove orphaned snapshots (no matching art/variant)\n serve --gallery-url Connect a secure hosted gallery to a local VRT session\n generate <component> Auto-generate .art.vue from a Vue component\n\nOptions:\n -u, --update Update baseline snapshots with current screenshots\n -c, --config <path> Path to Vite config file (default: Vite config discovery)\n -o, --output <dir> Output directory for reports (default: .vize)\n -t, --threshold <n> Diff threshold percentage (default: 0.1)\n -b, --base-url <url> Base URL for dev server (default: http://localhost:5173)\n --gallery-url <url> Capture a built hosted gallery using its static manifest\n --adopt-legacy-snapshots Adopt reviewed, unambiguous legacy PNG baselines once\n -w, --workers <n> Number of concurrent captures (default: 1)\n --json Output JSON report instead of HTML\n --ci CI mode - exit with non-zero code on failures\n --a11y Run accessibility audits alongside VRT\n -h, --help Show this help message\n\nExamples:\n # Run VRT tests\n musea-vrt\n\n # Update baseline snapshots\n musea-vrt -u\n\n # Run with custom threshold\n musea-vrt -t 0.5\n\n # CI mode with JSON output\n musea-vrt --ci --json\n\n # Run with accessibility audits\n musea-vrt --a11y\n\n # Capture variants concurrently\n musea-vrt --workers 8\n\n # Approve all failed snapshots\n musea-vrt approve\n\n # Approve specific snapshots by pattern\n musea-vrt approve \"Button/*\"\n\n # Clean orphaned snapshots\n musea-vrt clean\n\n # Auto-generate .art.vue from component\n musea-vrt generate src/components/Button.vue\n\n # Custom base URL\n musea-vrt -b http://localhost:3000\n`);\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n const options = parseArgs(args);\n\n if (options.help) {\n printHelp();\n process.exit(0);\n }\n\n const cwd = process.cwd();\n\n console.log(\"\\n Musea VRT\");\n console.log(\" =========\\n\");\n\n // Handle generate command early (doesn't need art file scanning)\n if (options.command === \"generate\") {\n try {\n await runGenerate(options);\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n return;\n }\n\n const { fileSet, vrt, configDir, previewBasePath } = await loadMuseaConfiguration(\n options.config,\n cwd,\n );\n options.vrt = vrt;\n options.configDir = configDir;\n if (options.command === \"serve\") {\n try {\n await runServe(options);\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n return;\n }\n options.previewBasePath = vrt?.previewBasePath ?? previewBasePath;\n if (options.galleryUrl) {\n const hosted = await loadHostedGallery(options.galleryUrl);\n options.previewUrls = hosted.previewUrls;\n options.snapshotIdentities = hosted.snapshotIdentities;\n if (options.command === \"run\") await runVrt(options, hosted.arts);\n else if (options.command === \"approve\") await runApprove(options, hosted.arts);\n else if (options.command === \"clean\") await runClean(options, hosted.arts);\n return;\n }\n options.projectRoot = fileSet.projectRoot;\n\n // Scan for art files\n console.log(\" Scanning for art files...\");\n const artFilePaths = await scanArtFiles(fileSet.root, fileSet.include, fileSet.exclude);\n\n if (artFilePaths.length === 0) {\n console.log(\" No art files found.\\n\");\n process.exit(0);\n }\n\n console.log(` Found ${artFilePaths.length} art file(s)\\n`);\n\n // Parse art files\n const artFiles: ArtFileInfo[] = [];\n for (const filePath of artFilePaths) {\n const art = await parseArtFile(filePath);\n if (art) {\n artFiles.push(art);\n }\n }\n\n try {\n switch (options.command) {\n case \"run\":\n await runVrt(options, artFiles);\n break;\n case \"approve\":\n await runApprove(options, artFiles);\n break;\n case \"clean\":\n await runClean(options, artFiles);\n break;\n case \"generate\":\n // Handled above before art file scanning\n break;\n }\n } catch (error) {\n console.error(\"\\n Error:\", error);\n process.exit(1);\n }\n}\n\nif (isDirectRun()) {\n main().catch((error) => {\n console.error(\"Fatal error:\", error);\n process.exit(1);\n });\n}\n\nfunction isDirectRun(): boolean {\n const entrypoint = process.argv[1];\n if (!entrypoint) {\n return false;\n }\n\n try {\n return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(path.resolve(entrypoint));\n } catch {\n return false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgDA,eAAsB,aAAa,UAA+C;CAChF,OAAO,oBAAoB,UAAU;EACnC,MAAM,KAAK,QAAQ,QAAQ;EAC3B,SAAS;CACX,CAAC;AACH;AAEA,SAAgB,aAAa,OAAmC;CAC9D,MAAM,UAAU,OAAO,SAAS,SAAS,IAAI,EAAE;CAC/C,OAAO,OAAO,SAAS,OAAO,IAAI,KAAK,IAAI,GAAG,OAAO,IAAI;AAC3D;;;;;;;;;ACzCA,SAAgB,uBAAuB,SAA8B;CACnE,OAAO,QAAQ,SAAS,MAAM,QAAQ,UAAU,KAAK;AACvD;AAEA,SAAgB,eAAe,UAA2B;CACxD,OAAO,SAAS,SAAS,UAAU;AACrC;AAEA,S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
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/vite-plugin-musea",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.475.0",
|
|
4
4
|
"description": "Vite plugin for Musea - Component gallery for Vue components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component-gallery",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@vizejs/native": "0.
|
|
65
|
+
"@vizejs/native": "0.475.0",
|
|
66
66
|
"pngjs": "7.0.0",
|
|
67
67
|
"typescript": "6.0.3"
|
|
68
68
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/node": "25.9.2",
|
|
73
73
|
"@types/pngjs": "6.0.5",
|
|
74
74
|
"@vitejs/plugin-vue": "6.0.7",
|
|
75
|
-
"@vizejs/vite-plugin": "0.
|
|
75
|
+
"@vizejs/vite-plugin": "0.475.0",
|
|
76
76
|
"highlight.js": "11.11.1",
|
|
77
77
|
"marked": "18.0.9",
|
|
78
78
|
"marked-highlight": "2.2.4",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"vue-router": "4.5.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@vizejs/vite-plugin": "0.
|
|
87
|
+
"@vizejs/vite-plugin": "0.475.0",
|
|
88
88
|
"axe-core": "^4.7.0",
|
|
89
89
|
"playwright": "^1.40.0",
|
|
90
90
|
"vite": "^7.3.0 || ^8.0.0"
|