mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor: move bundled extension gap allowlists into manifests
This commit is contained in:
@@ -37,6 +37,11 @@
|
|||||||
"npmSpec": "@openclaw/googlechat",
|
"npmSpec": "@openclaw/googlechat",
|
||||||
"localPath": "extensions/googlechat",
|
"localPath": "extensions/googlechat",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"google-auth-library"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
"npmSpec": "@openclaw/matrix",
|
"npmSpec": "@openclaw/matrix",
|
||||||
"localPath": "extensions/matrix",
|
"localPath": "extensions/matrix",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"@matrix-org/matrix-sdk-crypto-nodejs",
|
||||||
|
"@vector-im/matrix-bot-sdk",
|
||||||
|
"music-metadata"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,11 @@
|
|||||||
"npmSpec": "@openclaw/msteams",
|
"npmSpec": "@openclaw/msteams",
|
||||||
"localPath": "extensions/msteams",
|
"localPath": "extensions/msteams",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"@microsoft/agents-hosting"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
"npmSpec": "@openclaw/nostr",
|
"npmSpec": "@openclaw/nostr",
|
||||||
"localPath": "extensions/nostr",
|
"localPath": "extensions/nostr",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"nostr-tools"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,13 @@
|
|||||||
"npmSpec": "@openclaw/tlon",
|
"npmSpec": "@openclaw/tlon",
|
||||||
"localPath": "extensions/tlon",
|
"localPath": "extensions/tlon",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"@tloncorp/api",
|
||||||
|
"@tloncorp/tlon-skill",
|
||||||
|
"@urbit/aura"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
"npmSpec": "@openclaw/zalouser",
|
"npmSpec": "@openclaw/zalouser",
|
||||||
"localPath": "extensions/zalouser",
|
"localPath": "extensions/zalouser",
|
||||||
"defaultChoice": "npm"
|
"defaultChoice": "npm"
|
||||||
|
},
|
||||||
|
"releaseChecks": {
|
||||||
|
"rootDependencyMirrorAllowlist": [
|
||||||
|
"zca-js"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ type PackageJson = {
|
|||||||
install?: {
|
install?: {
|
||||||
npmSpec?: string;
|
npmSpec?: string;
|
||||||
};
|
};
|
||||||
|
releaseChecks?: {
|
||||||
|
rootDependencyMirrorAllowlist?: string[];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,15 +131,6 @@ function normalizePluginSyncVersion(version: string): string {
|
|||||||
return normalized.replace(/[-+].*$/, "");
|
return normalized.replace(/[-+].*$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
const ALLOWLISTED_BUNDLED_EXTENSION_ROOT_DEP_GAPS: Record<string, string[]> = {
|
|
||||||
googlechat: ["google-auth-library"],
|
|
||||||
matrix: ["@matrix-org/matrix-sdk-crypto-nodejs", "@vector-im/matrix-bot-sdk", "music-metadata"],
|
|
||||||
msteams: ["@microsoft/agents-hosting"],
|
|
||||||
nostr: ["nostr-tools"],
|
|
||||||
tlon: ["@tloncorp/api", "@tloncorp/tlon-skill", "@urbit/aura"],
|
|
||||||
zalouser: ["zca-js"],
|
|
||||||
};
|
|
||||||
|
|
||||||
export function collectBundledExtensionRootDependencyGapErrors(params: {
|
export function collectBundledExtensionRootDependencyGapErrors(params: {
|
||||||
rootPackage: PackageJson;
|
rootPackage: PackageJson;
|
||||||
extensions: Array<{ id: string; packageJson: PackageJson }>;
|
extensions: Array<{ id: string; packageJson: PackageJson }>;
|
||||||
@@ -156,7 +150,7 @@ export function collectBundledExtensionRootDependencyGapErrors(params: {
|
|||||||
.filter((dep) => dep !== "openclaw" && !rootDeps[dep])
|
.filter((dep) => dep !== "openclaw" && !rootDeps[dep])
|
||||||
.toSorted();
|
.toSorted();
|
||||||
const allowlisted = [
|
const allowlisted = [
|
||||||
...(ALLOWLISTED_BUNDLED_EXTENSION_ROOT_DEP_GAPS[extension.id] ?? []),
|
...(extension.packageJson.openclaw?.releaseChecks?.rootDependencyMirrorAllowlist ?? []),
|
||||||
].toSorted();
|
].toSorted();
|
||||||
if (missing.join("\n") !== allowlisted.join("\n")) {
|
if (missing.join("\n") !== allowlisted.join("\n")) {
|
||||||
const unexpected = missing.filter((dep) => !allowlisted.includes(dep));
|
const unexpected = missing.filter((dep) => !allowlisted.includes(dep));
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ describe("collectBundledExtensionRootDependencyGapErrors", () => {
|
|||||||
id: "googlechat",
|
id: "googlechat",
|
||||||
packageJson: {
|
packageJson: {
|
||||||
dependencies: { "google-auth-library": "^1.0.0" },
|
dependencies: { "google-auth-library": "^1.0.0" },
|
||||||
openclaw: { install: { npmSpec: "@openclaw/googlechat" } },
|
openclaw: {
|
||||||
|
install: { npmSpec: "@openclaw/googlechat" },
|
||||||
|
releaseChecks: {
|
||||||
|
rootDependencyMirrorAllowlist: ["google-auth-library"],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -66,7 +71,12 @@ describe("collectBundledExtensionRootDependencyGapErrors", () => {
|
|||||||
id: "googlechat",
|
id: "googlechat",
|
||||||
packageJson: {
|
packageJson: {
|
||||||
dependencies: { "google-auth-library": "^1.0.0", undici: "^7.0.0" },
|
dependencies: { "google-auth-library": "^1.0.0", undici: "^7.0.0" },
|
||||||
openclaw: { install: { npmSpec: "@openclaw/googlechat" } },
|
openclaw: {
|
||||||
|
install: { npmSpec: "@openclaw/googlechat" },
|
||||||
|
releaseChecks: {
|
||||||
|
rootDependencyMirrorAllowlist: ["google-auth-library"],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -85,7 +95,12 @@ describe("collectBundledExtensionRootDependencyGapErrors", () => {
|
|||||||
id: "googlechat",
|
id: "googlechat",
|
||||||
packageJson: {
|
packageJson: {
|
||||||
dependencies: { "google-auth-library": "^1.0.0" },
|
dependencies: { "google-auth-library": "^1.0.0" },
|
||||||
openclaw: { install: { npmSpec: "@openclaw/googlechat" } },
|
openclaw: {
|
||||||
|
install: { npmSpec: "@openclaw/googlechat" },
|
||||||
|
releaseChecks: {
|
||||||
|
rootDependencyMirrorAllowlist: ["google-auth-library"],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user