Skip to content

Commit 3efd3fa

Browse files
committed
docs: harden stable release note integrity
1 parent acb932b commit 3efd3fa

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

docs/releases/v1.2.2.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ This document anchors the current stable release reference used by the docs port
1111
- Canonical package name remains `codex-multi-auth`.
1212
- Keeps the docs portal and root README aligned with the currently published package version.
1313

14+
## What Changed
15+
16+
- aligned the root README and docs portal release links to the published `v1.2.2` stable line
17+
- added a dedicated `docs/releases/v1.2.2.md` entry so the current stable docs target exists as a first-class release note
18+
- updated the documentation integrity test to derive the current stable release note from `package.json` while keeping the previous and earlier stable slots explicit
19+
20+
## Why This Exists
21+
22+
- prevents the docs portal from pointing at retired stable release pages after version bumps
23+
- gives maintainers one stable note to refresh when the package version advances again
24+
- keeps release discoverability consistent between the README, docs portal, and test suite
25+
1426
## Related
1527

1628
- [../getting-started.md](../getting-started.md)

test/documentation.test.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ import { UI_COPY } from "../lib/ui/copy.js";
1515
const projectRoot = resolve(process.cwd());
1616

1717
function readPackageVersion(): string {
18-
const parsed = JSON.parse(readFileSync(join(projectRoot, "package.json"), "utf-8")) as {
19-
version?: unknown;
20-
};
18+
const packagePath = join(projectRoot, "package.json");
19+
let parsed: { version?: unknown };
20+
try {
21+
parsed = JSON.parse(readFileSync(packagePath, "utf-8")) as {
22+
version?: unknown;
23+
};
24+
} catch (error) {
25+
const message = error instanceof Error ? error.message : String(error);
26+
throw new Error(`Failed to read ${packagePath}: ${message}`);
27+
}
2128
if (typeof parsed.version !== "string" || parsed.version.trim().length === 0) {
2229
throw new Error("package.json must define a non-empty version string");
2330
}
@@ -26,6 +33,9 @@ function readPackageVersion(): string {
2633

2734
const packageVersion = readPackageVersion();
2835
const currentStableReleaseDoc = `docs/releases/v${packageVersion}.md`;
36+
// These stay manual so the docs portal keeps an intentional short stable-history window.
37+
const previousStableReleaseDoc = "docs/releases/v1.2.1.md";
38+
const earlierStableReleaseDoc = "docs/releases/v1.2.0.md";
2939

3040
const userDocs = [
3141
"docs/index.md",
@@ -44,8 +54,8 @@ const userDocs = [
4454
"docs/reference/settings.md",
4555
"docs/reference/storage-paths.md",
4656
currentStableReleaseDoc,
47-
"docs/releases/v1.2.1.md",
48-
"docs/releases/v1.2.0.md",
57+
previousStableReleaseDoc,
58+
earlierStableReleaseDoc,
4959
"docs/releases/v0.1.7.md",
5060
"docs/releases/v0.1.6.md",
5161
"docs/releases/v0.1.5.md",
@@ -141,8 +151,8 @@ describe("Documentation Integrity", () => {
141151
expect(portal).toContain("reference/public-api.md");
142152
expect(portal).toContain("reference/error-contracts.md");
143153
expect(portal).toContain(`releases/v${packageVersion}.md`);
144-
expect(portal).toContain("releases/v1.2.1.md");
145-
expect(portal).toContain("releases/v1.2.0.md");
154+
expect(portal).toContain(previousStableReleaseDoc.replace("docs/", ""));
155+
expect(portal).toContain(earlierStableReleaseDoc.replace("docs/", ""));
146156
expect(portal).toContain("releases/v0.1.7.md");
147157
expect(portal).toContain("releases/v0.1.6.md");
148158
expect(portal).toContain("releases/v0.1.5.md");
@@ -152,8 +162,8 @@ describe("Documentation Integrity", () => {
152162
"| [Daily Use release notes](#daily-use) | Stable, previous, and archived release notes |",
153163
);
154164
expect(readme).toContain(currentStableReleaseDoc);
155-
expect(readme).toContain("docs/releases/v1.2.1.md");
156-
expect(readme).toContain("docs/releases/v1.2.0.md");
165+
expect(readme).toContain(previousStableReleaseDoc);
166+
expect(readme).toContain(earlierStableReleaseDoc);
157167

158168
const beta = read("docs/releases/v0.1.0-beta.0.md");
159169
expect(beta).toContain("Archived");

0 commit comments

Comments
 (0)