Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions public/config/shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"versions": {
"hive": {
"latest": {
"label": "v4 (Latest)",
"label": "v5 (Latest)",
"branch": "main",
"isDefault": true
}
Expand Down Expand Up @@ -40,7 +40,7 @@
"hive": {
"name": "Hive",
"basePath": "hive",
"currentVersion": "v4"
"currentVersion": "v5"
},
"hotshot": {
"name": "hotshot",
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions scripts/sync-hive-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ 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"
);
});

it("sends an in-tree-but-UNSYNCED doc to GitHub (not synced by the script)", () => {
// 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"
);
});

Expand All @@ -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"
);
});
});
Expand All @@ -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);
});

Expand All @@ -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")'
);
});

Expand Down
3 changes: 2 additions & 1 deletion scripts/sync-hive-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
4 changes: 2 additions & 2 deletions src/components/docs/DocsSourceActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectId, string> = {
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',
Expand Down
2 changes: 1 addition & 1 deletion src/components/docs/EditPageLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectId, string> = {
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',
Expand Down
6 changes: 3 additions & 3 deletions src/config/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -42,7 +42,7 @@ export interface ProjectConfig {
// hive versions
const HIVE_VERSIONS: Record<string, VersionInfo> = {
latest: {
label: "v4 (Latest)",
label: "v5 (Latest)",
branch: "main",
isDefault: true,
},
Expand Down Expand Up @@ -90,7 +90,7 @@ export const PROJECTS: Record<ProjectId, ProjectConfig> = {
id: "hive",
name: "Hive",
basePath: "hive",
currentVersion: "v4",
currentVersion: "v5",
contentPath: "docs/content/hive",
versions: HIVE_VERSIONS,
},
Expand Down
Loading