build: clean tsdown declaration warnings

This commit is contained in:
Peter Steinberger
2026-05-10 02:10:29 +01:00
parent 6d1a7169da
commit 5131c3d677
12 changed files with 30 additions and 54 deletions

View File

@@ -1,4 +1,13 @@
import type { ContextVisibilityMode, GroupPolicy } from "./types.base.js";
import type { DiscordConfig } from "./types.discord.js";
import type { GoogleChatConfig } from "./types.googlechat.js";
import type { IMessageConfig } from "./types.imessage.js";
import type { IrcConfig } from "./types.irc.js";
import type { MSTeamsConfig } from "./types.msteams.js";
import type { SignalConfig } from "./types.signal.js";
import type { SlackConfig } from "./types.slack.js";
import type { TelegramConfig } from "./types.telegram.js";
import type { WhatsAppConfig } from "./types.whatsapp.js";
export type ChannelHeartbeatVisibilityConfig = {
/** Show HEARTBEAT_OK acknowledgments in chat (default: false). */
@@ -74,6 +83,15 @@ export interface ChannelsConfig {
defaults?: ChannelDefaultsConfig;
/** Map provider -> channel id -> model override. */
modelByChannel?: ChannelModelByChannelConfig;
discord?: DiscordConfig;
googlechat?: GoogleChatConfig;
imessage?: IMessageConfig;
irc?: IrcConfig;
msteams?: MSTeamsConfig;
signal?: SignalConfig;
slack?: SlackConfig;
telegram?: TelegramConfig;
whatsapp?: WhatsAppConfig;
/**
* Channel sections are plugin-owned and keyed by arbitrary channel ids.
* Keep the lookup permissive so augmented channel configs remain ergonomic at call sites.

View File

@@ -440,9 +440,3 @@ export type DiscordConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & DiscordAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
discord?: DiscordConfig;
}
}

View File

@@ -121,9 +121,3 @@ export type GoogleChatConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & GoogleChatAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
googlechat?: GoogleChatConfig;
}
}

View File

@@ -163,9 +163,3 @@ export type IMessageConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & IMessageAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
imessage?: IMessageConfig;
}
}

View File

@@ -59,9 +59,3 @@ export type IrcConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & IrcAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
irc?: IrcConfig;
}
}

View File

@@ -194,9 +194,3 @@ export type MSTeamsConfig = {
/** Bot Framework OAuth SSO (signin/tokenExchange + signin/verifyState) settings. */
sso?: MSTeamsSsoConfig;
};
declare module "./types.channels.js" {
interface ChannelsConfig {
msteams?: MSTeamsConfig;
}
}

View File

@@ -62,9 +62,3 @@ export type SignalConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & SignalAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
signal?: SignalConfig;
}
}

View File

@@ -221,9 +221,3 @@ export type SlackConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & SlackAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
slack?: SlackConfig;
}
}

View File

@@ -323,9 +323,3 @@ export type TelegramConfig = {
/** Optional default account id when multiple accounts are configured. */
defaultAccount?: string;
} & TelegramAccountConfig;
declare module "./types.channels.js" {
interface ChannelsConfig {
telegram?: TelegramConfig;
}
}

View File

@@ -145,9 +145,3 @@ export type WhatsAppAccountConfig = WhatsAppConfigCore &
/** Override auth directory (Baileys multi-file auth state). */
authDir?: string;
};
declare module "./types.channels.js" {
interface ChannelsConfig {
whatsapp?: WhatsAppConfig;
}
}

View File

@@ -163,19 +163,27 @@ describe("tsdown config", () => {
const external = unifiedGraph?.inputOptions?.({})?.external;
if (typeof neverBundle === "function") {
expect(neverBundle("@discordjs/voice")).toBe(true);
expect(neverBundle("@lancedb/lancedb")).toBe(true);
expect(neverBundle("@larksuiteoapi/node-sdk")).toBe(true);
expect(neverBundle("@matrix-org/matrix-sdk-crypto-nodejs")).toBe(true);
expect(neverBundle("@vitest/expect")).toBe(true);
expect(neverBundle("matrix-js-sdk/lib/client.js")).toBe(true);
expect(neverBundle("prism-media")).toBe(true);
expect(neverBundle("qrcode-terminal/lib/main.js")).toBe(true);
expect(neverBundle("vitest")).toBe(true);
expect(neverBundle("not-a-runtime-dependency")).toBe(false);
} else {
expect(neverBundle).toEqual(
expect.arrayContaining([
"@discordjs/voice",
"@lancedb/lancedb",
"@larksuiteoapi/node-sdk",
"@vitest/expect",
"matrix-js-sdk",
"prism-media",
"qrcode-terminal",
"vitest",
]),
);
}

View File

@@ -161,11 +161,15 @@ const bundledPluginRoot = (pluginId: string) => ["extensions", pluginId].join("/
const bundledPluginFile = (pluginId: string, relativePath: string) =>
`${bundledPluginRoot(pluginId)}/${relativePath}`;
const explicitNeverBundleDependencies = [
"@discordjs/voice",
"@lancedb/lancedb",
"@larksuiteoapi/node-sdk",
"@matrix-org/matrix-sdk-crypto-nodejs",
"@vitest/expect",
"matrix-js-sdk",
"prism-media",
"qrcode-terminal",
"vitest",
].toSorted((left, right) => left.localeCompare(right));
function shouldNeverBundleDependency(id: string): boolean {