diff --git a/.github/workflows/nodejs-test.yml b/.github/workflows/nodejs-test.yml index e5c2f957..2d325104 100644 --- a/.github/workflows/nodejs-test.yml +++ b/.github/workflows/nodejs-test.yml @@ -9,10 +9,9 @@ on: env: CI: true FORCE_COLOR: 2 - NODE_COV: lts/* # The Node.js version to run coveralls on permissions: - contents: read # to fetch code (actions/checkout) + contents: read jobs: lint: @@ -27,10 +26,6 @@ jobs: - run: npm run lint test: - permissions: - contents: read # to fetch code (actions/checkout) - checks: write # to create new checks (coverallsapp/github-action) - name: Node ${{ matrix.node }} runs-on: ubuntu-latest @@ -38,9 +33,9 @@ jobs: fail-fast: false matrix: node: - - 18 - 20 - 22 + - 24 - lts/* steps: @@ -52,18 +47,4 @@ jobs: cache: npm - run: npm ci - run: npm run build --if-present - - - name: Run Jest - run: npm run test:vi - if: matrix.node != env.NODE_COV - - - name: Run Jest with coverage - run: npm run test:vi -- --coverage - if: matrix.node == env.NODE_COV - - - name: Run Coveralls - uses: coverallsapp/github-action@v2.3.7 - if: matrix.node == env.NODE_COV - continue-on-error: true - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: npm run test:vi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..fe4702dc --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,50 @@ +name: Publish +on: + push: + tags: + - "v*" + +jobs: + publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: lts/* + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm ci + + - name: Create jsr.json based on package.json + run: | + node --input-type=module -e ' + import { readFileSync, writeFileSync } from "fs"; + const p = JSON.parse(readFileSync("./package.json", "utf8")); + const jsrJson = { + name: `@cheerio/${p.name}`, + version: p.version, + exports: { ".": "./src/index.ts" }, + imports: { + "boolbase": `jsr:@cheerio/boolbase@${p.dependencies.boolbase}`, + "css-what": `jsr:@cheerio/css-what@${p.dependencies["css-what"]}`, + "domhandler": `jsr:@cheerio/domhandler@${p.dependencies.domhandler}`, + "domutils": `jsr:@cheerio/domutils@${p.dependencies.domutils}`, + "nth-check": `jsr:@cheerio/nth-check@${p.dependencies["nth-check"]}`, + }, + }; + writeFileSync("./jsr.json", JSON.stringify(jsrJson, null, 2)); + ' + + - name: Publish package to JSR + run: npx jsr publish + + - name: Publish package to npm + run: npm publish --provenance --access public diff --git a/.gitignore b/.gitignore index e5ab5f9d..6f3539e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ .vscode/ node_modules/ coverage/ -lib/ dist/ -.tshy/ -.tshy-build/ \ No newline at end of file +jsr.json diff --git a/biome.json b/biome.json index 0e29de43..64e97f40 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.4.5/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.7/schema.json", "vcs": { "enabled": true, "clientKind": "git", diff --git a/package-lock.json b/package-lock.json index da0af4b4..231cd80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,29 +9,30 @@ "version": "6.0.0", "license": "BSD-2-Clause", "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^7.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "nth-check": "^2.1.1" + "boolbase": "^2.0.0", + "css-what": "^8.0.0", + "domhandler": "^6.0.0", + "domutils": "^4.0.0", + "nth-check": "^3.0.0" }, "devDependencies": { "@biomejs/biome": "^2.4.6", "@eslint/compat": "^2.0.3", "@feedic/eslint-config": "^0.2.3", - "@types/boolbase": "^1.0.3", "@types/node": "^25.5.0", - "@vitest/coverage-v8": "^4.0.18", "eslint": "^10.0.3", "eslint-config-biome": "^2.1.3", "globals": "^17.3.0", "htmlparser2": "^10.1.0", - "tshy": "^3.3.2", "typescript": "^5.9.3", "typescript-eslint": "^8.57.0", "vitest": "^4.0.18" }, + "engines": { + "node": ">=20.19.0" + }, "funding": { + "type": "github", "url": "https://github.com/sponsors/fb55" } }, @@ -42,16 +43,6 @@ "dev": true, "license": "ISC" }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-validator-identifier": { "version": "7.28.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", @@ -62,46 +53,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/parser": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", - "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.29.0" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", - "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/@biomejs/biome": { "version": "2.4.7", "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.4.7.tgz", @@ -566,16 +517,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -583,17 +524,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", @@ -942,13 +872,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@types/boolbase": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/boolbase/-/boolbase-1.0.3.tgz", - "integrity": "sha512-82A4AP0cokcm2I9YO1a0TudbJkE6SUjfJjQhxiHer5ZYOzD82YBHCK9ORvKYf4hrYf5479/CUpT2RcspAwJ7OQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -1228,154 +1151,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript/native-preview": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-x+ZrFAEq+c7bF4Ml8+abYZ9vW6mzu22fmcPbDcBmUl/4uGFCYXXww0FS3+me9MfdSOCAPtqcZtwApx1RQO2X/w==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsgo": "bin/tsgo.js" - }, - "optionalDependencies": { - "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260313.1", - "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260313.1", - "@typescript/native-preview-linux-arm": "7.0.0-dev.20260313.1", - "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260313.1", - "@typescript/native-preview-linux-x64": "7.0.0-dev.20260313.1", - "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260313.1", - "@typescript/native-preview-win32-x64": "7.0.0-dev.20260313.1" - } - }, - "node_modules/@typescript/native-preview-darwin-arm64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-/fU2IvlRQWOy63xSzkejW7tTQpsL5dQ/ATIsJFlK75vS941CnNJY8dAx3iQYLkHMhS45hhCIR+bbJPRaacq/fw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@typescript/native-preview-darwin-x64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-oy7Ew1J3+YtO9QsqVGkncQ8bCwVPxNk8nSO2q1sHLccyYq0f4eDaZTlJ+u9Ynry548NwNucLh9wE+DWfWhzU3Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@typescript/native-preview-linux-arm": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-IAx0ajfEiL1tJg1N6+/nHXJKebNe72yanY2N5bicwIB3t2BmydnrEPG+/OFVqc+prfJngxSx/61mvkXScZePzg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@typescript/native-preview-linux-arm64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-KkbAweTnBpmQ8wCGHjrLzPX+FuwhSrVERNqyGPaq/267Sxt0UwbIO3rZduXlq5UUln1+/z7uT/BNJiuoFW3iLw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@typescript/native-preview-linux-x64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-9LCNgXVNoArHlMuL6yFKJxSdshiiadTfW/pU4tz4Vbg+Dg9La1VE9mLlBdijy5ZIg4nsOFpR8JTDURcA1RoHXw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@typescript/native-preview-win32-arm64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-cP2y5hb2xhfEDIgxdhxhPXa/D5Lq3yj6zxVuhh9ZkUariF+ZAmF4pySlIA+7NdprgTQqvNY5Mp70cPUiYD3yUg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@typescript/native-preview-win32-x64": { - "version": "7.0.0-dev.20260313.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260313.1.tgz", - "integrity": "sha512-8KDfi7U1enFo4z6F0qe4Rd5QzBhk+4cwpZtOGAT9lgyR4pF/mo8zQd0t+Hlkj6d87W057RP8lgCGTGfclGWxUg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@vitest/coverage-v8": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.0.tgz", - "integrity": "sha512-nDWulKeik2bL2Va/Wl4x7DLuTKAXa906iRFooIRPR+huHkcvp9QDkPQ2RJdmjOFrqOqvNfoSQLF68deE3xC3CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.1.0", - "ast-v8-to-istanbul": "^1.0.0", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.2.0", - "magicast": "^0.5.2", - "obug": "^2.1.1", - "std-env": "^4.0.0-rc.1", - "tinyrainbow": "^3.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@vitest/browser": "4.1.0", - "vitest": "4.1.0" - }, - "peerDependenciesMeta": { - "@vitest/browser": { - "optional": true - } - } - }, "node_modules/@vitest/expect": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.0.tgz", @@ -1549,18 +1324,6 @@ "node": ">=12" } }, - "node_modules/ast-v8-to-istanbul": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.0.tgz", - "integrity": "sha512-1fSfIwuDICFA4LKkCzRPO7F0hzFf0B7+Xqrl27ynQaa+Rh0e1Es0v6kWHPott3lU10AyAr7oKHa65OppjLn3Rg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.31", - "estree-walker": "^3.0.3", - "js-tokens": "^10.0.0" - } - }, "node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", @@ -1585,10 +1348,17 @@ } }, "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "license": "ISC" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-2.0.0.tgz", + "integrity": "sha512-DkVaaQHymRhpYEYo9x1oo7Q7B0Y6KJUsjm3c9eTyFDby4MHLBTwZ6ZDWBel5zrYxj1WsZgC5oLpiz+93MluXeA==", + "license": "ISC", + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } }, "node_modules/brace-expansion": { "version": "5.0.4", @@ -1681,19 +1451,6 @@ "node": ">=18" } }, - "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/change-case": { "version": "5.4.4", "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", @@ -1701,22 +1458,6 @@ "dev": true, "license": "MIT" }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/ci-info": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", @@ -1803,14 +1544,15 @@ } }, "node_modules/css-what": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-7.0.0.tgz", - "integrity": "sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-8.0.0.tgz", + "integrity": "sha512-DH0Bqq3DNp5tdOReuNyAA+Ev4Y2GS5FMbZpeTLP6C4CDi0h5nL0BmUPChXw3o/qbHLDWHl49sbNqQVY7bMSDdw==", "license": "BSD-2-Clause", "engines": { - "node": ">= 6" + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/sponsors/fb55" } }, @@ -1876,23 +1618,43 @@ } }, "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-3.0.0.tgz", + "integrity": "sha512-x+9D6nkC8tdXOQUS32egtZpZFLP90+HBZmWjuT920srbJvD/zPgFB9t4k3pEhlw5BQrXStQtRc1Y1zuriXk+Nw==", "license": "MIT", "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" + "domelementtype": "^3.0.0", + "domhandler": "^6.0.0", + "entities": "^8.0.0" + }, + "engines": { + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, + "node_modules/dom-serializer/node_modules/domelementtype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz", + "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/domelementtype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, "funding": [ { "type": "github", @@ -1902,34 +1664,69 @@ "license": "BSD-2-Clause" }, "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz", + "integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==", "license": "BSD-2-Clause", "dependencies": { - "domelementtype": "^2.3.0" + "domelementtype": "^3.0.0" }, "engines": { - "node": ">= 4" + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/fb55/domhandler?sponsor=1" } }, + "node_modules/domhandler/node_modules/domelementtype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz", + "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/domutils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", - "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.1.tgz", + "integrity": "sha512-Dq1dfoiOCquRSO1LwRF4BPLmO+kFA9VU4VlaHbKHZp29cD6wZy0bdpdpOKltgUpgLx8rxZ47sbnnEdRyB3k1lg==", "license": "BSD-2-Clause", "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" + "dom-serializer": "^3.0.0", + "domelementtype": "^3.0.0", + "domhandler": "^6.0.0" + }, + "engines": { + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/domutils/node_modules/domelementtype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz", + "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause", + "engines": { + "node": ">=20.19.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.313", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.313.tgz", @@ -1952,12 +1749,12 @@ } }, "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-8.0.0.tgz", + "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==", "license": "BSD-2-Clause", "engines": { - "node": ">=0.12" + "node": ">=20.19.0" }, "funding": { "url": "https://github.com/fb55/entities?sponsor=1" @@ -2474,26 +2271,10 @@ "dev": true, "license": "ISC" }, - "node_modules/foreground-child": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-4.0.3.tgz", - "integrity": "sha512-yeXZaNbCBGaT9giTpLPBdtedzjwhlJBUoL/R4BVQU5mn0TQXOHwVIl1Q2DMuBIdNno4ktA1abZ7dQFVxD6uHxw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "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, "license": "MIT", @@ -2528,24 +2309,6 @@ "url": "https://github.com/fisker/git-hooks-list?sponsor=1" } }, - "node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "minimatch": "^10.2.2", - "minipass": "^7.1.3", - "path-scurry": "^2.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -2586,16 +2349,6 @@ "dev": true, "license": "ISC" }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/html-entities": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", @@ -2613,13 +2366,6 @@ ], "license": "MIT" }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" - }, "node_modules/htmlparser2": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz", @@ -2640,6 +2386,65 @@ "entities": "^7.0.1" } }, + "node_modules/htmlparser2/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/htmlparser2/node_modules/dom-serializer/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/htmlparser2/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/htmlparser2/node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/htmlparser2/node_modules/entities": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", @@ -2745,52 +2550,6 @@ "dev": true, "license": "ISC" }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-reports": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", - "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", - "dev": true, - "license": "MIT" - }, "node_modules/jsdoc-type-pratt-parser": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-7.1.1.tgz", @@ -2854,15 +2613,6 @@ "url": "https://github.com/sponsors/ota-meshi" } }, - "node_modules/jsonc-simple-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/jsonc-simple-parser/-/jsonc-simple-parser-3.0.0.tgz", - "integrity": "sha512-0qi9Kuj4JPar4/3b9wZteuPZrTeFzXsQyOZj7hksnReCZN3Vr17Doz7w/i3E9XH7vRkVTHhHES+r1h97I+hfww==", - "dev": true, - "dependencies": { - "reghex": "^3.0.2" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -3176,16 +2926,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache": { - "version": "11.2.7", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", - "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -3196,34 +2936,6 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/magicast": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.2.tgz", - "integrity": "sha512-E3ZJh4J3S9KfwdjZhe2afj6R9lGIN5Pher1pF39UGrXRqq/VDaGVIGN13BjHd2u8B61hArAGOnso7nBOouW3TQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.0", - "@babel/types": "^7.29.0", - "source-map-js": "^1.2.1" - } - }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/minimatch": { "version": "10.2.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", @@ -3240,32 +2952,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mkdirp": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", - "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3307,14 +2993,18 @@ "license": "MIT" }, "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-3.0.1.tgz", + "integrity": "sha512-GX0gsdbGVCgnRgbeGaubfjpBXyYRWOOCVeYh08bSQvDZqxz5ndXs1OTfAt/h36G1xvI94YIspsI0sVFqAV9+RQ==", "license": "BSD-2-Clause", "dependencies": { - "boolbase": "^1.0.0" + "boolbase": "^2.0.0" + }, + "engines": { + "node": ">=20.19.0" }, "funding": { + "type": "github", "url": "https://github.com/fb55/nth-check?sponsor=1" } }, @@ -3386,13 +3076,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, "node_modules/package-json-validator": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/package-json-validator/-/package-json-validator-1.3.1.tgz", @@ -3445,23 +3128,6 @@ "node": ">=8" } }, - "node_modules/path-scurry": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -3499,19 +3165,6 @@ "node": ">=4" } }, - "node_modules/polite-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/polite-json/-/polite-json-5.0.0.tgz", - "integrity": "sha512-OLS/0XeUAcE8a2fdwemNja+udKgXNnY6yKVIXqAD2zVRx1KvY6Ato/rZ2vdzbxqYwPW0u6SCNC/bAMPNzpzxbw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/postcss": { "version": "8.5.8", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", @@ -3561,20 +3214,6 @@ "node": ">=6" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/regexp-tree": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", @@ -3585,13 +3224,6 @@ "regexp-tree": "bin/regexp-tree" } }, - "node_modules/reghex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/reghex/-/reghex-3.0.2.tgz", - "integrity": "sha512-Zb9DJ5u6GhgqRSBnxV2QSnLqEwcKxHWFA1N2yUa4ZUAO1P8jlWKYtWZ6/ooV6yylspGXJX0O/uNzEv0xrCtwaA==", - "dev": true, - "license": "MIT" - }, "node_modules/regjsparser": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.0.tgz", @@ -3618,23 +3250,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/resolve-import": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/resolve-import/-/resolve-import-2.4.0.tgz", - "integrity": "sha512-gLWKdA5tiv5j/D7ipR47u3ovbVfzFPrctTdw2Ulnpmr6PPVVSvPKGNWu09jXVNlOSLLAeD6CA13bjIelpWttSw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "glob": "^13.0.0", - "walk-up-path": "^4.0.0" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -3645,26 +3260,6 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/rimraf": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", - "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "glob": "^13.0.3", - "package-json-from-dist": "^1.0.1" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/rolldown": { "version": "1.0.0-rc.9", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.9.tgz", @@ -3742,19 +3337,6 @@ "dev": true, "license": "ISC" }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/sort-object-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-2.1.0.tgz", @@ -3868,41 +3450,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/sync-content": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/sync-content/-/sync-content-2.0.4.tgz", - "integrity": "sha512-w3ioiBmbaogob33WdLnuwFk+8tpePI58CTWKqtdAgEqc2hfGuSwP02gPETqNX/3PLS5skv5a1wQR0gbaa2W0XQ==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "glob": "^13.0.1", - "mkdirp": "^3.0.1", - "path-scurry": "^2.0.0", - "rimraf": "^6.0.0" - }, - "bin": { - "sync-content": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", @@ -4014,34 +3561,6 @@ "typescript": ">=4.0.0" } }, - "node_modules/tshy": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/tshy/-/tshy-3.3.2.tgz", - "integrity": "sha512-vOIXkqMtBWNjKUR/c99+6N50LhWdnKG1xE3+5wf8IPdzxx2lcIFPvbGgFdBBgoTMbdNb8mz06MUm7hY+TFnJcw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@typescript/native-preview": "^7.0.0-dev.20260218.1", - "chalk": "^5.6.2", - "chokidar": "^4.0.3", - "foreground-child": "^4.0.0", - "jsonc-simple-parser": "^3.0.0", - "minimatch": "^10.0.3", - "mkdirp": "^3.0.1", - "polite-json": "^5.0.0", - "resolve-import": "^2.4.0", - "rimraf": "^6.1.2", - "sync-content": "^2.0.3", - "typescript": "^5.9.3", - "walk-up-path": "^4.0.0" - }, - "bin": { - "tshy": "dist/esm/bin-min.mjs" - }, - "engines": { - "node": "20 || >=22" - } - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4342,16 +3861,6 @@ } } }, - "node_modules/walk-up-path": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", - "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index b69c01f9..b93df6af 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "a CSS selector compiler/engine", "author": "Felix Boehm ", "funding": { + "type": "github", "url": "https://github.com/sponsors/fb55" }, "keywords": [ @@ -16,51 +17,42 @@ "url": "git://github.com/fb55/css-select.git" }, "sideEffects": false, - "main": "./dist/commonjs/index.js", - "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - }, - "./package.json": "./package.json" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } }, "files": [ "dist", - "src" + "src", + "!**/*.spec.ts" ], "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^7.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.2.2", - "nth-check": "^2.1.1" + "boolbase": "^2.0.0", + "css-what": "^8.0.0", + "domhandler": "^6.0.0", + "domutils": "^4.0.0", + "nth-check": "^3.0.0" }, "devDependencies": { "@biomejs/biome": "^2.4.6", "@eslint/compat": "^2.0.3", "@feedic/eslint-config": "^0.2.3", - "@types/boolbase": "^1.0.3", "@types/node": "^25.5.0", - "@vitest/coverage-v8": "^4.0.18", "eslint": "^10.0.3", "eslint-config-biome": "^2.1.3", "globals": "^17.3.0", "htmlparser2": "^10.1.0", - "tshy": "^3.3.2", "typescript": "^5.9.3", "typescript-eslint": "^8.57.0", "vitest": "^4.0.18" }, "scripts": { - "build": "tshy", + "build": "tsc", "format": "npm run format:es && npm run format:biome", "format:biome": "biome check --write .", "format:es": "npm run lint:es -- --fix", @@ -69,22 +61,11 @@ "lint:es": "eslint .", "lint:tsc": "tsc --noEmit", "prepublishOnly": "npm run build", - "test": "vitest run && npm run lint", + "test": "npm run test:vi && npm run lint", "test:vi": "vitest run" }, "license": "BSD-2-Clause", - "tshy": { - "exclude": [ - "**/*.spec.ts", - "**/__fixtures__/*", - "**/__tests__/*", - "**/__snapshots__/*", - "test" - ], - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - } - }, - "type": "module" + "engines": { + "node": ">=20.19.0" + } } diff --git a/src/helpers/cache.spec.ts b/src/helpers/cache.spec.ts index c0d68a90..2e7d2936 100644 --- a/src/helpers/cache.spec.ts +++ b/src/helpers/cache.spec.ts @@ -1,5 +1,5 @@ import * as boolbase from "boolbase"; -import type { Element, Node } from "domhandler"; +import { type Element, isTag, type Node } from "domhandler"; import * as DomUtils from "domutils"; import { parseDocument } from "htmlparser2"; import { describe, expect, it, vi } from "vitest"; @@ -8,7 +8,7 @@ import type { InternalOptions } from "../types.js"; import { cacheParentResults } from "./cache.js"; const cacheParentResultsOptions = { - adapter: DomUtils, + adapter: { ...DomUtils, isTag }, } as unknown as InternalOptions; describe("cacheParentResults", () => { diff --git a/src/index.ts b/src/index.ts index 299a4ef0..1c90114b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ import type { Element as DomHandlerElement, AnyNode as DomHandlerNode, } from "domhandler"; +import { isTag } from "domhandler"; import * as DomUtils from "domutils"; import { compileToken } from "./compile.js"; import { findAll, findOne, getNextSiblings } from "./helpers/querying.js"; @@ -18,7 +19,7 @@ import type { const defaultEquals = (a: Node, b: Node) => a === b; const defaultOptions: InternalOptions = { - adapter: DomUtils, + adapter: { ...DomUtils, isTag }, equals: defaultEquals, }; @@ -31,7 +32,7 @@ function convertOptionFormats( // @ts-expect-error Default options may have incompatible `Node` / `ElementNode`. const finalOptions: Options = options ?? defaultOptions; // @ts-expect-error Same as above. - finalOptions.adapter ??= DomUtils; + finalOptions.adapter ??= defaultOptions.adapter; // @ts-expect-error `equals` does not exist on `Options` finalOptions.equals ??= finalOptions.adapter?.equals ?? defaultEquals; @@ -70,26 +71,9 @@ export function _compileUnsafe( selector: string | Selector[][], options?: Options, context?: Node[] | Node, -): CompiledQuery { - return _compileToken( - typeof selector === "string" ? parse(selector) : selector, - options, - context, - ); -} -/** - * @param selector Selector used to match elements. - * @param options Options that control this operation. - * @param context Context nodes used to scope selector matching. - * @deprecated Use `_compileUnsafe` instead. - */ -export function _compileToken( - selector: Selector[][], - options?: Options, - context?: Node[] | Node, ): CompiledQuery { return compileToken( - selector, + typeof selector === "string" ? parse(selector) : selector, convertOptionFormats(options), context, ); @@ -239,8 +223,4 @@ export function is( */ export default selectAll; -// Export filters, pseudos and aliases to allow users to supply their own. -/** @deprecated Use the `pseudos` option instead. */ -export { aliases, filters, pseudos } from "./pseudo-selectors/index.js"; - export type { Options } from "./types.js"; diff --git a/test/api.ts b/test/api.ts index db4550ad..97884377 100644 --- a/test/api.ts +++ b/test/api.ts @@ -1,16 +1,17 @@ import * as boolbase from "boolbase"; import { AttributeAction, SelectorType } from "css-what"; -import type { AnyNode, Element } from "domhandler"; +import { type AnyNode, type Element, isTag } from "domhandler"; import * as DomUtils from "domutils"; -import { parseDOM, parseDocument } from "htmlparser2"; +import { parseDocument } from "htmlparser2"; import { describe, expect, it, vi } from "vitest"; import * as CSSselect from "../src/index.js"; import type { Adapter } from "../src/types.js"; -const [dom] = parseDOM("

foo

") as Element[]; -const [xmlDom] = parseDOM("

foo

", { +const [dom] = parseDocument("

foo

") + .children as Element[]; +const [xmlDom] = parseDocument("

foo

", { xmlMode: true, -}) as Element[]; +}).children as Element[]; const notYet = "not yet supported by css-select"; @@ -67,9 +68,9 @@ describe("API", () => { expect(CSSselect.selectAll("p", ps)).toStrictEqual(ps); }); it("should support pseudos led by a traversal (#111)", () => { - const [dom] = parseDOM( + const [dom] = parseDocument( '
a
b
', - ) as Element[]; + ).children as Element[]; const a = CSSselect.selectAll(".foo:has(+.bar)", dom); expect(a).toHaveLength(1); expect(a[0]).toStrictEqual(dom.children[0]); @@ -175,17 +176,6 @@ describe("API", () => { ); }); - it("should throw if no parameter is supplied for pseudo", () => { - CSSselect.pseudos["foovalue"] = (element, { adapter }, subselect) => - adapter.getAttributeValue(element, "foo") === subselect; - - expect(() => CSSselect.compile(":foovalue")).toThrow( - "requires an argument", - ); - - delete CSSselect.pseudos["foovalue"]; - }); - it("should throw if parameter is supplied for user-provided pseudo", () => expect(() => CSSselect.compile(":foovalue(boo)", { @@ -229,7 +219,7 @@ describe("API", () => { const matches2 = CSSselect.selectAll( "p:has(+ *)", - parseDOM("

"), + parseDocument("

"), ); expect(matches2).toHaveLength(1); expect(matches2[0]).toHaveProperty("tagName", "p"); @@ -301,7 +291,8 @@ describe("API", () => { expect(matches).toHaveLength(1); expect(matches[0].name).toBe("div"); - const [multiLevelDom] = parseDOM("") as Element[]; + const [multiLevelDom] = parseDocument("") + .children as Element[]; matches = CSSselect.selectAll(":is(* c)", multiLevelDom); expect(matches).toHaveLength(1); expect(matches[0].name).toBe("c"); @@ -391,7 +382,8 @@ describe("API", () => { }); it("should not crash when siblings repeat", () => { - const dom = parseDOM("

".repeat(51)) as Element[]; + const dom = parseDocument("
".repeat(51)) + .children as Element[]; expect( CSSselect.selectAll("+div", dom, { context: dom }), @@ -399,9 +391,8 @@ describe("API", () => { }); it("should cache results by default", () => { - const [dom] = parseDOM( - '

bar

', - ) as Element[]; + const [dom] = parseDocument('

bar

') + .children as Element[]; const selector = ":has(#bar) p"; const query = CSSselect.compile(selector); @@ -414,9 +405,8 @@ describe("API", () => { }); it("should skip cacheing results if asked to", () => { - const [dom] = parseDOM( - '

bar

', - ) as Element[]; + const [dom] = parseDocument('

bar

') + .children as Element[]; const query = CSSselect.compile("#bar p", { cacheResults: false }); expect(CSSselect.selectAll(query, [dom])).toHaveLength(0); @@ -439,12 +429,11 @@ describe("API", () => { describe("optional adapter methods", () => { it("should support prevElementSibling", () => { - const adapter: Adapter = { ...DomUtils }; + const adapter: Adapter = { ...DomUtils, isTag }; delete adapter.prevElementSibling; - const dom = parseDOM( - `${"

foo".repeat(10)}

bar
`, - ) as Element[]; + const dom = parseDocument(`${"

foo".repeat(10)}

bar
`) + .children as Element[]; expect( CSSselect.selectAll("p + div", dom, { adapter }), @@ -452,10 +441,12 @@ describe("API", () => { }); it("should support isHovered", () => { - const dom = parseDOM(`${"

foo".repeat(10)}`) as Element[]; + const dom = parseDocument(`${"

foo".repeat(10)}`) + .children as Element[]; const adapter = { ...DomUtils, + isTag, isHovered: (element: Element) => element === dom[dom.length - 1], }; @@ -466,7 +457,7 @@ describe("API", () => { }); it("should not match any elements if `isHovered` is not defined", () => { - const dom = parseDOM(`${"

foo".repeat(10)}`); + const dom = parseDocument(`${"

foo".repeat(10)}`); expect(CSSselect.selectAll("p:hover", dom)).toHaveLength(0); }); }); diff --git a/test/qwery.ts b/test/qwery.ts index 75eba1c2..a2b13c74 100644 --- a/test/qwery.ts +++ b/test/qwery.ts @@ -2,9 +2,9 @@ import * as helper from "./tools/helper.js"; const document = helper.getDocument("qwery.html"); -import type { AnyNode, Element } from "domhandler"; +import { type AnyNode, type Element, isTag } from "domhandler"; import * as DomUtils from "domutils"; -import { parseDOM } from "htmlparser2"; +import { parseDocument } from "htmlparser2"; import { describe, expect, it } from "vitest"; import * as CSSselect from "../src/index.js"; @@ -28,16 +28,16 @@ function selectAll(selector: string, context: AnyNode | AnyNode[] = document) { * Adapted from https://github.com/ded/qwery/blob/master/tests/tests.js */ -const frag = parseDOM( +const frag = parseDocument( '

' + '

' + "
" + '

' + '

' + "

", -); +).children; -const testDocument = parseDOM( +const testDocument = parseDocument( '
' + '
' + '

' + @@ -47,13 +47,11 @@ const testDocument = parseDOM( '

' + "
" + '
', -); +).children; const element = document.getElementById("attr-child-boosh"); -const pseudos = document - .getElementById("pseudos") - .children.filter(DomUtils.isTag); +const pseudos = document.getElementById("pseudos").children.filter(isTag); describe("qwery", () => { describe("Contexts", () => { diff --git a/test/tools/helper.ts b/test/tools/helper.ts index c01946dd..4328e649 100644 --- a/test/tools/helper.ts +++ b/test/tools/helper.ts @@ -1,7 +1,7 @@ import assert from "node:assert"; import { readFileSync } from "node:fs"; import path from "node:path"; -import { type Document, Element, Text } from "domhandler"; +import { type Document, Element, isTag, Text } from "domhandler"; import * as DomUtils from "domutils"; import { type ParserOptions, parseDocument } from "htmlparser2"; @@ -35,7 +35,7 @@ export function getDocument(file: string): SimpleDocument { document.createElement = (name: string) => new Element(name.toLowerCase(), {}); [document.body] = DomUtils.getElementsByTagName("body", document, true, 1); - const documentElement = document.children.find(DomUtils.isTag); + const documentElement = document.children.find(isTag); assert.ok(documentElement, "Did not find document element"); document.documentElement = documentElement; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 9228417e..eb727dec 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,5 +1,9 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "noEmit": true + }, "include": ["src", "test"], "exclude": [] } diff --git a/tsconfig.json b/tsconfig.json index 2df2445b..3fa542a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,16 @@ { "compilerOptions": { - /* Basic Options */ - "target": "es2020", + "target": "es2022", "module": "nodenext", - "lib": ["ES2020", "DOM"], + "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, "sourceMap": true, - "outDir": "lib", + "outDir": "dist", - /* Strict Type-Checking Options */ "strict": true, "skipLibCheck": true, - /* Additional Checks */ "exactOptionalPropertyTypes": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, @@ -23,8 +20,13 @@ "noImplicitReturns": true, "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, - "noUnusedParameters": true, - - "types": ["vitest/globals"] - } + "noUnusedParameters": true + }, + "include": ["src"], + "exclude": [ + "**/*.spec.ts", + "**/__fixtures__/*", + "**/__tests__/*", + "**/__snapshots__/*" + ] }