From 87feb84154df355fffb1e9a6fce59eb6b67df755 Mon Sep 17 00:00:00 2001 From: vxern Date: Mon, 16 Oct 2023 21:01:23 +0100 Subject: [PATCH] misc: Switch to `biome`, add missing exports. --- CHANGELOG.md | 5 + rome.json => biome.json | 7 +- package-lock.json | 373 ++++++++++++++++---------------------- package.json | 27 +-- src/index.ts | 6 +- src/tabs/inflection.ts | 2 +- src/tabs/synthesis.ts | 12 +- src/tabs/synthesis/row.ts | 2 +- 8 files changed, 194 insertions(+), 240 deletions(-) rename rome.json => biome.json (68%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9560449..05fbe57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.1 + +- Switch from `rome` to `biome`. +- Add missing exports. + ## 0.1.0 - Migrated package from Deno to Node. diff --git a/rome.json b/biome.json similarity index 68% rename from rome.json rename to biome.json index 2cf442a..844f9b7 100644 --- a/rome.json +++ b/biome.json @@ -1,11 +1,16 @@ { - "$schema": "https://docs.rome.tools/schemas/12.1.3/schema.json", "linter": { "enabled": true, "rules": { "all": true, "suspicious": { "noEmptyInterface": "off" + }, + "nursery": { + "useImportRestrictions": "off" + }, + "style": { + "useNamingConvention": "off" } } }, diff --git a/package-lock.json b/package-lock.json index 29cffcb..b4091be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,138 +1,162 @@ { "name": "dexonline-scraper", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dexonline-scraper", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "dependencies": { "cheerio": "^1.0.0-rc.12" }, "devDependencies": { - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "chai": "^4.3.7", + "@biomejs/biome": "1.2.2", + "@types/chai": "^4.3.8", + "@types/mocha": "^10.0.2", + "@types/node": "^20.8.6", + "chai": "^4.3.10", "mocha": "^10.2.0", - "rome": "12.1.3", - "ts-node": "^10.9.1", - "typescript": "^5.1.3" + "typescript": "^5.2.2" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "node_modules/@biomejs/biome": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.2.2.tgz", + "integrity": "sha512-fXwXi56ZdaKO/N3rTmhWw41UxstoviODk+wia4WWNSlm23r8xJ/NxjaZ88scV2IsmsFHqc8rmwb2dkrStAdIEw==", "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" }, "engines": { - "node": ">=12" + "node": ">=14.*" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.2.2", + "@biomejs/cli-darwin-x64": "1.2.2", + "@biomejs/cli-linux-arm64": "1.2.2", + "@biomejs/cli-linux-x64": "1.2.2", + "@biomejs/cli-win32-arm64": "1.2.2", + "@biomejs/cli-win32-x64": "1.2.2" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.2.2.tgz", + "integrity": "sha512-Fx1IURKhoqH6wPawtKLT6wcfMSjRRcNK8+VWau0iDOjXvNtjJpSmICbU89B7Vt/gZRwPqkfDMBkFwm6V5vFTSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.2.2.tgz", + "integrity": "sha512-JNaAFOI/ZisnmzvcFNd73geJxaFaN2L4YsWM6cgBeKyLY/ycl9C/PBTFfEmeB1c7f5XIIal8P2cj47kLJpN5Ig==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.0.0" + "node": ">=14.*" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.2.2.tgz", + "integrity": "sha512-JHXRnfhOLx8UO/Fcyn2c5pFRri0XKqRZm2wf5oH5GSfLVpckDw2X15dYGbu3nmfM/3pcAaTV46pUpjrCnaAieg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" } }, - "node_modules/@rometools/cli-win32-x64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3.tgz", - "integrity": "sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==", + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.2.2.tgz", + "integrity": "sha512-5Zr+iM7lUKsw81p9PkXRESuH2/AhRZ6RCWkgE+FSLcxMhXy/4RDR+o2YQDsJM6cWKIzOJM05vDHTGrDq7vXE4A==", "cpu": [ "x64" ], "dev": true, "optional": true, "os": [ - "win32" - ] - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "linux" + ], + "engines": { + "node": ">=14.*" + } }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.2.2.tgz", + "integrity": "sha512-HvUcG2p++RvYP0zfOqh+DgiUUH+JI/uETr0kzWlOJ9F3lsG525pkywg4RSd4OvJd7Wpd3wt3UpN/A4IEJaVmbA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.2.2.tgz", + "integrity": "sha512-bfaFJwqJ9ApFga2o88OaROSd3pasYRzRGXHJWAE9VUUKdSNSTYxHOqVrNvV54yYPtL6Kt9xkuZa4HNu9it3TaA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } }, "node_modules/@types/chai": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", - "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.8.tgz", + "integrity": "sha512-yW/qTM4mRBBcsA9Xw9FbcImYtFPY7sgr+G/O5RDYVmxiy9a+pE5FyoFUi8JYCZY5nicj8atrr1pcfPiYpeNGOA==", "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", - "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.2.tgz", + "integrity": "sha512-NaHL0+0lLNhX6d9rs+NSt97WH/gIlRHmszXbQ/8/MV/eVcFNdeJ/GYhrFuUc8K7WuPhRhTSdMkCp8VMzhUq85w==", "dev": true }, "node_modules/@types/node": { - "version": "20.3.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", - "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", - "dev": true, - "peer": true - }, - "node_modules/acorn": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", - "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "20.8.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz", + "integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==", "dev": true, - "engines": { - "node": ">=0.4.0" + "dependencies": { + "undici-types": "~5.25.1" } }, "node_modules/ansi-colors": { @@ -181,12 +205,6 @@ "node": ">= 8" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -262,18 +280,18 @@ } }, "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" @@ -308,10 +326,13 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -414,12 +435,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -634,6 +649,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -644,9 +673,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -874,20 +903,14 @@ } }, "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "dependencies": { - "get-func-name": "^2.0.0" + "get-func-name": "^2.0.1" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, "node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -1109,27 +1132,6 @@ "node": ">=0.10.0" } }, - "node_modules/rome": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/rome/-/rome-12.1.3.tgz", - "integrity": "sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "rome": "bin/rome" - }, - "engines": { - "node": ">=14.*" - }, - "optionalDependencies": { - "@rometools/cli-darwin-arm64": "12.1.3", - "@rometools/cli-darwin-x64": "12.1.3", - "@rometools/cli-linux-arm64": "12.1.3", - "@rometools/cli-linux-x64": "12.1.3", - "@rometools/cli-win32-arm64": "12.1.3", - "@rometools/cli-win32-x64": "12.1.3" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1224,58 +1226,6 @@ "node": ">=8.0" } }, - "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -1286,9 +1236,9 @@ } }, "node_modules/typescript": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", - "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1298,10 +1248,10 @@ "node": ">=14.17" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", "dev": true }, "node_modules/workerpool": { @@ -1384,15 +1334,6 @@ "node": ">=10" } }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index a6dbfd4..3942c11 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "dexonline-scraper", "description": "A lightweight Dexonline.ro page scraper to fetch information about words in the Romanian language.", "license": "MIT", - "version": "0.1.0", + "version": "0.1.1", "main": "./dist/index.js", "types": "./dist/index.d.ts", "type": "module", @@ -18,9 +18,9 @@ "language", "dictionary" ], - "homepage": "https://github.com/wordcollector/dexonline-scraper", + "homepage": "https://github.com/vxern/dexonline-scraper", "bugs": { - "url": "https://github.com/wordcollector/dexonline-scraper/issues", + "url": "https://github.com/vxern/dexonline-scraper/issues", "email": "contact@wordcollector.co.uk" }, "contributors": [ @@ -32,23 +32,24 @@ ], "repository": { "type": "git", - "url": "https://github.com/wordcollector/dexonline-scraper" + "url": "https://github.com/vxern/dexonline-scraper" }, "scripts": { "build": "tsc", "test": "mocha --no-warnings", + "format": "biome check src/ --apply-unsafe", "publish": "tsc && npm publish" }, - "devDependencies": { - "@types/chai": "^4.3.5", - "@types/mocha": "^10.0.1", - "chai": "^4.3.7", - "mocha": "^10.2.0", - "rome": "12.1.3", - "ts-node": "^10.9.1", - "typescript": "^5.1.3" - }, "dependencies": { "cheerio": "^1.0.0-rc.12" + }, + "devDependencies": { + "@biomejs/biome": "1.2.2", + "@types/chai": "^4.3.8", + "@types/mocha": "^10.0.2", + "@types/node": "^20.8.6", + "chai": "^4.3.10", + "mocha": "^10.2.0", + "typescript": "^5.2.2" } } diff --git a/src/index.ts b/src/index.ts index 3ceb8df..1c06a37 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,8 @@ import * as cheerio from "cheerio"; import Links from "./constants/links.js"; +import { DictionaryFlags, MatchingModes, ParserOptions, SearchOptionsWithWord } from "./options.js"; import * as Inflection from "./tabs/inflection.js"; import * as Synthesis from "./tabs/synthesis.js"; -import { DictionaryFlags, MatchingModes, ParserOptions, SearchOptionsWithWord } from "./options.js"; /** The default search options. */ const defaultSearchOptions: ParserOptions = { @@ -70,5 +70,7 @@ export function parse( return { synthesis, inflection }; } -export { DictionaryFlags, MatchingModes, Synthesis, Links }; +export * from "./tabs/inflection.js"; +export * from "./tabs/synthesis.js"; +export { DictionaryFlags, MatchingModes, Synthesis, Inflection, Links }; export type { ParserOptions }; diff --git a/src/tabs/inflection.ts b/src/tabs/inflection.ts index 3b1a76f..b7a6d04 100644 --- a/src/tabs/inflection.ts +++ b/src/tabs/inflection.ts @@ -1,4 +1,4 @@ -import { CheerioAPI, Cheerio, Element } from "cheerio"; +import { Cheerio, CheerioAPI, Element } from "cheerio"; import Expressions from "../constants/expressions.js"; import Selectors from "../constants/selectors.js"; import { ContentTabs, SearchOptionsWithWord } from "../options.js"; diff --git a/src/tabs/synthesis.ts b/src/tabs/synthesis.ts index 12c7fe6..16840ef 100644 --- a/src/tabs/synthesis.ts +++ b/src/tabs/synthesis.ts @@ -22,7 +22,7 @@ interface Body extends Tree { etymology: Etymology[]; } -type RelationTypes = "synonym" | "antonym" | "diminutive" | "augmentative"; +export type RelationTypes = "synonym" | "antonym" | "diminutive" | "augmentative"; const relationTypeNameToRelationType: Record = { sinonime: "synonym", @@ -31,21 +31,21 @@ const relationTypeNameToRelationType: Record = { augmentative: "augmentative", }; -type Relations = Record<`${RelationTypes}s`, string[]>; +export type Relations = Record<`${RelationTypes}s`, string[]>; -interface Example extends Row.Row {} -interface Definition extends Row.Row { +export interface Example extends Row.Row {} +export interface Definition extends Row.Row { definitions: Definition[]; examples: Example[]; expressions: Expression[]; relations: Relations; } -interface Expression extends Row.Row { +export interface Expression extends Row.Row { examples: Example[]; expressions: Expression[]; relations: Relations; } -interface Etymology extends Row.Row {} +export interface Etymology extends Row.Row {} export function parse($: CheerioAPI, options: SearchOptionsWithWord): Lemma[] { const synthesis = $(Selectors.contentTab(ContentTabs.Synthesis)); diff --git a/src/tabs/synthesis/row.ts b/src/tabs/synthesis/row.ts index d95f2e7..cd990dc 100644 --- a/src/tabs/synthesis/row.ts +++ b/src/tabs/synthesis/row.ts @@ -1,4 +1,4 @@ -import { CheerioAPI, Cheerio, Element } from "cheerio"; +import { Cheerio, CheerioAPI, Element } from "cheerio"; import copyrightedDictionaries from "../../constants/copyright.js"; import Selectors from "../../constants/selectors.js"; import { ParserOptions } from "../../options.js";