diff --git a/docs/package.json b/docs/package.json index a24b692f..ba34d259 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "docs", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "private": true, "scripts": { "docs:dev": "vitepress dev", diff --git a/package.json b/package.json index f2dad646..a1ee3117 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "any-reader", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "private": true, "packageManager": "pnpm@9.4.0", "description": "", diff --git a/packages/cli/package.json b/packages/cli/package.json index 1b136d69..2d526bee 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/cli", "type": "commonjs", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3", diff --git a/packages/cli/src/command/check.ts b/packages/cli/src/command/check.ts index 06394cb3..e5fc5005 100644 --- a/packages/cli/src/command/check.ts +++ b/packages/cli/src/command/check.ts @@ -38,24 +38,25 @@ async function checkRules(options: CheckOptions) { const limit = pLimit(+options.concurrency); const rows: Rule[] = JSON.parse(fs.readFileSync(input, 'utf-8')); - const progressBar = new SingleBar({}); + const progressBar = new SingleBar({ + format: '[检查规则] [{bar}] {percentage}% | {value}/{total}' + }); progressBar.start(rows.length, 0); const validRules: Rule[] = []; await Promise.all( rows.map((row) => limit(() => - timeoutWith( - ping(row.host) - .then((ping: number) => { - if (ping && ping !== -1) { - validRules.push(row); - } - }) - .catch(() => {}) - ).finally(() => { - progressBar.increment(); - }) + timeoutWith(ping(row.host)) + .then((ping: number) => { + if (ping && ping !== -1) { + validRules.push(row); + } + }) + .catch(() => {}) + .finally(() => { + progressBar.increment(); + }) ) ) ) diff --git a/packages/cli/src/utils/promise.ts b/packages/cli/src/utils/promise.ts index 614a5c81..00cf1eab 100644 --- a/packages/cli/src/utils/promise.ts +++ b/packages/cli/src/utils/promise.ts @@ -1,8 +1,4 @@ export function timeoutWith(tasks: any, t = 6000) { - const delay = () => - new Promise((_, reject) => { - setTimeout(reject, t); - }); - - return Promise.race([tasks, delay()]); + const delay = new Promise((_, reject) => setTimeout(reject, t)); + return Promise.race([tasks, delay]); } diff --git a/packages/core/package.json b/packages/core/package.json index 373726e6..487dcd0e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/core", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3", diff --git a/packages/epub/package.json b/packages/epub/package.json index a46c625c..71c0bb7f 100644 --- a/packages/epub/package.json +++ b/packages/epub/package.json @@ -1,6 +1,6 @@ { "name": "@any-reader/epub", - "version": "1.10.4", + "version": "1.10.5", "description": "", "scripts": { "build": "unbuild", diff --git a/packages/legado/package.json b/packages/legado/package.json index 1c0ea89b..3ba246d9 100644 --- a/packages/legado/package.json +++ b/packages/legado/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/legado", "type": "module", - "version": "1.9.7", + "version": "1.10.5", "private": true, "description": "", "author": "aooiuu ", diff --git a/packages/rubick/package.json b/packages/rubick/package.json index 2fd26627..5dbff500 100644 --- a/packages/rubick/package.json +++ b/packages/rubick/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/rubick", "type": "commonjs", - "version": "1.10.4", + "version": "1.10.5", "private": true, "description": "", "author": "aooiuu ", diff --git a/packages/rule-utils/package.json b/packages/rule-utils/package.json index 0d9d9214..2a05cdf9 100644 --- a/packages/rule-utils/package.json +++ b/packages/rule-utils/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/rule-utils", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3", diff --git a/packages/server/package.json b/packages/server/package.json index 69b1b569..d7eb3f9c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/server", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 3cf344d7..0213e7ed 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,7 +1,7 @@ { "name": "@any-reader/shared", "type": "module", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3", diff --git a/packages/utools/package.json b/packages/utools/package.json index e228b6b1..d03aa156 100644 --- a/packages/utools/package.json +++ b/packages/utools/package.json @@ -1,6 +1,6 @@ { "name": "@any-reader/utools", - "version": "1.10.4", + "version": "1.10.5", "private": true, "description": "", "author": "aooiuu ", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index a3ff9c4b..46a938a5 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -3,7 +3,7 @@ "displayName": "any-reader", "description": "摸鱼,自定义规则多站点聚合搜索阅读小说、漫画。包含JS规则解析库和VSCode插件。支持本地小说 TXT、EPUB", "icon": "resources/icon.png", - "version": "1.10.4", + "version": "1.10.5", "publisher": "aooiu", "private": true, "qna": "https://github.com/aooiuu/any-reader/issues", diff --git a/packages/web/package.json b/packages/web/package.json index f9e921e5..c55a41d6 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@any-reader/web", - "version": "1.10.4", + "version": "1.10.5", "description": "", "author": "aooiuu ", "license": "GPL3",