mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 21:21:10 +00:00
refactor: consolidate plugin sdk surface
This commit is contained in:
@@ -23,7 +23,7 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("plugin loader git path regression", () => {
|
||||
it("loads git-style package extension entries when they import plugin-sdk channel-runtime (#49806)", async () => {
|
||||
it("loads git-style package extension entries when they import plugin-sdk infra-runtime (#49806)", async () => {
|
||||
const copiedExtensionRoot = path.join(makeTempDir(), "extensions", "imessage");
|
||||
const copiedSourceDir = path.join(copiedExtensionRoot, "src");
|
||||
const copiedPluginSdkDir = path.join(copiedExtensionRoot, "plugin-sdk");
|
||||
@@ -33,7 +33,7 @@ describe("plugin loader git path regression", () => {
|
||||
fs.writeFileSync(jitiBaseFile, "export {};\n", "utf-8");
|
||||
fs.writeFileSync(
|
||||
path.join(copiedSourceDir, "channel.runtime.ts"),
|
||||
`import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
`import { resolveOutboundSendDep } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import { PAIRING_APPROVED_MESSAGE } from "../runtime-api.js";
|
||||
|
||||
export const copiedRuntimeMarker = {
|
||||
@@ -49,7 +49,7 @@ export const copiedRuntimeMarker = {
|
||||
`,
|
||||
"utf-8",
|
||||
);
|
||||
const copiedChannelRuntimeShim = path.join(copiedPluginSdkDir, "channel-runtime.ts");
|
||||
const copiedChannelRuntimeShim = path.join(copiedPluginSdkDir, "infra-runtime.ts");
|
||||
fs.writeFileSync(
|
||||
copiedChannelRuntimeShim,
|
||||
`export function resolveOutboundSendDep() {
|
||||
@@ -77,7 +77,7 @@ export const copiedRuntimeMarker = {
|
||||
tryNative: false,
|
||||
extensions: [".ts", ".tsx", ".mts", ".cts", ".mtsx", ".ctsx", ".js", ".mjs", ".cjs", ".json"],
|
||||
alias: {
|
||||
"openclaw/plugin-sdk/channel-runtime": ${JSON.stringify(copiedChannelRuntimeShim)},
|
||||
"openclaw/plugin-sdk/infra-runtime": ${JSON.stringify(copiedChannelRuntimeShim)},
|
||||
},
|
||||
});
|
||||
const mod = withAlias(${JSON.stringify(copiedChannelRuntime)});
|
||||
|
||||
Reference in New Issue
Block a user