From 77f4fb071310dd1e411270c2075f37825f845a2d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 07:36:41 +0100 Subject: [PATCH] test(plugins): satisfy web provider lint --- src/plugins/web-provider-runtime-shared.test.ts | 2 +- src/plugins/web-provider-runtime-shared.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/plugins/web-provider-runtime-shared.test.ts b/src/plugins/web-provider-runtime-shared.test.ts index e480d928470..a1203817772 100644 --- a/src/plugins/web-provider-runtime-shared.test.ts +++ b/src/plugins/web-provider-runtime-shared.test.ts @@ -6,7 +6,7 @@ const mocks = vi.hoisted(() => ({ resolveCompatibleRuntimePluginRegistry: vi.fn(), resolvePluginRegistryLoadCacheKey: vi.fn((options: unknown) => JSON.stringify(options)), resolveRuntimePluginRegistry: vi.fn(), - getActivePluginRegistry: vi.fn<() => unknown | null>(() => null), + getActivePluginRegistry: vi.fn<() => Record | null>(() => null), getActivePluginRegistryWorkspaceDir: vi.fn(() => undefined), buildPluginRuntimeLoadOptionsFromValues: vi.fn( (_values: unknown, overrides?: Record) => ({ diff --git a/src/plugins/web-provider-runtime-shared.ts b/src/plugins/web-provider-runtime-shared.ts index 33194170b3e..9be65fe3db6 100644 --- a/src/plugins/web-provider-runtime-shared.ts +++ b/src/plugins/web-provider-runtime-shared.ts @@ -58,10 +58,19 @@ type ResolveWebProviderRuntimeDeps = { }) => TEntry[] | null; }; +type WebProviderRuntimeContext = { + env: NonNullable; + workspaceDir?: string; + config: PluginLoadOptions["config"]; + activationSourceConfig?: PluginLoadOptions["config"]; + autoEnabledReasons: Record; + onlyPluginIds?: string[]; +}; + function resolveWebProviderRuntimeContext( params: ResolvePluginWebProvidersParams, deps: ResolveWebProviderRuntimeDeps, -) { +): WebProviderRuntimeContext { const env = params.env ?? process.env; const workspaceDir = params.workspaceDir ?? getActivePluginRegistryWorkspaceDir(); const { config, activationSourceConfig, autoEnabledReasons } = @@ -89,8 +98,8 @@ function resolveWebProviderRuntimeContext( }; } -function resolveWebProviderLoadOptions( - context: ReturnType>, +function resolveWebProviderLoadOptions( + context: WebProviderRuntimeContext, params: ResolvePluginWebProvidersParams, ) { return buildPluginRuntimeLoadOptionsFromValues(