mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 07:38:37 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -9,7 +9,7 @@ import { afterEach, describe, expect, it } from "vitest";
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
function makeTempDir() {
|
||||
const dir = path.join(os.tmpdir(), `clawdbot-plugin-install-${randomUUID()}`);
|
||||
const dir = path.join(os.tmpdir(), `moltbot-plugin-install-${randomUUID()}`);
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
tempDirs.push(dir);
|
||||
return dir;
|
||||
@@ -96,9 +96,9 @@ describe("installPluginFromArchive", () => {
|
||||
fs.writeFileSync(
|
||||
path.join(pkgDir, "package.json"),
|
||||
JSON.stringify({
|
||||
name: "@clawdbot/voice-call",
|
||||
name: "@moltbot/voice-call",
|
||||
version: "0.0.1",
|
||||
clawdbot: { extensions: ["./dist/index.js"] },
|
||||
moltbot: { extensions: ["./dist/index.js"] },
|
||||
}),
|
||||
"utf-8",
|
||||
);
|
||||
@@ -129,9 +129,9 @@ describe("installPluginFromArchive", () => {
|
||||
fs.writeFileSync(
|
||||
path.join(pkgDir, "package.json"),
|
||||
JSON.stringify({
|
||||
name: "@clawdbot/voice-call",
|
||||
name: "@moltbot/voice-call",
|
||||
version: "0.0.1",
|
||||
clawdbot: { extensions: ["./dist/index.js"] },
|
||||
moltbot: { extensions: ["./dist/index.js"] },
|
||||
}),
|
||||
"utf-8",
|
||||
);
|
||||
@@ -163,9 +163,9 @@ describe("installPluginFromArchive", () => {
|
||||
zip.file(
|
||||
"package/package.json",
|
||||
JSON.stringify({
|
||||
name: "@clawdbot/zipper",
|
||||
name: "@moltbot/zipper",
|
||||
version: "0.0.1",
|
||||
clawdbot: { extensions: ["./dist/index.js"] },
|
||||
moltbot: { extensions: ["./dist/index.js"] },
|
||||
}),
|
||||
);
|
||||
zip.file("package/dist/index.js", "export {};");
|
||||
@@ -192,9 +192,9 @@ describe("installPluginFromArchive", () => {
|
||||
fs.writeFileSync(
|
||||
path.join(pkgDir, "package.json"),
|
||||
JSON.stringify({
|
||||
name: "@clawdbot/voice-call",
|
||||
name: "@moltbot/voice-call",
|
||||
version: "0.0.1",
|
||||
clawdbot: { extensions: ["./dist/index.js"] },
|
||||
moltbot: { extensions: ["./dist/index.js"] },
|
||||
}),
|
||||
"utf-8",
|
||||
);
|
||||
@@ -210,9 +210,9 @@ describe("installPluginFromArchive", () => {
|
||||
fs.writeFileSync(
|
||||
path.join(pkgDir, "package.json"),
|
||||
JSON.stringify({
|
||||
name: "@clawdbot/voice-call",
|
||||
name: "@moltbot/voice-call",
|
||||
version: "0.0.2",
|
||||
clawdbot: { extensions: ["./dist/index.js"] },
|
||||
moltbot: { extensions: ["./dist/index.js"] },
|
||||
}),
|
||||
"utf-8",
|
||||
);
|
||||
@@ -244,14 +244,14 @@ describe("installPluginFromArchive", () => {
|
||||
expect(manifest.version).toBe("0.0.2");
|
||||
});
|
||||
|
||||
it("rejects packages without clawdbot.extensions", async () => {
|
||||
it("rejects packages without moltbot.extensions", async () => {
|
||||
const stateDir = makeTempDir();
|
||||
const workDir = makeTempDir();
|
||||
const pkgDir = path.join(workDir, "package");
|
||||
fs.mkdirSync(pkgDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(pkgDir, "package.json"),
|
||||
JSON.stringify({ name: "@clawdbot/nope", version: "0.0.1" }),
|
||||
JSON.stringify({ name: "@moltbot/nope", version: "0.0.1" }),
|
||||
"utf-8",
|
||||
);
|
||||
|
||||
@@ -266,6 +266,6 @@ describe("installPluginFromArchive", () => {
|
||||
const result = await installPluginFromArchive({ archivePath, extensionsDir });
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) return;
|
||||
expect(result.error).toContain("clawdbot.extensions");
|
||||
expect(result.error).toContain("moltbot.extensions");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user