From e3fcbcbd6f2506b94a0f94e1db66eae6cfeac4e4 Mon Sep 17 00:00:00 2001 From: Vitalii Perehonchuk Date: Sat, 11 Mar 2023 07:34:42 +0200 Subject: [PATCH] feat: orphans across all sections --- package.json | 2 +- src/runner/index.ts | 25 +++++++++---------------- yarn.lock | 8 ++++---- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index a0794f9..2752183 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@rollup/plugin-commonjs": "^22.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", - "@webdoky/yari-ports": "^3.1.1", + "@webdoky/yari-ports": "~3.5.0", "acorn-import-assertions": "^1.8.0", "cyrillic-to-translit-js": "^3.2.1", "github-slugger": "^1.4.0", diff --git a/src/runner/index.ts b/src/runner/index.ts index 7d2dd67..44d4c77 100644 --- a/src/runner/index.ts +++ b/src/runner/index.ts @@ -16,14 +16,14 @@ interface LocalRunnerOptions { const trimHash = (url: string) => url.split('#')[0]; -const existingSectionsUrls = [ - '/uk/docs/web/javascript/', - '/uk/docs/web/html/', - '/uk/docs/web/css/', - '/uk/docs/web/svg/', - '/uk/docs/web/guide/', - '/uk/docs/glossary/', -]; +// const existingSectionsUrls = [ +// '/uk/docs/web/javascript/', +// '/uk/docs/web/html/', +// '/uk/docs/web/css/', +// '/uk/docs/web/svg/', +// '/uk/docs/web/guide/', +// '/uk/docs/glossary/', +// ]; export type RunnerOptions = RegistryInitOptions & LocalRunnerOptions; @@ -135,14 +135,7 @@ export default class Runner { ); } - const urlsInScope: Array<[string, number]> = Object.entries( - countsByPage, - ).filter(([url]) => { - const normalizedUrl = url.toLowerCase(); - return existingSectionsUrls.some((urlPrefix) => - normalizedUrl.includes(urlPrefix), - ); - }); + const urlsInScope: Array<[string, number]> = Object.entries(countsByPage); if (urlsInScope.length) { urlsInScope.sort(([_a, countA], [_b, countB]) => countB - countA); diff --git a/yarn.lock b/yarn.lock index e0b4232..834e856 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1118,10 +1118,10 @@ resolved "https://registry.yarnpkg.com/@use-it/interval/-/interval-1.0.0.tgz#c42c68f22ca29a0dc929041746373d94496d2b3a" integrity sha512-WQFcnSt/xM/mS8ZtJ0ut5lhPrl+V0HDPPcI/J0eUClsfiD+/r8A7IeW/pVcfpSVGWRmN3+WnjNteWuKyWs2WZg== -"@webdoky/yari-ports@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@webdoky/yari-ports/-/yari-ports-3.1.1.tgz#dae57e075ef633921ff0401b79c818bab10705a0" - integrity sha512-3rUnsX+JvsBbKcbF8P0DFNGtf5OBFdiq4zWZ4EOdEzU/X28rGBUCFVCVNt7ZcFU7s+I5PGgnaRh68ESQiEB11g== +"@webdoky/yari-ports@~3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@webdoky/yari-ports/-/yari-ports-3.5.0.tgz#20cd26ef6fa46f0f163361c5114c1c74bf386a21" + integrity sha512-XPSaEigu8Dr/V9ZGt32kgzbrovpMQ++c6EZdgOtKweIzYRT5LtPZFMkhwxl8UAJGc7SpiQPfk7c+K7EwCGs3IQ== dependencies: "@mdn/browser-compat-data" "^4.1.2" "@mdn/yari" "^1.7.0"