diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d090194..77446b6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,21 +5,25 @@ on: tags: ['v*'] permissions: - contents: write + contents: read id-token: write +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + jobs: publish: runs-on: ubuntu-latest + timeout-minutes: 15 steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: - node-version: '20' + node-version: '24' registry-url: 'https://registry.npmjs.org' - cache: 'npm' - - run: npm install -g npm@11.5.1 - - run: npm ci + package-manager-cache: false + - run: npm install -g npm@11.19.0 - name: Check tag matches package version run: | TAG_VERSION=${GITHUB_REF#refs/tags/v} @@ -28,8 +32,24 @@ jobs: echo "Version mismatch: tag v$TAG_VERSION, package.json v$PKG_VERSION" >&2 exit 1 fi + - run: npm ci - run: npm publish - - name: Create GitHub Release - env: - GH_TOKEN: ${{ github.token }} - run: gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --generate-notes --verify-tag + + github-release: + needs: publish + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: write + env: + GH_TOKEN: ${{ github.token }} + steps: + - run: | + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + exit 0 + fi + gh release create "$GITHUB_REF_NAME" \ + --repo "$GITHUB_REPOSITORY" \ + --verify-tag \ + --generate-notes \ + --title "$GITHUB_REF_NAME" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..8527b47 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +coverage/ +dist/ +node_modules/ +package-lock.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..5ac85e2 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "printWidth": 100, + "singleQuote": true +} diff --git a/README.md b/README.md index ad29b4d..7ff806d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # @nbtca/docs -Data-only library for the [NBTCA documents repository](https://github.com/nbtca/documents). -Fetches directory listings and raw markdown files from GitHub with built-in TTL caching, -stale-on-error fallback, and rate-limit handling. - -Rendering is the consumer's job (e.g. `@nbtca/prompt`). +Typed GitHub client for the [NBTCA documents repository](https://github.com/nbtca/documents). +It lists Markdown documents, reads raw content, caches successful responses, and falls back to +stale data after transient failures. Rendering remains the consumer's responsibility. ## Install @@ -17,53 +15,63 @@ npm install @nbtca/docs ```ts import { createDocsClient } from '@nbtca/docs'; -const docs = createDocsClient(); // defaults to nbtca/documents@main +const docs = createDocsClient(); -const items = await docs.listDir('tutorial'); // DocItem[] -const all = await docs.listAll(); // all markdown DocItem[] -const md = await docs.getFile('repair/guide.md'); // string (raw markdown) -``` - -Custom target: - -```ts -const docs = createDocsClient({ - owner: 'my-org', - repo: 'my-docs', - branch: 'main', - token: process.env.GITHUB_TOKEN, -}); +const sections = await docs.listDir(); +const documents = await docs.listAll(); +const markdown = await docs.getFile('repair/guide.md'); +const page = await docs.getDocument('repair/index.md'); +const matches = await docs.search('repair', { pathPrefix: 'repair' }); ``` ## API ### `createDocsClient(options?)` -| Option | Default | Description | -|---|---|---| -| `owner` | `'nbtca'` | GitHub org/user | -| `repo` | `'documents'` | Repository name | -| `branch` | `'main'` | Branch or ref | -| `token` | `GITHUB_TOKEN` env | Auth token (raises rate limit) | -| `cacheTtlMs.dir` | `300000` (5 min) | Directory listing cache TTL | -| `cacheTtlMs.file` | `600000` (10 min) | File content cache TTL | +| Option | Default | Description | +| ----------------- | ---------------------------- | ---------------------------- | +| `owner` | `'nbtca'` | GitHub owner | +| `repo` | `'documents'` | Repository name | +| `branch` | `'main'` | Branch name or ref | +| `token` | `GITHUB_TOKEN` or `GH_TOKEN` | GitHub token | +| `cacheTtlMs.dir` | `300000` | Directory and tree cache TTL | +| `cacheTtlMs.file` | `600000` | File cache TTL | ### `docs.listDir(path?)` -Returns `DocItem[]` for the given path (root if omitted). -Filters out hidden files, non-markdown files, and repository metadata. +Lists directories and Markdown files at a repository-relative path. The root path is used when +`path` is omitted. ### `docs.getFile(path)` -Returns raw markdown as a string. Falls back to stale cache on network error. +Returns raw file content. ### `docs.listAll()` -Returns every markdown file in the repository through GitHub's recursive tree API. +Lists every Markdown file through GitHub's recursive tree API. + +### `docs.listSections()` + +Returns top-level content sections with document counts and optional index paths. + +### `docs.getDocument(path)` + +Returns content with its route, section, title, summary, and semantic component attributes. Component +metadata covers `PageHero`, `FactStrip`, `LinkCard`, `Split`, `TimelineEntry`, and `Figure` without +imposing a renderer. + +### `docs.search(query, options?)` + +Searches paths, titles, summaries, Markdown text, and semantic component attributes. Results are +ranked and include excerpts. Use `pathPrefix` to scope a search and `limit` to cap results. + +### `docs.clear()` + +Clears all cached values and in-flight request bookkeeping. ### `DocsFetchError` -Thrown when a fetch fails with no stale cache available. Has `.path` and `.status` fields. +Thrown when a request fails without usable stale data. Exposes `path` and HTTP `status`. ## License diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..a108aad --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,45 @@ +import eslint from '@eslint/js'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + { + ignores: ['coverage', 'dist', 'node_modules'], + }, + eslint.configs.recommended, + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + { + files: ['**/*.ts'], + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + rules: { + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/consistent-type-imports': [ + 'error', + { fixStyle: 'inline-type-imports', prefer: 'type-imports' }, + ], + '@typescript-eslint/no-import-type-side-effects': 'error', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + }, + }, + { + files: ['src/__tests__/**/*.ts'], + rules: { + '@typescript-eslint/require-await': 'off', + }, + }, + { + files: ['**/*.mjs'], + extends: [tseslint.configs.disableTypeChecked], + languageOptions: { + globals: globals.node, + }, + }, + prettier, +); diff --git a/package-lock.json b/package-lock.json index dd0071a..f7d9ab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,23 @@ { "name": "@nbtca/docs", - "version": "0.2.3", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@nbtca/docs", - "version": "0.2.3", + "version": "0.3.0", "license": "MIT", "devDependencies": { - "@types/node": "^26.0.0", - "typescript": "^5.4.0", + "@eslint/js": "^9.39.5", + "@types/node": "20.12.12", + "eslint": "^9.39.5", + "eslint-config-prettier": "^10.1.8", + "globals": "^17.9.0", + "prettier": "^3.9.6", + "typescript": "^5.9.3", + "typescript-eslint": "^8.67.0", + "vite": "6.4.3", "vitest": "^3.2.7" }, "engines": { @@ -18,9 +25,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", "cpu": [ "ppc64" ], @@ -35,9 +42,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", "cpu": [ "arm" ], @@ -52,9 +59,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", "cpu": [ "arm64" ], @@ -69,9 +76,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", "cpu": [ "x64" ], @@ -86,9 +93,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", "cpu": [ "arm64" ], @@ -103,9 +110,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", "cpu": [ "x64" ], @@ -120,9 +127,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", "cpu": [ "arm64" ], @@ -137,9 +144,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", "cpu": [ "x64" ], @@ -154,9 +161,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", "cpu": [ "arm" ], @@ -171,9 +178,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", "cpu": [ "arm64" ], @@ -188,9 +195,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", "cpu": [ "ia32" ], @@ -205,9 +212,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", "cpu": [ "loong64" ], @@ -222,9 +229,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", "cpu": [ "mips64el" ], @@ -239,9 +246,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", "cpu": [ "ppc64" ], @@ -256,9 +263,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", "cpu": [ "riscv64" ], @@ -273,9 +280,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", "cpu": [ "s390x" ], @@ -290,9 +297,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", "cpu": [ "x64" ], @@ -307,9 +314,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", "cpu": [ "arm64" ], @@ -324,9 +331,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", "cpu": [ "x64" ], @@ -341,9 +348,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", "cpu": [ "arm64" ], @@ -358,9 +365,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", "cpu": [ "x64" ], @@ -375,9 +382,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", "cpu": [ "arm64" ], @@ -392,9 +399,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", "cpu": [ "x64" ], @@ -409,9 +416,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", "cpu": [ "arm64" ], @@ -426,9 +433,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", "cpu": [ "ia32" ], @@ -443,9 +450,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", "cpu": [ "x64" ], @@ -459,6 +466,229 @@ "node": ">=18" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.6.tgz", + "integrity": "sha512-l2Ul9PrHsPCKcEY/ac7VgFj9D80C7S68sOKc618SyHDPK36s1XcFebXY0iTzUVn4Yq+YbwvSnDmCz9yxjX+QrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.3.0", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.5", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.5.tgz", + "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -900,194 +1130,606 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { - "version": "26.1.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz", - "integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "undici-types": "~5.26.4" } }, - "node_modules/@vitest/expect": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", - "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.67.0.tgz", + "integrity": "sha512-Un7Heoyj65NREbKAyIrFxeM143NZpExWmy1Nep4DLeQOeLlTeumPjoNKnBrU5D5moWXbPJgRa5Uwcdu0faVNGQ==", "dev": true, "license": "MIT", "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.7", - "@vitest/utils": "3.2.7", - "chai": "^5.2.0", - "tinyrainbow": "^2.0.0" + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.67.0", + "@typescript-eslint/type-utils": "8.67.0", + "@typescript-eslint/utils": "8.67.0", + "@typescript-eslint/visitor-keys": "8.67.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.67.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@vitest/mocker": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", - "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz", + "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.67.0.tgz", + "integrity": "sha512-fUBfTuuEulWqX6V8+O3PtScV01tzYYRUDTAirHFKoRAt7nOzoGiPt0M/bB47wWNy0coOOcgEwAMUtBpykMxl6w==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "3.2.7", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.17" + "@typescript-eslint/scope-manager": "8.67.0", + "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/typescript-estree": "8.67.0", + "@typescript-eslint/visitor-keys": "8.67.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@vitest/pretty-format": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", - "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", + "node_modules/@typescript-eslint/project-service": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.67.0.tgz", + "integrity": "sha512-cvE8c7ulYeXN9fYuszhCeCsbzyVEXuhrRCybnBre7TUmqb5nRmBfQAwCj0O3WJFDeyAZt4VYv51vMCC9LHSdYw==", "dev": true, "license": "MIT", "dependencies": { - "tinyrainbow": "^2.0.0" + "@typescript-eslint/tsconfig-utils": "^8.67.0", + "@typescript-eslint/types": "^8.67.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@vitest/runner": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", - "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.67.0.tgz", + "integrity": "sha512-EgvsleTwS4E+WzzSvem8fAUubLwatMNF1B5hHSLQxcvs7q2dtRhGyujHwLJSYlG41niJ7GP24Aha2+0mb1b2kg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.2.7", - "pathe": "^2.0.3", - "strip-literal": "^3.0.0" + "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/visitor-keys": "8.67.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@vitest/snapshot": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", - "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.67.0.tgz", + "integrity": "sha512-vV+LUSv5njUWsknE71fqKTlXUva+R76SaeORd6Zojcunk/6DvKFXONU3BrAs2H49mbygUXt6gbYunzwqNwlhdg==", "dev": true, "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.7", - "magic-string": "^0.30.17", - "pathe": "^2.0.3" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@vitest/spy": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", - "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.67.0.tgz", + "integrity": "sha512-aVWDXbRmdXO9siTfX4ditQI1T9+zVcNazT48EJCD0v40/9RIFoUgZ05CmGEq9H2gixRpjUn/iplwvlcvutJW/Q==", "dev": true, "license": "MIT", "dependencies": { - "tinyspy": "^4.0.3" + "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/typescript-estree": "8.67.0", + "@typescript-eslint/utils": "8.67.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@vitest/utils": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", - "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", + "node_modules/@typescript-eslint/types": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.67.0.tgz", + "integrity": "sha512-sBtgslww8nsMYUjhdPBiSyUqSzT8uR6g93A2QXnQC8+cGdjz0CyaOdqHDRJb1AtORbZCNUJBBeFA/tNR2uQmww==", "dev": true, "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.7", - "loupe": "^3.1.4", - "tinyrainbow": "^2.0.0" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/vitest" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.67.0.tgz", + "integrity": "sha512-EKQBCE9yNlRJYm7jdTW5AhDacDUmSwQb0FAJAmK2EKYrNXIsa2vxcSZx6PvJ/dEdI6lS+Y9W+EXckLj0iPFGcw==", "dev": true, "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.67.0", + "@typescript-eslint/tsconfig-utils": "8.67.0", + "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/visitor-keys": "8.67.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, "engines": { - "node": ">=12" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": "18 || 20 || >=22" } }, - "node_modules/chai": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", - "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "dev": true, "license": "MIT", "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">=18" + "node": "20 || >=22" } }, - "node_modules/check-error": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", - "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, "engines": { - "node": ">= 16" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/@typescript-eslint/utils": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.67.0.tgz", + "integrity": "sha512-U9D1FdwEWBwok3hxxSdhclMb0twvt9QnjIQ0VfQ1AiX2epnpSgv2ubVDsayOFyY8K6FX+AQ7E0FKWVG3iKsj1A==", "dev": true, "license": "MIT", "dependencies": { - "ms": "^2.1.3" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.67.0", + "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/typescript-estree": "8.67.0" }, "engines": { - "node": ">=6.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.67.0.tgz", + "integrity": "sha512-fkv8dHRDqfGtTHuJeebdrQ7cX6Ad4WAS00rgHh9UGvMycF1mjBfsxry1XsLIFhWZ6Judlh6UdzK+TYlbpCXgnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.67.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", + "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", + "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", + "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.7", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", + "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", + "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", + "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", + "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/deep-eql": { @@ -1100,6 +1742,13 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/es-module-lexer": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", @@ -1108,9 +1757,9 @@ "license": "MIT" }, "node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1121,32 +1770,205 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.5", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.5.tgz", + "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.6", + "@eslint/js": "9.39.5", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" } }, "node_modules/estree-walker": { @@ -1156,56 +1978,332 @@ "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "^1.0.0" + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "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", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.9.0.tgz", + "integrity": "sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/expect-type": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", - "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" } }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } + "engines": { + "node": ">= 0.8.0" } }, - "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/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, - "hasInstallScript": true, "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "p-locate": "^5.0.0" + }, "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, "license": "MIT" }, @@ -1226,6 +2324,19 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1234,9 +2345,9 @@ "license": "MIT" }, "node_modules/nanoid": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", "dev": true, "funding": [ { @@ -1252,6 +2363,96 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -1290,9 +2491,9 @@ } }, "node_modules/postcss": { - "version": "8.5.25", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.25.tgz", - "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==", + "version": "8.5.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", + "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", "dev": true, "funding": [ { @@ -1310,7 +2511,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.16", + "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -1318,6 +2519,52 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/rollup": { "version": "4.62.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.4.tgz", @@ -1364,6 +2611,42 @@ "fsevents": "~2.3.2" } }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -1395,6 +2678,19 @@ "dev": true, "license": "MIT" }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-literal": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", @@ -1408,6 +2704,19 @@ "url": "https://github.com/sponsors/antfu" } }, + "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/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -1469,6 +2778,32 @@ "node": ">=14.0.0" } }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -1483,32 +2818,66 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.67.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.67.0.tgz", + "integrity": "sha512-S2udFs8tCKEKffuJ4TB1idGUZiXdCPGi3IPBGWXarbLQ5UPXORV8QEVzJ4gCRduURMb5EkpNCdjbk0eDIuI8Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.67.0", + "@typescript-eslint/parser": "8.67.0", + "@typescript-eslint/typescript-estree": "8.67.0", + "@typescript-eslint/utils": "8.67.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true, "license": "MIT" }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/vite": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.6.tgz", - "integrity": "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==", + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", + "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -1517,14 +2886,14 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", - "less": "^4.0.0", + "less": "*", "lightningcss": "^1.21.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" @@ -1661,6 +3030,49 @@ } } }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", + "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -1677,6 +3089,29 @@ "engines": { "node": ">=8" } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 82a5d8e..d725af5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nbtca/docs", - "version": "0.2.3", - "description": "Data-only library for the NBTCA documents repository", + "version": "0.3.0", + "description": "GitHub-backed document client for NBTCA", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -18,11 +18,16 @@ "scripts": { "clean": "node --input-type=module --eval \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"", "prebuild": "npm run clean", - "build": "tsc", + "build": "tsc -p tsconfig.build.json", + "format": "prettier --write .", + "format:check": "prettier --check .", + "lint": "eslint . --max-warnings 0", + "typecheck": "tsc --noEmit", "test": "vitest run", "precheck:package": "npm run build", "check:package": "node scripts/check-package.mjs", - "check": "npm test && npm run check:package && npm audit --audit-level=moderate", + "audit": "npm audit --audit-level=moderate", + "check": "npm run format:check && npm run lint && npm run typecheck && npm test && npm run check:package && npm run audit", "prepublishOnly": "npm run check" }, "keywords": [ @@ -46,8 +51,15 @@ "node": ">=20.12.0" }, "devDependencies": { - "@types/node": "^26.0.0", - "typescript": "^5.4.0", + "@eslint/js": "^9.39.5", + "@types/node": "20.12.12", + "eslint": "^9.39.5", + "eslint-config-prettier": "^10.1.8", + "globals": "^17.9.0", + "prettier": "^3.9.6", + "typescript": "^5.9.3", + "typescript-eslint": "^8.67.0", + "vite": "6.4.3", "vitest": "^3.2.7" } } diff --git a/scripts/check-package.mjs b/scripts/check-package.mjs index a23065d..23a0c2a 100644 --- a/scripts/check-package.mjs +++ b/scripts/check-package.mjs @@ -2,6 +2,7 @@ import { spawnSync } from 'node:child_process'; import { mkdtemp, readdir, rm, writeFile } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import { dirname, join } from 'node:path'; +import process from 'node:process'; import { fileURLToPath } from 'node:url'; const root = dirname(dirname(fileURLToPath(import.meta.url))); @@ -10,7 +11,12 @@ const temporaryDirectory = await mkdtemp(join(tmpdir(), 'nbtca-docs-package-')); function run(command, args, cwd) { const result = spawnSync(command, args, { cwd, - env: { ...process.env, npm_config_audit: 'false', npm_config_fund: 'false' }, + env: { + ...process.env, + npm_config_audit: 'false', + npm_config_dry_run: 'false', + npm_config_fund: 'false', + }, stdio: 'inherit', }); if (result.error) throw result.error; @@ -22,30 +28,70 @@ try { const tarballs = (await readdir(temporaryDirectory)).filter((name) => name.endsWith('.tgz')); if (tarballs.length !== 1) throw new Error('npm pack did not produce exactly one tarball'); - await writeFile(join(temporaryDirectory, 'package.json'), JSON.stringify({ - private: true, - type: 'module', - })); - await writeFile(join(temporaryDirectory, 'smoke.mjs'), [ - "import { createDocsClient, DocsFetchError } from '@nbtca/docs';", - "const client = createDocsClient();", - "if (typeof client.listDir !== 'function') throw new TypeError('invalid client export');", - "if (!(new DocsFetchError('', null, 'test') instanceof Error)) throw new TypeError('invalid error export');", - ].join('\n')); - await writeFile(join(temporaryDirectory, 'consumer.ts'), [ - "import type { DocItem, DocsClient, DocsClientOptions } from '@nbtca/docs';", - "const item: DocItem = { name: 'guide.md', path: 'guide.md', type: 'file' };", - "const options: DocsClientOptions = { branch: 'main' };", - "const client = null as DocsClient | null;", - 'void item;', - 'void options;', - 'void client;', - ].join('\n')); + await writeFile( + join(temporaryDirectory, 'package.json'), + JSON.stringify({ + private: true, + type: 'module', + }), + ); + await writeFile( + join(temporaryDirectory, 'smoke.mjs'), + [ + "import { createDocsClient, DocsFetchError, parseDoc } from '@nbtca/docs';", + 'const client = createDocsClient();', + "if (typeof client.listDir !== 'function') throw new TypeError('invalid client export');", + "if (typeof client.listSections !== 'function') throw new TypeError('invalid discovery export');", + "if (typeof client.getDocument !== 'function') throw new TypeError('invalid document export');", + "if (typeof client.search !== 'function') throw new TypeError('invalid search export');", + "if (parseDoc('index.md', '# Home').title !== 'Home') throw new TypeError('invalid parser export');", + "if (!(new DocsFetchError('', null, 'test') instanceof Error)) throw new TypeError('invalid error export');", + ].join('\n'), + ); + await writeFile( + join(temporaryDirectory, 'consumer.ts'), + [ + "import type { DocComponent, DocItem, DocPage, DocSection, DocsClient, DocsClientOptions, DocsSearchOptions, DocsSearchResult } from '@nbtca/docs';", + "const item: DocItem = { name: 'guide.md', path: 'guide.md', type: 'file' };", + "const component: DocComponent = { name: 'Figure', attributes: { caption: 'Example' } };", + 'const page = null as DocPage | null;', + 'const section = null as DocSection | null;', + "const searchOptions: DocsSearchOptions = { pathPrefix: 'repair', limit: 10 };", + 'const searchResult = null as DocsSearchResult | null;', + "const options: DocsClientOptions = { branch: 'main' };", + 'const client = null as DocsClient | null;', + 'void item;', + 'void component;', + 'void page;', + 'void section;', + 'void searchOptions;', + 'void searchResult;', + 'void options;', + 'void client;', + ].join('\n'), + ); - run('npm', ['install', '--ignore-scripts', join(temporaryDirectory, tarballs[0])], temporaryDirectory); - run(process.execPath, [join(root, 'node_modules/typescript/bin/tsc'), - '--noEmit', '--strict', '--target', 'ES2022', '--module', 'NodeNext', - '--moduleResolution', 'NodeNext', 'consumer.ts'], temporaryDirectory); + run( + 'npm', + ['install', '--ignore-scripts', join(temporaryDirectory, tarballs[0])], + temporaryDirectory, + ); + run( + process.execPath, + [ + join(root, 'node_modules/typescript/bin/tsc'), + '--noEmit', + '--strict', + '--target', + 'ES2022', + '--module', + 'NodeNext', + '--moduleResolution', + 'NodeNext', + 'consumer.ts', + ], + temporaryDirectory, + ); run(process.execPath, ['smoke.mjs'], temporaryDirectory); } finally { await rm(temporaryDirectory, { recursive: true, force: true }); diff --git a/src/__tests__/cache.test.ts b/src/__tests__/cache.test.ts index dc0941a..ed418a5 100644 --- a/src/__tests__/cache.test.ts +++ b/src/__tests__/cache.test.ts @@ -31,7 +31,7 @@ describe('TtlCache', () => { vi.advanceTimersByTime(1); c.set('b', 2); vi.advanceTimersByTime(1); - c.set('c', 3); // should evict 'a' + c.set('c', 3); expect(c.get('a')).toBeUndefined(); expect(c.get('b')).toBe(2); expect(c.get('c')).toBe(3); diff --git a/src/__tests__/client.test.ts b/src/__tests__/client.test.ts index 6f8f1f4..606a413 100644 --- a/src/__tests__/client.test.ts +++ b/src/__tests__/client.test.ts @@ -13,33 +13,48 @@ const mockDir = [ const mockTree = { truncated: false, tree: [ - { path: 'repair/guide.md', type: 'blob' }, - { path: 'repair/advanced.md', type: 'blob' }, - { path: 'repair', type: 'tree' }, - { path: 'repair/image.png', type: 'blob' }, + { path: 'repair/guide.md', type: 'blob' }, + { path: 'repair/advanced.md', type: 'blob' }, + { path: 'repair', type: 'tree' }, + { path: 'repair/image.png', type: 'blob' }, { path: 'node_modules/pkg.md', type: 'blob' }, - { path: '.github/CODEOWNERS', type: 'blob' }, - { path: 'CONTRIBUTING.md', type: 'blob' }, - { path: '.hidden/secret.md', type: 'blob' }, - { path: 'intro.md', type: 'blob' }, + { path: '.github/CODEOWNERS', type: 'blob' }, + { path: 'CONTRIBUTING.md', type: 'blob' }, + { path: 'README.md', type: 'blob' }, + { path: 'docs/editorial-standard.md', type: 'blob' }, + { path: '.hidden/secret.md', type: 'blob' }, + { path: 'intro.md', type: 'blob' }, ], }; -function mockFetch(response: { ok: boolean; status?: number; json?: () => Promise; text?: () => Promise }) { +function mockFetch(response: { + ok: boolean; + status?: number; + json?: () => Promise; + text?: () => Promise; +}) { vi.stubGlobal('fetch', vi.fn().mockResolvedValue(response)); } -function mockFetchThenFail(first: { ok: boolean; status?: number; json?: () => Promise; text?: () => Promise }, error: Error) { - const fn = vi.fn() - .mockResolvedValueOnce(first) - .mockRejectedValue(error); +function mockFetchThenFail( + first: { + ok: boolean; + status?: number; + json?: () => Promise; + text?: () => Promise; + }, + error: Error, +) { + const fn = vi.fn().mockResolvedValueOnce(first).mockRejectedValue(error); vi.stubGlobal('fetch', fn); return fn; } function deferred() { let resolve!: (value: T) => void; - const promise = new Promise(done => { resolve = done; }); + const promise = new Promise((done) => { + resolve = done; + }); return { promise, resolve }; } @@ -53,26 +68,23 @@ describe('createDocsClient', () => { { repo: '.' }, { branch: '' }, { branch: '..' }, - ])('rejects invalid repository coordinates: %o', options => { + ])('rejects invalid repository coordinates: %o', (options) => { expect(() => createDocsClient(options)).toThrow(TypeError); }); - it.each([-1, Number.NaN, Number.POSITIVE_INFINITY])( - 'rejects an invalid cache TTL: %s', - ttl => { - expect(() => createDocsClient({ cacheTtlMs: { dir: ttl } })).toThrow(RangeError); - expect(() => createDocsClient({ cacheTtlMs: { file: ttl } })).toThrow(RangeError); - }, - ); + it.each([-1, Number.NaN, Number.POSITIVE_INFINITY])('rejects an invalid cache TTL: %s', (ttl) => { + expect(() => createDocsClient({ cacheTtlMs: { dir: ttl } })).toThrow(RangeError); + expect(() => createDocsClient({ cacheTtlMs: { file: ttl } })).toThrow(RangeError); + }); it('filters skipped names and non-md files', async () => { mockFetch({ ok: true, json: async () => mockDir }); const client = createDocsClient(); const items = await client.listDir('repair'); - expect(items.map(i => i.name)).not.toContain('node_modules'); - expect(items.map(i => i.name)).not.toContain('.github'); - expect(items.map(i => i.name)).not.toContain('image.png'); - expect(items.find(i => i.name === 'guide.md')).toBeDefined(); + expect(items.map((i) => i.name)).not.toContain('node_modules'); + expect(items.map((i) => i.name)).not.toContain('.github'); + expect(items.map((i) => i.name)).not.toContain('image.png'); + expect(items.find((i) => i.name === 'guide.md')).toBeDefined(); }); it('does not expose symlinks or submodules as document files', async () => { @@ -90,7 +102,7 @@ describe('createDocsClient', () => { mockFetch({ ok: true, json: async () => mockDir }); const client = createDocsClient(); const items = await client.listDir(); - const types = items.map(i => i.type); + const types = items.map((i) => i.type); const firstFile = types.indexOf('file'); const lastDir = types.lastIndexOf('dir'); expect(lastDir).toBeLessThan(firstFile === -1 ? Infinity : firstFile); @@ -115,7 +127,8 @@ describe('createDocsClient', () => { }); it('keeps the root cache separate from a directory named __root__', async () => { - const fetchMock = vi.fn() + const fetchMock = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => [{ name: 'root.md', path: 'root.md', type: 'file' }], @@ -225,7 +238,8 @@ describe('createDocsClient', () => { }); it('listDir returns stale data when a refetch responds with an HTTP error (not just a thrown network error)', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockDir }) .mockResolvedValue({ ok: false, status: 503 }); vi.stubGlobal('fetch', fn); @@ -237,7 +251,8 @@ describe('createDocsClient', () => { }); it('does not hide a permanent HTTP error behind stale data', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockDir }) .mockResolvedValue({ ok: false, status: 404 }); vi.stubGlobal('fetch', fn); @@ -274,9 +289,15 @@ describe('createDocsClient', () => { }); it('listDir returns stale data when reading a successful response fails', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockDir }) - .mockResolvedValue({ ok: true, json: async () => { throw new Error('invalid JSON'); } }); + .mockResolvedValue({ + ok: true, + json: async () => { + throw new Error('invalid JSON'); + }, + }); vi.stubGlobal('fetch', fn); const client = createDocsClient({ cacheTtlMs: { dir: 1000 } }); const fresh = await client.listDir('repair'); @@ -285,9 +306,15 @@ describe('createDocsClient', () => { }); it('listAll returns stale data when reading a successful response fails', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockTree }) - .mockResolvedValue({ ok: true, json: async () => { throw new Error('invalid JSON'); } }); + .mockResolvedValue({ + ok: true, + json: async () => { + throw new Error('invalid JSON'); + }, + }); vi.stubGlobal('fetch', fn); const client = createDocsClient({ cacheTtlMs: { dir: 1000 } }); const fresh = await client.listAll(); @@ -296,7 +323,8 @@ describe('createDocsClient', () => { }); it('listDir returns stale data when a successful response has the wrong shape', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockDir }) .mockResolvedValue({ ok: true, json: async () => ({ message: 'unexpected' }) }); vi.stubGlobal('fetch', fn); @@ -307,7 +335,8 @@ describe('createDocsClient', () => { }); it('listAll returns stale data when a successful response has the wrong shape', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, json: async () => mockTree }) .mockResolvedValue({ ok: true, json: async () => ({ truncated: false, tree: null }) }); vi.stubGlobal('fetch', fn); @@ -318,9 +347,15 @@ describe('createDocsClient', () => { }); it('getFile returns stale data when reading a successful response fails', async () => { - const fn = vi.fn() + const fn = vi + .fn() .mockResolvedValueOnce({ ok: true, text: async () => '# Hello' }) - .mockResolvedValue({ ok: true, text: async () => { throw new Error('stream closed'); } }); + .mockResolvedValue({ + ok: true, + text: async () => { + throw new Error('stream closed'); + }, + }); vi.stubGlobal('fetch', fn); const client = createDocsClient({ cacheTtlMs: { file: 1000 } }); const fresh = await client.getFile('repair/guide.md'); @@ -329,7 +364,12 @@ describe('createDocsClient', () => { }); it('wraps response body failures when no stale data exists', async () => { - mockFetch({ ok: true, json: async () => { throw new Error('invalid JSON'); } }); + mockFetch({ + ok: true, + json: async () => { + throw new Error('invalid JSON'); + }, + }); const client = createDocsClient(); await expect(client.listDir('broken')).rejects.toMatchObject({ name: 'DocsFetchError', @@ -348,14 +388,21 @@ describe('createDocsClient', () => { describe('clear', () => { it('does not cache a directory response started before clear', async () => { const pending = deferred<{ ok: boolean; json: () => Promise }>(); - const fetchMock = vi.fn() + const fetchMock = vi + .fn() .mockImplementationOnce(() => pending.promise) - .mockResolvedValue({ ok: true, json: async () => [{ name: 'new.md', path: 'new.md', type: 'file' }] }); + .mockResolvedValue({ + ok: true, + json: async () => [{ name: 'new.md', path: 'new.md', type: 'file' }], + }); vi.stubGlobal('fetch', fetchMock); const client = createDocsClient(); const first = client.listDir(); client.clear(); - pending.resolve({ ok: true, json: async () => [{ name: 'old.md', path: 'old.md', type: 'file' }] }); + pending.resolve({ + ok: true, + json: async () => [{ name: 'old.md', path: 'old.md', type: 'file' }], + }); await expect(first).resolves.toMatchObject([{ name: 'old.md' }]); await expect(client.listDir()).resolves.toMatchObject([{ name: 'new.md' }]); expect(fetchMock).toHaveBeenCalledTimes(2); @@ -363,7 +410,8 @@ describe('createDocsClient', () => { it('does not cache a tree response started before clear', async () => { const pending = deferred<{ ok: boolean; json: () => Promise }>(); - const fetchMock = vi.fn() + const fetchMock = vi + .fn() .mockImplementationOnce(() => pending.promise) .mockResolvedValue({ ok: true, @@ -384,7 +432,8 @@ describe('createDocsClient', () => { it('does not cache file content started before clear', async () => { const pending = deferred<{ ok: boolean; text: () => Promise }>(); - const fetchMock = vi.fn() + const fetchMock = vi + .fn() .mockImplementationOnce(() => pending.promise) .mockResolvedValue({ ok: true, text: async () => 'new' }); vi.stubGlobal('fetch', fetchMock); @@ -411,6 +460,9 @@ describe('createDocsClient', () => { pending.resolve({ ok: true, json: async () => mockDir }); const [a, b] = await Promise.all([first, second]); expect(b).toEqual(a); + expect(b).not.toBe(a); + a.splice(0, a.length); + expect(b.length).toBeGreaterThan(0); }); it('shares the in-flight tree request', async () => { @@ -424,6 +476,9 @@ describe('createDocsClient', () => { pending.resolve({ ok: true, json: async () => mockTree }); const [a, b] = await Promise.all([first, second]); expect(b).toEqual(a); + expect(b).not.toBe(a); + a.splice(0, a.length); + expect(b.length).toBeGreaterThan(0); }); it('shares an in-flight file request for the same path', async () => { @@ -440,7 +495,8 @@ describe('createDocsClient', () => { }); it('retries after a shared request fails', async () => { - const fetchMock = vi.fn() + const fetchMock = vi + .fn() .mockRejectedValueOnce(new Error('network down')) .mockResolvedValue({ ok: true, text: async () => '# Guide' }); vi.stubGlobal('fetch', fetchMock); @@ -449,7 +505,7 @@ describe('createDocsClient', () => { client.getFile('guide.md'), client.getFile('guide.md'), ]); - expect(failed.every(result => result.status === 'rejected')).toBe(true); + expect(failed.every((result) => result.status === 'rejected')).toBe(true); expect(fetchMock).toHaveBeenCalledTimes(1); await expect(client.getFile('guide.md')).resolves.toBe('# Guide'); expect(fetchMock).toHaveBeenCalledTimes(2); @@ -463,29 +519,36 @@ describe('createDocsClient', () => { it('keeps the timeout active while reading a response body', async () => { let signal!: AbortSignal; const fetchMock = vi.fn().mockImplementation((_url: string, init: RequestInit) => { - signal = init.signal as AbortSignal; + if (!init.signal) throw new TypeError('Expected an abort signal'); + signal = init.signal; return Promise.resolve({ ok: true, - json: () => new Promise((_resolve, reject) => { - signal.addEventListener('abort', () => { - const error = new Error('aborted'); - error.name = 'AbortError'; - reject(error); - }, { once: true }); - }), + json: () => + new Promise((_resolve, reject) => { + signal.addEventListener( + 'abort', + () => { + const error = new Error('aborted'); + error.name = 'AbortError'; + reject(error); + }, + { once: true }, + ); + }), }); }); vi.stubGlobal('fetch', fetchMock); const client = createDocsClient(); const request = client.listDir(); - await vi.advanceTimersByTimeAsync(10_000); - expect(signal.aborted).toBe(true); - await expect(request).rejects.toMatchObject({ + const rejection = expect(request).rejects.toMatchObject({ name: 'DocsFetchError', path: '', status: null, message: 'Request timed out', }); + await vi.advanceTimersByTimeAsync(10_000); + expect(signal.aborted).toBe(true); + await rejection; }); }); }); @@ -495,7 +558,7 @@ describe('listAll', () => { mockFetch({ ok: true, json: async () => mockTree }); const client = createDocsClient(); const items = await client.listAll(); - const paths = items.map(i => i.path); + const paths = items.map((i) => i.path); expect(paths).toEqual(['intro.md', 'repair/advanced.md', 'repair/guide.md']); }); @@ -503,10 +566,12 @@ describe('listAll', () => { mockFetch({ ok: true, json: async () => mockTree }); const client = createDocsClient(); const items = await client.listAll(); - const paths = items.map(i => i.path); + const paths = items.map((i) => i.path); expect(paths).not.toContain('node_modules/pkg.md'); expect(paths).not.toContain('.hidden/secret.md'); expect(paths).not.toContain('CONTRIBUTING.md'); + expect(paths).not.toContain('README.md'); + expect(paths).not.toContain('docs/editorial-standard.md'); expect(paths).not.toContain('repair/image.png'); }); @@ -514,7 +579,7 @@ describe('listAll', () => { mockFetch({ ok: true, json: async () => mockTree }); const client = createDocsClient(); const items = await client.listAll(); - expect(items.every(i => i.type === 'file')).toBe(true); + expect(items.every((i) => i.type === 'file')).toBe(true); }); it('caches tree results', async () => { @@ -532,3 +597,181 @@ describe('listAll', () => { await expect(client.listAll()).rejects.toBeInstanceOf(DocsFetchError); }); }); + +describe('document discovery', () => { + it('groups documents by top-level section and identifies section indexes', async () => { + mockFetch({ + ok: true, + json: async () => ({ + truncated: false, + tree: [ + { path: 'about/index.md', type: 'blob' }, + { path: 'about/join.md', type: 'blob' }, + { path: 'index.md', type: 'blob' }, + { path: 'repair/guide.md', type: 'blob' }, + ], + }), + }); + + await expect(createDocsClient().listSections()).resolves.toEqual([ + { count: 2, indexPath: 'about/index.md', path: 'about' }, + { count: 1, path: 'repair' }, + ]); + }); + + it('returns parsed document metadata and components', async () => { + mockFetch({ + ok: true, + text: async () => + [ + '---', + 'title: Repair', + 'summary: Campus support', + '---', + '
', + ].join('\n'), + }); + + await expect(createDocsClient().getDocument('repair/index.md')).resolves.toMatchObject({ + components: [{ name: 'Figure', attributes: { caption: 'Workshop', source: 'Archive' } }], + route: '/repair/', + summary: 'Campus support', + title: 'Repair', + }); + }); + + it('rejects non-Markdown document paths', async () => { + const fetchMock = vi.fn(); + vi.stubGlobal('fetch', fetchMock); + await expect(createDocsClient().getDocument('repair/photo.jpg')).rejects.toBeInstanceOf( + TypeError, + ); + expect(fetchMock).not.toHaveBeenCalled(); + }); +}); + +describe('search', () => { + it('searches titles, body text, and semantic component attributes', async () => { + const tree = { + truncated: false, + tree: [ + { path: 'about/history.md', type: 'blob' }, + { path: 'repair/guide.md', type: 'blob' }, + { path: 'tutorial/setup.md', type: 'blob' }, + ], + }; + const content = new Map([ + [ + 'about/history.md', + '# History\n\n', + ], + ['repair/guide.md', '# Community founded\n\nA repair guide.'], + ['tutorial/setup.md', '# Setup\n\nThe community founded a service.'], + ]); + const fetchMock = vi.fn().mockImplementation(async (url: string) => { + if (url.includes('/git/trees/')) return { ok: true, json: async () => tree }; + const path = [...content.keys()].find((candidate) => url.endsWith(candidate)); + return { + ok: path !== undefined, + status: path ? 200 : 404, + text: async () => content.get(path ?? '') ?? '', + }; + }); + vi.stubGlobal('fetch', fetchMock); + + const results = await createDocsClient().search('community founded'); + + expect(results.map((result) => result.path)).toEqual([ + 'repair/guide.md', + 'about/history.md', + 'tutorial/setup.md', + ]); + expect(results[1]).toMatchObject({ + title: 'History', + section: 'about', + }); + expect(results[1]?.excerpt).toContain('Community founded'); + }); + + it('supports path and result limits before loading files', async () => { + const tree = { + truncated: false, + tree: [ + { path: 'about/index.md', type: 'blob' }, + { path: 'repair/a.md', type: 'blob' }, + { path: 'repair/b.md', type: 'blob' }, + ], + }; + const fetchMock = vi.fn().mockImplementation(async (url: string) => { + if (url.includes('/git/trees/')) return { ok: true, json: async () => tree }; + return { ok: true, text: async () => '# Repair\n\nRepair support.' }; + }); + vi.stubGlobal('fetch', fetchMock); + + const results = await createDocsClient().search('repair', { + limit: 1, + pathPrefix: 'repair', + }); + + expect(results).toHaveLength(1); + expect(results[0]?.path.startsWith('repair/')).toBe(true); + expect(fetchMock).toHaveBeenCalledTimes(3); + }); + + it('returns partial results when one document cannot be loaded', async () => { + const tree = { + truncated: false, + tree: [ + { path: 'repair/available.md', type: 'blob' }, + { path: 'repair/missing.md', type: 'blob' }, + ], + }; + const fetchMock = vi.fn().mockImplementation(async (url: string) => { + if (url.includes('/git/trees/')) return { ok: true, json: async () => tree }; + if (url.endsWith('repair/missing.md')) return { ok: false, status: 404 }; + return { ok: true, text: async () => '# Repair guide\n\nRepair support.' }; + }); + vi.stubGlobal('fetch', fetchMock); + + await expect(createDocsClient().search('repair')).resolves.toMatchObject([ + { path: 'repair/available.md', title: 'Repair guide' }, + ]); + }); + + it('surfaces the failure when no document can be loaded', async () => { + const tree = { + truncated: false, + tree: [{ path: 'repair/missing.md', type: 'blob' }], + }; + const fetchMock = vi + .fn() + .mockImplementation(async (url: string) => + url.includes('/git/trees/') + ? { ok: true, json: async () => tree } + : { ok: false, status: 503 }, + ); + vi.stubGlobal('fetch', fetchMock); + + await expect(createDocsClient().search('repair')).rejects.toMatchObject({ + name: 'DocsFetchError', + path: 'repair/missing.md', + status: 503, + }); + }); + + it('rejects invalid queries and options without fetching', async () => { + const fetchMock = vi.fn(); + vi.stubGlobal('fetch', fetchMock); + const client = createDocsClient(); + + await expect(client.search(' ')).rejects.toBeInstanceOf(TypeError); + await expect(client.search('repair', { limit: -1 })).rejects.toBeInstanceOf(RangeError); + await expect(client.search('repair', { pathPrefix: '../private' })).rejects.toBeInstanceOf( + TypeError, + ); + await expect( + client.search('repair', { limit: 0, pathPrefix: '../private' }), + ).rejects.toBeInstanceOf(TypeError); + expect(fetchMock).not.toHaveBeenCalled(); + }); +}); diff --git a/src/__tests__/content.test.ts b/src/__tests__/content.test.ts new file mode 100644 index 0000000..1f308f9 --- /dev/null +++ b/src/__tests__/content.test.ts @@ -0,0 +1,167 @@ +import { describe, expect, it } from 'vitest'; +import { parseDoc, searchDoc } from '../content.js'; + +describe('parseDoc', () => { + it('reads top-level frontmatter used by component-led pages', () => { + const page = parseDoc( + 'repair/index.md', + [ + '---', + 'title: "Repair"', + "summary: 'Free support for the campus.'", + '---', + '', + '', + '', + 'The team runs regular repair days.', + ].join('\n'), + ); + + expect(page).toMatchObject({ + name: 'index.md', + path: 'repair/index.md', + route: '/repair/', + section: 'repair', + summary: 'Free support for the campus.', + title: 'Repair', + }); + expect(page.components).toContainEqual({ + name: 'PageHero', + attributes: { + lede: 'Bring us a computer.', + src: './hero.jpg', + title: 'Repair', + }, + }); + }); + + it('falls back to the first H1 and prose paragraph', () => { + const page = parseDoc( + 'about/community.md', + [ + '```md', + '# Not the title', + '```', + '', + '# Community **guide**', + '', + '
', + '', + 'Meet the [community](/about/) and its projects.', + ].join('\n'), + ); + + expect(page.title).toBe('Community guide'); + expect(page.summary).toBe('Meet the community and its projects.'); + expect(page.route).toBe('/about/community'); + }); + + it('prefers the document H1 when legacy frontmatter is stale', () => { + const page = parseDoc( + 'archived/meeting.md', + ['---', 'title: Docs with VitePress', '---', '', '# Development meeting'].join('\n'), + ); + + expect(page.title).toBe('Development meeting'); + }); + + it('preserves semantic attributes from document components', () => { + const page = parseDoc( + 'about/history.md', + [ + '# History', + '', + '', + '', + '
', + ].join('\n'), + ); + + expect(page.components).toEqual([ + { + name: 'LinkCard', + attributes: { desc: 'Ways to participate', href: '/join', title: 'Join' }, + }, + { name: 'Split', attributes: { alt: 'Members together', heading: 'One community' } }, + { + name: 'TimelineEntry', + attributes: { pivot: true, title: 'Founded', year: '2001' }, + }, + { + name: 'Figure', + attributes: { caption: 'First gathering', date: '2001', source: 'Archive', wide: true }, + }, + ]); + }); + + it('uses PageHero metadata when a component-led page has no frontmatter or H1', () => { + const page = parseDoc( + 'about/index.md', + [ + '', + ].join('\n'), + ); + + expect(page.title).toBe('About the community'); + expect(page.summary).toBe('People, projects, and history.'); + }); + + it('indexes FactStrip labels and values without evaluating bindings', () => { + const page = parseDoc( + 'about/facts.md', + [ + '# Facts', + '', + ].join('\n'), + ); + + expect(searchDoc(page, 'open source')).toMatchObject({ path: 'about/facts.md' }); + expect(searchDoc(page, 'founded 2001')).toMatchObject({ path: 'about/facts.md' }); + }); + + it('does not treat nested home-page frontmatter as page metadata', () => { + const page = parseDoc( + 'index.md', + [ + '---', + 'layout: home', + 'hero:', + ' title: Nested title', + '---', + '', + ].join('\n'), + ); + + expect(page.title).toBe('index'); + expect(page.summary).toBe(''); + expect(page.route).toBe('/'); + }); + + it('ignores component examples in comments and fenced code', () => { + const page = parseDoc( + 'tutorial/components.md', + [ + '# Components', + '', + '```vue', + '', + '```', + ].join('\n'), + ); + + expect(page.components).toEqual([]); + expect(page.title).toBe('Components'); + }); +}); diff --git a/src/cache.ts b/src/cache.ts index 4364e70..0eab742 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -8,7 +8,7 @@ export class TtlCache { constructor( private readonly ttlMs: number, - private readonly maxSize: number = 50, + private readonly maxSize = 50, ) {} get(key: string): T | undefined { diff --git a/src/client.ts b/src/client.ts index 12cde56..dd0a5c6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,15 @@ import { TtlCache } from './cache.js'; +import { parseDoc, searchDoc } from './content.js'; import { DocsFetchError } from './types.js'; -import type { DocItem, DocsClient, DocsClientOptions } from './types.js'; +import type { + DocItem, + DocPage, + DocSection, + DocsClient, + DocsClientOptions, + DocsSearchOptions, + DocsSearchResult, +} from './types.js'; const DEFAULTS = { owner: 'nbtca', @@ -10,16 +19,45 @@ const DEFAULTS = { fileTtlMs: 10 * 60 * 1000, } as const; -const SKIP = new Set(['.github', '.husky', '.vitepress', '.vscode', 'node_modules', - 'assets', 'public', 'scripts', 'utils', 'package.json', 'pnpm-lock.yaml', - 'tsconfig.json', 'eslint.config.mjs', '.nvmrc', '.gitignore', - '.markdownlint-cli2.jsonc', 'CONTRIBUTING.md', 'CONTEXT.md']); +const SKIP = new Set([ + '.github', + '.husky', + '.vitepress', + '.vscode', + 'node_modules', + 'assets', + 'public', + 'scripts', + 'utils', + 'package.json', + 'pnpm-lock.yaml', + 'tsconfig.json', + 'eslint.config.mjs', + '.nvmrc', + '.gitignore', + '.markdownlint-cli2.jsonc', + 'CONTRIBUTING.md', + 'CONTEXT.md', + 'README.md', + 'docs', +]); + +const SEARCH_CONCURRENCY = 6; +const SEARCH_RESULT_LIMIT = 20; function filterAndSort(raw: GitHubItem[]): DocItem[] { return raw - .filter(i => !i.name.startsWith('.') && !SKIP.has(i.name) && - (i.type === 'dir' || (i.type === 'file' && i.name.endsWith('.md')))) - .map(i => ({ name: i.name, path: i.path, type: (i.type === 'dir' ? 'dir' : 'file') as 'dir' | 'file' })) + .filter( + (item) => + !item.name.startsWith('.') && + !SKIP.has(item.name) && + (item.type === 'dir' || (item.type === 'file' && item.name.endsWith('.md'))), + ) + .map((item): DocItem => ({ + name: item.name, + path: item.path, + type: item.type === 'dir' ? 'dir' : 'file', + })) .sort((a, b) => { if (a.type !== b.type) return a.type === 'dir' ? -1 : 1; return a.name.localeCompare(b.name); @@ -28,53 +66,122 @@ function filterAndSort(raw: GitHubItem[]): DocItem[] { function filterTree(items: GitHubTreeItem[]): DocItem[] { return items - .filter(i => { - const parts = i.path.split('/'); - if (parts.some(p => p.startsWith('.') || SKIP.has(p))) return false; - // Only return .md files; directories are navigated via listDir - return i.type === 'blob' && i.path.endsWith('.md'); + .filter((item) => { + const parts = item.path.split('/'); + if (parts.some((part) => part.startsWith('.') || SKIP.has(part))) return false; + return item.type === 'blob' && item.path.endsWith('.md'); }) - .map(i => ({ - name: i.path.split('/').pop()!, - path: i.path, + .map((item) => ({ + name: item.path.slice(item.path.lastIndexOf('/') + 1), + path: item.path, type: 'file' as const, })) .sort((a, b) => a.path.localeCompare(b.path)); } function copyItems(items: DocItem[]): DocItem[] { - return items.map(item => ({ ...item })); + return items.map((item) => ({ ...item })); +} + +function sectionsFromItems(items: DocItem[]): DocSection[] { + const sections = new Map(); + for (const item of items) { + const separator = item.path.indexOf('/'); + if (separator < 1) continue; + const path = item.path.slice(0, separator); + const current = sections.get(path) ?? { count: 0, path }; + current.count += 1; + if (item.path === `${path}/index.md`) current.indexPath = item.path; + sections.set(path, current); + } + return [...sections.values()] + .map((section) => ({ ...section })) + .sort((left, right) => left.path.localeCompare(right.path)); } -interface GitHubItem { name: string; path: string; type: string } -interface GitHubTreeItem { path: string; type: string } -interface GitHubTreeResponse { tree: GitHubTreeItem[]; truncated: boolean } +function searchLimit(value: number | undefined): number { + const limit = value ?? SEARCH_RESULT_LIMIT; + if (!Number.isSafeInteger(limit) || limit < 0) { + throw new RangeError('limit must be a non-negative safe integer'); + } + return limit; +} + +async function mapConcurrent( + values: readonly T[], + concurrency: number, + map: (value: T) => Promise, +): Promise { + const results = new Array(values.length); + let nextIndex = 0; + async function worker(): Promise { + for (;;) { + const index = nextIndex; + nextIndex += 1; + if (index >= values.length) return; + const value = values[index]; + if (value !== undefined) results[index] = await map(value); + } + } + const workers = Math.min(concurrency, values.length); + await Promise.all(Array.from({ length: workers }, worker)); + return results; +} + +interface GitHubItem { + name: string; + path: string; + type: string; +} + +interface GitHubTreeItem { + path: string; + type: string; +} + +interface GitHubTreeResponse { + tree: GitHubTreeItem[]; + truncated: boolean; +} function encodePath(path: string): string { - return path.split('/').map(encodeURIComponent).join('/'); + return path + .split('/') + .map((segment) => encodeURIComponent(segment)) + .join('/'); } function assertRepositoryPath(path: string, allowEmpty: boolean): void { if (allowEmpty && path === '') return; const parts = path.split('/'); if ( - path === '' - || path.startsWith('/') - || path.endsWith('/') - || path.includes('\\') - || parts.some(part => part === '' || part === '.' || part === '..') + path === '' || + path.startsWith('/') || + path.endsWith('/') || + path.includes('\\') || + parts.some((part) => part === '' || part === '.' || part === '..') ) { throw new TypeError('path must be a normalized repository-relative path'); } } +function hasControlCharacter(value: string): boolean { + for (const character of value) { + const code = character.charCodeAt(0); + if (code <= 0x1f || code === 0x7f) return true; + } + return false; +} + function assertRepositoryCoordinate(value: string, name: string): void { if ( - value === '' - || value !== value.trim() - || value === '.' - || value === '..' - || /[\/\\\u0000-\u001f\u007f]/.test(value) + value === '' || + value !== value.trim() || + value === '.' || + value === '..' || + value.includes('/') || + value.includes('\\') || + hasControlCharacter(value) ) { throw new TypeError(`${name} must be a valid GitHub repository coordinate`); } @@ -83,11 +190,11 @@ function assertRepositoryCoordinate(value: string, name: string): void { function assertBranchRef(value: string): void { const parts = value.split('/'); if ( - value === '' - || value !== value.trim() - || value.includes('\\') - || /[\u0000-\u001f\u007f]/.test(value) - || parts.some(part => part === '' || part === '.' || part === '..') + value === '' || + value !== value.trim() || + value.includes('\\') || + hasControlCharacter(value) || + parts.some((part) => part === '' || part === '.' || part === '..') ) { throw new TypeError('branch must be a valid Git ref'); } @@ -105,18 +212,27 @@ function isTransientStatus(status: number): boolean { return status === 408 || status === 429 || status >= 500; } +function reject(error: unknown): Promise { + return Promise.reject( + error instanceof Error ? error : new Error('Operation failed with a non-error value'), + ); +} + function isRecord(value: unknown): value is Record { return typeof value === 'object' && value !== null; } function isGitHubItem(value: unknown): value is GitHubItem { - return isRecord(value) && typeof value.name === 'string' && - typeof value.path === 'string' && typeof value.type === 'string'; + return ( + isRecord(value) && + typeof value.name === 'string' && + typeof value.path === 'string' && + typeof value.type === 'string' + ); } function isGitHubTreeItem(value: unknown): value is GitHubTreeItem { - return isRecord(value) && typeof value.path === 'string' && - typeof value.type === 'string'; + return isRecord(value) && typeof value.path === 'string' && typeof value.type === 'string'; } function parseContentsResponse(value: unknown): GitHubItem[] { @@ -127,8 +243,12 @@ function parseContentsResponse(value: unknown): GitHubItem[] { } function parseTreeResponse(value: unknown): GitHubTreeResponse { - if (!isRecord(value) || typeof value.truncated !== 'boolean' || - !Array.isArray(value.tree) || !value.tree.every(isGitHubTreeItem)) { + if ( + !isRecord(value) || + typeof value.truncated !== 'boolean' || + !Array.isArray(value.tree) || + !value.tree.every(isGitHubTreeItem) + ) { throw new TypeError('Invalid GitHub tree response'); } return { tree: value.tree, truncated: value.truncated }; @@ -141,17 +261,19 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { assertRepositoryCoordinate(owner, 'owner'); assertRepositoryCoordinate(repo, 'repo'); assertBranchRef(branch); - const token = options.token ?? (typeof process !== 'undefined' - ? (process.env['GITHUB_TOKEN'] ?? process.env['GH_TOKEN']) - : undefined); + const token = + options.token ?? + (typeof process !== 'undefined' + ? (process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN) + : undefined); const apiRepoUrl = `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`; const rawRepoUrl = `https://raw.githubusercontent.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`; const encodedBranch = encodeURIComponent(branch); const dirTtlMs = cacheTtl(options.cacheTtlMs?.dir, DEFAULTS.dirTtlMs, 'cacheTtlMs.dir'); const fileTtlMs = cacheTtl(options.cacheTtlMs?.file, DEFAULTS.fileTtlMs, 'cacheTtlMs.file'); - const dirCache = new TtlCache(dirTtlMs, 30); - const fileCache = new TtlCache(fileTtlMs, 50); + const dirCache = new TtlCache(dirTtlMs, 30); + const fileCache = new TtlCache(fileTtlMs, 200); const treeCache = new TtlCache(dirTtlMs, 1); const dirRequests = new Map>(); const fileRequests = new Map>(); @@ -159,9 +281,11 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { let cacheGeneration = 0; function headers(): Record { - const h: Record = { 'Accept': 'application/vnd.github.v3+json' }; - if (token) h['Authorization'] = `Bearer ${token}`; - return h; + const requestHeaders: Record = { + Accept: 'application/vnd.github.v3+json', + }; + if (token) requestHeaders.Authorization = `Bearer ${token}`; + return requestHeaders; } async function withResponse( @@ -170,7 +294,9 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { consume: (response: Response) => Promise, ): Promise { const ctrl = new AbortController(); - const timer = setTimeout(() => ctrl.abort(), timeoutMs); + const timer = setTimeout(() => { + ctrl.abort(); + }, timeoutMs); try { const response = await fetch(url, { signal: ctrl.signal, headers: headers() }); return await consume(response); @@ -184,13 +310,12 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { key: string, path: string, error: unknown, - copy: (value: T) => T = value => value, + copy: (value: T) => T = (value) => value, ): T { const stale = cache.getStale(key); if (stale !== undefined) return copy(stale); - const message = error instanceof Error && error.name === 'AbortError' - ? 'Request timed out' - : String(error); + const message = + error instanceof Error && error.name === 'AbortError' ? 'Request timed out' : String(error); throw new DocsFetchError(path, null, message); } @@ -210,23 +335,23 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { return request; } - async function loadDir(path: string, key: string, generation: number): Promise { + async function loadDir(path: string, generation: number): Promise { const url = `${apiRepoUrl}/contents/${encodePath(path)}?ref=${encodedBranch}`; try { - return await withResponse(url, 10_000, async response => { + return await withResponse(url, 10_000, async (response) => { if (!response.ok) { - const stale = dirCache.getStale(key); + const stale = dirCache.getStale(path); if (isTransientStatus(response.status) && stale !== undefined) return copyItems(stale); - throw new DocsFetchError(path, response.status, `HTTP ${response.status}`); + throw new DocsFetchError(path, response.status, `HTTP ${String(response.status)}`); } const data = parseContentsResponse(await response.json()); const items = filterAndSort(data); - if (generation === cacheGeneration) dirCache.set(key, copyItems(items)); + if (generation === cacheGeneration) dirCache.set(path, copyItems(items)); return items; }); } catch (error) { if (error instanceof DocsFetchError) throw error; - return recoverFailure(dirCache, key, path, error, copyItems); + return recoverFailure(dirCache, path, path, error, copyItems); } } @@ -234,28 +359,32 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { try { assertRepositoryPath(path, true); } catch (error) { - return Promise.reject(error); + return reject(error); } const hit = dirCache.get(path); if (hit) return Promise.resolve(copyItems(hit)); - return shareRequest(dirRequests, path, () => loadDir(path, path, cacheGeneration)); + return shareRequest(dirRequests, path, () => loadDir(path, cacheGeneration)).then(copyItems); } async function loadAll(generation: number): Promise { const key = '__tree__'; const url = `${apiRepoUrl}/git/trees/${encodedBranch}?recursive=1`; try { - return await withResponse(url, 20_000, async response => { + return await withResponse(url, 20_000, async (response) => { if (!response.ok) { const stale = treeCache.getStale(key); if (isTransientStatus(response.status) && stale !== undefined) return copyItems(stale); - throw new DocsFetchError('', response.status, `HTTP ${response.status}`); + throw new DocsFetchError('', response.status, `HTTP ${String(response.status)}`); } const data = parseTreeResponse(await response.json()); if (data.truncated) { const stale = treeCache.getStale(key); if (stale !== undefined) return copyItems(stale); - throw new DocsFetchError('', null, 'GitHub truncated the repository tree (too many files) -- results would be incomplete'); + throw new DocsFetchError( + '', + null, + 'GitHub truncated the repository tree (too many files) -- results would be incomplete', + ); } const items = filterTree(data.tree); if (generation === cacheGeneration) treeCache.set(key, copyItems(items)); @@ -271,17 +400,21 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { const key = '__tree__'; const hit = treeCache.get(key); if (hit) return Promise.resolve(copyItems(hit)); - return shareRequest(treeRequests, key, () => loadAll(cacheGeneration)); + return shareRequest(treeRequests, key, () => loadAll(cacheGeneration)).then(copyItems); + } + + async function listSections(): Promise { + return sectionsFromItems(await listAll()); } async function loadFile(path: string, generation: number): Promise { const url = `${rawRepoUrl}/${encodedBranch}/${encodePath(path)}`; try { - return await withResponse(url, 15_000, async response => { + return await withResponse(url, 15_000, async (response) => { if (!response.ok) { const stale = fileCache.getStale(path); if (isTransientStatus(response.status) && stale !== undefined) return stale; - throw new DocsFetchError(path, response.status, `HTTP ${response.status}`); + throw new DocsFetchError(path, response.status, `HTTP ${String(response.status)}`); } const content = await response.text(); if (generation === cacheGeneration) fileCache.set(path, content); @@ -297,13 +430,56 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { try { assertRepositoryPath(path, false); } catch (error) { - return Promise.reject(error); + return reject(error); } const hit = fileCache.get(path); if (hit !== undefined) return Promise.resolve(hit); return shareRequest(fileRequests, path, () => loadFile(path, cacheGeneration)); } + async function getDocument(path: string): Promise { + if (!path.toLowerCase().endsWith('.md')) { + throw new TypeError('path must point to a Markdown document'); + } + return parseDoc(path, await getFile(path)); + } + + async function search( + query: string, + options: DocsSearchOptions = {}, + ): Promise { + const normalizedQuery = query.trim(); + if (!normalizedQuery) throw new TypeError('query must not be empty'); + const limit = searchLimit(options.limit); + const pathPrefix = options.pathPrefix ?? ''; + assertRepositoryPath(pathPrefix, true); + if (limit === 0) return []; + const all = await listAll(); + const candidates = pathPrefix + ? all.filter((item) => item.path.startsWith(`${pathPrefix}/`)) + : all; + let loaded = 0; + let firstFailure: DocsFetchError | undefined; + const matches = await mapConcurrent(candidates, SEARCH_CONCURRENCY, async (item) => { + try { + const document = await getDocument(item.path); + loaded += 1; + return searchDoc(document, normalizedQuery); + } catch (error) { + if (error instanceof DocsFetchError) { + firstFailure ??= error; + return null; + } + throw error; + } + }); + if (loaded === 0 && firstFailure) throw firstFailure; + return matches + .filter((result): result is DocsSearchResult => result !== null) + .sort((left, right) => right.score - left.score || left.path.localeCompare(right.path)) + .slice(0, limit); + } + function clear(): void { cacheGeneration += 1; dirCache.clear(); @@ -314,5 +490,5 @@ export function createDocsClient(options: DocsClientOptions = {}): DocsClient { treeRequests.clear(); } - return { listDir, listAll, getFile, clear }; + return { listDir, listAll, listSections, getFile, getDocument, search, clear }; } diff --git a/src/content.ts b/src/content.ts new file mode 100644 index 0000000..0a4a257 --- /dev/null +++ b/src/content.ts @@ -0,0 +1,336 @@ +import type { DocComponent, DocPage, DocsSearchResult } from './types.js'; + +const SUMMARY_LENGTH = 160; +const EXCERPT_LENGTH = 180; + +interface ParsedSource { + body: string; + frontmatter: string; +} + +const COMPONENT_ATTRIBUTES: Readonly> = { + Band: ['alt', 'source'], + Figure: ['alt', 'caption', 'date', 'source'], + LinkCard: ['title', 'desc', 'alt'], + PageHero: ['title', 'lede', 'alt', 'source'], + Split: ['heading', 'alt'], + TimelineEntry: ['year', 'title'], +}; + +function splitFrontmatter(content: string): ParsedSource { + const match = /^(?:\uFEFF)?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(content); + if (!match) return { body: content, frontmatter: '' }; + return { + body: content.slice(match[0].length), + frontmatter: match[1] ?? '', + }; +} + +function decodeScalar(value: string): string | undefined { + const trimmed = value.trim(); + if (!trimmed || trimmed === '|' || trimmed === '>' || trimmed === '~' || trimmed === 'null') { + return undefined; + } + if (trimmed.startsWith('"') && trimmed.endsWith('"')) { + try { + const parsed: unknown = JSON.parse(trimmed); + return typeof parsed === 'string' ? parsed : undefined; + } catch { + return trimmed.slice(1, -1); + } + } + if (trimmed.startsWith("'") && trimmed.endsWith("'")) { + return trimmed.slice(1, -1).replace(/''/g, "'"); + } + return trimmed; +} + +function frontmatterValue(frontmatter: string, key: string): string | undefined { + for (const line of frontmatter.split(/\r?\n/)) { + if (/^[ \t]/.test(line)) continue; + const separator = line.indexOf(':'); + if (separator < 0 || line.slice(0, separator).trim() !== key) continue; + return decodeScalar(line.slice(separator + 1)); + } + return undefined; +} + +function cleanInline(value: string): string { + return value + .replace(/!\[([^\]]*)\]\([^)]*\)/g, '$1') + .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1') + .replace(/`([^`]+)`/g, '$1') + .replace(/<[^>]+>/g, '') + .replace(/[*_~]+/g, '') + .replace(/\s+/g, ' ') + .trim(); +} + +function extractTitle(body: string): string | undefined { + let fence: string | undefined; + for (const line of body.split(/\r?\n/)) { + const marker = /^\s*(`{3,}|~{3,})/.exec(line)?.[1]?.slice(0, 1); + if (marker) { + if (!fence) fence = marker; + else if (marker === fence) fence = undefined; + continue; + } + if (fence) continue; + const match = /^#\s+(.+?)\s*$/.exec(line); + if (match?.[1]) return cleanInline(match[1].replace(/\s+#+\s*$/, '')); + } + return undefined; +} + +function truncate(value: string, length: number): string { + const characters: string[] = []; + for (const character of value) characters.push(character); + if (characters.length <= length) return value; + return `${characters.slice(0, length).join('').trimEnd()}…`; +} + +function extractSummary(body: string): string { + const paragraphs: string[] = []; + let current: string[] = []; + let fence: string | undefined; + let inContainer = false; + let inTag = false; + let hiddenTag: 'script' | 'style' | undefined; + + const finishParagraph = () => { + if (current.length > 0) paragraphs.push(current.join(' ')); + current = []; + }; + + for (const rawLine of body.split(/\r?\n/)) { + const line = rawLine.trim(); + const marker = /^(`{3,}|~{3,})/.exec(line)?.[1]?.slice(0, 1); + if (marker) { + if (!fence) fence = marker; + else if (marker === fence) fence = undefined; + finishParagraph(); + continue; + } + if (fence) continue; + if (hiddenTag) { + if (line.toLowerCase().includes(``)) hiddenTag = undefined; + continue; + } + const hiddenStart = /^<(script|style)(?:\s|>)/i.exec(line)?.[1]?.toLowerCase(); + if (hiddenStart === 'script' || hiddenStart === 'style') { + hiddenTag = line.toLowerCase().includes(``) ? undefined : hiddenStart; + finishParagraph(); + continue; + } + if (line.startsWith(':::')) { + inContainer = !inContainer; + finishParagraph(); + continue; + } + if (inContainer) continue; + if (inTag) { + if (line.endsWith('>')) inTag = false; + continue; + } + if (line.startsWith('<')) { + if (!line.endsWith('>')) inTag = true; + finishParagraph(); + continue; + } + if (line === '') { + finishParagraph(); + if (paragraphs.length > 0) break; + continue; + } + if (/^(?:#{1,6}\s|>|\||[-*+]\s|\d+[.)]\s|(?:-{3,}|\*{3,}|_{3,})$)/.test(line)) { + finishParagraph(); + continue; + } + current.push(line); + } + finishParagraph(); + return truncate(cleanInline(paragraphs[0] ?? ''), SUMMARY_LENGTH); +} + +function markdownText(body: string): string { + return cleanInline( + body + .replace(//g, ' ') + .replace(/<(?:script|style)(?:\s[^>]*)?>[\s\S]*?<\/(?:script|style)>/gi, ' ') + .replace(/<[A-Z][A-Za-z\d]*(?:\s[^>]*)?\s*\/\s*>/g, ' ') + .replace(/<\/?[A-Z][A-Za-z\d]*(?:\s[^>]*)?>/g, ' ') + .replace(/^---\s*$/gm, ' ') + .replace(/^:::[^\n]*$/gm, ' ') + .replace(/^\s*(?:#{1,6}|>|[-*+]|\d+[.)])\s+/gm, ''), + ); +} + +function parseAttributes(source: string): Readonly> { + const attributes: Record = {}; + const pattern = /([:@A-Za-z_][:@\w.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g; + for (const match of source.matchAll(pattern)) { + const name = match[1]; + if (!name) continue; + attributes[name] = match[2] ?? match[3] ?? match[4] ?? true; + } + return attributes; +} + +function componentSource(body: string): string { + const lines: string[] = []; + let fence: string | undefined; + for (const line of body.split(/\r?\n/)) { + const marker = /^\s*(`{3,}|~{3,})/.exec(line)?.[1]?.slice(0, 1); + if (marker) { + if (!fence) fence = marker; + else if (marker === fence) fence = undefined; + continue; + } + if (!fence) lines.push(line); + } + return lines.join('\n').replace(//g, ' '); +} + +function extractComponents(body: string): DocComponent[] { + const components: DocComponent[] = []; + const pattern = /<([A-Z][A-Za-z\d]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\/?\s*>/g; + for (const match of componentSource(body).matchAll(pattern)) { + const name = match[1]; + if (!name) continue; + components.push({ attributes: parseAttributes(match[2] ?? ''), name }); + } + return components; +} + +function componentText(components: readonly DocComponent[]): string { + const values: string[] = []; + for (const component of components) { + if (component.name === 'FactStrip') { + const facts = component.attributes[':facts']; + if (typeof facts === 'string') { + for (const match of facts.matchAll(/\b(?:label|value)\s*:\s*(['"])(.*?)\1/gs)) { + if (match[2]) values.push(match[2].replace(/\\(['"\\])/g, '$1')); + } + } + } + for (const name of COMPONENT_ATTRIBUTES[component.name] ?? []) { + const value = component.attributes[name]; + if (typeof value === 'string') values.push(value); + } + } + return values.join(' '); +} + +function routeFromPath(path: string): string { + const withoutExtension = path.replace(/\.md$/i, ''); + if (withoutExtension === 'index') return '/'; + if (withoutExtension.endsWith('/index')) return `/${withoutExtension.slice(0, -5)}`; + return `/${withoutExtension}`; +} + +function fallbackTitle(path: string): string { + const name = path.slice(path.lastIndexOf('/') + 1); + return name.replace(/\.md$/i, ''); +} + +export function parseDoc(path: string, content: string): DocPage { + const { body, frontmatter } = splitFrontmatter(content); + const components = extractComponents(body); + const hero = components.find((component) => component.name === 'PageHero'); + const heroTitle = hero?.attributes.title; + const heroSummary = hero?.attributes.lede; + const name = path.slice(path.lastIndexOf('/') + 1); + const title = cleanInline( + extractTitle(body) ?? + frontmatterValue(frontmatter, 'title') ?? + (typeof heroTitle === 'string' ? heroTitle : ''), + ); + const summary = cleanInline( + frontmatterValue(frontmatter, 'summary') ?? + (typeof heroSummary === 'string' ? heroSummary : extractSummary(body)), + ); + return { + components, + content, + name, + path, + route: routeFromPath(path), + section: path.includes('/') ? (path.split('/')[0] ?? null) : null, + summary: truncate(summary, SUMMARY_LENGTH), + title: title || fallbackTitle(path), + }; +} + +function normalize(value: string): string { + return value.normalize('NFKC').toLowerCase(); +} + +function countMatches(value: string, term: string): number { + let count = 0; + let offset = 0; + while (offset < value.length) { + const index = value.indexOf(term, offset); + if (index < 0) break; + count += 1; + offset = index + Math.max(term.length, 1); + } + return count; +} + +function excerpt(text: string, query: string, terms: string[]): string { + if (!text) return ''; + const normalized = normalize(text); + const exactIndex = normalized.indexOf(query); + const matchIndex = + exactIndex >= 0 + ? exactIndex + : Math.min(...terms.map((term) => normalized.indexOf(term)).filter((index) => index >= 0)); + if (!Number.isFinite(matchIndex)) return truncate(text, EXCERPT_LENGTH); + + const start = Math.max(0, matchIndex - Math.floor(EXCERPT_LENGTH / 3)); + const prefix = start > 0 ? '…' : ''; + const value = text.slice(start, start + EXCERPT_LENGTH).trim(); + const suffix = start + EXCERPT_LENGTH < text.length ? '…' : ''; + return `${prefix}${value}${suffix}`; +} + +export function searchDoc(page: DocPage, query: string): DocsSearchResult | null { + const normalizedQuery = normalize(query.trim()); + if (!normalizedQuery) throw new TypeError('query must not be empty'); + const terms = normalizedQuery.split(/\s+/).filter(Boolean); + const componentValue = componentText(page.components); + const bodyValue = markdownText(splitFrontmatter(page.content).body); + const textValue = `${componentValue} ${bodyValue}`.trim(); + const title = normalize(page.title); + const summary = normalize(page.summary); + const path = normalize(page.path.replace(/[-_/]+/g, ' ')); + const components = normalize(componentValue); + const text = normalize(bodyValue); + const combined = `${title}\n${summary}\n${path}\n${components}\n${text}`; + if (!terms.every((term) => combined.includes(term))) return null; + + let score = title === normalizedQuery ? 240 : 0; + score += countMatches(title, normalizedQuery) * 80; + score += countMatches(summary, normalizedQuery) * 40; + score += countMatches(components, normalizedQuery) * 60; + score += countMatches(path, normalizedQuery) * 24; + score += Math.min(countMatches(text, normalizedQuery), 5) * 10; + for (const term of terms) { + score += countMatches(title, term) * 24; + score += countMatches(summary, term) * 12; + score += countMatches(components, term) * 18; + score += countMatches(path, term) * 8; + score += Math.min(countMatches(text, term), 5) * 3; + } + + return { + excerpt: excerpt(textValue, normalizedQuery, terms), + name: page.name, + path: page.path, + route: page.route, + score, + section: page.section, + summary: page.summary, + title: page.title, + }; +} diff --git a/src/index.ts b/src/index.ts index 2ed9642..dcd6949 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,13 @@ export { createDocsClient } from './client.js'; -export type { DocItem, DocsClient, DocsClientOptions } from './types.js'; +export { parseDoc } from './content.js'; +export type { + DocComponent, + DocItem, + DocPage, + DocSection, + DocsClient, + DocsClientOptions, + DocsSearchOptions, + DocsSearchResult, +} from './types.js'; export { DocsFetchError } from './types.js'; diff --git a/src/types.ts b/src/types.ts index 3683c06..0eb81f0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,6 +4,44 @@ export interface DocItem { type: 'file' | 'dir'; } +export interface DocComponent { + attributes: Readonly>; + name: string; +} + +export interface DocPage { + components: DocComponent[]; + content: string; + name: string; + path: string; + route: string; + section: string | null; + summary: string; + title: string; +} + +export interface DocSection { + count: number; + indexPath?: string; + path: string; +} + +export interface DocsSearchOptions { + limit?: number; + pathPrefix?: string; +} + +export interface DocsSearchResult { + excerpt: string; + name: string; + path: string; + route: string; + score: number; + section: string | null; + summary: string; + title: string; +} + export interface DocsClientOptions { owner?: string; repo?: string; @@ -18,7 +56,10 @@ export interface DocsClientOptions { export interface DocsClient { listDir(path?: string): Promise; listAll(): Promise; + listSections(): Promise; getFile(path: string): Promise; + getDocument(path: string): Promise; + search(query: string, options?: DocsSearchOptions): Promise; clear(): void; } diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..b72074f --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "noEmit": false, + "noEmitOnError": true, + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["src/__tests__"] +} diff --git a/tsconfig.json b/tsconfig.json index 8a0558b..4c7f5dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,15 +4,19 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2020", "DOM"], - "outDir": "./dist", - "declaration": true, - "declarationMap": true, - "sourceMap": true, "strict": true, - "esModuleInterop": true, + "exactOptionalPropertyTypes": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noImplicitOverride": true, + "noUncheckedIndexedAccess": true, + "noUncheckedSideEffectImports": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "verbatimModuleSyntax": true, + "noEmit": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, - "include": ["src"], - "exclude": ["node_modules", "dist", "src/__tests__"] + "include": ["src", "vitest.config.ts"] }