Fix warning with vite dev

This commit is contained in:
2026-11-11 14:46:51 -03:00
parent 216d54a0ae
commit 8aa05e104d
9 changed files with 132 additions and 42 deletions
+4 -29
View File
@@ -1,13 +1,11 @@
import { Context, type ServerIslandRegistry } from "./context.ts";
import { Context } from "./context.ts";
import type { FsAdapter } from "./fs.ts";
import type { BuildCache, StaticFile } from "./build_cache.ts";
import { type BuildCache, MockBuildCache } from "./build_cache.ts";
import type { ResolvedFreshConfig } from "./config.ts";
import type { WalkEntry } from "@std/fs/walk";
import { DEFAULT_CONN_INFO } from "./app.ts";
import type { Command } from "./commands.ts";
import { fsItemsToCommands, type FsRouteFile } from "./fs_routes.ts";
import * as path from "@std/path";
import { toPosix } from "./dev/dev_build_cache.ts";
import { toPosix } from "./utils.ts";
const STUB = {} as unknown as Deno.ServeHandlerInfo;
@@ -162,30 +160,7 @@ export async function withTmpDir(
};
}
export class MockBuildCache<State> implements BuildCache<State> {
#files: FsRouteFile<State>[];
root = "";
clientEntry = "";
islandRegistry: ServerIslandRegistry = new Map();
features = { errorOverlay: false };
constructor(files: FsRouteFile<State>[], mode: "development" | "production") {
this.features.errorOverlay = mode === "development";
this.#files = files;
}
getEntryAssets(): string[] {
return [];
}
getFsRoutes(): Command<State>[] {
return fsItemsToCommands(this.#files);
}
readFile(_pathname: string): Promise<StaticFile | null> {
return Promise.resolve(null);
}
}
export { MockBuildCache };
/**
* Wrapper around `Deno.test` for integration tests that disables sanitizers.