Skip to content

Commit

Permalink
feat: use Starlight's Tabs (#8196)
Browse files Browse the repository at this point in the history
* feat:  upgrade Starlight to 0.22.2 & use Starlight's Tabs

* fix tabs in mdx
  • Loading branch information
liruifengv authored May 21, 2024
1 parent e128bc9 commit d825b1c
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 118 deletions.
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

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

5 changes: 2 additions & 3 deletions src/components/tabs/AstroJSXTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="astro-jsx">
<Tabs syncKey="astro-jsx">
<TabItem label="JSX">
<slot name="jsx" />
</TabItem>
Expand Down
5 changes: 2 additions & 3 deletions src/components/tabs/AstroVueTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="astro-vue">
<Tabs syncKey="astro-vue">
<TabItem label="Vue">
<slot name="vue" />
</TabItem>
Expand Down
5 changes: 2 additions & 3 deletions src/components/tabs/JavascriptFlavorTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="javascript-flavors">
<Tabs syncKey="javascript-flavors">
<TabItem label="JavaScript">
<slot name="js" />
</TabItem>
Expand Down
5 changes: 2 additions & 3 deletions src/components/tabs/PackageManagerTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="package-managers">
<Tabs syncKey="package-managers">
<TabItem label="npm">
<slot name="npm" />
</TabItem>
Expand Down
5 changes: 2 additions & 3 deletions src/components/tabs/StaticSsrTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="deploy-type">
<Tabs syncKey="deploy-type">
<TabItem label="Static">
<slot name="static" />
</TabItem>
Expand Down
84 changes: 0 additions & 84 deletions src/components/tabs/Tabs.astro

This file was deleted.

5 changes: 2 additions & 3 deletions src/components/tabs/UIFrameworkTabs.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import Tabs from './Tabs.astro';
import { TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';
---

<Tabs group="package-managers">
<Tabs syncKey="ui-frameworks">
{
Astro.slots.has('preact') && (
<TabItem label="Preact">
Expand Down
5 changes: 2 additions & 3 deletions src/content/docs/de/guides/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ i18nReady: true
---
import Since from '~/components/Since.astro'
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
import Tabs from '~/components/tabs/Tabs.astro'
import { TabItem } from '@astrojs/starlight/components'
import { Tabs, TabItem } from '@astrojs/starlight/components'


Astro wird mit integrierter Unterstützung für [TypeScript](https://www.typescriptlang.org/) ausgeliefert. Du kannst `.ts`- und `.tsx`-Dateien in dein Astro-Projekt importieren, TypeScript-Code direkt in deiner [Astro-Komponente](/de/basics/astro-components/#das-komponentenskript) schreiben und sogar eine [`astro.config.ts`](/de/guides/configuring-astro/#die-astro-konfigurationsdatei)-Datei verwenden, wenn du möchtest.
Expand Down Expand Up @@ -88,7 +87,7 @@ Auf diese Weise vermeidest du Fälle, in denen der Astro-Bundler versucht, deine

Du kannst TypeScript so konfigurieren, dass Typ-Importe in deiner `.tsconfig`-Datei erzwungen werden.

<Tabs group="typescript-version">
<Tabs syncKey="typescript-version">
<TabItem label="TypeScript ≤4.9">
Setze [`importsNotUsedAsValues`](https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues) auf `"error"`. TypeScript prüft dann deine Importe und sagt dir, wann `import type` verwendet werden sollte. Diese Einstellung ist standardmäßig in unseren Vorlagen `strict` und `strictest` enthalten.

Expand Down

0 comments on commit d825b1c

Please sign in to comment.