diff --git a/package.json b/package.json index 6ea5896..d13c6a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "2.0.1-beta.15", + "version": "2.0.1-beta.16", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -24,7 +24,6 @@ "fix-path": "^3.0.0", "get-mac-apps": "^1.0.2", "got": "^11.8.3", - "libnpmsearch": "^3.1.2", "lodash.throttle": "^4.1.1", "pouchdb": "^7.2.2", "vue": "^3.0.0", diff --git a/src/core/plugin-handler/index.ts b/src/core/plugin-handler/index.ts index c0db313..2e9c559 100644 --- a/src/core/plugin-handler/index.ts +++ b/src/core/plugin-handler/index.ts @@ -3,7 +3,6 @@ import { AdapterInfo, } from "@/core/plugin-handler/types"; import fs from "fs-extra"; -import search, { Result } from "libnpmsearch"; import path from "path"; import got from "got"; import fixPath from "fix-path"; @@ -90,30 +89,6 @@ class AdapterHandler { await this.execCommand(installCmd, adapters); } - /** - * 从 npm 搜索插件 - * 传入 streamFunc 可以流式处理 - * @param {string} adapter 插件名称 - * @param {(data: Result) => void} [streamFunc] 流式处理钩子 - * @memberof AdapterHandler - */ - async search(adapter: string, streamFunc?: (data: Result) => void) { - return await new Promise((resolve, reject) => { - const result: Result[] = []; - const stream = search.stream(adapter); - stream.on("data", (data: Result) => { - result.push(data); - if (streamFunc !== undefined) streamFunc(data); - }); - stream.on("end", () => { - resolve(result); - }); - stream.on("error", (e: any) => { - reject(e); - }); - }); - } - /** * 更新指定插件 * @param {...string[]} adapters 插件名称 diff --git a/src/renderer/components/result.vue b/src/renderer/components/result.vue index 845c134..b033fc7 100644 --- a/src/renderer/components/result.vue +++ b/src/renderer/components/result.vue @@ -1,6 +1,6 @@