refactor: simplify plugin sdk compatibility aliases

This commit is contained in:
Peter Steinberger
2026-03-08 17:08:33 +00:00
parent dd7470730d
commit 25d0aa7296
4 changed files with 64 additions and 180 deletions

View File

@@ -1439,6 +1439,13 @@ describe("loadOpenClawPlugins", () => {
expect(candidates.indexOf(srcFile)).toBeLessThan(candidates.indexOf(distFile));
});
it("derives plugin-sdk subpaths from package exports", () => {
const subpaths = __testing.listPluginSdkExportedSubpaths();
expect(subpaths).toContain("compat");
expect(subpaths).toContain("telegram");
expect(subpaths).not.toContain("root-alias");
});
it("falls back to src plugin-sdk alias when dist is missing in production", () => {
const { root, srcFile, distFile } = createPluginSdkAliasFixture();
fs.rmSync(distFile);