starlight-versions 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # starlight-versions
2
2
 
3
+ ## 0.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#64](https://github.com/HiDeoo/starlight-versions/pull/64) [`5e26275`](https://github.com/HiDeoo/starlight-versions/commit/5e262755d6b8f61ba4c17f59f32ff0fa0ff87938) Thanks [@Hexalyse](https://github.com/Hexalyse)! - Fixes a Windows-only issue where archived docs could generate incorrect routes.
8
+
9
+ ## 0.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#62](https://github.com/HiDeoo/starlight-versions/pull/62) [`3b6b14a`](https://github.com/HiDeoo/starlight-versions/commit/3b6b14a1e55f13aaf289e822f10dcead916e6c12) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Improves the error message logged when the plugin configuration is invalid.
14
+
3
15
  ## 0.8.0
4
16
 
5
17
  ### Minor Changes
package/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { StarlightPlugin } from '@astrojs/starlight/types'
2
+ import { z } from 'astro/zod'
2
3
 
3
4
  import { StarlightVersionsConfigSchema, type StarlightVersionsUserConfig } from './libs/config'
4
5
  import { overrideComponents, throwPluginError } from './libs/plugin'
@@ -13,7 +14,10 @@ export default function starlightVersionsPlugin(userConfig: StarlightVersionsUse
13
14
 
14
15
  if (!parsedConfig.success) {
15
16
  throwPluginError(
16
- `The provided plugin configuration is invalid.\n${parsedConfig.error.issues.map((issue) => issue.message).join('\n')}`,
17
+ `Invalid starlight-versions configuration:
18
+
19
+ ${z.prettifyError(parsedConfig.error)}
20
+ `,
17
21
  )
18
22
  }
19
23
 
package/libs/starlight.ts CHANGED
@@ -18,7 +18,7 @@ export function getFrontmatterNodeValue(frontmatter: StarlightFrontmatter) {
18
18
  }
19
19
 
20
20
  export function getDocSlug(docsDir: URL, doc: URL) {
21
- const docPath = path.relative(url.fileURLToPath(docsDir), url.fileURLToPath(doc))
21
+ const docPath = path.relative(url.fileURLToPath(docsDir), url.fileURLToPath(doc)).replaceAll('\\', '/')
22
22
  const slug = slugifyPath(docPath)
23
23
 
24
24
  return slug === 'index' ? '/' : slug.replace(/\/index$/, '')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-versions",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to version documentation pages.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",