do not require opts

This commit is contained in:
Nate Moore 2023-02-02 08:40:34 -06:00
parent 33017d7ea6
commit 8d00309193

View file

@ -8,9 +8,10 @@ import type { CreateBasicEnvironmentArgs, Environment } from '../core/render/env
export class AstroContainer { export class AstroContainer {
env: Environment; env: Environment;
constructor(opts: Pick<CreateBasicEnvironmentArgs, 'mode'|'renderers'|'site'>) { constructor(opts: Pick<CreateBasicEnvironmentArgs, 'renderers'|'site'>) {
this.env = createBasicEnvironment({ this.env = createBasicEnvironment({
...opts, ...opts,
mode: 'production',
logging: { dest: nodeLogDestination, level: 'error' }, logging: { dest: nodeLogDestination, level: 'error' },
}); });
} }
@ -23,11 +24,11 @@ export class AstroContainer {
params = {}, params = {},
slots = {}, slots = {},
}: { }: {
props: Record<string | number | symbol, any>, props?: Record<string | number | symbol, any>,
slots?: Record<string, any> slots?: Record<string, any>
params?: Record<string, any>, params?: Record<string, any>,
request?: Request, request?: Request,
} } = {}
) { ) {
const { env } = this; const { env } = this;
const ctx = createRenderContext({ request }) const ctx = createRenderContext({ request })