diff --git a/docs/latest/concepts/server-configuration.md b/docs/latest/concepts/server-configuration.md index e0300373..e0e60911 100644 --- a/docs/latest/concepts/server-configuration.md +++ b/docs/latest/concepts/server-configuration.md @@ -8,22 +8,16 @@ In this page we discuss how the server can be configured during startup. The signature of the primary method looks like this: ```ts main.ts -export async function start(manifest: Manifest, opts: StartOptions = {}); +export async function start(manifest: Manifest, config: FreshConfig = {}); ``` -## Options +## Configuration -`Manifest` comes from `fresh.gen.ts`, so nothing to do there. `opts` is where -things get interesting. `StartOptions` looks like this: - -``` -export type StartOptions = ServeInit & FreshOptions; -``` - -The good stuff is really in... +`Manifest` comes from `fresh.gen.ts`, so nothing to do there. `config` is where +things get interesting. `FreshConfig` looks like this: ```ts -export interface FreshOptions { +export interface FreshConfig { render?: RenderFunction; plugins?: Plugin[]; staticDir?: string; diff --git a/docs/latest/getting-started/running-locally.md b/docs/latest/getting-started/running-locally.md index ac629e6c..7c76c6a1 100644 --- a/docs/latest/getting-started/running-locally.md +++ b/docs/latest/getting-started/running-locally.md @@ -35,7 +35,7 @@ passing the extra folder as an argument: `--watch=static/`. You should also add `routes/` to the watch list, so that the server restarts automatically whenever you add a new route. -If you want to change the port or host, modify the options bag of the `start()` +If you want to change the port or host, modify the config bag of the `start()` call in `main.ts` to include an explicit port number: ```js main.ts diff --git a/src/dev/build.ts b/src/dev/build.ts index 3e611391..2e59e3ff 100644 --- a/src/dev/build.ts +++ b/src/dev/build.ts @@ -3,10 +3,10 @@ import { join } from "../server/deps.ts"; import { colors, fs } from "./deps.ts"; import { BuildSnapshotJson } from "../build/mod.ts"; import { BUILD_ID } from "../server/build_id.ts"; -import { InternalFreshOptions } from "../server/types.ts"; +import { InternalFreshConfig } from "../server/types.ts"; export async function build( - config: InternalFreshOptions, + config: InternalFreshConfig, ) { // Ensure that build dir is empty await fs.emptyDir(config.build.outDir); diff --git a/src/dev/dev_command.ts b/src/dev/dev_command.ts index dd3d5c93..177af317 100644 --- a/src/dev/dev_command.ts +++ b/src/dev/dev_command.ts @@ -1,6 +1,6 @@ import { updateCheck } from "./update_check.ts"; import { DAY, dirname, fromFileUrl, join, toFileUrl } from "./deps.ts"; -import { FreshOptions, Manifest as ServerManifest } from "../server/mod.ts"; +import { FreshConfig, Manifest as ServerManifest } from "../server/mod.ts"; import { build } from "./build.ts"; import { collect, ensureMinDenoVersion, generate, Manifest } from "./mod.ts"; import { startFromContext } from "../server/boot.ts"; @@ -10,7 +10,7 @@ import { getServerContext } from "$fresh/src/server/context.ts"; export async function dev( base: string, entrypoint: string, - options?: FreshOptions, + config?: FreshConfig, ) { ensureMinDenoVersion(); @@ -26,7 +26,7 @@ export async function dev( } else { currentManifest = { islands: [], routes: [] }; } - const newManifest = await collect(dir, options?.router?.ignoreFilePattern); + const newManifest = await collect(dir, config?.router?.ignoreFilePattern); Deno.env.set("FRSH_DEV_PREVIOUS_MANIFEST", JSON.stringify(newManifest)); const manifestChanged = @@ -39,22 +39,22 @@ export async function dev( .default as ServerManifest; if (Deno.args.includes("build")) { - const config = await getFreshConfigWithDefaults( + const configWithDefaults = await getFreshConfigWithDefaults( manifest, - options ?? {}, + config ?? {}, ); - config.dev = false; - config.loadSnapshot = false; - await build(config); - } else if (options) { - const config = await getFreshConfigWithDefaults( + configWithDefaults.dev = false; + configWithDefaults.loadSnapshot = false; + await build(configWithDefaults); + } else if (config) { + const configWithDefaults = await getFreshConfigWithDefaults( manifest, - options, + config, ); - config.dev = true; - config.loadSnapshot = false; - const ctx = await getServerContext(config); - await startFromContext(ctx, config.server); + configWithDefaults.dev = true; + configWithDefaults.loadSnapshot = false; + const ctx = await getServerContext(configWithDefaults); + await startFromContext(ctx, configWithDefaults.server); } else { // Legacy entry point: Back then `dev.ts` would call `main.ts` but // this causes duplicate plugin instantiation if both `dev.ts` and diff --git a/src/server/config.ts b/src/server/config.ts index da382e8a..e310d0ad 100644 --- a/src/server/config.ts +++ b/src/server/config.ts @@ -1,6 +1,6 @@ import { dirname, fromFileUrl, isAbsolute, join, JSONC } from "./deps.ts"; -import { FromManifestOptions, Manifest } from "./mod.ts"; -import { DenoConfig, InternalFreshOptions } from "./types.ts"; +import { FromManifestConfig, Manifest } from "./mod.ts"; +import { DenoConfig, InternalFreshConfig } from "./types.ts"; export async function readDenoConfig( directory: string, @@ -39,8 +39,8 @@ function isObject(value: unknown) { export async function getFreshConfigWithDefaults( manifest: Manifest, - opts: FromManifestOptions, -): Promise { + config: FromManifestConfig, +): Promise { const base = dirname(fromFileUrl(manifest.baseUrl)); const { config: denoJson, path: denoJsonPath } = await readDenoConfig(base); @@ -50,59 +50,59 @@ export async function getFreshConfigWithDefaults( ); } - const config: InternalFreshOptions = { - loadSnapshot: typeof opts.skipSnapshot === "boolean" - ? !opts.skipSnapshot + const internalConfig: InternalFreshConfig = { + loadSnapshot: typeof config.skipSnapshot === "boolean" + ? !config.skipSnapshot : false, - dev: opts.dev ?? false, + dev: config.dev ?? false, denoJsonPath, denoJson, manifest, build: { outDir: "", - target: opts.build?.target ?? ["chrome99", "firefox99", "safari15"], + target: config.build?.target ?? ["chrome99", "firefox99", "safari15"], }, - plugins: opts.plugins ?? [], + plugins: config.plugins ?? [], staticDir: "", - render: opts.render, - router: opts.router, - server: opts.server ?? {}, + render: config.render, + router: config.router, + server: config.server ?? {}, }; - if (opts.cert) { - config.server.cert = opts.cert; + if (config.cert) { + internalConfig.server.cert = config.cert; } - if (opts.hostname) { - config.server.hostname = opts.hostname; + if (config.hostname) { + internalConfig.server.hostname = config.hostname; } - if (opts.key) { - config.server.key = opts.key; + if (config.key) { + internalConfig.server.key = config.key; } - if (opts.onError) { - config.server.onError = opts.onError; + if (config.onError) { + internalConfig.server.onError = config.onError; } - if (opts.onListen) { - config.server.onListen = opts.onListen; + if (config.onListen) { + internalConfig.server.onListen = config.onListen; } - if (opts.port) { - config.server.port = opts.port; + if (config.port) { + internalConfig.server.port = config.port; } - if (opts.reusePort) { - config.server.reusePort = opts.reusePort; + if (config.reusePort) { + internalConfig.server.reusePort = config.reusePort; } - if (opts.signal) { - config.server.signal = opts.signal; + if (config.signal) { + internalConfig.server.signal = config.signal; } - config.build.outDir = opts.build?.outDir - ? parseFileOrUrl(opts.build.outDir, base) + internalConfig.build.outDir = config.build?.outDir + ? parseFileOrUrl(config.build.outDir, base) : join(base, "_fresh"); - config.staticDir = opts.staticDir - ? parseFileOrUrl(opts.staticDir, base) + internalConfig.staticDir = config.staticDir + ? parseFileOrUrl(config.staticDir, base) : join(base, "static"); - return config; + return internalConfig; } function parseFileOrUrl(input: string, base: string) { diff --git a/src/server/context.ts b/src/server/context.ts index 4b2af5ad..6cc5a533 100644 --- a/src/server/context.ts +++ b/src/server/context.ts @@ -9,7 +9,7 @@ import { } from "./deps.ts"; import { ComponentType, h } from "preact"; import * as router from "./router.ts"; -import { Manifest } from "./mod.ts"; +import { FreshConfig, Manifest } from "./mod.ts"; import { ALIVE_URL, JS_PREFIX, REFRESH_JS_URL } from "./constants.ts"; import { BUILD_ID, setBuildId } from "./build_id.ts"; import DefaultErrorHandler from "./default_error_page.tsx"; @@ -18,9 +18,8 @@ import { BaseRoute, ErrorPage, ErrorPageModule, - FreshOptions, Handler, - InternalFreshOptions, + InternalFreshConfig, Island, LayoutModule, LayoutRoute, @@ -79,12 +78,17 @@ interface StaticFile { etag: string; } -export type FromManifestOptions = FreshOptions & { +/** + * @deprecated Use {@linkcode FromManifestConfig} instead + */ +export type FromManifestOptions = FromManifestConfig; + +export type FromManifestConfig = FreshConfig & { skipSnapshot?: boolean; dev?: boolean; }; -export async function getServerContext(opts: InternalFreshOptions) { +export async function getServerContext(opts: InternalFreshConfig) { const { manifest, denoJson: config, denoJsonPath: configPath } = opts; // Get the manifest' base URL. const baseUrl = new URL("./", manifest.baseUrl).href; @@ -455,18 +459,21 @@ export class ServerContext { */ static async fromManifest( manifest: Manifest, - opts: FromManifestOptions, + config: FromManifestConfig, ): Promise { const isLegacyDev = Deno.env.get("__FRSH_LEGACY_DEV") === "true"; - opts.dev = isLegacyDev || - Boolean(opts.dev); + config.dev = isLegacyDev || + Boolean(config.dev); if (isLegacyDev) { - opts.skipSnapshot = true; + config.skipSnapshot = true; } - const config = await getFreshConfigWithDefaults(manifest, opts); - return getServerContext(config); + const configWithDefaults = await getFreshConfigWithDefaults( + manifest, + config, + ); + return getServerContext(configWithDefaults); } /** diff --git a/src/server/defines.ts b/src/server/defines.ts index b396ffd7..61718abd 100644 --- a/src/server/defines.ts +++ b/src/server/defines.ts @@ -2,14 +2,14 @@ import { ComponentChildren } from "preact"; import { AsyncLayout, AsyncRoute, + FreshConfig, LayoutContext, RouteContext, - StartOptions, } from "./types.ts"; import { checkAsyncComponent } from "./render.ts"; import { AppContext } from "$fresh/server.ts"; -export function defineConfig(config: StartOptions): StartOptions { +export function defineConfig(config: FreshConfig): FreshConfig { return config; } diff --git a/src/server/mod.ts b/src/server/mod.ts index 00c133b9..d65b9603 100644 --- a/src/server/mod.ts +++ b/src/server/mod.ts @@ -1,8 +1,9 @@ import { ServerContext } from "./context.ts"; -export type { FromManifestOptions } from "./context.ts"; +export type { FromManifestConfig, FromManifestOptions } from "./context.ts"; export { Status } from "./deps.ts"; import { ErrorHandler, + FreshConfig, Handler, Handlers, IslandModule, @@ -10,7 +11,6 @@ import { MiddlewareModule, RouteConfig, ServeHandlerInfo, - StartOptions, UnknownHandler, } from "./types.ts"; import { startFromContext } from "./boot.ts"; @@ -27,6 +27,7 @@ export type { ErrorHandler, ErrorHandlerContext, ErrorPageProps, + FreshConfig, FreshOptions, Handler, HandlerContext, @@ -86,19 +87,19 @@ export { ServerContext }; export async function createHandler( manifest: Manifest, - opts: StartOptions = {}, + config: FreshConfig = {}, ): Promise< (req: Request, connInfo?: ServeHandlerInfo) => Promise > { - const ctx = await ServerContext.fromManifest(manifest, opts); + const ctx = await ServerContext.fromManifest(manifest, config); return ctx.handler(); } -export async function start(manifest: Manifest, opts: StartOptions = {}) { +export async function start(manifest: Manifest, config: FreshConfig = {}) { const ctx = await ServerContext.fromManifest(manifest, { - ...opts, + ...config, skipSnapshot: false, dev: false, }); - await startFromContext(ctx, opts.server ?? opts); + await startFromContext(ctx, config.server ?? config); } diff --git a/src/server/types.ts b/src/server/types.ts index 01aba104..8a6106dc 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -23,9 +23,17 @@ export interface DenoConfig { // --- APPLICATION CONFIGURATION --- -export type StartOptions = FreshOptions; +/** + * @deprecated Use {@linkcode FreshConfig} instead + */ +export type StartOptions = FreshConfig; -export interface FreshOptions { +/** + * @deprecated Use {@linkcode FreshConfig} interface instead. + */ +export type FreshOptions = FreshConfig; + +export interface FreshConfig { build?: { /** * The directory to write generated files to when `dev.ts build` is run. @@ -100,7 +108,7 @@ export interface FreshOptions { onListen?: (params: { hostname: string; port: number }) => void; } -export interface InternalFreshOptions { +export interface InternalFreshConfig { dev: boolean; loadSnapshot: boolean; denoJsonPath: string; diff --git a/tests/fixture/options.ts b/tests/fixture/fresh.config.ts similarity index 75% rename from tests/fixture/options.ts rename to tests/fixture/fresh.config.ts index 8d1b3986..252cb213 100644 --- a/tests/fixture/options.ts +++ b/tests/fixture/fresh.config.ts @@ -1,4 +1,4 @@ -import { FreshOptions } from "$fresh/server.ts"; +import { FreshConfig } from "$fresh/server.ts"; export default { async render(_ctx, render) { @@ -8,4 +8,4 @@ export default { throw new Error("body is missing"); } }, -} as FreshOptions; +} as FreshConfig; diff --git a/tests/fixture/main.ts b/tests/fixture/main.ts index 1895b320..fc935921 100644 --- a/tests/fixture/main.ts +++ b/tests/fixture/main.ts @@ -6,6 +6,6 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture/main_tls.ts b/tests/fixture/main_tls.ts index 9a2daaeb..be8ec20b 100644 --- a/tests/fixture/main_tls.ts +++ b/tests/fixture/main_tls.ts @@ -6,7 +6,7 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; // this just exists to function as a type check to assert that we can actually pass a key and cert in -await start(manifest, { ...options, key: "test", cert: "test" }); +await start(manifest, { ...config, key: "test", cert: "test" }); diff --git a/tests/fixture/main_wasm.ts b/tests/fixture/main_wasm.ts index 0bf2b69e..2068d2dc 100644 --- a/tests/fixture/main_wasm.ts +++ b/tests/fixture/main_wasm.ts @@ -9,6 +9,6 @@ import "./polyfill_deno_deploy.ts"; import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture_plugin/options.ts b/tests/fixture_plugin/fresh.config.ts similarity index 88% rename from tests/fixture_plugin/options.ts rename to tests/fixture_plugin/fresh.config.ts index 2996f04d..b1d9701e 100644 --- a/tests/fixture_plugin/options.ts +++ b/tests/fixture_plugin/fresh.config.ts @@ -1,4 +1,4 @@ -import { FreshOptions } from "$fresh/server.ts"; +import { FreshConfig } from "$fresh/server.ts"; import cssInjectPlugin from "./utils/css-inject-plugin.ts"; import jsInjectPlugin from "./utils/js-inject-plugin.ts"; import cssInjectPluginAsync from "./utils/css-inject-plugin-async.ts"; @@ -13,4 +13,4 @@ export default { routePlugin({ title: "Title Set From Plugin Config" }), secondMiddlewarePlugin(), ], -} as FreshOptions; +} as FreshConfig; diff --git a/tests/fixture_plugin/main.ts b/tests/fixture_plugin/main.ts index 1d83e08b..fc935921 100644 --- a/tests/fixture_plugin/main.ts +++ b/tests/fixture_plugin/main.ts @@ -6,5 +6,6 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; -await start(manifest, options); +import config from "./fresh.config.ts"; + +await start(manifest, config); diff --git a/tests/fixture_preact_rts_v5/options.ts b/tests/fixture_preact_rts_v5/fresh.config.ts similarity index 75% rename from tests/fixture_preact_rts_v5/options.ts rename to tests/fixture_preact_rts_v5/fresh.config.ts index 8d1b3986..252cb213 100644 --- a/tests/fixture_preact_rts_v5/options.ts +++ b/tests/fixture_preact_rts_v5/fresh.config.ts @@ -1,4 +1,4 @@ -import { FreshOptions } from "$fresh/server.ts"; +import { FreshConfig } from "$fresh/server.ts"; export default { async render(_ctx, render) { @@ -8,4 +8,4 @@ export default { throw new Error("body is missing"); } }, -} as FreshOptions; +} as FreshConfig; diff --git a/tests/fixture_preact_rts_v5/main.ts b/tests/fixture_preact_rts_v5/main.ts index 1895b320..fc935921 100644 --- a/tests/fixture_preact_rts_v5/main.ts +++ b/tests/fixture_preact_rts_v5/main.ts @@ -6,6 +6,6 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture_preact_rts_v5/main_wasm.ts b/tests/fixture_preact_rts_v5/main_wasm.ts index 0bf2b69e..2068d2dc 100644 --- a/tests/fixture_preact_rts_v5/main_wasm.ts +++ b/tests/fixture_preact_rts_v5/main_wasm.ts @@ -9,6 +9,6 @@ import "./polyfill_deno_deploy.ts"; import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture_router_ignore_files/dev.ts b/tests/fixture_router_ignore_files/dev.ts index 3908da70..1fe3e340 100755 --- a/tests/fixture_router_ignore_files/dev.ts +++ b/tests/fixture_router_ignore_files/dev.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run -A --watch=static/,routes/ import dev from "$fresh/dev.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await dev(import.meta.url, "./main.ts", options); +await dev(import.meta.url, "./main.ts", config); diff --git a/tests/fixture_router_ignore_files/options.ts b/tests/fixture_router_ignore_files/fresh.config.ts similarity index 54% rename from tests/fixture_router_ignore_files/options.ts rename to tests/fixture_router_ignore_files/fresh.config.ts index 3bba27a2..473657f5 100644 --- a/tests/fixture_router_ignore_files/options.ts +++ b/tests/fixture_router_ignore_files/fresh.config.ts @@ -1,7 +1,7 @@ -import { FreshOptions } from "$fresh/server.ts"; +import { FreshConfig } from "$fresh/server.ts"; export default { router: { ignoreFilePattern: /[\.|_]cy\.[t|j]s(x)?$/, }, -} as FreshOptions; +} as FreshConfig; diff --git a/tests/fixture_router_ignore_files/main.ts b/tests/fixture_router_ignore_files/main.ts index 1895b320..fc935921 100644 --- a/tests/fixture_router_ignore_files/main.ts +++ b/tests/fixture_router_ignore_files/main.ts @@ -6,6 +6,6 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture_twind_hydrate/fresh.config.ts b/tests/fixture_twind_hydrate/fresh.config.ts new file mode 100644 index 00000000..8d2c1635 --- /dev/null +++ b/tests/fixture_twind_hydrate/fresh.config.ts @@ -0,0 +1,5 @@ +import { FreshConfig } from "$fresh/server.ts"; +import twindPlugin from "../../plugins/twindv1.ts"; +import twindConfig from "./twind.config.ts"; + +export default { plugins: [twindPlugin(twindConfig)] } as FreshConfig; diff --git a/tests/fixture_twind_hydrate/main.ts b/tests/fixture_twind_hydrate/main.ts index 1895b320..fc935921 100644 --- a/tests/fixture_twind_hydrate/main.ts +++ b/tests/fixture_twind_hydrate/main.ts @@ -6,6 +6,6 @@ import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; -import options from "./options.ts"; +import config from "./fresh.config.ts"; -await start(manifest, options); +await start(manifest, config); diff --git a/tests/fixture_twind_hydrate/options.ts b/tests/fixture_twind_hydrate/options.ts deleted file mode 100644 index d3975809..00000000 --- a/tests/fixture_twind_hydrate/options.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FreshOptions } from "$fresh/server.ts"; -import twindPlugin from "../../plugins/twindv1.ts"; -import twindConfig from "./twind.config.ts"; - -export default { plugins: [twindPlugin(twindConfig)] } as FreshOptions; diff --git a/tests/main_test.ts b/tests/main_test.ts index 21fc8464..9f355e90 100644 --- a/tests/main_test.ts +++ b/tests/main_test.ts @@ -10,7 +10,7 @@ import { retry, } from "./deps.ts"; import manifest from "./fixture/fresh.gen.ts"; -import options from "./fixture/options.ts"; +import config from "./fixture/fresh.config.ts"; import { BUILD_ID } from "../src/server/build_id.ts"; import { assertSelector, @@ -22,7 +22,7 @@ import { withPageName, } from "./test_utils.ts"; -const ctx = await ServerContext.fromManifest(manifest, options); +const ctx = await ServerContext.fromManifest(manifest, config); const handler = ctx.handler(); Deno.test("/ page prerender", async () => { @@ -303,7 +303,7 @@ Deno.test("/foo/:path*", async () => { Deno.test("static files in custom directory", async () => { const newCtx = await ServerContext.fromManifest(manifest, { - ...options, + ...config, staticDir: "./custom_static", }); const newRouter = (req: Request) => { diff --git a/tests/plugin_test.ts b/tests/plugin_test.ts index 300ec70d..74a3040a 100644 --- a/tests/plugin_test.ts +++ b/tests/plugin_test.ts @@ -8,7 +8,7 @@ import { puppeteer, } from "./deps.ts"; import manifest from "./fixture_plugin/fresh.gen.ts"; -import options from "./fixture_plugin/options.ts"; +import config from "./fixture_plugin/fresh.config.ts"; import { clickWhenListenerReady, runBuild, @@ -16,7 +16,7 @@ import { withPageName, } from "./test_utils.ts"; -const ctx = await ServerContext.fromManifest(manifest, options); +const ctx = await ServerContext.fromManifest(manifest, config); const handler = ctx.handler(); const router = (req: Request) => { return handler(req, { diff --git a/tests/render_test.ts b/tests/render_test.ts index 4a78ef88..a0ed7e8d 100644 --- a/tests/render_test.ts +++ b/tests/render_test.ts @@ -2,9 +2,9 @@ import { assertSelector, parseHtml } from "$fresh/tests/test_utils.ts"; import { assertEquals } from "$std/testing/asserts.ts"; import { createHandler } from "$fresh/server.ts"; import manifest from "./fixture/fresh.gen.ts"; -import options from "./fixture/options.ts"; +import config from "./fixture/fresh.config.ts"; -const handler = await createHandler(manifest, options); +const handler = await createHandler(manifest, config); // Issue: https://github.com/denoland/fresh/issues/1636 Deno.test("doesn't leak data across renderers", async () => { diff --git a/tests/test_utils.ts b/tests/test_utils.ts index 62f14b89..ba5e64c7 100644 --- a/tests/test_utils.ts +++ b/tests/test_utils.ts @@ -2,7 +2,7 @@ import { colors, toFileUrl } from "$fresh/src/server/deps.ts"; import { assert } from "$std/_util/asserts.ts"; import * as path from "$std/path/mod.ts"; import { - FromManifestOptions, + FromManifestConfig, Manifest, ServeHandlerInfo, ServerContext, @@ -252,9 +252,9 @@ async function handleRequest( export async function fakeServe( manifest: Manifest, - options: FromManifestOptions, + config: FromManifestConfig, ): Promise { - const ctx = await ServerContext.fromManifest(manifest, options); + const ctx = await ServerContext.fromManifest(manifest, config); const handler = ctx.handler(); const conn: ServeHandlerInfo = {