From 53a52e5f205c7ea54683827954bec954d816ede4 Mon Sep 17 00:00:00 2001 From: tgreyuk Date: Tue, 7 Jan 2025 20:45:15 +0000 Subject: [PATCH] fix(vitepress): correctly handle base sidebar paths in windows --- .changeset/config.json | 1 - .changeset/rude-readers-hope.md | 5 +++++ packages/typedoc-vitepress-theme/package.json | 2 +- packages/typedoc-vitepress-theme/src/index.ts | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/rude-readers-hope.md diff --git a/.changeset/config.json b/.changeset/config.json index 0c19bc500..483166b6d 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -14,7 +14,6 @@ "@devtools/*", "typedoc-github-wiki-theme", "typedoc-gitlab-wiki-theme", - "typedoc-vitepress-theme", "typedoc-plugin-frontmatter" ] } diff --git a/.changeset/rude-readers-hope.md b/.changeset/rude-readers-hope.md new file mode 100644 index 000000000..e4f7e5c61 --- /dev/null +++ b/.changeset/rude-readers-hope.md @@ -0,0 +1,5 @@ +--- +'typedoc-vitepress-theme': patch +--- + +- Correctly handle base sidebar paths in windows (#756). diff --git a/packages/typedoc-vitepress-theme/package.json b/packages/typedoc-vitepress-theme/package.json index 31691e887..6a96e9a36 100644 --- a/packages/typedoc-vitepress-theme/package.json +++ b/packages/typedoc-vitepress-theme/package.json @@ -30,7 +30,7 @@ "test:update": "npm run build && npm test -- -u" }, "peerDependencies": { - "typedoc-plugin-markdown": ">=4.4.1" + "typedoc-plugin-markdown": ">=4.4.0" }, "license": "MIT", "keywords": [ diff --git a/packages/typedoc-vitepress-theme/src/index.ts b/packages/typedoc-vitepress-theme/src/index.ts index 0c58773b0..41d526736 100644 --- a/packages/typedoc-vitepress-theme/src/index.ts +++ b/packages/typedoc-vitepress-theme/src/index.ts @@ -59,8 +59,9 @@ export function load(app: MarkdownApplication) { if (sidebarOptions.autoConfiguration && output.navigation) { const outDir = app.options.getValue('out'); const sidebarPath = path.resolve(outDir, 'typedoc-sidebar.json'); - const basePath = path.relative(app.options.getValue('docsRoot'), outDir); - + const basePath = path + .relative(app.options.getValue('docsRoot'), outDir) + .replace(/\\/g, '/'); const sidebarJson = getSidebar( output.navigation, basePath,