import * as vite from '@voidzero-dev/vite-plus-core';
import { resolveConfig as resolveConfig$1, mergeConfig } from '@voidzero-dev/vite-plus-core';
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from '@voidzero-dev/vite-plus-core';
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.Bxr1Nn49.js';
export { F as ForksPoolWorker, G as GitNotFoundError, b as TestsNotFoundError, T as ThreadsPoolWorker, c as TypecheckPoolWorker, d as VitestPackageInstaller, e as VmForksPoolWorker, f as VmThreadsPoolWorker, g as createDebugger, h as createMethodsRPC, i as createViteLogger, j as createVitest, k as escapeTestName, l as experimental_getRunnerTask, m as getFilePoolName, n as isFileServingAllowed, o as isValidApiRequest, r as registerConsoleShortcuts, p as resolveFsAllow, s as startVitest } from './chunks/cli-api.Bxr1Nn49.js';
export { p as parseCLI } from './chunks/cac.DRKYQDPl.js';
import { r as resolveConfig$2 } from './chunks/coverage.kqM80boz.js';
export { B as BaseCoverageProvider, a as BaseSequencer, b as resolveApiServerConfig } from './chunks/coverage.kqM80boz.js';
import { slash, deepClone } from './@vitest/utils/helpers.js';
import { a as any } from './chunks/index.og1WyBLx.js';
import { resolve } from './vendor/pathe.mjs';
import { c as configFiles } from './chunks/constants.CPYnjOGj.js';
export { A as AgentReporter, B as BenchmarkReporter, a as BenchmarkReportsMap, D as DefaultReporter, b as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, c as JsonReporter, R as ReportersMap, T as TapFlatReporter, d as TapReporter, V as VerboseBenchmarkReporter, e as VerboseReporter } from './chunks/index.0GYC6HAu.js';
export { distDir, rootDir } from './path.js';
export { generateFileHash } from './@vitest/runner/utils.js';
import 'node:fs';
import './chunks/coverage.CTzCuANN.js';
import 'node:path';
import './chunks/index.BCY_7LL2.js';
import 'node:module';
import 'node:process';
import 'node:fs/promises';
import 'node:url';
import 'node:assert';
import 'node:v8';
import 'node:util';
import 'node:os';
import './@vitest/snapshot/manager.js';
import './@vitest/utils/serialize.js';
import './chunks/nativeModuleRunner.BIakptoF.js';
import '@voidzero-dev/vite-plus-core/module-runner';
import './chunks/traces.DT5aQ62U.js';
import './vendor/obug.mjs';
import './vendor/tinyrainbow.mjs';
import '#module-evaluator';
import 'node:console';
import './chunks/_commonjsHelpers.D26ty3Ew.js';
import './chunks/utils.DK8FXp4T.js';
import './chunks/env.D4Lgay0q.js';
import './vendor/std-env.mjs';
import 'node:tty';
import 'node:crypto';
import 'node:events';
import './chunks/index.Chj8NDwU.js';
import './chunks/modules.BJuCwlRJ.js';
import 'node:child_process';
import 'node:worker_threads';
import './vendor/picomatch.mjs';
import './vendor/tinyglobby.mjs';
import 'node:perf_hooks';
import 'events';
import 'https';
import 'http';
import 'net';
import 'tls';
import 'crypto';
import 'stream';
import 'url';
import 'zlib';
import 'buffer';
import './chunks/defaults.9aQKnqFk.js';
import './vendor/magic-string.mjs';
import './@vitest/mocker/node.js';
import './@vitest/utils/constants.js';
import './@vitest/utils/resolver.js';
import './vendor/es-module-lexer.mjs';
import './@vitest/utils/source-map.js';
import './@vitest/utils/source-map/node.js';
import './vendor/tinyexec.mjs';
import 'node:readline';
import 'readline';
import 'node:stream';
import './@vitest/utils/display.js';
import './@vitest/utils/offset.js';

// this is only exported as a public function and not used inside vitest
async function resolveConfig(options = {}, viteOverrides = {}) {
  const root = slash(resolve(options.root || process.cwd()));
  const configPath = options.config === false ? false : options.config ? resolve(root, options.config) : any(configFiles, { cwd: root });
  options.config = configPath;
  const vitest = new Vitest("test", deepClone(options));
  const config = await resolveConfig$1(mergeConfig({
    configFile: configPath,
    mode: options.mode || "test",
    plugins: [await VitestPlugin(options, vitest)]
  }, mergeConfig(viteOverrides, { root: options.root })), "serve");
  const vitestConfig = resolveConfig$2(vitest, Reflect.get(config, "_vitest"), config);
  await vitest.close();
  return {
    viteConfig: config,
    vitestConfig
  };
}

const version = Vitest.version;
const createViteServer = vite.createServer;
// rolldownVersion is exported only by rolldown-vite
const rolldownVersion = vite.rolldownVersion;

export { VitestPlugin, createViteServer, resolveConfig, rolldownVersion, version };
