test(plugins): satisfy web provider lint · openclaw/openclaw@77f4fb0
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ const mocks = vi.hoisted(() => ({
|
6 | 6 | resolveCompatibleRuntimePluginRegistry: vi.fn(), |
7 | 7 | resolvePluginRegistryLoadCacheKey: vi.fn((options: unknown) => JSON.stringify(options)), |
8 | 8 | resolveRuntimePluginRegistry: vi.fn(), |
9 | | -getActivePluginRegistry: vi.fn<() => unknown | null>(() => null), |
| 9 | +getActivePluginRegistry: vi.fn<() => Record<string, unknown> | null>(() => null), |
10 | 10 | getActivePluginRegistryWorkspaceDir: vi.fn(() => undefined), |
11 | 11 | buildPluginRuntimeLoadOptionsFromValues: vi.fn( |
12 | 12 | (_values: unknown, overrides?: Record<string, unknown>) => ({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,10 +58,19 @@ type ResolveWebProviderRuntimeDeps<TEntry> = {
|
58 | 58 | }) => TEntry[] | null; |
59 | 59 | }; |
60 | 60 | |
| 61 | +type WebProviderRuntimeContext = { |
| 62 | +env: NonNullable<PluginLoadOptions["env"]>; |
| 63 | +workspaceDir?: string; |
| 64 | +config: PluginLoadOptions["config"]; |
| 65 | +activationSourceConfig?: PluginLoadOptions["config"]; |
| 66 | +autoEnabledReasons: Record<string, string[]>; |
| 67 | +onlyPluginIds?: string[]; |
| 68 | +}; |
| 69 | + |
61 | 70 | function resolveWebProviderRuntimeContext<TEntry>( |
62 | 71 | params: ResolvePluginWebProvidersParams, |
63 | 72 | deps: ResolveWebProviderRuntimeDeps<TEntry>, |
64 | | -) { |
| 73 | +): WebProviderRuntimeContext { |
65 | 74 | const env = params.env ?? process.env; |
66 | 75 | const workspaceDir = params.workspaceDir ?? getActivePluginRegistryWorkspaceDir(); |
67 | 76 | const { config, activationSourceConfig, autoEnabledReasons } = |
@@ -89,8 +98,8 @@ function resolveWebProviderRuntimeContext<TEntry>(
|
89 | 98 | }; |
90 | 99 | } |
91 | 100 | |
92 | | -function resolveWebProviderLoadOptions<TEntry>( |
93 | | -context: ReturnType<typeof resolveWebProviderRuntimeContext<TEntry>>, |
| 101 | +function resolveWebProviderLoadOptions( |
| 102 | +context: WebProviderRuntimeContext, |
94 | 103 | params: ResolvePluginWebProvidersParams, |
95 | 104 | ) { |
96 | 105 | return buildPluginRuntimeLoadOptionsFromValues( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。