@astrojs/starlight 0.15.0 → 0.15.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,29 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1254](https://github.com/withastro/starlight/pull/1254) [`e9659e8`](https://github.com/withastro/starlight/commit/e9659e869cd0c9ad0b7388397b0fff8e2a9db27a) Thanks [@Pukimaa](https://github.com/Pukimaa)! - Adds Open Collective social link icon
8
+
9
+ - [#1295](https://github.com/withastro/starlight/pull/1295) [`c3732a9`](https://github.com/withastro/starlight/commit/c3732a9bb5cb7907f00a3ed5e65534f48a5ff6b9) Thanks [@juchym](https://github.com/juchym)! - Improve Ukrainian UI translations
10
+
11
+ ## 0.15.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1273](https://github.com/withastro/starlight/pull/1273) [`ae53155`](https://github.com/withastro/starlight/commit/ae531557aa4d42bd27c15f8f08bb3ca8242c9beb) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Updates `<SocialIcon />` styling for improved accessibility. Specifically, the component now meets the [Target Size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) success criteria defined by [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/).
16
+
17
+ - [#1289](https://github.com/withastro/starlight/pull/1289) [`9bd343f`](https://github.com/withastro/starlight/commit/9bd343fb1efab90a0aa03a95b1928a53c1674000) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds French translations for Expressive Code UI
18
+
19
+ - [#1280](https://github.com/withastro/starlight/pull/1280) [`6b1693d`](https://github.com/withastro/starlight/commit/6b1693d55552a48316a31d986e1cbaf695f10a61) Thanks [@kevinzunigacuellar](https://github.com/kevinzunigacuellar)! - Adds Spanish translations for Expressive Code UI
20
+
21
+ - [#1276](https://github.com/withastro/starlight/pull/1276) [`667f23d`](https://github.com/withastro/starlight/commit/667f23d615742b44bb18ace39d981f8797b8ac55) Thanks [@hippotastic](https://github.com/hippotastic)! - Updates `astro-expressive-code` dependency to the latest version
22
+
23
+ - [#1266](https://github.com/withastro/starlight/pull/1266) [`c9edf30`](https://github.com/withastro/starlight/commit/c9edf30b16f66757797dcaa5161b4afc18027476) Thanks [@alex-way](https://github.com/alex-way)! - Removes redundant subprocess calls in git last-updated time utility to improve performance
24
+
25
+ - [#1278](https://github.com/withastro/starlight/pull/1278) [`e88abb0`](https://github.com/withastro/starlight/commit/e88abb0cc8b329500c15bc77aaed3907ec7dc507) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Exports the `StarlightUserConfig` TypeScript type representing the user's Starlight configuration received by plugins.
26
+
3
27
  ## 0.15.0
4
28
 
5
29
  ### Minor Changes
@@ -103,4 +103,6 @@ export const Icons = {
103
103
  '<path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52Zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313ZM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834Zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312Zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834Zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312Zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52Zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313Z"/>',
104
104
  matrix:
105
105
  '<path d="M22.5 1.5v21h-2.25V24H24V0h-3.75v1.5h2.25ZM7.46 7.95V9.1h.04a3.02 3.02 0 0 1 2.61-1.39c.54 0 1.03.1 1.48.32.44.2.78.58 1.01 1.1.26-.37.6-.7 1.03-.99.44-.28.95-.43 1.55-.43.45 0 .87.06 1.26.17.38.11.71.29.99.53.27.24.49.56.64.95.15.4.23.86.23 1.42v5.72h-2.34v-4.85c0-.29-.01-.56-.04-.8a1.73 1.73 0 0 0-.18-.67 1.1 1.1 0 0 0-.44-.45 1.6 1.6 0 0 0-.78-.16c-.33 0-.6.06-.8.19-.2.12-.37.29-.48.5a2 2 0 0 0-.23.69c-.04.26-.06.52-.06.78v4.77H10.6v-4.8l-.01-.75a2.29 2.29 0 0 0-.14-.69c-.08-.2-.23-.38-.42-.5a1.5 1.5 0 0 0-.85-.2c-.15.01-.3.04-.44.08-.19.06-.37.15-.52.28-.18.14-.32.34-.44.6-.12.26-.18.6-.18 1.02v4.96H5.25V7.94h2.21ZM1.5 1.5v21h2.25V24H0V0h3.75v1.5H1.5Z"/>',
106
+ openCollective:
107
+ '<path d="M21.86 5.17a11.94 11.94 0 0 1 0 13.66l-3.1-3.1a7.68 7.68 0 0 0 0-7.46l3.1-3.1Zm-3.03-3.03-3.1 3.1a7.71 7.71 0 1 0 0 13.51l3.1 3.11a12 12 0 1 1 0-19.73Z"/><path d="M21.86 5.17a11.94 11.94 0 0 1 0 13.66l-3.1-3.1a7.68 7.68 0 0 0 0-7.46l3.1-3.1Z"/>',
106
108
  };
@@ -24,6 +24,8 @@ const links = Object.entries(config.social || {}) as [Platform, SocialConfig][];
24
24
  <style>
25
25
  a {
26
26
  color: var(--sl-color-text-accent);
27
+ padding: 0.5em;
28
+ margin: -0.5em;
27
29
  }
28
30
  a:hover {
29
31
  opacity: 0.66;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -174,7 +174,7 @@
174
174
  "@pagefind/default-ui": "^1.0.3",
175
175
  "@types/hast": "^3.0.3",
176
176
  "@types/mdast": "^4.0.3",
177
- "astro-expressive-code": "^0.29.3",
177
+ "astro-expressive-code": "^0.30.1",
178
178
  "bcp-47": "^2.1.0",
179
179
  "execa": "^8.0.1",
180
180
  "hast-util-select": "^6.0.2",
package/schemas/social.ts CHANGED
@@ -26,6 +26,7 @@ export const socialLinks = [
26
26
  'patreon',
27
27
  'slack',
28
28
  'matrix',
29
+ 'openCollective',
29
30
  ] as const;
30
31
 
31
32
  export const SocialLinksSchema = () =>
@@ -67,6 +68,7 @@ export const SocialLinksSchema = () =>
67
68
  patreon: 'Patreon',
68
69
  slack: 'Slack',
69
70
  matrix: 'Matrix',
71
+ openCollective: 'Open Collective',
70
72
  }[key];
71
73
  labelledLinks[key] = { label, url };
72
74
  }
@@ -22,5 +22,8 @@
22
22
  "aside.note": "Nota",
23
23
  "aside.tip": "Consejo",
24
24
  "aside.caution": "Precaución",
25
- "aside.danger": "Peligro"
25
+ "aside.danger": "Peligro",
26
+ "expressiveCode.copyButtonCopied": "¡Copiado!",
27
+ "expressiveCode.copyButtonTooltip": "Copiar al portapapeles",
28
+ "expressiveCode.terminalWindowFallbackTitle": "Ventana de terminal"
26
29
  }
@@ -22,5 +22,8 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Astuce",
24
24
  "aside.caution": "Attention",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "expressiveCode.copyButtonCopied": "Copié !",
27
+ "expressiveCode.copyButtonTooltip": "Copier dans le presse-papiers",
28
+ "expressiveCode.terminalWindowFallbackTitle": "Fenêtre de terminal"
26
29
  }
@@ -3,24 +3,24 @@
3
3
  "search.label": "Пошук",
4
4
  "search.shortcutLabel": "(Натисніть / для Пошуку)",
5
5
  "search.cancelLabel": "Скасувати",
6
- "search.devWarning": "Пошук доступний лише у виробничих зборках. \nСпробуйте виконати збірку та переглянути сайт, щоб протестувати його локально",
7
- "themeSelect.accessibleLabel": "Вибрати Тему",
6
+ "search.devWarning": "Пошук доступний лише у виробничих зборках. \nСпробуйте зібрати та переглянути сайт, щоби протестувати його локально",
7
+ "themeSelect.accessibleLabel": "Обрати тему",
8
8
  "themeSelect.dark": "Темна",
9
9
  "themeSelect.light": "Світла",
10
10
  "themeSelect.auto": "Авто",
11
- "languageSelect.accessibleLabel": "Оберіть мову",
11
+ "languageSelect.accessibleLabel": "Обрати мову",
12
12
  "menuButton.accessibleLabel": "Меню",
13
13
  "sidebarNav.accessibleLabel": "Головне",
14
14
  "tableOfContents.onThisPage": "На цій сторінці",
15
15
  "tableOfContents.overview": "Огляд",
16
- "i18n.untranslatedContent": "Цей контент ще не доступний на Вашій мові.",
16
+ "i18n.untranslatedContent": "Цей контент ще не доступний вашою мовою.",
17
17
  "page.editLink": "Редагувати сторінку",
18
18
  "page.lastUpdated": "Останнє оновлення:",
19
- "page.previousLink": "Попередня",
20
- "page.nextLink": "Наступна",
21
- "404.text": "Сторінку не знайдено. Перевірте URL-адресу або спробуйте скористатися рядком пошуку.",
22
- "aside.note": "Note",
23
- "aside.tip": "Tip",
24
- "aside.caution": "Caution",
25
- "aside.danger": "Danger"
19
+ "page.previousLink": "Назад",
20
+ "page.nextLink": "Далі",
21
+ "404.text": "Сторінку не знайдено. Перевірте URL або спробуйте скористатися пошуком.",
22
+ "aside.note": "Заувага",
23
+ "aside.tip": "Порада",
24
+ "aside.caution": "Обережно",
25
+ "aside.danger": "Небезпечно"
26
26
  }
package/types.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  export type { StarlightConfig } from './utils/user-config';
2
- export type { StarlightPlugin } from './utils/plugins';
2
+ export type {
3
+ StarlightPlugin,
4
+ StarlightUserConfigWithPlugins as StarlightUserConfig,
5
+ } from './utils/plugins';
package/utils/git.ts CHANGED
@@ -8,12 +8,9 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- import path from 'node:path';
11
+ import { basename, dirname } from 'node:path';
12
12
  import { execaSync } from 'execa';
13
13
 
14
- /** Custom error thrown when git is not found in `PATH`. */
15
- class GitNotFoundError extends Error {}
16
-
17
14
  /** Custom error thrown when the current file is not tracked by git. */
18
15
  class FileNotTrackedError extends Error {}
19
16
 
@@ -22,7 +19,6 @@ class FileNotTrackedError extends Error {}
22
19
  * It gets the commit date instead of author date so that amended commits
23
20
  * can have their dates updated.
24
21
  *
25
- * @throws {GitNotFoundError} If git is not found in `PATH`.
26
22
  * @throws {FileNotTrackedError} If the current file is not tracked by git.
27
23
  * @throws Also throws when `git log` exited with non-zero, or when it outputs
28
24
  * unexpected text.
@@ -34,24 +30,6 @@ export function getFileCommitDate(
34
30
  date: Date;
35
31
  timestamp: number;
36
32
  } {
37
- try {
38
- const { stdout } = execaSync('which', ['git']);
39
- if (!stdout) {
40
- throw new GitNotFoundError(
41
- `Failed to retrieve git history for "${file}" because git is not installed.`
42
- );
43
- }
44
- } catch {}
45
-
46
- try {
47
- const { stdout } = execaSync('test', ['-f', file]);
48
- if (!stdout) {
49
- throw new Error(
50
- `Failed to retrieve git history for "${file}" because the file does not exist.`
51
- );
52
- }
53
- } catch {}
54
-
55
33
  const result = execaSync(
56
34
  'git',
57
35
  [
@@ -60,10 +38,10 @@ export function getFileCommitDate(
60
38
  '--max-count=1',
61
39
  ...(age === 'oldest' ? ['--follow', '--diff-filter=A'] : []),
62
40
  '--',
63
- path.basename(file),
41
+ basename(file),
64
42
  ],
65
43
  {
66
- cwd: path.dirname(file),
44
+ cwd: dirname(file),
67
45
  }
68
46
  );
69
47
  if (result.exitCode !== 0) {
@@ -71,7 +49,6 @@ export function getFileCommitDate(
71
49
  `Failed to retrieve the git history for file "${file}" with exit code ${result.exitCode}: ${result.stderr}`
72
50
  );
73
51
  }
74
- let regex = /^(?<timestamp>\d+)$/;
75
52
 
76
53
  const output = result.stdout.trim();
77
54
 
@@ -81,6 +58,7 @@ export function getFileCommitDate(
81
58
  );
82
59
  }
83
60
 
61
+ const regex = /^(?<timestamp>\d+)$/;
84
62
  const match = output.match(regex);
85
63
 
86
64
  if (!match) {