Skip to content

Commit

Permalink
Merge branch 'main' into hd-i18n-fr-0-27-0-guides-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored Sep 8, 2024
2 parents becadb7 + 73389fe commit 8c81812
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.27.0",
"@astrojs/starlight": "^0.27.1",
"astro": "^4.15.3",
"sharp": "^0.32.5"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.4",
"@astrojs/starlight": "^0.27.0",
"@astrojs/starlight": "^0.27.1",
"@astrojs/starlight-markdoc": "^0.1.0",
"astro": "^4.15.3",
"sharp": "^0.32.5"
Expand Down
2 changes: 1 addition & 1 deletion examples/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.27.0",
"@astrojs/starlight": "^0.27.1",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.15.3",
Expand Down
6 changes: 6 additions & 0 deletions packages/starlight/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @astrojs/starlight

## 0.27.1

### Patch Changes

- [#2303](https://github.com/withastro/starlight/pull/2303) [`f92791a`](https://github.com/withastro/starlight/commit/f92791aa1d1ec3d5498e445a078f7143fef60553) Thanks [@delucis](https://github.com/delucis)! - Fixes resolution for the internal module Git virtual module in projects with special characters in the file path

## 0.27.0

### Minor Changes
Expand Down
13 changes: 11 additions & 2 deletions packages/starlight/integrations/virtual-user-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ export function vitePluginStarlightUserConfig(
const resolveId = (id: string, base = root) =>
JSON.stringify(id.startsWith('.') ? resolve(fileURLToPath(base), id) : id);

/**
* Resolves a path to a Starlight file relative to this file.
* @example
* resolveLocalPath('../utils/git.ts');
* // => '"/users/houston/docs/node_modules/@astrojs/starlight/utils/git.ts"'
*/
const resolveLocalPath = (path: string) =>
JSON.stringify(fileURLToPath(new URL(path, import.meta.url)));

const docsPath = resolve(fileURLToPath(srcDir), 'content/docs');

const virtualComponentModules = Object.fromEntries(
Expand All @@ -51,9 +60,9 @@ export function vitePluginStarlightUserConfig(
})}`,
'virtual:starlight/git-info':
(command !== 'build'
? `import { makeAPI } from '${new URL('../utils/git.ts', import.meta.url)}';` +
? `import { makeAPI } from ${resolveLocalPath('../utils/git.ts')};` +
`const api = makeAPI(${JSON.stringify(docsPath)});`
: `import { makeAPI } from '${new URL('../utils/gitInlined.ts', import.meta.url)}';` +
: `import { makeAPI } from ${resolveLocalPath('../utils/gitInlined.ts')};` +
`const api = makeAPI(${JSON.stringify(getAllNewestCommitDate(docsPath))});`) +
'export const getNewestCommitDate = api.getNewestCommitDate;',
'virtual:starlight/user-css': opts.customCss.map((id) => `import ${resolveId(id)};`).join(''),
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@astrojs/starlight",
"version": "0.27.0",
"version": "0.27.1",
"description": "Build beautiful, high-performance documentation websites with Astro",
"scripts": {
"test": "vitest",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c81812

Please sign in to comment.