Skip to content

fix: label auto versions like Docusaurus, resolve blog routes in prefixed versions, run every test - #93

Merged
rachfop merged 2 commits into
mainfrom
fix/versions-edges-and-tests
Oct 3, 2026
Merged

rachfop merged 2 commits into
mainfrom
fix/versions-edges-and-tests

Conversation

@rachfop

@rachfop rachfop commented Oct 3, 2026

Copy link
Copy Markdown
Owner
  • With versions: 'auto', the current docs are labeled Next, as Docusaurus labels them (getVersionLabel in @docusaurus/plugin-content-docs), unless versions.current.label is set.
  • With an explicit versions array where no version writes to the root, blog posts in the first version linked to file-based URLs because the version's route prefix filtered out blog routes. Blog files now match blog routes in every version.
  • A draft: "TRUE" page (any letter case) is a draft, matching Docusaurus's boolean conversion.
  • Every file in tests/ runs under npm test (85, up from 65). test-individual-markdown-generation.js was broken by the lint cleanup in chore: add oxlint and oxfmt, fix findings, format the repo #81, which removed two result bindings it still used. Other unwired tests were fixed to call the real lib and fail on mismatches, and three tests that only checked copies of the source logic were removed.

tests/test-versions-edges.js covers the label and blog cases. Real Docusaurus builds of a versioned site with an fr locale have 0 broken links across five version configurations. The docs site output is unchanged apart from the edited sentence in multi-version.md.

…refixed versions

- versions: 'auto' labels the current docs 'Next' and every other version
  by its name unless versions.<name>.label is set, matching
  plugin-content-docs getVersionLabel.
- Blog posts match blog routes regardless of the version's route prefix,
  so an explicit versions array with no root version links the blog's
  real /blog/... routes.
- Add tests/test-versions-edges.js for both cases.
- Wire every test in tests/ into npm test. Fix test-individual-markdown-
  generation (lost its `result` bindings), test-draft-filtering
  (Docusaurus reads draft: "true" as a draft), and tests that never
  failed or reimplemented lib logic (double-slash-url, numbered-prefixes,
  path-bounds-checking, description-extraction, route-resolution-helpers,
  path-transformation-ignore, ignore-path-with-draft); run
  test-pattern-matching in a temp site instead of test-docs/.
- Delete test-array-bounds-checking, test-description-truncation and
  test-refactored-route-helpers: they test local copies of lib helpers
  whose real behavior other wired tests cover.
Docusaurus validates draft as a Joi boolean with conversion, which reads the string true case-insensitively ("TRUE", "True"). Match that.
@rachfop
rachfop merged commit d1f8c5c into main Oct 3, 2026
5 checks passed
@rachfop
rachfop deleted the fix/versions-edges-and-tests branch October 3, 2026 00:23
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.

1 participant