test: remove discord sdk path references

This commit is contained in:
Peter Steinberger
2026-04-27 11:03:09 +01:00
parent 9f62c73893
commit ca882aeb42
2 changed files with 16 additions and 35 deletions

View File

@@ -56,14 +56,11 @@ The old approach caused problems:
The modern plugin SDK fixes this: each import path (`openclaw/plugin-sdk/\<subpath\>`)
is a small, self-contained module with a clear purpose and documented contract.
Legacy provider convenience seams for bundled channels are also gone. Imports
such as `openclaw/plugin-sdk/slack`, `openclaw/plugin-sdk/discord`,
`openclaw/plugin-sdk/signal`, `openclaw/plugin-sdk/whatsapp`,
channel-branded helper seams, and
`openclaw/plugin-sdk/telegram-core` were private mono-repo shortcuts, not
stable plugin contracts. Use narrow generic SDK subpaths instead. Inside the
bundled plugin workspace, keep provider-owned helpers in that plugin's own
`api.ts` or `runtime-api.ts`.
Legacy provider convenience seams for bundled channels are also gone.
Channel-branded helper seams were private mono-repo shortcuts, not stable
plugin contracts. Use narrow generic SDK subpaths instead. Inside the bundled
plugin workspace, keep provider-owned helpers in that plugin's own `api.ts` or
`runtime-api.ts`.
Current bundled provider examples:

View File

@@ -465,37 +465,21 @@ describe("plugin-sdk root alias", () => {
expect(rootSdk.__esModule).toBe(true);
});
it("does not publish removed channel-specific plugin-sdk subpaths", () => {
it("does not publish private local-only plugin-sdk subpaths", () => {
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) as {
exports?: Record<string, unknown>;
};
const privateSubpathsPath = path.join(
path.dirname(packageJsonPath),
"scripts",
"lib",
"plugin-sdk-private-local-only-subpaths.json",
);
const privateSubpaths = JSON.parse(fs.readFileSync(privateSubpathsPath, "utf-8")) as string[];
expect(packageJson.exports?.["./plugin-sdk/discord"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/signal"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/telegram-core"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-runtime-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-thread-bindings"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-timeouts"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-account"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-session-key"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/discord-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/signal-account"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/signal-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack-account"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack-runtime-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack-target-parser"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/slack-targets"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/telegram-account"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/telegram-allow-from"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/telegram-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp-auth-presence"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp-core"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp-shared"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp-surface"]).toBeUndefined();
expect(packageJson.exports?.["./plugin-sdk/whatsapp-targets"]).toBeUndefined();
for (const subpath of privateSubpaths) {
expect(packageJson.exports?.[`./plugin-sdk/${subpath}`]).toBeUndefined();
}
});
it("preserves reflection semantics for lazily resolved exports", { timeout: 240_000 }, () => {