From e771cefbd37f8b512bce17f4803697e1deca4600 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Thu, 22 Oct 2026 22:48:15 +0000 Subject: [PATCH] slack: default-export the server factory so bb can load the plugin The Slack plugin exported createSlackPlugin but never the factory itself, so every bb server refused it at start: "server entry must default-export a factory (bb) => void, got undefined". Export it the way linear and github-watcher do, and add a test that imports the default export. Co-Authored-By: Claude Fable 5.1 --- plugins/slack/server.test.ts | 7 ++++++- plugins/slack/server.ts | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/slack/server.test.ts b/plugins/slack/server.test.ts index 1f944ff1..cd1ff7f4 100644 --- a/plugins/slack/server.test.ts +++ b/plugins/slack/server.test.ts @@ -1,6 +1,6 @@ import { createFakePluginHost } from "@get-bb/plugin-sdk/testing"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { CALLBACK_PATH, createSlackPlugin } from "./server.js"; +import serverEntry, { CALLBACK_PATH, createSlackPlugin } from "./server.js"; const APP_URL = "https://bb.example"; const HOOKS_URL = "http://bb-gate-hooks.test:8081"; @@ -136,6 +136,11 @@ async function setup( } describe("Slack plugin", () => { + it("default-exports the factory bb loads as the server entry", () => { + // bb refuses the plugin ("server entry must default-export a factory (bb) => void, got undefined") without this. + expect(typeof serverEntry).toBe("function"); + }); + beforeEach(() => vi.useFakeTimers()); afterEach(() => vi.useRealTimers()); const tick = (ms = 0) => vi.advanceTimersByTimeAsync(ms); diff --git a/plugins/slack/server.ts b/plugins/slack/server.ts index 1124f616..d9294247 100644 --- a/plugins/slack/server.ts +++ b/plugins/slack/server.ts @@ -611,3 +611,5 @@ export function createSlackPlugin(deps: SlackPluginDeps): (bb: BbPluginApi) => P } }; } + +export default createSlackPlugin({ fetch: (url, init) => fetch(url, init), now: () => Date.now(), env: process.env });