diff --git a/packages/boot/app-boot/src/package-meta.ts b/packages/boot/app-boot/src/package-meta.ts index cc8fe2ebfe..434b233d1e 100644 --- a/packages/boot/app-boot/src/package-meta.ts +++ b/packages/boot/app-boot/src/package-meta.ts @@ -58,7 +58,7 @@ function textOf(value: unknown, path: string): string | undefined { function readObject(file: string): Record { let contents: unknown try { - contents = JSON.parse(readFileSync(file, 'utf8')) as unknown + contents = JSON.parse(readFileSync(file, 'utf8')) } catch (error) { throw new Error(`${file}: ${String(error)}`) } diff --git a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx index 0737596fb5..dd0dca61f8 100644 --- a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx +++ b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx @@ -10,6 +10,7 @@ import type { ReactNode } from 'react' import { PluginManagerPage } from '../src/client/PluginManagerPage.tsx' import type { PluginManagerPageProps } from '../src/client/PluginManagerPage.tsx' import type { ConfigLedger } from '../src/client/config-ledger.ts' +import type { PluginConfigViewProps } from '../src/client/slot-contract.ts' import { rowKey, type InstallState, type PackageRow, type PackageView, type PluginManagerState } from '../src/client/manager-store.ts' import { en, zh, type PluginManagerLocaleKey } from '../src/client/locales.ts' @@ -101,15 +102,22 @@ function renderTab(state: Partial = {}, config: Partial { throw new Error('PluginManagerPage does not consume global runtime hooks') } + const props: PluginManagerPageProps = { + useSessions: unusedGlobalHook, + useSessionStatus: unusedGlobalHook, + useSessionRetainInfo: unusedGlobalHook, + usePanelInfo: unusedGlobalHook, + useResource: unusedGlobalHook, + useWorkspaces: unusedGlobalHook, t, resolveText, ...actions, usePluginManager: bindSnapshotSelector(store), useConfigLedger: bindSnapshotSelector(ledger), - renderSlot: (name: string, owner: { view: 'summary' | 'page' }, opts: { only?: string; entryKey?: string }) => - bodies[`${name}:${opts.only ?? opts.entryKey ?? ''}`]?.(owner.view) ?? null, - } as unknown as PluginManagerPageProps + renderSlot: (name, owner: PluginConfigViewProps, opts) => + bodies[`${name}:${opts?.only ?? opts?.entryKey ?? ''}`]?.(owner.view) ?? null, + } const { rerender } = render() return { store, diff --git a/scripts/no-unknown-casts.baseline.json b/scripts/no-unknown-casts.baseline.json index 0237265ba1..0818a119ef 100644 --- a/scripts/no-unknown-casts.baseline.json +++ b/scripts/no-unknown-casts.baseline.json @@ -671,9 +671,6 @@ "packages/client/ui-plugin-manager/tests/browser-plugin.client.spec.tsx": { "04984a2ce1486250236e638e0197da0a1a840855ed3975c59130a85358c7e5fe": 1 }, - "packages/client/ui-plugin-manager/tests/components.client.spec.tsx": { - "624ce7f0e7acb423fcd3937994cd5ca0916ac27b76cb56a7587025f209a14351": 1 - }, "packages/client/ui-primitives/tests/highlight-viewport.client.spec.tsx": { "6061de0a1e01547eb1abf9d4e1b5fa79fda112fa35dda980775491123413dcce": 1 }, diff --git a/scripts/verify-package-meta.ts b/scripts/verify-package-meta.ts index 70dcc6d7ee..f5a486678f 100644 --- a/scripts/verify-package-meta.ts +++ b/scripts/verify-package-meta.ts @@ -22,7 +22,7 @@ function sourceJsonFiles(dir: string): SourceJson[] { const file = path.replaceAll('\\', '/') let contents: unknown try { - contents = JSON.parse(readFileSync(join(dir, file), 'utf8')) as unknown + contents = JSON.parse(readFileSync(join(dir, file), 'utf8')) } catch (_error) { return { file, metadata: false, invalid: true } }