mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
fix(onboarding): surface official WeCom channel install
This commit is contained in:
27
scripts/lib/official-external-channel-catalog.json
Normal file
27
scripts/lib/official-external-channel-catalog.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"name": "@wecom/wecom-openclaw-plugin",
|
||||
"description": "OpenClaw WeCom channel plugin by the Tencent WeCom team.",
|
||||
"source": "external",
|
||||
"kind": "channel",
|
||||
"openclaw": {
|
||||
"channel": {
|
||||
"id": "wecom",
|
||||
"label": "WeCom",
|
||||
"selectionLabel": "WeCom (Enterprise WeChat)",
|
||||
"detailLabel": "WeCom",
|
||||
"docsPath": "/plugins/community#wecom",
|
||||
"docsLabel": "wecom",
|
||||
"blurb": "Enterprise WeChat bot and conversation channel.",
|
||||
"aliases": ["qywx", "wework", "enterprise-wechat"],
|
||||
"order": 45
|
||||
},
|
||||
"install": {
|
||||
"npmSpec": "@wecom/wecom-openclaw-plugin",
|
||||
"defaultChoice": "npm"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import officialExternalChannelCatalog from "./lib/official-external-channel-catalog.json" with { type: "json" };
|
||||
import { isRecord, trimString } from "./lib/record-shared.mjs";
|
||||
import { writeTextFileIfChanged } from "./runtime-postbuild-shared.mjs";
|
||||
|
||||
@@ -13,9 +14,14 @@ function toCatalogInstall(value, packageName) {
|
||||
return null;
|
||||
}
|
||||
const defaultChoice = trimString(install.defaultChoice);
|
||||
const minHostVersion = trimString(install.minHostVersion);
|
||||
const expectedIntegrity = trimString(install.expectedIntegrity);
|
||||
return {
|
||||
npmSpec,
|
||||
...(defaultChoice === "npm" || defaultChoice === "local" ? { defaultChoice } : {}),
|
||||
...(minHostVersion ? { minHostVersion } : {}),
|
||||
...(expectedIntegrity ? { expectedIntegrity } : {}),
|
||||
...(install.allowInvalidConfigRecovery === true ? { allowInvalidConfigRecovery: true } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,7 +56,9 @@ function buildCatalogEntry(packageJson) {
|
||||
export function buildOfficialChannelCatalog(params = {}) {
|
||||
const repoRoot = params.cwd ?? params.repoRoot ?? process.cwd();
|
||||
const extensionsRoot = path.join(repoRoot, "extensions");
|
||||
const entries = [];
|
||||
const entries = Array.isArray(officialExternalChannelCatalog.entries)
|
||||
? [...officialExternalChannelCatalog.entries]
|
||||
: [];
|
||||
if (!fs.existsSync(extensionsRoot)) {
|
||||
return { entries };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user