Skip to content

docs: directory-based versioning — freeze v0.16.23, fix license to Apache-2.0#1

Merged
jhfnetboy merged 1 commit into
mainfrom
chore/docs-versioning-0.16.23
Jun 18, 2026
Merged

docs: directory-based versioning — freeze v0.16.23, fix license to Apache-2.0#1
jhfnetboy merged 1 commit into
mainfrom
chore/docs-versioning-0.16.23

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

Summary

Introduce VitePress directory-based doc versioning. The current live docs describe SDK v0.16.23, but the SDK has since moved to v0.20.5. This PR freezes the current content as an archived /0.16.23/ line and keeps the repo root as the latest (v0.20.x) line, plus fixes a stale license label.

Versioning scheme

  • Root (/) = latest line (v0.20.x). Continues to receive updates.
  • /0.16.23/ = frozen snapshot of the docs as they describe SDK v0.16.23.
  • A version dropdown is added to the nav (v0.20.x (latest)/, v0.16.23/0.16.23/).
  • Sidebars for the archived version are mirrored from the latest sidebars via a small prefixSidebar() helper in .vitepress/config.ts that deep-clones each array and prefixes every root-absolute link with /0.16.23 — avoiding hand-maintained duplicates.
  • 0.16.23/index.md gets an "archived version" banner pointing back to latest (/).
  • All root-absolute internal links (/guide, /api, /examples) inside 0.16.23/**/*.md are rescoped to /0.16.23/... so the snapshot is self-contained.

Evidence the live content is v0.16.23

  • guide/installation.md carries the v0.16.23 SDK integrity hash.
  • changelog.md top released entry is ## [0.16.23].
  • (The homepage Status-0.16.6 badge was stale and is unrelated to content version.)

License fix (MIT → Apache-2.0)

The project is Apache-2.0, but the docs still labelled MIT:

  • index.md license badge → Apache-2.0.
  • .vitepress/config.ts footer message → "Released under the Apache-2.0 License."

What changed

  • .vitepress/config.ts — extracted sidebar arrays into named consts; added prefixSidebar() helper; added version dropdown to nav; added mirrored /0.16.23/{guide,api,examples}/ and /0.16.23/zh/guide/ sidebar keys; footer → Apache-2.0. ignoreDeadLinks left as-is.
  • index.md — license badge MIT → Apache-2.0.
  • 0.16.23/ — new frozen snapshot (index.md, changelog.md, guide/, api/, examples/, zh/), with version-scoped links + archived banner.

Build

pnpm run docs:build succeeds locally with these changes (VitePress 1.6.4). Build output (.vitepress/dist/) is intentionally not committed (gitignored).

…Apache-2.0

- Freeze current docs (SDK v0.16.23) into /0.16.23/ as an archived line;
  root stays the latest (v0.20.x) line.
- Evidence the live content is v0.16.23: guide/installation.md integrity
  hash + changelog.md '## [0.16.23]'.
- Scope all root-absolute /guide /api /examples links inside 0.16.23/ to
  /0.16.23/* so the snapshot is self-contained.
- Add archived-version banner to 0.16.23/index.md pointing to latest (/).
- config.ts: add version dropdown to nav; mirror guide/api/examples/zh-guide
  sidebars under /0.16.23/* via a prefixSidebar() helper.
- Fix stale MIT -> Apache-2.0 in index.md badge and config footer.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying aastar-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6861f1a
Status: ✅  Deploy successful!
Preview URL: https://30dcf8de.aastar-docs.pages.dev
Branch Preview URL: https://chore-docs-versioning-0-16-2.aastar-docs.pages.dev

View logs

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clestons review — #1 [2-round, APPROVE]

docs: directory-based versioning — freeze v0.16.23, fix license to Apache-2.0 — 文档版本化结构正确,两轮通过。

核心确认

prefixSidebar() 递归前缀

if (typeof next.link === 'string' && next.link.startsWith('/')) {
  next.link = prefix + next.link
}
if (Array.isArray(next.items)) {
  next.items = prefixSidebar(next.items, prefix)
}

根绝对链接全部被前缀 — 包括 hash 锚点(/api/@aastar/sdk#installation/0.16.23/api/@aastar/sdk#installation)✅;外部链接(GitHub 等)不以 / 开头,不受影响 ✅。

归档 banner 确认

> [!WARNING]
> **Archived documentation — SDK v0.16.23.** This is a frozen snapshot of an older release. For the latest version, see the [current documentation](/).

存在于 0.16.23/index.md ✅;hero actions 使用版本化路径 /0.16.23/guide/getting-started ✅。

License 变更

  • root/index.md 徽章:MIT → Apache-2.0 ✅
  • .vitepress/config.ts footer:MIT → Apache-2.0 ✅
  • VitePress build 实测通过(1.6.4,~29s)✅

410 个冻结快照文件
内部相对链接(如 classes/UserOpClient.md)无需改写,路径在 0.16.23/ 子目录下仍正确解析 ✅。sidebar 导航由 prefixSidebar() 统一处理 ✅。

关于第 ② 点(归档快照 license)

建议:保留 MIT。 冻结快照 0.16.23/index.md 中的 MIT 徽章是历史准确的——v0.16.23 发布时 license 确实是 MIT;Apache-2.0 是后续决定。改写归档会让快照失去"历史原样"的意义。如果未来有人对照 npm 发布的 0.16.23 版本,MIT 是正确的历史 license。当前处理方式正确。

非阻塞建议

  1. ARCHIVED_VERSION 常量 — 若未来新增 v0.17.x 归档,可以考虑从 ARCHIVED_VERSION: string[] 数组驱动 prefixSidebar,避免每次手动新增 sidebar key;但当前单版本范围合理。
  2. 0.16.23/guide/getting-started.md 内嵌绝对外链 — 文件中含 https://docs.aastar.io/api/@aastar/community 等绝对链接指向当前版本站点,这是常见归档惯例(外链不冻结),可接受;如需完全隔离也可替换为相对路径,非阻塞。

@jhfnetboy jhfnetboy merged commit 09edb8b into main Jun 18, 2026
1 of 2 checks passed
@jhfnetboy jhfnetboy deleted the chore/docs-versioning-0.16.23 branch June 18, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants