diff --git a/.bun-version b/.bun-version new file mode 100644 index 0000000..1c99cf0 --- /dev/null +++ b/.bun-version @@ -0,0 +1 @@ +1.4.4 diff --git a/.github/instructions/bug-fixing.instructions.md b/.github/instructions/bug-fixing.instructions.md index 97be174..770b839 100644 --- a/.github/instructions/bug-fixing.instructions.md +++ b/.github/instructions/bug-fixing.instructions.md @@ -61,8 +61,8 @@ For bugs in `tui.ts` or `api.ts` (side-effectful code), a test may not be practi ```bash bun test # the previously failing test now passes; full suite still green -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no formatting diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no formatting diff bun run knip # no unused exports or imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/instructions/documentation.instructions.md b/.github/instructions/documentation.instructions.md index 8ec039e..f66a516 100644 --- a/.github/instructions/documentation.instructions.md +++ b/.github/instructions/documentation.instructions.md @@ -96,7 +96,7 @@ Before opening a PR for any docs change: ```bash bun run docs:build # must complete without errors or dead-link warnings -bun run format:check # oxfmt — no formatting diff +bun run format:check # bun fmt --check — no formatting diff ``` - All internal links must resolve (VitePress reports dead links on build). diff --git a/.github/instructions/github-actions.instructions.md b/.github/instructions/github-actions.instructions.md index cb46890..02a3d4f 100644 --- a/.github/instructions/github-actions.instructions.md +++ b/.github/instructions/github-actions.instructions.md @@ -49,6 +49,12 @@ Actions that appear in multiple workflows (e.g. `actions/checkout`, `oven-sh/set always reference **the same commit SHA** across all files. Use `grep` to find all usages before opening a PR. +Every `oven-sh/setup-bun` step must use `bun-version-file: .bun-version`, including +release, documentation and browser-test jobs. Keep `.bun-version` at Bun 1.4.4 or +newer: quality checks use native `bun fmt` / `bun check`, not standalone tools. +Use `bun run typecheck` and `bun run format:check` in CI; `bun run lint` is only a +compatibility alias for type checking, not an equivalent linter. + ```bash grep -r "oven-sh/setup-bun" .github/workflows/ ``` diff --git a/.github/instructions/implement-feature.instructions.md b/.github/instructions/implement-feature.instructions.md index e99daf7..742fc3f 100644 --- a/.github/instructions/implement-feature.instructions.md +++ b/.github/instructions/implement-feature.instructions.md @@ -58,8 +58,8 @@ Before opening the pull request, ensure every item passes: ```bash bun test # all tests green -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no formatting diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no formatting diff bun run knip # no unused exports or imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/instructions/refactoring.instructions.md b/.github/instructions/refactoring.instructions.md index efd5ef5..6abb61b 100644 --- a/.github/instructions/refactoring.instructions.md +++ b/.github/instructions/refactoring.instructions.md @@ -67,8 +67,8 @@ Remove dead code rather than leaving it commented out. ```bash bun test # full suite passes — same behaviour before and after -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no formatting diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no formatting diff bun run knip # no unused exports or imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/instructions/release.instructions.md b/.github/instructions/release.instructions.md index 15c1760..4d06f1d 100644 --- a/.github/instructions/release.instructions.md +++ b/.github/instructions/release.instructions.md @@ -104,8 +104,8 @@ Do **not** create the GitHub Release manually — the CD pipeline handles it. ```bash bun test # full suite green -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no diff bun run knip # no unused exports bun run build.ts # binary compiles ``` @@ -117,7 +117,8 @@ bun run build.ts # binary compiles - [ ] `bun run docs:build` succeeds locally (spot-check the new blog entry) - The **version badge** in the hero (`VersionBadge.vue`) reads `version` from `package.json` at build time via `vite.define` — no manual update needed. It auto-points to the new blog post - slug (`release-vX-Y-Z`) derived from the version. Verify it shows the new version after deploy. + slug (`release-vX-Y-Z`) derived from the version, or to the GitHub Release page when no blog + post exists (e.g. patch releases). Verify it shows the new version after deploy. - [ ] `CHANGELOG.md` has no `_pending_` entries - [ ] For **major** releases: versioned docs snapshot available at `/github-code-search/vX/` diff --git a/.github/skills/bug-fixing.md b/.github/skills/bug-fixing.md index d19bb48..91eb8a3 100644 --- a/.github/skills/bug-fixing.md +++ b/.github/skills/bug-fixing.md @@ -121,8 +121,8 @@ Document manual repro steps in the PR description: ```bash bun test # the previously failing test now passes; full suite still green -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no formatting diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no formatting diff bun run knip # no unused exports or imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/skills/documentation.md b/.github/skills/documentation.md index f2b3eb3..e6affb1 100644 --- a/.github/skills/documentation.md +++ b/.github/skills/documentation.md @@ -158,5 +158,5 @@ bun run docs:build:a11y # build for a11y audit bun run docs:preview -- --port 4173 & bun run docs:a11y # 0 pa11y violations bun run docs:test:responsive # 20/20 Playwright tests green -bun run format:check # oxfmt — no formatting diff +bun run format:check # bun fmt --check — no formatting diff ``` diff --git a/.github/skills/feature.md b/.github/skills/feature.md index a45840f..824d00d 100644 --- a/.github/skills/feature.md +++ b/.github/skills/feature.md @@ -121,8 +121,8 @@ Conventions: ```bash bun test # all tests green (including new ones) -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no diff bun run knip # no unused exports / imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/skills/github-actions.md b/.github/skills/github-actions.md index c58e188..0a083c6 100644 --- a/.github/skills/github-actions.md +++ b/.github/skills/github-actions.md @@ -13,7 +13,7 @@ repository. Read this before writing or modifying any `.github/workflows/*.yaml` start-preview-server/ ← composite reusable action (shared server start logic) action.yml workflows/ - ci.yaml ← unit tests, format, lint, knip + coverage PR comment + ci.yaml ← unit tests, native format/type checks, knip + coverage PR comment cd.yaml ← binary build + GitHub Release on tag push docs.yaml ← VitePress Pages deploy + versioned snapshot a11y.yaml ← WCAG 2.1 AA audit via pa11y-ci @@ -21,6 +21,14 @@ repository. Read this before writing or modifying any `.github/workflows/*.yaml` responsive.yaml ← Playwright mobile viewport checks ``` +All Bun setup steps use `bun-version-file: .bun-version` (Bun 1.4.4 or newer). +Update that single pin rather than using `latest` or per-workflow versions. +CI and release checks use `bun run typecheck` (`bun check`) and +`bun run format:check` (`bun fmt --check .`). `bun run lint` is retained only as a +compatibility alias: TypeScript checking does not enforce the retired oxlint rules. +Documentation audit path filters include `.bun-version`, `package.json` and +`bun.lock` so runtime/dependency changes are verified too. + ### Composite action: `start-preview-server` Shared by `a11y.yaml` and `responsive.yaml`. Starts `bun run docs:preview --port ` diff --git a/.github/skills/refactoring.md b/.github/skills/refactoring.md index ce50bb6..3963ed0 100644 --- a/.github/skills/refactoring.md +++ b/.github/skills/refactoring.md @@ -115,8 +115,8 @@ bun run knip ```bash bun test # full suite passes — same behaviour before and after -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no formatting diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no formatting diff bun run knip # no unused exports or imports bun run build.ts # binary compiles without errors ``` diff --git a/.github/skills/release.md b/.github/skills/release.md index 7e8c270..15e0329 100644 --- a/.github/skills/release.md +++ b/.github/skills/release.md @@ -77,7 +77,7 @@ Pushing `vX.Y.Z` triggers the release pipeline automatically: ## Version badge -`VersionBadge.vue` reads `version` from `package.json` at build time via `vite.define`. It auto-derives the blog post slug (`release-vX-Y-Z`) from the version — no manual update needed. Verify it shows correctly after the docs deploy (~5 min after tag push). +`VersionBadge.vue` reads `version` from `package.json` at build time via `vite.define`. It auto-derives the blog post slug (`release-vX-Y-Z`) from the version and falls back to the GitHub Release page when that post does not exist (optional for patch releases) — no manual update needed. Verify it shows correctly after the docs deploy (~5 min after tag push). --- @@ -160,8 +160,8 @@ The version selector in the VitePress nav (`themeConfig.versionSelector`) reads ```bash bun test # full suite green -bun run lint # oxlint — zero errors -bun run format:check # oxfmt — no diff +bun run typecheck # bun check — zero type errors +bun run format:check # bun fmt --check — no diff bun run knip # no unused exports bun run build.ts # binary compiles for current platform diff --git a/.github/workflows/a11y.yaml b/.github/workflows/a11y.yaml index 3e9fa54..89b4430 100644 --- a/.github/workflows/a11y.yaml +++ b/.github/workflows/a11y.yaml @@ -24,6 +24,9 @@ on: pull_request: paths: - "docs/**" + - ".bun-version" + - "package.json" + - "bun.lock" - ".github/workflows/a11y.yaml" - ".pa11yci.json" workflow_dispatch: @@ -51,7 +54,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 971a8e0..548345b 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -1,3 +1,5 @@ +# Validate and compile release tags for each supported target, then publish +# the self-contained binaries and compatibility aliases in a GitHub Release. name: CD on: @@ -55,11 +57,17 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile + - name: Type check (bun check) + run: bun run typecheck + + - name: Check formatting (bun fmt) + run: bun run format:check + - name: Run tests run: bun test diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index af78b13..07e8595 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,5 @@ +# Validate pull requests and manually dispatched snapshot branches with tests, +# native Bun formatting/type checking and knip; retain the coverage PR report. name: CI on: @@ -12,11 +14,20 @@ on: # evaluation. workflow_dispatch: +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: test: + # Keep the existing status-check name for branch protection compatibility. name: Test · Format · Lint · Dead code runs-on: ubuntu-latest permissions: + contents: read pull-requests: write steps: @@ -26,7 +37,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile @@ -42,11 +53,11 @@ jobs: lcov-file: coverage/lcov.info continue-on-error: true - - name: Check formatting (oxfmt) + - name: Check formatting (bun fmt) run: bun run format:check - - name: Lint (oxlint) - run: bun run lint + - name: Type check (bun check) + run: bun run typecheck - name: Dead code detection (knip) run: bun run knip diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index b9ffbeb..6876f36 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -9,6 +9,9 @@ on: branches: [main] paths: - "docs/**" + - ".bun-version" + - "package.json" + - "bun.lock" - ".github/workflows/docs.yaml" tags: # Glob pattern (not regex): matches v1.0.0, v2.0.0, v10.0.0 … @@ -66,7 +69,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile @@ -158,7 +161,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile diff --git a/.github/workflows/lighthouse.yaml b/.github/workflows/lighthouse.yaml index d7f54c4..9fdd651 100644 --- a/.github/workflows/lighthouse.yaml +++ b/.github/workflows/lighthouse.yaml @@ -32,6 +32,9 @@ on: pull_request: paths: - "docs/**" + - ".bun-version" + - "package.json" + - "bun.lock" - ".github/workflows/lighthouse.yaml" - ".lhci.config.cjs" - "scripts/generate-lhci-report.ts" @@ -60,7 +63,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: - bun-version: latest + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile @@ -98,8 +101,12 @@ jobs: # Uses marocchino/sticky-pull-request-comment which upserts the comment # (one create, then updates on every subsequent push to the PR). # Reads the report written by the previous step via the `path:` input. + # continue-on-error: fork PRs get a read-only GITHUB_TOKEN, so posting the + # comment can fail even when the audit passes. The job summary and the + # "Fail if LHCI assertions failed" step below still reflect the result. - name: Post / update Lighthouse report on PR if: github.event_name == 'pull_request' + continue-on-error: true uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 with: header: lighthouse-ci diff --git a/.github/workflows/responsive.yaml b/.github/workflows/responsive.yaml index 253265b..32f7922 100644 --- a/.github/workflows/responsive.yaml +++ b/.github/workflows/responsive.yaml @@ -8,6 +8,9 @@ on: pull_request: paths: - "docs/**" + - ".bun-version" + - "package.json" + - "bun.lock" - "playwright.config.ts" - "scripts/responsive.pw.ts" - ".github/workflows/responsive.yaml" @@ -28,6 +31,8 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version-file: .bun-version - name: Install dependencies run: bun install --frozen-lockfile diff --git a/.oxfmtrc.json b/.oxfmtrc.json deleted file mode 100644 index 55c15df..0000000 --- a/.oxfmtrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "./node_modules/oxfmt/configuration_schema.json", - "ignorePatterns": [] -} diff --git a/.oxlintrc.json b/.oxlintrc.json deleted file mode 100644 index 2dbe09d..0000000 --- a/.oxlintrc.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "./node_modules/oxlint/configuration_schema.json", - "plugins": null, - "categories": { - "correctness": "error", - "suspicious": "warn" - }, - "rules": {}, - "overrides": [ - { - "files": ["**/*.test.ts"], - "rules": { - "no-control-regex": "off" - } - }, - { - "files": ["**/*.vue"], - "rules": { - "no-underscore-dangle": "off" - } - } - ], - "settings": { - "jsx-a11y": { - "polymorphicPropName": null, - "components": {}, - "attributes": {} - }, - "next": { - "rootDir": [] - }, - "react": { - "formComponents": [], - "linkComponents": [], - "version": null, - "componentWrapperFunctions": [] - }, - "jsdoc": { - "ignorePrivate": false, - "ignoreInternal": false, - "ignoreReplacesDocs": true, - "overrideReplacesDocs": true, - "augmentsExtendsReplacesDocs": false, - "implementsReplacesDocs": false, - "exemptDestructuredRootsFromChecks": false, - "tagNamePreference": {} - }, - "vitest": { - "typecheck": false - } - }, - "env": { - "builtin": true - }, - "globals": {}, - "ignorePatterns": [] -} diff --git a/AGENTS.md b/AGENTS.md index f930711..cf607a2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,13 +8,11 @@ This file provides context for AI coding agents (GitHub Copilot, Claude, Gemini, ## Runtime & toolchain -| Tool | Version | -| -------------- | -------------------------------------------------------- | -| **Bun** | ≥ 1.4 (runtime, bundler, test runner, package manager) | -| **TypeScript** | via Bun (no separate `tsc` invocation needed at runtime) | -| **oxlint** | linter (`bun run lint`) | -| **oxfmt** | formatter (`bun run format`) | -| **knip** | dead-code detector (`bun run knip`) | +| Tool | Version | +| -------------- | ---------------------------------------------------------------------- | +| **Bun** | ≥ 1.4.4 (runtime, bundler, tests, packages, formatting, type checking) | +| **TypeScript** | via Bun (no separate `tsc` invocation needed at runtime) | +| **knip** | dead-code detector (`bun run knip`) | There is **no Node.js / npm** involved. Always use `bun` commands. @@ -47,16 +45,31 @@ All TypeScript tests use Bun's built-in test runner (`@jest/globals`-compatible Shell-integration tests use [bats-core](https://github.com/bats-core/bats-core) (`brew install bats-core` or install via your package manager). They cover `install_completions()` from `install.sh` and are located in `install.test.bats`. -## Linting & formatting +## Type checking & formatting ```bash -bun run lint # oxlint — must pass before submitting -bun run format # oxfmt write (auto-fix) -bun run format:check # oxfmt check (CI check) +bun run typecheck # bun check — strict TypeScript checking +bun run lint # compatibility alias for typecheck (not a linter) +bun run format # bun fmt write (auto-fix) +bun run format:check # bun fmt --check (CI check) bun run knip # detect unused exports / files ``` -Always run `bun run lint` and `bun run format:check` before considering a change complete. +Always run `bun run typecheck` and `bun run format:check` before considering a change complete. + +`bun check` reads `tsconfig.json` and checks application code, tests and supporting +TypeScript scripts. It does not check Vue templates or replace general-purpose +lint rules. The former oxlint correctness/suspicious rules are intentionally retired; +do not reintroduce a standalone linter or formatter as part of routine changes. + +Formatting options live in `[fmt]` in `bunfig.toml` (100-column print width). +`knip.json` ignores `fmt` and `check` as binaries because knip currently mistakes +these native Bun subcommands for external executables. +All CI/CD and docs workflows read the pinned Bun version from `.bun-version`. +When updating that version, keep the minimum `engines.bun` requirement and current +installation/contributor documentation consistent. Compiled binaries do not need Bun. +No repository custom agent definitions are currently shipped; any future agents +must use the same native tooling and validation commands. ## Project layout diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e67162..5a4a67c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Thank you for taking the time to contribute! This document describes how to set ## Prerequisites -- [Bun](https://bun.sh) ≥ 1.4 +- [Bun](https://bun.sh) ≥ 1.4.4 (CI uses the version pinned in `.bun-version`) - A GitHub personal access token with `repo` scope (for integration testing) ## Development setup @@ -106,14 +106,20 @@ Compiled binaries require no runtime dependencies and can be distributed as a si - TypeScript throughout. - Pure functions wherever possible (makes unit testing straightforward). - Side-effectful code (CLI parsing, API calls, TTY interaction) is isolated in `github-code-search`, `src/api.ts`, and `src/tui.ts`. -- Run `bun run lint` (oxlint) — must pass with zero errors before submitting. -- Run `bun run format:check` (oxfmt) — auto-fix locally with `bun run format`. +- Run `bun run typecheck` (`bun check`) — strict TypeScript checking of application code, tests and supporting TypeScript scripts. +- Run `bun run format:check` (`bun fmt --check .`) — auto-fix locally with `bun run format` (`bun fmt .`). + +Formatting options live in `[fmt]` in `bunfig.toml`, retaining the 100-column print +width. No standalone formatter or linter is installed. `bun run lint` remains a +compatibility alias for type checking: `bun check` is not a linter, and the previous +oxlint correctness/suspicious rules are intentionally no longer enforced. Vue +templates are validated by the documentation build, not by `bun check`. ## Submitting a pull request 1. Fork the repository and create a branch: `git checkout -b my-feature`. 2. Make your changes, add or update tests. -3. Ensure `bun test` passes. +3. Ensure `bun test`, `bun run typecheck`, `bun run format:check`, `bun run knip` and `bun run build.ts` pass. 4. Open a pull request against `main` with a clear description of the motivation and changes. If your PR touches docs (`docs/**`), also verify: diff --git a/README.md b/README.md index 0270c72..18b9ee8 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,14 @@ keyboard- and mouse-driven TUI, fine-grained extract selection, markdown/JSON ou ## Requirements -- **Bun** ≥ 1.4 (runtime and package manager) +- **Bun** ≥ 1.4.4 when running or building from source; compiled binaries do not require Bun - **GitHub Token** with `repo` and `read:org` scopes +Development uses Bun's built-in `bun fmt` and `bun check`, with no standalone +formatter or linter dependency. Run `bun run format`, `bun run format:check` and +`bun run typecheck`; `bun run lint` is a compatibility alias for type checking, +not equivalent lint coverage. See [Contributing](CONTRIBUTING.md) for setup and checks. + ## Quick start **macOS / Linux** diff --git a/build.ts b/build.ts index c5484fe..fb7c29d 100644 --- a/build.ts +++ b/build.ts @@ -184,7 +184,7 @@ if (import.meta.main) { const icoPath = `${import.meta.dir}/docs/public/icons/favicon.ico`; const currentYear = new Date().getFullYear(); - const authorName = typeof author === "string" ? author : author.name; + const authorName = author; await Bun.$`mkdir -p dist`; await Bun.build({ diff --git a/bun.lock b/bun.lock index b033674..ef2f4e9 100644 --- a/bun.lock +++ b/bun.lock @@ -13,8 +13,6 @@ "bun-types": "^1.4.2", "knip": "^6.39.0", "mermaid": "^12.2.0", - "oxfmt": "^0.74.0", - "oxlint": "^1.86.0", "pa11y-ci": "^5.0.0", "sharp": "^0.35.5", "vitepress": "^1.6.4", @@ -299,82 +297,6 @@ "@oxc-resolver/binding-win32-x64-msvc": ["@oxc-resolver/binding-win32-x64-msvc@11.24.2", "", { "os": "win32", "cpu": "x64" }, "sha512-UqGPmo56KDfLlfXFAFIrNflHT8tFxWGEivWg3Zeyp4Uy2NlKN1FGPr6/BxcLGG3+kZ6Wp14g5Uj+n71boqZfiw=="], - "@oxfmt/binding-android-arm-eabi": ["@oxfmt/binding-android-arm-eabi@0.74.0", "", { "os": "android", "cpu": "arm" }, "sha512-xxQwrf5EPI5zxvuCTW8r6tzCTjPQ+h6+HqJ0iRKRy2zS1yBllt/xLVjoIyUc+FnR7g0a5g1SZv2yyDYhTItLbA=="], - - "@oxfmt/binding-android-arm64": ["@oxfmt/binding-android-arm64@0.74.0", "", { "os": "android", "cpu": "arm64" }, "sha512-FJW3sATVvrWbV64al8xofCPZj4500Z/1W0ad7Tg1rcCUyh0EMbuSrsf3jsZS7CEbwQ5fQ0mRhmkc129GFgofSQ=="], - - "@oxfmt/binding-darwin-arm64": ["@oxfmt/binding-darwin-arm64@0.74.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TfmNKBD30dGyMu9GCLiaw2rt/z7fms9LS+5cKcNOyWst0QgAs8oZs6wPxMbVaaDVE0/PCdCosgWM1vbu6f5NUg=="], - - "@oxfmt/binding-darwin-x64": ["@oxfmt/binding-darwin-x64@0.74.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-5Usf8+DfC4Q3o/MD8FkN47GrI6y0KbhQ4KhZ2HGzMZcXjcW1AeldwbUn51aKih+1TVuJFF9qkNm6X1nzm6NYng=="], - - "@oxfmt/binding-freebsd-x64": ["@oxfmt/binding-freebsd-x64@0.74.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-eL+1O3gykw1XihbZh2MRAciQvU2988LByrnjhyo/dmNG74X4oZ7XzigRoWPRFLfJCp8hzRkp/LbEhwe7uuT2eA=="], - - "@oxfmt/binding-linux-arm-gnueabihf": ["@oxfmt/binding-linux-arm-gnueabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-Xt0QtO2hJ4stnul8IL4LJGVLyp0xnc6ccN9fZ30yuubv8FWSRYxWwd1Za62KsEqAfmPSazoS/cLSUUJpja6npA=="], - - "@oxfmt/binding-linux-arm-musleabihf": ["@oxfmt/binding-linux-arm-musleabihf@0.74.0", "", { "os": "linux", "cpu": "arm" }, "sha512-/4wYQ0gZl4vUR0QoBTGaay73FmQ1GAjUa9z9101TR2xbGNrg4a+grazlR0yzEOe3/E+PJr5BGfj66MMzm/54vg=="], - - "@oxfmt/binding-linux-arm64-gnu": ["@oxfmt/binding-linux-arm64-gnu@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-846bKzF+HJd+JkOFh3rxzmYvSq4Cm+GMT+p+mW7S13ZYo6GAAGv8bL8cAOi/XcdeMqxEJDCIMTVQLVBXHMCdig=="], - - "@oxfmt/binding-linux-arm64-musl": ["@oxfmt/binding-linux-arm64-musl@0.74.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-nI5FJwZ4Flo6CBdscpwxymZXxO3m3IErQJX55ZS6h+ObfGXu8FostL85L/RWPFaCLnIVE4/WfLw+2q8XvVEeUA=="], - - "@oxfmt/binding-linux-ppc64-gnu": ["@oxfmt/binding-linux-ppc64-gnu@0.74.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-BoQYKuqUdsKAFAkK6DLBvkdv4+t0hppSm79sB0wIcE2o/eOwNj+6Z3OlKY4q3Eta/tlssP65FaS9vHn8TeF7vQ=="], - - "@oxfmt/binding-linux-riscv64-gnu": ["@oxfmt/binding-linux-riscv64-gnu@0.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-FSroRrM12+jCdSQklF9aOxsKpI6wFs4ZCo/1cSYG80RWZS6z4LV+l9tXRMT8lDGu+yohIZBwi9M76FzGPFDE2A=="], - - "@oxfmt/binding-linux-riscv64-musl": ["@oxfmt/binding-linux-riscv64-musl@0.74.0", "", { "os": "linux", "cpu": "none" }, "sha512-0VLQD0dhGBLY9Ik/w+otMvD81D0YXi4VDwql65macV+O9UzmSWmUr6CKf+dMtysDeC0PnG3y6kBkRO08BJx52g=="], - - "@oxfmt/binding-linux-s390x-gnu": ["@oxfmt/binding-linux-s390x-gnu@0.74.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-6X7BbZNz34+OHM6Oqjf6TRcUyRn6aRcB4VtIDZAF/uQRyeVhg+G2hv6MlMvmnRekVSyTJ/8rG/u8W2dRFW6glg=="], - - "@oxfmt/binding-linux-x64-gnu": ["@oxfmt/binding-linux-x64-gnu@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-4kYIQK53yJXrxwxSzx8H2bojlf6/KezLGYLRXzV9QCCkoiCsvBTCid9Bg83dUPTLPa3g9K0730f6MKDbck1+OA=="], - - "@oxfmt/binding-linux-x64-musl": ["@oxfmt/binding-linux-x64-musl@0.74.0", "", { "os": "linux", "cpu": "x64" }, "sha512-MfWz4wDREjp/JQDmuxtKieix4FHGa1z5rBvB3betdcPwZvf5fqeQrlCm1mmoyuUVQOh9Pt3M61HwN94kJCxw7Q=="], - - "@oxfmt/binding-openharmony-arm64": ["@oxfmt/binding-openharmony-arm64@0.74.0", "", { "os": "none", "cpu": "arm64" }, "sha512-6rmAApkq5s1kbDjvNI6Nl5A+JqQkLORb2sR941pf5HWsrd01WGKyagK/B4vX9+kh1FfvRkNgEu59FHvVk4H8cQ=="], - - "@oxfmt/binding-win32-arm64-msvc": ["@oxfmt/binding-win32-arm64-msvc@0.74.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-+5SpRUnZNGeXTyumHnpHa791tQtt04qZs076WT8eTcGF2OJ631VLnf7S0kQSPuDG+PtJM0phadEB2WAr5n1w9g=="], - - "@oxfmt/binding-win32-ia32-msvc": ["@oxfmt/binding-win32-ia32-msvc@0.74.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-1Fg+wYBO3Dsti1QX+/6EYHjeQzLC84tLOAqPu/r7ah3UJlUs9C/DB703Ay9Vcg+8VMzqZA2P5VGhzJraVUD4OQ=="], - - "@oxfmt/binding-win32-x64-msvc": ["@oxfmt/binding-win32-x64-msvc@0.74.0", "", { "os": "win32", "cpu": "x64" }, "sha512-y9jXUgPBm2TZIWbQhMYRRYAQM57+r4fbykgc+j24ICIIZl+pcuoNhnq1CRGm3oFiHnEUnZO00qOtSPGQdJ2ziQ=="], - - "@oxlint/binding-android-arm-eabi": ["@oxlint/binding-android-arm-eabi@1.86.0", "", { "os": "android", "cpu": "arm" }, "sha512-63Ozq6yQn79B2UxjSZ9huJmI+3/ZPI7hxAe6TyFh9oQL447KnIMoffOdtog+h4KILbQr61ZRvFPW5gYbAUgpgQ=="], - - "@oxlint/binding-android-arm64": ["@oxlint/binding-android-arm64@1.86.0", "", { "os": "android", "cpu": "arm64" }, "sha512-JdLGp44phbf/0Du236Dt06yfK6Qw8xhTFeDvHJdjk167r59OfP5+BL31mgMYVnswS8e+j6tFuccSY0QDC/lgCw=="], - - "@oxlint/binding-darwin-arm64": ["@oxlint/binding-darwin-arm64@1.86.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-h+vkOr4ik6KLFCXdtNVEj9xfnXfNUpPoF95QjORdhiSpLqQePzcN81kGHjAgsw1/G7WBWK5KsFKbI2UK8EyzMA=="], - - "@oxlint/binding-darwin-x64": ["@oxlint/binding-darwin-x64@1.86.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-wbglRuH5eKsp68keTOOeKDHU1astWSRYFsh2bwKQTAPb44rD6kVgzYI1ZrAJRTc6/7PH55ZXFCQx0rQXrj0UdA=="], - - "@oxlint/binding-freebsd-x64": ["@oxlint/binding-freebsd-x64@1.86.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-yTQ7QSOlNfQsrfbeVweTiegQJLKPjUKgXp/JpGiFzza6Hp29S9LAoH77TM3L0RjK39iQRZB5lk5iq2t241Mfag=="], - - "@oxlint/binding-linux-arm-gnueabihf": ["@oxlint/binding-linux-arm-gnueabihf@1.86.0", "", { "os": "linux", "cpu": "arm" }, "sha512-QYJGy0E2Tv8GAayyBIeHFTwQb8u+zrvrOYrifuDGZDr9ad5XsDhiMScpZymhS9fwWjqrgG2ZUwT4vpY0ISqp4Q=="], - - "@oxlint/binding-linux-arm-musleabihf": ["@oxlint/binding-linux-arm-musleabihf@1.86.0", "", { "os": "linux", "cpu": "arm" }, "sha512-oQo83CafLT8p3qh0AGkN0tSUIh5Hm63mfDsoqUmBQUBnSZLNBAbyRaAftfGY5a0cKZ34dG6jAtMYgcY5kZqt5g=="], - - "@oxlint/binding-linux-arm64-gnu": ["@oxlint/binding-linux-arm64-gnu@1.86.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-EM6wy5c2UM12qPb7iDJDBAZvHyfEJGH6iosFgaFiaRZpirz99//EHcUyD2KAskz07x1TULuiAtsojf4nvWWksw=="], - - "@oxlint/binding-linux-arm64-musl": ["@oxlint/binding-linux-arm64-musl@1.86.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-vCiUQb9ZNzZalxYRU4mlZwUqT5f+c7Sk9DwUOplWHtik3Dl4r3DVnUB5tBeRuTAUe6MUVCTylNW7TkkN8J1oTw=="], - - "@oxlint/binding-linux-ppc64-gnu": ["@oxlint/binding-linux-ppc64-gnu@1.86.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-T0AzE89yjTYmOhB/hb6i+rWTpe2mYt+xiguBhs9DEPIJTZ1H8OYqsE4VxJHHw2Wlq8Mztwvp2P8NV87ZOuhPRw=="], - - "@oxlint/binding-linux-riscv64-gnu": ["@oxlint/binding-linux-riscv64-gnu@1.86.0", "", { "os": "linux", "cpu": "none" }, "sha512-s49r0K2f5Oc7fJoMUO1WkdhYK5Ob79uYRwWQ/XNoGysaOq3RUGmGUbHSuXiyydTTA+P9xEdDEnnlZVXiaSJhlw=="], - - "@oxlint/binding-linux-riscv64-musl": ["@oxlint/binding-linux-riscv64-musl@1.86.0", "", { "os": "linux", "cpu": "none" }, "sha512-JIa2tYR8ayb3nvcMSZzn4O/xTy13S7MHllu7cBD+B5qDQXXSRy/Vwk1aNpiTjZmBJGwKCHOy/NvnY5Xcwg27uQ=="], - - "@oxlint/binding-linux-s390x-gnu": ["@oxlint/binding-linux-s390x-gnu@1.86.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-XwXMyBsAuWZkhZU74UNcfQKr1CJJAKnS80dZzOnjl6A4fKcf91IjFgidegQugMHA5SN8ulwDXEDV1yPntjXgQQ=="], - - "@oxlint/binding-linux-x64-gnu": ["@oxlint/binding-linux-x64-gnu@1.86.0", "", { "os": "linux", "cpu": "x64" }, "sha512-C1WjukSyMnr66b+w1/tV8RFVv6d9v0MzDf4p9IxVXknqgmTHBgZh1pccN1eHzFr0b9Tbb3OXoPsAAdAuHAQfeA=="], - - "@oxlint/binding-linux-x64-musl": ["@oxlint/binding-linux-x64-musl@1.86.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ap6KLmvC38c6MdYzsIh25cXQupqYvjd37tMNftzrX1DCtkX1Gcf2B+S2B17dD4lKa5c5gJog7DQJyDo82PBKyw=="], - - "@oxlint/binding-openharmony-arm64": ["@oxlint/binding-openharmony-arm64@1.86.0", "", { "os": "none", "cpu": "arm64" }, "sha512-996Q9w/2GLwNyy5Djs39Jt09aFlr4b7TPhoj7dvo5FHmcyiF68nPz73HNc5UAYKIYeK+M9JzPQ4Wg1r1dXvP6A=="], - - "@oxlint/binding-win32-arm64-msvc": ["@oxlint/binding-win32-arm64-msvc@1.86.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-9uTCHYTknNkug5+46ViSoUMuOuGWK61D87QnblU6CXaWKJC630Z7dbls61vdHxya/cR2ycQZ6Mm6ckgF6Cag5g=="], - - "@oxlint/binding-win32-ia32-msvc": ["@oxlint/binding-win32-ia32-msvc@1.86.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-a47ga7EKVfMU8rO0i1m3mGwfNRj3FhQyt1d/ukO/E9u1HHF3KpR3tyb3VhuJBGEVPF8uR4exSyHUyx7xbE+uxw=="], - - "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.86.0", "", { "os": "win32", "cpu": "x64" }, "sha512-az4dzifCRzES1crwu6pDFXzJTIanrdxXFL9TbiJWrx9LKcuacbR83aPvxDA1LKLNswi/RoqitC7Afcflhu3zBQ=="], - "@pa11y/html_codesniffer": ["@pa11y/html_codesniffer@2.6.0", "", {}, "sha512-BKA7qG8NyaIBdCBDep0hYuYoF/bEyWJprE6EEVJOPiwj80sSiIKDT8LUVd19qKhVqNZZD3QvJIdFZ35p+vAFPg=="], "@paulirish/trace_engine": ["@paulirish/trace_engine@0.0.53", "", { "dependencies": { "legacy-javascript": "latest", "third-party-web": "latest" } }, "sha512-PUl/vlfo08Oj804VI5nDPeSk9vyslnBlVzDDwFt8SUVxY8+KdGMkra/vrXjEEHe8gb7+RqVTfOIlGw0nyrEelA=="], @@ -1171,10 +1093,6 @@ "oxc-resolver": ["oxc-resolver@11.24.2", "", { "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.24.2", "@oxc-resolver/binding-android-arm64": "11.24.2", "@oxc-resolver/binding-darwin-arm64": "11.24.2", "@oxc-resolver/binding-darwin-x64": "11.24.2", "@oxc-resolver/binding-freebsd-x64": "11.24.2", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.24.2", "@oxc-resolver/binding-linux-arm-musleabihf": "11.24.2", "@oxc-resolver/binding-linux-arm64-gnu": "11.24.2", "@oxc-resolver/binding-linux-arm64-musl": "11.24.2", "@oxc-resolver/binding-linux-ppc64-gnu": "11.24.2", "@oxc-resolver/binding-linux-riscv64-gnu": "11.24.2", "@oxc-resolver/binding-linux-riscv64-musl": "11.24.2", "@oxc-resolver/binding-linux-s390x-gnu": "11.24.2", "@oxc-resolver/binding-linux-x64-gnu": "11.24.2", "@oxc-resolver/binding-linux-x64-musl": "11.24.2", "@oxc-resolver/binding-openharmony-arm64": "11.24.2", "@oxc-resolver/binding-wasm32-wasi": "11.24.2", "@oxc-resolver/binding-win32-arm64-msvc": "11.24.2", "@oxc-resolver/binding-win32-x64-msvc": "11.24.2" } }, "sha512-FY91FiDBj7ls5MsFS9jN3tjz2o0/zsdSsymlakySaBwVJZorHhkWyICLZMKxlu1R9vYo+sd3z1jwb4J8x7bNDw=="], - "oxfmt": ["oxfmt@0.74.0", "", { "dependencies": { "tinypool": "2.2.0" }, "optionalDependencies": { "@oxfmt/binding-android-arm-eabi": "0.74.0", "@oxfmt/binding-android-arm64": "0.74.0", "@oxfmt/binding-darwin-arm64": "0.74.0", "@oxfmt/binding-darwin-x64": "0.74.0", "@oxfmt/binding-freebsd-x64": "0.74.0", "@oxfmt/binding-linux-arm-gnueabihf": "0.74.0", "@oxfmt/binding-linux-arm-musleabihf": "0.74.0", "@oxfmt/binding-linux-arm64-gnu": "0.74.0", "@oxfmt/binding-linux-arm64-musl": "0.74.0", "@oxfmt/binding-linux-ppc64-gnu": "0.74.0", "@oxfmt/binding-linux-riscv64-gnu": "0.74.0", "@oxfmt/binding-linux-riscv64-musl": "0.74.0", "@oxfmt/binding-linux-s390x-gnu": "0.74.0", "@oxfmt/binding-linux-x64-gnu": "0.74.0", "@oxfmt/binding-linux-x64-musl": "0.74.0", "@oxfmt/binding-openharmony-arm64": "0.74.0", "@oxfmt/binding-win32-arm64-msvc": "0.74.0", "@oxfmt/binding-win32-ia32-msvc": "0.74.0", "@oxfmt/binding-win32-x64-msvc": "0.74.0" }, "peerDependencies": { "@astrojs/compiler-rs": "^0.4.0 || ^0.5.0", "svelte": "^5.0.0", "vite-plus": "*" }, "optionalPeers": ["@astrojs/compiler-rs", "svelte", "vite-plus"], "bin": { "oxfmt": "bin/oxfmt" } }, "sha512-G4OP7FgwGYZR5ttRpCOOfJdyRsSyvtn34vSXnjDq6Oqed5Dufg5mB44mank+51nAdHOKuTJ0lj0mksY7L+N61A=="], - - "oxlint": ["oxlint@1.86.0", "", { "optionalDependencies": { "@oxlint/binding-android-arm-eabi": "1.86.0", "@oxlint/binding-android-arm64": "1.86.0", "@oxlint/binding-darwin-arm64": "1.86.0", "@oxlint/binding-darwin-x64": "1.86.0", "@oxlint/binding-freebsd-x64": "1.86.0", "@oxlint/binding-linux-arm-gnueabihf": "1.86.0", "@oxlint/binding-linux-arm-musleabihf": "1.86.0", "@oxlint/binding-linux-arm64-gnu": "1.86.0", "@oxlint/binding-linux-arm64-musl": "1.86.0", "@oxlint/binding-linux-ppc64-gnu": "1.86.0", "@oxlint/binding-linux-riscv64-gnu": "1.86.0", "@oxlint/binding-linux-riscv64-musl": "1.86.0", "@oxlint/binding-linux-s390x-gnu": "1.86.0", "@oxlint/binding-linux-x64-gnu": "1.86.0", "@oxlint/binding-linux-x64-musl": "1.86.0", "@oxlint/binding-openharmony-arm64": "1.86.0", "@oxlint/binding-win32-arm64-msvc": "1.86.0", "@oxlint/binding-win32-ia32-msvc": "1.86.0", "@oxlint/binding-win32-x64-msvc": "1.86.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2003", "vite-plus": "*" }, "optionalPeers": ["oxlint-tsgolint", "vite-plus"], "bin": { "oxlint": "bin/oxlint" } }, "sha512-og0lhgvZfgGF//gOOmZXvtr+GmBbAGEnbEhv/QUg7UW2Wi4wHMnJbnMD+zuHgPdJxdklfgpPupdlAaAySyxrZg=="], - "p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], "p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], @@ -1379,8 +1297,6 @@ "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], - "tinypool": ["tinypool@2.2.0", "", {}, "sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ=="], - "tldts-core": ["tldts-core@6.1.86", "", {}, "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA=="], "tldts-icann": ["tldts-icann@6.1.86", "", { "dependencies": { "tldts-core": "^6.1.86" } }, "sha512-NFxmRT2lAEMcCOBgeZ0NuM0zsK/xgmNajnY6n4S1mwAKocft2s2ise1O3nQxrH3c+uY6hgHUV9GGNVp7tUE4Sg=="], diff --git a/bunfig.toml b/bunfig.toml index 0635736..7a30037 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,3 +1,6 @@ +[fmt] +printWidth = 100 + [test] coverage = true coverageReporter = ["text", "lcov"] diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 4afdf6a..6d34789 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,11 +1,17 @@ import { defineConfig } from "vitepress"; -import { readdirSync } from "node:fs"; +import { existsSync, readdirSync } from "node:fs"; import { fileURLToPath } from "node:url"; import versionsData from "../public/versions.json"; import pkg from "../../package.json"; const latestVersion: string = pkg.version; const latestBlogSlug = `release-v${latestVersion.replace(/\./g, "-")}`; +// Patch releases may ship without a blog post: fall back to the GitHub Release page. +const latestReleaseUrl = existsSync( + fileURLToPath(new URL(`../blog/${latestBlogSlug}.md`, import.meta.url)), +) + ? null + : `https://github.com/fulll/github-code-search/releases/tag/v${latestVersion}`; // ─── Semantic version helpers for blog sidebar sort ─────────────────────────── function parseBlogVersion(filename: string): number[] { @@ -177,6 +183,7 @@ export default defineConfig({ // Consumed by docs/.vitepress/theme/VersionBadge.vue — auto-updates on docs:build __LATEST_VERSION__: JSON.stringify(latestVersion), __LATEST_BLOG_SLUG__: JSON.stringify(latestBlogSlug), + __LATEST_RELEASE_URL__: JSON.stringify(latestReleaseUrl), }, plugins: [ { diff --git a/docs/.vitepress/theme/VersionBadge.vue b/docs/.vitepress/theme/VersionBadge.vue index a80b208..7a8c7af 100644 --- a/docs/.vitepress/theme/VersionBadge.vue +++ b/docs/.vitepress/theme/VersionBadge.vue @@ -15,12 +15,15 @@ import { withBase } from "vitepress"; * __LATEST_VERSION__ and __LATEST_BLOG_SLUG__ are replaced at build/dev time * by vite.define in docs/.vitepress/config.mts, reading from package.json. * When docs:build is triggered after a release tag, the badge auto-updates. + * __LATEST_RELEASE_URL__ is set (GitHub Release page) only when the version + * has no blog post (optional for patch releases); otherwise it is null. */ declare const __LATEST_VERSION__: string; declare const __LATEST_BLOG_SLUG__: string; +declare const __LATEST_RELEASE_URL__: string | null; const version = __LATEST_VERSION__; -const releaseLink = withBase(`/blog/${__LATEST_BLOG_SLUG__}`); +const releaseLink = __LATEST_RELEASE_URL__ ?? withBase(`/blog/${__LATEST_BLOG_SLUG__}`);