diff --git a/package.json b/package.json index 77435b6..c27d061 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "koishi-plugin-market-info", "description": "Koishi plugin market information", - "version": "1.1.4", + "version": "1.1.5", "main": "lib/index.js", "typings": "lib/index.d.ts", "files": [ @@ -43,10 +43,10 @@ "koishi": "^4.10.5" }, "devDependencies": { - "@koishijs/registry": "^4.4.5", - "@types/node": "^18.11.18", + "@koishijs/registry": "^4.6.0", + "@types/node": "^18.15.5", "atsc": "^1.2.2", - "koishi": "^4.11.3", - "typescript": "^4.9.4" + "koishi": "^4.12.1", + "typescript": "^4.9.5" } } diff --git a/src/index.ts b/src/index.tsx similarity index 94% rename from src/index.ts rename to src/index.tsx index 819d9d7..ec20216 100644 --- a/src/index.ts +++ b/src/index.tsx @@ -59,7 +59,8 @@ export function apply(ctx: Context, config: Config) { ctx.command('market') .action(async ({ session }) => { - return session.text('.overview', [Object.keys(previous).length]) + const objects = Object.values(previous).filter(data => !data.manifest.hidden) + return session.text('.overview', [objects.length]) }) ctx.setInterval(async () => { @@ -70,7 +71,7 @@ export function apply(ctx: Context, config: Config) { if (version1 === version2) return if (!version1) { - let output = `新增:${name}` + let output =

if (config.showPublisher) output += ` (@${current[name].publisher.username})` if (config.showDescription) { const { description } = current[name].manifest diff --git a/src/locales/zh-CN.yml b/src/locales/zh-CN.yml index 3b9f4fc..950d23f 100644 --- a/src/locales/zh-CN.yml +++ b/src/locales/zh-CN.yml @@ -4,3 +4,9 @@ commands: messages: overview: 当前共有 {0} 个插件。 + +market-info: + header: '[插件市场更新]' + created: 新增:{0} + updated: 更新:{0} ({1} → {2})` + deleted: 移除:{0} diff --git a/tsconfig.json b/tsconfig.json index 8d1fad2..2cafbb7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,9 @@ "incremental": true, "skipLibCheck": true, "esModuleInterop": true, - "moduleResolution": "node" + "moduleResolution": "node", + "jsx": "react-jsx", + "jsxImportSource": "@satorijs/element", }, "include": [ "src"