From a96868980c9fa7c7fd0bb25561dd9fe473460f44 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 21 Feb 2023 20:26:14 +0800 Subject: [PATCH] chore: add registry config for fe and add i18n support for plugin --- apps/cli/bin/cli | 0 apps/cli/package.json | 2 + apps/cli/src/commands/registry/config.ts | 66 ++++++ apps/cli/src/commands/registry/index.ts | 11 + apps/cli/src/index.ts | 2 + .../plugins/com.msgbyte.bbcode/manifest.json | 6 +- .../com.msgbyte.biggerfont/manifest.json | 6 +- .../plugins/com.msgbyte.draw/manifest.json | 6 +- .../plugins/com.msgbyte.env.rn/manifest.json | 6 +- .../com.msgbyte.filepizza/manifest.json | 4 +- .../com.msgbyte.filesend/manifest.json | 4 +- .../plugins/com.msgbyte.filesfm/manifest.json | 4 +- .../plugins/com.msgbyte.genshin/manifest.json | 6 +- .../com.msgbyte.integration/manifest.json | 6 +- .../plugins/com.msgbyte.intro/manifest.json | 6 +- .../com.msgbyte.miaolang/manifest.json | 6 +- .../plugins/com.msgbyte.music/manifest.json | 6 +- .../plugins/com.msgbyte.notify/manifest.json | 6 +- .../plugins/com.msgbyte.openapi/manifest.json | 6 +- .../plugins/com.msgbyte.posthog/manifest.json | 3 +- .../plugins/com.msgbyte.sentry/manifest.json | 3 +- .../com.msgbyte.snapdrop/manifest.json | 6 +- .../com.msgbyte.theme.genshin/manifest.json | 6 +- .../com.msgbyte.theme.miku/manifest.json | 6 +- .../plugins/com.msgbyte.toolwa/manifest.json | 6 +- .../com.msgbyte.user.location/manifest.json | 6 +- .../plugins/com.msgbyte.webview/manifest.json | 6 +- .../com.msgbyte.wenshushu/manifest.json | 3 +- .../com.msgbyte.wormhole/manifest.json | 3 +- client/web/registry.json | 197 ++++++++++-------- package.json | 3 +- pnpm-lock.yaml | 23 +- 32 files changed, 301 insertions(+), 129 deletions(-) mode change 100644 => 100755 apps/cli/bin/cli create mode 100644 apps/cli/src/commands/registry/config.ts create mode 100644 apps/cli/src/commands/registry/index.ts diff --git a/apps/cli/bin/cli b/apps/cli/bin/cli old mode 100644 new mode 100755 diff --git a/apps/cli/package.json b/apps/cli/package.json index 263601ef..83474972 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -43,6 +43,7 @@ "filesize": "^8.0.7", "find-process": "^1.4.7", "fs-extra": "^10.1.0", + "glob": "^8.1.0", "got": "11.8.5", "ink": "^3.2.0", "ink-tab": "^4.2.0", @@ -65,6 +66,7 @@ }, "devDependencies": { "@types/fs-extra": "^9.0.13", + "@types/glob": "^8.0.0", "@types/inquirer": "^8.2.1", "@types/lodash": "^4.14.170", "@types/node": "16.11.7", diff --git a/apps/cli/src/commands/registry/config.ts b/apps/cli/src/commands/registry/config.ts new file mode 100644 index 00000000..ef9a25a8 --- /dev/null +++ b/apps/cli/src/commands/registry/config.ts @@ -0,0 +1,66 @@ +import { CommandModule } from 'yargs'; +import path from 'path'; +import glob from 'glob'; +import inquirer from 'inquirer'; +import fs from 'fs-extra'; + +const feRegistryPath = path.join(process.cwd(), './client/web/registry.json'); + +export const registryConfigCommand: CommandModule = { + command: 'config', + describe: + 'config tailchat registry which can display in Tailchat, run it in tailchat root path', + builder: (yargs) => + yargs + .option('fe', { + describe: 'Config FE Plugin List', + type: 'boolean', + }) + .option('be', { + describe: 'Config BE Plugin List', + type: 'boolean', + }) + .option('verbose', { + describe: 'Show plugin manifest path list', + type: 'boolean', + }), + async handler(args) { + const feplugins = glob.sync( + path.join(process.cwd(), './client/web/plugins/*/manifest.json') + ); + const beplugins = glob.sync( + path.join(process.cwd(), './server/plugins/*/web/plugins/*/manifest.json') + ); + + if (args.verbose) { + console.log('feplugins', feplugins); + console.log('beplugins', beplugins); + } + + console.log( + `Scan plugins: fe(count: ${feplugins.length}) be(count: ${beplugins.length})` + ); + + if (args.fe) { + const alreadySelected = await fs.readJSON(feRegistryPath); + const feInfos = await Promise.all(feplugins.map((p) => fs.readJSON(p))); + const { selected: selectedInfo } = await inquirer.prompt([ + { + name: 'selected', + type: 'checkbox', + default: alreadySelected + .map((item: any) => feInfos.find((info) => info.name === item.name)) + .filter(Boolean), + choices: feInfos.map((info) => ({ + name: `${info.name}(${info.version})`, + value: info, + })), + }, + ]); + + console.log(`Selected ${selectedInfo.length} plugin.`); + + await fs.writeJSON(feRegistryPath, selectedInfo, { spaces: 2 }); + } + }, +}; diff --git a/apps/cli/src/commands/registry/index.ts b/apps/cli/src/commands/registry/index.ts new file mode 100644 index 00000000..069799ab --- /dev/null +++ b/apps/cli/src/commands/registry/index.ts @@ -0,0 +1,11 @@ +import { CommandModule } from 'yargs'; +import { registryConfigCommand } from './config'; + +// https://docs.docker.com/engine/api/v1.41/ + +export const registryCommand: CommandModule = { + command: 'registry', + describe: 'Tailchat registry config', + builder: (yargs) => yargs.command(registryConfigCommand).demandCommand(), + handler(args) {}, +}; diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index fb1abecc..2747895d 100644 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -7,6 +7,7 @@ import { declarationCommand } from './commands/declaration'; import { benchCommand } from './commands/bench'; import { dockerCommand } from './commands/docker'; import { usageCommand } from './commands/usage'; +import { registryCommand } from './commands/registry'; yargs .demandCommand() @@ -16,6 +17,7 @@ yargs .command(benchCommand) .command(declarationCommand) .command(dockerCommand) + .command(registryCommand) .command(usageCommand) .alias('h', 'help') .scriptName('tailchat') diff --git a/client/web/plugins/com.msgbyte.bbcode/manifest.json b/client/web/plugins/com.msgbyte.bbcode/manifest.json index a24032c2..0a6ef9ff 100644 --- a/client/web/plugins/com.msgbyte.bbcode/manifest.json +++ b/client/web/plugins/com.msgbyte.bbcode/manifest.json @@ -1,9 +1,11 @@ { - "label": "BBCode 消息解释器", + "label": "BBCode Mmessage Interpreter", + "label.zh-CN": "BBCode 消息解释器", "name": "com.msgbyte.bbcode", "url": "/plugins/com.msgbyte.miaolang/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "一个用于支持bbcode语法解释富文本消息的插件", + "description": "A plugin for supporting bbcode syntax to interpret rich text messages", + "description.zh-CN": "一个用于支持bbcode语法解释富文本消息的插件", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.biggerfont/manifest.json b/client/web/plugins/com.msgbyte.biggerfont/manifest.json index a85ab39c..cf9d1118 100644 --- a/client/web/plugins/com.msgbyte.biggerfont/manifest.json +++ b/client/web/plugins/com.msgbyte.biggerfont/manifest.json @@ -1,9 +1,11 @@ { - "label": "字号放大", + "label": "Bigger Font Size", + "label.zh-CN": "字号放大", "name": "com.msgbyte.biggerfont", "url": "/plugins/com.msgbyte.biggerfont/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "为Tailchat增加放大字号的功能,方便不同用户群体", + "description": "Add the feature of enlarging the font size to Tailchat, which is convenient for different user", + "description.zh-CN": "为Tailchat增加放大字号的功能,方便不同用户群体", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.draw/manifest.json b/client/web/plugins/com.msgbyte.draw/manifest.json index b76ff482..a105dbbe 100644 --- a/client/web/plugins/com.msgbyte.draw/manifest.json +++ b/client/web/plugins/com.msgbyte.draw/manifest.json @@ -1,9 +1,11 @@ { - "label": "绘图插件", + "label": "Drawing plugin", + "label.zh-CN": "绘图插件", "name": "com.msgbyte.draw", "url": "/plugins/com.msgbyte.draw/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "允许发送自定义绘图", + "description": "Allows sending custom drawings", + "description.zh-CN": "允许发送自定义绘图", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.env.rn/manifest.json b/client/web/plugins/com.msgbyte.env.rn/manifest.json index cca03ce3..e3b0e884 100644 --- a/client/web/plugins/com.msgbyte.env.rn/manifest.json +++ b/client/web/plugins/com.msgbyte.env.rn/manifest.json @@ -1,9 +1,11 @@ { - "label": "ReactNative支持", + "label": "React Native support", + "label.zh-CN": "ReactNative支持", "name": "com.msgbyte.env.rn", "url": "/plugins/com.msgbyte.env.rn/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "在Tailchat添加对ReactNative环境的支持", + "description": "Add support for ReactNative environment in Tailchat", + "description.zh-CN": "在Tailchat添加对ReactNative环境的支持", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.filepizza/manifest.json b/client/web/plugins/com.msgbyte.filepizza/manifest.json index 6bcfa81f..abaae439 100644 --- a/client/web/plugins/com.msgbyte.filepizza/manifest.json +++ b/client/web/plugins/com.msgbyte.filepizza/manifest.json @@ -1,10 +1,12 @@ { "label": "file.pizza", + "label.zh-CN": "file.pizza", "name": "com.msgbyte.filepizza", "url": "/plugins/com.msgbyte.filepizza/index.js", "icon": "/plugins/com.msgbyte.filepizza/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "在聊天输入框快捷打开 filepizza 以支持p2p传输文件", + "description": "Quickly open filepizza in the chat input box to support p2p file transfer", + "description.zh-CN": "在聊天输入框快捷打开 filepizza 以支持p2p传输文件", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.filesend/manifest.json b/client/web/plugins/com.msgbyte.filesend/manifest.json index e1f5723c..bfc8eb4b 100644 --- a/client/web/plugins/com.msgbyte.filesend/manifest.json +++ b/client/web/plugins/com.msgbyte.filesend/manifest.json @@ -1,9 +1,11 @@ { "label": "filesend", + "label.zh-CN": "filesend", "name": "com.msgbyte.filesend", "url": "/plugins/com.msgbyte.filesend/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "在聊天输入框快捷打开 Filesend 以支持传输文件", + "description": "Quickly open Filesend in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 Filesend 以支持传输文件", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.filesfm/manifest.json b/client/web/plugins/com.msgbyte.filesfm/manifest.json index cfdebc7c..87b1cfe7 100644 --- a/client/web/plugins/com.msgbyte.filesfm/manifest.json +++ b/client/web/plugins/com.msgbyte.filesfm/manifest.json @@ -1,10 +1,12 @@ { "label": "files.fm", + "label.zh-CN": "files.fm", "name": "com.msgbyte.filesfm", "url": "/plugins/com.msgbyte.filesfm/index.js", "icon": "/plugins/com.msgbyte.filesfm/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "在聊天输入框快捷打开 files.fm 以支持传输文件", + "description": "Quickly open files.fm in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 files.fm 以支持传输文件", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.genshin/manifest.json b/client/web/plugins/com.msgbyte.genshin/manifest.json index 449734b1..637da2d1 100644 --- a/client/web/plugins/com.msgbyte.genshin/manifest.json +++ b/client/web/plugins/com.msgbyte.genshin/manifest.json @@ -1,9 +1,11 @@ { - "label": "原神工具箱", + "label": "Genshin Toolbox", + "label.zh-CN": "原神工具箱", "name": "com.msgbyte.genshin", "url": "/plugins/com.msgbyte.genshin/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "为Tailchat增加原神相关的娱乐能力", + "description": "Add Genshin-related entertainment capabilities to Tailchat", + "description.zh-CN": "为Tailchat增加原神相关的娱乐能力", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.integration/manifest.json b/client/web/plugins/com.msgbyte.integration/manifest.json index ca79646f..e16444c1 100644 --- a/client/web/plugins/com.msgbyte.integration/manifest.json +++ b/client/web/plugins/com.msgbyte.integration/manifest.json @@ -1,9 +1,11 @@ { - "label": "第三方集成", + "label": "third party integration", + "label.zh-CN": "第三方集成", "name": "com.msgbyte.integration", "url": "/plugins/com.msgbyte.integration/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "用于在群组中集成第三方应用", + "description": "Used to integrate third-party applications in groups", + "description.zh-CN": "用于在群组中集成第三方应用", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.intro/manifest.json b/client/web/plugins/com.msgbyte.intro/manifest.json index 5da1ed55..6898c078 100644 --- a/client/web/plugins/com.msgbyte.intro/manifest.json +++ b/client/web/plugins/com.msgbyte.intro/manifest.json @@ -1,9 +1,11 @@ { - "label": "初始引导插件", + "label": "Intro plugin", + "label.zh-CN": "初始引导插件", "name": "com.msgbyte.intro", "url": "/plugins/com.msgbyte.intro/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "为应用首次打开介绍应用的能力", + "description": "Turn on the ability to introduce the app for the first time for the app", + "description.zh-CN": "为应用首次打开介绍应用的能力", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.miaolang/manifest.json b/client/web/plugins/com.msgbyte.miaolang/manifest.json index 01419df7..d0ff69c1 100644 --- a/client/web/plugins/com.msgbyte.miaolang/manifest.json +++ b/client/web/plugins/com.msgbyte.miaolang/manifest.json @@ -1,10 +1,12 @@ { - "label": "喵语言", + "label": "Miaolang", + "label.zh-CN": "喵语言", "name": "com.msgbyte.miaolang", "url": "/plugins/com.msgbyte.miaolang/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "允许发送喵语,安装插件后的双方加密对话,未安装插件的人看到的是 '喵'", + "description": "It is allowed to send meow, and the two parties encrypt the conversation after installing the plugin. People who have not installed the plugin will see 'meow'", + "description.zh-CN": "允许发送喵语,安装插件后的双方加密对话,未安装插件的人看到的是 '喵'", "documentUrl": "/plugins/com.msgbyte.miaolang/README.md", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.music/manifest.json b/client/web/plugins/com.msgbyte.music/manifest.json index fdc74504..9d64f97e 100644 --- a/client/web/plugins/com.msgbyte.music/manifest.json +++ b/client/web/plugins/com.msgbyte.music/manifest.json @@ -1,10 +1,12 @@ { - "label": "在线听音乐", + "label": "Listen Music Online", + "label.zh-CN": "在线听音乐", "name": "com.msgbyte.music", "url": "/plugins/com.msgbyte.music/index.js", "icon": "/plugins/com.msgbyte.music/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "提供在线听音乐服务,内容来自网络", + "description": "Provide online music listening service, the content comes from the Internet", + "description.zh-CN": "提供在线听音乐服务,内容来自网络", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.notify/manifest.json b/client/web/plugins/com.msgbyte.notify/manifest.json index 897d3b38..ccc52232 100644 --- a/client/web/plugins/com.msgbyte.notify/manifest.json +++ b/client/web/plugins/com.msgbyte.notify/manifest.json @@ -1,9 +1,11 @@ { - "label": "消息通知插件", + "label": "Message notification plugin", + "label.zh-CN": "消息通知插件", "name": "com.msgbyte.notify", "url": "/plugins/com.msgbyte.notify/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "为应用增加通知的能力", + "description": "Ability to add notifications to apps", + "description.zh-CN": "为应用增加通知的能力", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.openapi/manifest.json b/client/web/plugins/com.msgbyte.openapi/manifest.json index d47acd81..54f7fc78 100644 --- a/client/web/plugins/com.msgbyte.openapi/manifest.json +++ b/client/web/plugins/com.msgbyte.openapi/manifest.json @@ -1,9 +1,11 @@ { - "label": "开放平台插件", + "label": "Openapi Platform Plugin", + "label.zh-CN": "开放平台插件", "name": "com.msgbyte.openapi", "url": "/plugins/com.msgbyte.openapi/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "为应用提供开放平台的操作能力", + "description": "Provide the operating capability of the open platform for the application", + "description.zh-CN": "为应用提供开放平台的操作能力", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.posthog/manifest.json b/client/web/plugins/com.msgbyte.posthog/manifest.json index 0f5cb54a..d670902b 100644 --- a/client/web/plugins/com.msgbyte.posthog/manifest.json +++ b/client/web/plugins/com.msgbyte.posthog/manifest.json @@ -5,6 +5,7 @@ "icon": "/plugins/com.msgbyte.posthog/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "Posthog 数据统计", + "description": "Posthog Statistics", + "description.zh-CN": "Posthog 数据统计", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.sentry/manifest.json b/client/web/plugins/com.msgbyte.sentry/manifest.json index 995d4fd3..105522c2 100644 --- a/client/web/plugins/com.msgbyte.sentry/manifest.json +++ b/client/web/plugins/com.msgbyte.sentry/manifest.json @@ -5,6 +5,7 @@ "icon": "/plugins/com.msgbyte.sentry/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "Sentry 错误处理", + "description": "Sentry error handling", + "description.zh-CN": "Sentry 错误处理", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.snapdrop/manifest.json b/client/web/plugins/com.msgbyte.snapdrop/manifest.json index 81321cad..4b806027 100644 --- a/client/web/plugins/com.msgbyte.snapdrop/manifest.json +++ b/client/web/plugins/com.msgbyte.snapdrop/manifest.json @@ -1,11 +1,13 @@ { - "label": "隔空投送", + "label": "Snapdrop", + "label.zh-CN": "隔空投送", "name": "com.msgbyte.snapdrop", "url": "/plugins/com.msgbyte.snapdrop/index.js", "icon": "/plugins/com.msgbyte.snapdrop/assets/icon.png", "documentUrl": "/plugins/com.msgbyte.snapdrop/README.md", "version": "0.0.0", "author": "msgbyte", - "description": "隔空投送 —— 在同一网络发送文件与消息", + "description": "Snapdrop —— Send files and messages on the same network", + "description.zh-CN": "隔空投送 —— 在同一网络发送文件与消息", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.theme.genshin/manifest.json b/client/web/plugins/com.msgbyte.theme.genshin/manifest.json index ec3f60f5..f01dc0a2 100644 --- a/client/web/plugins/com.msgbyte.theme.genshin/manifest.json +++ b/client/web/plugins/com.msgbyte.theme.genshin/manifest.json @@ -1,11 +1,13 @@ { - "label": "原神主题", + "label": "Genshin Theme", + "label.zh-CN": "原神主题", "name": "com.msgbyte.theme.genshin", "url": "/plugins/com.msgbyte.theme.genshin/index.js", "icon": "/plugins/com.msgbyte.theme.genshin/assets/icon.jpg", "version": "0.0.0", "author": "msgbyte", - "description": "原神主题", + "description": "Genshin Theme", + "description.zh-CN": "原神主题", "documentUrl": "/plugins/com.msgbyte.theme.genshin/README.md", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.theme.miku/manifest.json b/client/web/plugins/com.msgbyte.theme.miku/manifest.json index be11172d..72e01a92 100644 --- a/client/web/plugins/com.msgbyte.theme.miku/manifest.json +++ b/client/web/plugins/com.msgbyte.theme.miku/manifest.json @@ -1,9 +1,11 @@ { - "label": "Miku初音未来主题", + "label": "Hatsune Miku Theme", + "label.zh-CN": "Miku初音未来主题", "name": "com.msgbyte.theme.miku", "url": "/plugins/com.msgbyte.theme.miku/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "初音未来主题,支持亮色与暗色", + "description": "Hatsune Miku theme, supports light and dark colors", + "description.zh-CN": "初音未来主题,支持亮色与暗色", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.toolwa/manifest.json b/client/web/plugins/com.msgbyte.toolwa/manifest.json index 8f234480..5e18a1f7 100644 --- a/client/web/plugins/com.msgbyte.toolwa/manifest.json +++ b/client/web/plugins/com.msgbyte.toolwa/manifest.json @@ -1,10 +1,12 @@ { - "label": "工具哇!", + "label": "Tool frog!", + "label.zh-CN": "工具哇!", "name": "com.msgbyte.toolwa", "url": "/plugins/com.msgbyte.toolwa/index.js", "icon": "/plugins/com.msgbyte.toolwa/assets/icon.png", "version": "0.0.0", "author": "msgbyte", - "description": "工具哇 —— 在线小工具", + "description": "Tool frog —— online tools", + "description.zh-CN": "工具哇 —— 在线小工具", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.user.location/manifest.json b/client/web/plugins/com.msgbyte.user.location/manifest.json index e33762cd..9b99194a 100644 --- a/client/web/plugins/com.msgbyte.user.location/manifest.json +++ b/client/web/plugins/com.msgbyte.user.location/manifest.json @@ -1,9 +1,11 @@ { - "label": "用户地理位置", + "label": "User Location", + "label.zh-CN": "用户地理位置", "name": "com.msgbyte.user.location", "url": "/plugins/com.msgbyte.user.location/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "为用户信息增加地理位置记录", + "description": "Add geographic location records for user information", + "description.zh-CN": "为用户信息增加地理位置记录", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.webview/manifest.json b/client/web/plugins/com.msgbyte.webview/manifest.json index be330d14..da50e8eb 100644 --- a/client/web/plugins/com.msgbyte.webview/manifest.json +++ b/client/web/plugins/com.msgbyte.webview/manifest.json @@ -1,10 +1,12 @@ { - "label": "网页面板插件", + "label": "Web Panel Plugin", + "label.zh-CN": "网页面板插件", "name": "com.msgbyte.webview", "url": "/plugins/com.msgbyte.webview/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "为群组提供创建网页面板的功能", + "description": "Provides groups with the ability to create web panels", + "description.zh-CN": "为群组提供创建网页面板的功能", "documentUrl": "/plugins/com.msgbyte.webview/README.md", "requireRestart": false } diff --git a/client/web/plugins/com.msgbyte.wenshushu/manifest.json b/client/web/plugins/com.msgbyte.wenshushu/manifest.json index a57ea4aa..4f6d94fe 100644 --- a/client/web/plugins/com.msgbyte.wenshushu/manifest.json +++ b/client/web/plugins/com.msgbyte.wenshushu/manifest.json @@ -5,6 +5,7 @@ "icon": "/plugins/com.msgbyte.wenshushu/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "在聊天输入框快捷打开 文叔叔 以支持传输文件", + "description": "Quickly open Wenshushu in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 文叔叔 以支持传输文件", "requireRestart": true } diff --git a/client/web/plugins/com.msgbyte.wormhole/manifest.json b/client/web/plugins/com.msgbyte.wormhole/manifest.json index f5bc2975..c649a8d8 100644 --- a/client/web/plugins/com.msgbyte.wormhole/manifest.json +++ b/client/web/plugins/com.msgbyte.wormhole/manifest.json @@ -5,6 +5,7 @@ "icon": "/plugins/com.msgbyte.wormhole/assets/icon.webp", "version": "0.0.0", "author": "moonrailgun", - "description": "在聊天输入框快捷打开 wormhole 以支持传输文件", + "description": "Quickly open wormhole in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 wormhole 以支持传输文件", "requireRestart": true } diff --git a/client/web/registry.json b/client/web/registry.json index 7082a1c1..0c166975 100644 --- a/client/web/registry.json +++ b/client/web/registry.json @@ -1,147 +1,176 @@ [ { - "label": "喵语言", - "name": "com.msgbyte.miaolang", - "url": "/plugins/com.msgbyte.miaolang/index.js", - "version": "0.0.0", - "author": "msgbyte", - "description": "为聊天提供喵语言对话功能", - "documentUrl": "/plugins/com.msgbyte.miaolang/README.md", - "requireRestart": false - }, - { - "label": "Miku初音未来主题", - "name": "com.msgbyte.theme.miku", - "url": "/plugins/com.msgbyte.theme.miku/index.js", - "version": "0.0.0", - "author": "msgbyte", - "description": "初音未来主题", - "requireRestart": false - }, - { - "label": "原神主题", - "name": "com.msgbyte.theme.genshin", - "url": "/plugins/com.msgbyte.theme.genshin/index.js", - "icon": "/plugins/com.msgbyte.theme.genshin/assets/icon.jpg", + "label": "Bigger Font Size", + "label.zh-CN": "字号放大", + "name": "com.msgbyte.biggerfont", + "url": "/plugins/com.msgbyte.biggerfont/index.js", "version": "0.0.0", - "author": "msgbyte", - "description": "原神主题", - "requireRestart": false + "author": "moonrailgun", + "description": "Add the feature of enlarging the font size to Tailchat, which is convenient for different user", + "description.zh-CN": "为Tailchat增加放大字号的功能,方便不同用户群体", + "requireRestart": true }, { - "label": "绘图插件", + "label": "Drawing plugin", + "label.zh-CN": "绘图插件", "name": "com.msgbyte.draw", "url": "/plugins/com.msgbyte.draw/index.js", "version": "0.0.0", "author": "msgbyte", - "description": "允许发送自定义绘图", + "description": "Allows sending custom drawings", + "description.zh-CN": "允许发送自定义绘图", "requireRestart": false }, - { - "label": "原神工具箱", - "name": "com.msgbyte.genshin", - "url": "/plugins/com.msgbyte.genshin/index.js", - "version": "0.0.0", - "author": "msgbyte", - "description": "为Tailchat增加原神相关的娱乐能力", - "requireRestart": true - }, - { - "label": "隔空投送", - "name": "com.msgbyte.snapdrop", - "url": "/plugins/com.msgbyte.snapdrop/index.js", - "icon": "/plugins/com.msgbyte.snapdrop/assets/icon.png", - "documentUrl": "/plugins/com.msgbyte.snapdrop/README.md", - "version": "0.0.0", - "author": "msgbyte", - "description": "隔空投送 —— 在同一网络发送文件与消息", - "requireRestart": true - }, { "label": "file.pizza", + "label.zh-CN": "file.pizza", "name": "com.msgbyte.filepizza", "url": "/plugins/com.msgbyte.filepizza/index.js", "icon": "/plugins/com.msgbyte.filepizza/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "快捷打开 filepizza 以支持p2p传输文件", + "description": "Quickly open filepizza in the chat input box to support p2p file transfer", + "description.zh-CN": "在聊天输入框快捷打开 filepizza 以支持p2p传输文件", + "requireRestart": true + }, + { + "label": "filesend", + "label.zh-CN": "filesend", + "name": "com.msgbyte.filesend", + "url": "/plugins/com.msgbyte.filesend/index.js", + "version": "0.0.0", + "author": "moonrailgun", + "description": "Quickly open Filesend in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 Filesend 以支持传输文件", "requireRestart": true }, { "label": "files.fm", + "label.zh-CN": "files.fm", "name": "com.msgbyte.filesfm", "url": "/plugins/com.msgbyte.filesfm/index.js", "icon": "/plugins/com.msgbyte.filesfm/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "快捷打开 files.fm 以支持传输文件", + "description": "Quickly open files.fm in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 files.fm 以支持传输文件", "requireRestart": true }, { - "label": "wenshushu", - "name": "com.msgbyte.wenshushu", - "url": "/plugins/com.msgbyte.wenshushu/index.js", - "icon": "/plugins/com.msgbyte.wenshushu/assets/icon.png", + "label": "Genshin Toolbox", + "label.zh-CN": "原神工具箱", + "name": "com.msgbyte.genshin", + "url": "/plugins/com.msgbyte.genshin/index.js", "version": "0.0.0", - "author": "moonrailgun", - "description": "在聊天输入框快捷打开 文叔叔 以支持传输文件", + "author": "msgbyte", + "description": "Add Genshin-related entertainment capabilities to Tailchat", + "description.zh-CN": "为Tailchat增加原神相关的娱乐能力", "requireRestart": true }, { - "label": "filesend", - "name": "com.msgbyte.filesend", - "url": "/plugins/com.msgbyte.filesend/index.js", + "label": "Miaolang", + "label.zh-CN": "喵语言", + "name": "com.msgbyte.miaolang", + "url": "/plugins/com.msgbyte.miaolang/index.js", "version": "0.0.0", - "author": "moonrailgun", - "description": "在聊天输入框快捷打开 Filesend 以支持传输文件", - "requireRestart": true + "author": "msgbyte", + "description": "It is allowed to send meow, and the two parties encrypt the conversation after installing the plugin. People who have not installed the plugin will see 'meow'", + "description.zh-CN": "允许发送喵语,安装插件后的双方加密对话,未安装插件的人看到的是 '喵'", + "documentUrl": "/plugins/com.msgbyte.miaolang/README.md", + "requireRestart": false }, { - "label": "用户地理位置", - "name": "com.msgbyte.user.location", - "url": "/plugins/com.msgbyte.user.location/index.js", + "label": "Listen Music Online", + "label.zh-CN": "在线听音乐", + "name": "com.msgbyte.music", + "url": "/plugins/com.msgbyte.music/index.js", + "icon": "/plugins/com.msgbyte.music/assets/icon.png", "version": "0.0.0", "author": "moonrailgun", - "description": "为用户信息增加地理位置记录", + "description": "Provide online music listening service, the content comes from the Internet", + "description.zh-CN": "提供在线听音乐服务,内容来自网络", "requireRestart": true }, { - "label": "wormhole", - "name": "com.msgbyte.wormhole", - "url": "/plugins/com.msgbyte.wormhole/index.js", - "icon": "/plugins/com.msgbyte.wormhole/assets/icon.webp", + "label": "Snapdrop", + "label.zh-CN": "隔空投送", + "name": "com.msgbyte.snapdrop", + "url": "/plugins/com.msgbyte.snapdrop/index.js", + "icon": "/plugins/com.msgbyte.snapdrop/assets/icon.png", + "documentUrl": "/plugins/com.msgbyte.snapdrop/README.md", "version": "0.0.0", - "author": "moonrailgun", - "description": "在聊天输入框快捷打开 wormhole 以支持传输文件", - "requireRestart": true + "author": "msgbyte", + "description": "Snapdrop —— Send files and messages on the same network", + "description.zh-CN": "隔空投送 —— 在同一网络发送文件与消息", + "requireRestart": false }, { - "label": "工具哇!", + "label": "Genshin Theme", + "label.zh-CN": "原神主题", + "name": "com.msgbyte.theme.genshin", + "url": "/plugins/com.msgbyte.theme.genshin/index.js", + "icon": "/plugins/com.msgbyte.theme.genshin/assets/icon.jpg", + "version": "0.0.0", + "author": "msgbyte", + "description": "Genshin Theme", + "description.zh-CN": "原神主题", + "documentUrl": "/plugins/com.msgbyte.theme.genshin/README.md", + "requireRestart": false + }, + { + "label": "Hatsune Miku Theme", + "label.zh-CN": "Miku初音未来主题", + "name": "com.msgbyte.theme.miku", + "url": "/plugins/com.msgbyte.theme.miku/index.js", + "version": "0.0.0", + "author": "msgbyte", + "description": "Hatsune Miku theme, supports light and dark colors", + "description.zh-CN": "初音未来主题,支持亮色与暗色", + "requireRestart": false + }, + { + "label": "Tool frog!", + "label.zh-CN": "工具哇!", "name": "com.msgbyte.toolwa", "url": "/plugins/com.msgbyte.toolwa/index.js", "icon": "/plugins/com.msgbyte.toolwa/assets/icon.png", "version": "0.0.0", "author": "msgbyte", - "description": "工具哇 —— 在线小工具", + "description": "Tool frog —— online tools", + "description.zh-CN": "工具哇 —— 在线小工具", "requireRestart": false }, { - "label": "在线听音乐", - "name": "com.msgbyte.music", - "url": "/plugins/com.msgbyte.music/index.js", - "icon": "/plugins/com.msgbyte.music/assets/icon.png", + "label": "User Location", + "label.zh-CN": "用户地理位置", + "name": "com.msgbyte.user.location", + "url": "/plugins/com.msgbyte.user.location/index.js", "version": "0.0.0", "author": "moonrailgun", - "description": "提供在线听音乐服务,内容来自网络", + "description": "Add geographic location records for user information", + "description.zh-CN": "为用户信息增加地理位置记录", "requireRestart": true }, { - "label": "字号放大", - "name": "com.msgbyte.biggerfont", - "url": "/plugins/com.msgbyte.biggerfont/index.js", + "label": "wenshushu", + "name": "com.msgbyte.wenshushu", + "url": "/plugins/com.msgbyte.wenshushu/index.js", + "icon": "/plugins/com.msgbyte.wenshushu/assets/icon.png", + "version": "0.0.0", + "author": "moonrailgun", + "description": "Quickly open Wenshushu in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 文叔叔 以支持传输文件", + "requireRestart": true + }, + { + "label": "wormhole", + "name": "com.msgbyte.wormhole", + "url": "/plugins/com.msgbyte.wormhole/index.js", + "icon": "/plugins/com.msgbyte.wormhole/assets/icon.webp", "version": "0.0.0", "author": "moonrailgun", - "description": "为Tailchat增加放大字号的功能,方便不同用户群体", + "description": "Quickly open wormhole in the chat input box to support file transfer", + "description.zh-CN": "在聊天输入框快捷打开 wormhole 以支持传输文件", "requireRestart": true } ] diff --git a/package.json b/package.json index 90835790..30acfac1 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ }, "dependencies": { "crc": "^3.8.0", - "lodash": "^4.17.21" + "lodash": "^4.17.21", + "tailchat-cli": "workspace:^1.5.5" }, "pnpm": { "patchedDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87c16d43..aad5e102 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,11 +30,13 @@ importers: lodash: ^4.17.21 prettier: ^2.7.1 release-it: ^15.5.1 + tailchat-cli: workspace:^1.5.5 typescript: ^4.8.2 vinyl-fs: ^3.0.3 dependencies: crc: 3.8.0 lodash: 4.17.21 + tailchat-cli: link:apps/cli devDependencies: '@commitlint/cli': 17.0.3 '@commitlint/config-conventional': 17.0.3 @@ -62,6 +64,7 @@ importers: specifiers: '@types/dockerode': ^3.3.10 '@types/fs-extra': ^9.0.13 + '@types/glob': ^8.0.0 '@types/inquirer': ^8.2.1 '@types/lodash': ^4.14.170 '@types/node': 16.11.7 @@ -79,6 +82,7 @@ importers: filesize: ^8.0.7 find-process: ^1.4.7 fs-extra: ^10.1.0 + glob: ^8.1.0 got: 11.8.5 ink: ^3.2.0 ink-tab: ^4.2.0 @@ -112,6 +116,7 @@ importers: filesize: 8.0.7 find-process: 1.4.7 fs-extra: 10.1.0 + glob: 8.1.0 got: 11.8.5 ink: 3.2.0_w5j4k42lgipnm43s3brx6h3c34 ink-tab: 4.2.0_ink@3.2.0+react@18.2.0 @@ -133,6 +138,7 @@ importers: yargs: 17.5.1 devDependencies: '@types/fs-extra': 9.0.13 + '@types/glob': 8.0.0 '@types/inquirer': 8.2.3 '@types/lodash': 4.14.184 '@types/node': 16.11.7 @@ -12996,13 +13002,13 @@ packages: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.11.18 + '@types/node': 18.13.0 /@types/glob/8.0.0: resolution: {integrity: sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.11.16 + '@types/node': 18.13.0 dev: true /@types/graceful-fs/4.1.5: @@ -13799,7 +13805,7 @@ packages: /@types/whatwg-url/8.2.2: resolution: {integrity: sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==} dependencies: - '@types/node': 18.11.18 + '@types/node': 18.13.0 '@types/webidl-conversions': 6.1.1 /@types/ws/8.5.3: @@ -22062,6 +22068,17 @@ packages: once: 1.4.0 dev: false + /glob/8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.1 + once: 1.4.0 + dev: false + /global-dirs/0.1.1: resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} engines: {node: '>=4'}