From 468a61364e4a64e5553169e36f3073c00280f7d9 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 21 Sep 2026 11:42:11 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20sync:=20retarget=20Hive=20docs?= =?UTF-8?q?=20source=20from=20v4=20to=20v5=20for=20the=20stable=20channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flips the sync-hive-docs.ts default branch to v5 so docs.hivecommons.dev documents the line that feeds the `stable` release channel once v5 is promoted (hivecommons/hive#7721 Phase 3). Netlify can still override with HIVE_DOCS_REF. Refs hivecommons/hive#7814 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Andrew Anderson --- README.md | 2 +- public/config/shared.json | 6 +++--- scripts/sync-hive-docs.test.ts | 12 ++++++------ scripts/sync-hive-docs.ts | 3 ++- src/components/docs/DocsSourceActions.tsx | 4 ++-- src/components/docs/EditPageLink.tsx | 2 +- src/config/versions.ts | 6 +++--- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3356c61..efeb21b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Official documentation site for [Hive Commons](https://hivecommons.dev), served Hive, hotshot, and pluk docs are **single-sourced from their repositories** and pulled at build time: -- `scripts/sync-hive-docs.ts` pulls Hive docs from `hivecommons/hive` (`src/docs/`, branch `v4`; +- `scripts/sync-hive-docs.ts` pulls Hive docs from `hivecommons/hive` (`src/docs/`, branch `v5`; override with `HIVE_DOCS_OWNER` / `HIVE_DOCS_REPO` / `HIVE_DOCS_REF`). - `scripts/sync-sibling-docs.ts` pulls the hotshot, pluk, rationguard, and promptargs docs from their repos. diff --git a/public/config/shared.json b/public/config/shared.json index dfb189e..60a005d 100644 --- a/public/config/shared.json +++ b/public/config/shared.json @@ -2,7 +2,7 @@ "versions": { "hive": { "latest": { - "label": "v4 (Latest)", + "label": "v5 (Latest)", "branch": "main", "isDefault": true } @@ -40,7 +40,7 @@ "hive": { "name": "Hive", "basePath": "hive", - "currentVersion": "v4" + "currentVersion": "v5" }, "hotshot": { "name": "hotshot", @@ -95,7 +95,7 @@ } ], "editBaseUrls": { - "hive": "https://github.com/hivecommons/hive/edit/v4/src/docs", + "hive": "https://github.com/hivecommons/hive/edit/v5/src/docs", "hotshot": "https://github.com/hivecommons/hotshot/edit/main", "pluk": "https://github.com/hivecommons/pluk/edit/main", "rationguard": "https://github.com/hivecommons/rationguard/edit/main", diff --git a/scripts/sync-hive-docs.test.ts b/scripts/sync-hive-docs.test.ts index 8058a63..83f5514 100644 --- a/scripts/sync-hive-docs.test.ts +++ b/scripts/sync-hive-docs.test.ts @@ -38,14 +38,14 @@ describe("rewriteLinkTarget — Case 2: escapes / unsynced -> absolute GitHub UR it("resolves `../../` escape to the repo-root path on the sync branch", () => { // src/docs/ + ../../bin/README.md = bin/README.md at the repo root. expect(rewriteLinkTarget("../../bin/README.md", README)).toBe( - "https://github.com/hivecommons/hive/blob/v4/bin/README.md" + "https://github.com/hivecommons/hive/blob/v5/bin/README.md" ); }); it("resolves a single `../` escape into the sibling repo directory", () => { // src/docs/ + ../deploy/README.md = src/deploy/README.md. expect(rewriteLinkTarget("../deploy/README.md", README)).toBe( - "https://github.com/hivecommons/hive/blob/v4/src/deploy/README.md" + "https://github.com/hivecommons/hive/blob/v5/src/deploy/README.md" ); }); @@ -53,7 +53,7 @@ describe("rewriteLinkTarget — Case 2: escapes / unsynced -> absolute GitHub UR // env-vars.md exists in hive src/docs but is not on the sync allow-list, // so links to it resolve to a GitHub blob URL rather than a site route. expect(rewriteLinkTarget("env-vars.md", README)).toBe( - "https://github.com/hivecommons/hive/blob/v4/src/docs/env-vars.md" + "https://github.com/hivecommons/hive/blob/v5/src/docs/env-vars.md" ); }); @@ -68,7 +68,7 @@ describe("rewriteLinkTarget — Case 2: escapes / unsynced -> absolute GitHub UR it("handles a JSON (non-markdown) escape target", () => { expect(rewriteLinkTarget("../../dashboard/openapi.json", README)).toBe( - "https://github.com/hivecommons/hive/blob/v4/dashboard/openapi.json" + "https://github.com/hivecommons/hive/blob/v5/dashboard/openapi.json" ); }); }); @@ -80,7 +80,7 @@ describe("rewriteLinkTarget — left untouched", () => { }); it("leaves an already-rewritten GitHub blob URL alone (idempotent)", () => { - const url = "https://github.com/hivecommons/hive/blob/v4/bin/README.md"; + const url = "https://github.com/hivecommons/hive/blob/v5/bin/README.md"; expect(rewriteLinkTarget(url, README)).toBe(url); }); @@ -105,7 +105,7 @@ describe("rewriteLinks — over full markdown content", () => { const out = rewriteLinks(md, README); expect(out).toContain("[Architecture](/docs/hive/architecture)"); expect(out).toContain( - '[bin](https://github.com/hivecommons/hive/blob/v4/bin/README.md "index")' + '[bin](https://github.com/hivecommons/hive/blob/v5/bin/README.md "index")' ); }); diff --git a/scripts/sync-hive-docs.ts b/scripts/sync-hive-docs.ts index 6d6198f..22d43cb 100644 --- a/scripts/sync-hive-docs.ts +++ b/scripts/sync-hive-docs.ts @@ -5,7 +5,8 @@ import path from "path"; // transfer lands the docs stay in hivecommons/hive. Override with HIVE_DOCS_OWNER. const owner = process.env.HIVE_DOCS_OWNER || "hivecommons"; const repo = process.env.HIVE_DOCS_REPO || "hive"; -const branch = process.env.HIVE_DOCS_REF || "v4"; +// Default tracks the Hive branch that feeds the `stable` release channel (hivecommons/hive#7814, #7721 Phase 3). +const branch = process.env.HIVE_DOCS_REF || "v5"; const docsRoot = path.join(process.cwd(), "docs", "content", "hive"); const rawBase = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/src/docs`; const canonicalBase = `https://github.com/${owner}/${repo}/blob/${branch}/src/docs`; diff --git a/src/components/docs/DocsSourceActions.tsx b/src/components/docs/DocsSourceActions.tsx index 2e30aa5..f339922 100644 --- a/src/components/docs/DocsSourceActions.tsx +++ b/src/components/docs/DocsSourceActions.tsx @@ -5,13 +5,13 @@ import type { ProjectId } from "@/config/versions"; import { GitPullRequest, FileCode, AlertCircle } from "lucide-react"; -// Hive has no `main` branch (default is `v4`) and its docs live under +// Hive has no `main` branch (default tracks the stable release branch) and its docs live under // `src/docs`. Kept in sync with scripts/sync-hive-docs.ts. NOTE: page // filePaths use `readme.md` (lowercased), but the canonical source is // `README.md`; that single page's edit/source link will 404 until the // filePath casing is reconciled. const STATIC_EDIT_BASE_URLS: Record = { - hive: 'https://github.com/hivecommons/hive/edit/v4/src/docs', + hive: 'https://github.com/hivecommons/hive/edit/v5/src/docs', hotshot: 'https://github.com/hivecommons/hotshot/edit/main', pluk: 'https://github.com/hivecommons/pluk/edit/main', rationguard: 'https://github.com/hivecommons/rationguard/edit/main', diff --git a/src/components/docs/EditPageLink.tsx b/src/components/docs/EditPageLink.tsx index 9116e90..6049841 100644 --- a/src/components/docs/EditPageLink.tsx +++ b/src/components/docs/EditPageLink.tsx @@ -6,7 +6,7 @@ import type { ProjectId } from '@/config/versions'; // See DocsSourceActions.tsx for the full rationale; kept in sync with // scripts/sync-hive-docs.ts. const STATIC_EDIT_BASE_URLS: Record = { - hive: 'https://github.com/hivecommons/hive/edit/v4/src/docs', + hive: 'https://github.com/hivecommons/hive/edit/v5/src/docs', hotshot: 'https://github.com/hivecommons/hotshot/edit/main', pluk: 'https://github.com/hivecommons/pluk/edit/main', rationguard: 'https://github.com/hivecommons/rationguard/edit/main', diff --git a/src/config/versions.ts b/src/config/versions.ts index a53b86e..d5f95bf 100644 --- a/src/config/versions.ts +++ b/src/config/versions.ts @@ -7,7 +7,7 @@ // - Hive is continuously deployed rather than semver-released, so the docs are // a single "latest" line: content is fetched at build time from the hive // branch named by HIVE_DOCS_REF (see scripts/sync-hive-docs.ts), which tracks -// hive's current major release line (v4 today). When hive moves to a new +// hive's current major release line (v5 after the first v5 stable promotion). When hive moves to a new // major line, update this label, currentVersion below, and the HIVE_DOCS_REF // default together. @@ -42,7 +42,7 @@ export interface ProjectConfig { // hive versions const HIVE_VERSIONS: Record = { latest: { - label: "v4 (Latest)", + label: "v5 (Latest)", branch: "main", isDefault: true, }, @@ -90,7 +90,7 @@ export const PROJECTS: Record = { id: "hive", name: "Hive", basePath: "hive", - currentVersion: "v4", + currentVersion: "v5", contentPath: "docs/content/hive", versions: HIVE_VERSIONS, },