Skip to content

Commit fc36663

Browse files
committed
fix(feishu): wire setup runtime setter
1 parent 8f1ae59 commit fc36663

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Narrow entry point for setFeishuRuntime. Keep setup/runtime registration
2+
// from pulling in the broader Feishu runtime-api barrel.
3+
export { setFeishuRuntime } from "./src/runtime.js";

extensions/feishu/setup-entry.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,16 @@ describe("feishu setup entry", () => {
1717
expect(setupEntry.features).toEqual({ legacyStateMigrations: true });
1818
expect(typeof setupEntry.loadSetupPlugin).toBe("function");
1919
expect(setupEntry.loadLegacyStateMigrationDetector?.()).toBeTypeOf("function");
20+
expect(typeof setupEntry.setChannelRuntime).toBe("function");
21+
});
22+
23+
it("wires the Feishu runtime from setup-only registration", async () => {
24+
const { default: setupEntry } = await import("./setup-entry.js");
25+
const runtime = { channel: { inbound: { run: vi.fn() } } };
26+
27+
setupEntry.setChannelRuntime?.(runtime as never);
28+
29+
const { getFeishuRuntime } = await import("./src/runtime.js");
30+
expect(getFeishuRuntime()).toBe(runtime);
2031
});
2132
});

extensions/feishu/setup-entry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ export default defineBundledChannelSetupEntry({
1717
specifier: "./secret-contract-api.js",
1818
exportName: "channelSecrets",
1919
},
20+
runtime: {
21+
specifier: "./runtime-setter-api.js",
22+
exportName: "setFeishuRuntime",
23+
},
2024
});

0 commit comments

Comments
 (0)