From 4d94e4695b53ac68b25023d0e643d534bb41ea00 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 28 Jan 2026 13:37:20 -0500 Subject: [PATCH 1/2] Fix astro utils --- .../src/expressive-code/plugins/tsp-tryit-code.ts | 13 +++++++------ packages/astro-utils/tsconfig.build.json | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/astro-utils/src/expressive-code/plugins/tsp-tryit-code.ts b/packages/astro-utils/src/expressive-code/plugins/tsp-tryit-code.ts index d5e7008ff48..68754573445 100644 --- a/packages/astro-utils/src/expressive-code/plugins/tsp-tryit-code.ts +++ b/packages/astro-utils/src/expressive-code/plugins/tsp-tryit-code.ts @@ -43,6 +43,12 @@ export default function (playgroundUrl: string) { display: flex; align-items: center; padding: 0 0.5rem; + text-decoration: none; + color: var(--colorPaletteGreenBackground3); + + &:hover { + color: var(--colorPaletteGreenBackground4); + } } .tryit-link.with-title { @@ -59,12 +65,7 @@ export default function (playgroundUrl: string) { right: 0px; height: 34px; } - - .tryit-link { - text-decoration: none; - color: var(--colorPaletteGreenBackground3); - } .play { height: 20px; @@ -85,7 +86,7 @@ export default function (playgroundUrl: string) { const compilerOptions = JSON.parse(tryitStr); const extraElements = []; - const hasTitle = metaOptions.getString("title"); + const hasTitle = codeBlock.props.title || metaOptions.getString("title"); extraElements.push( h( "a", diff --git a/packages/astro-utils/tsconfig.build.json b/packages/astro-utils/tsconfig.build.json index 9a76ef348a3..4b9dc7a926b 100644 --- a/packages/astro-utils/tsconfig.build.json +++ b/packages/astro-utils/tsconfig.build.json @@ -4,6 +4,7 @@ "allowImportingTsExtensions": false, "noEmit": false, "declaration": true, + "sourceMap": true, "rootDir": "src", "outDir": "dist" }, From 54f72473da0704bd21e152c6ddf0e31c9ce1a1a1 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Wed, 28 Jan 2026 13:39:43 -0500 Subject: [PATCH 2/2] move editor tabs to common --- .../astro-utils}/src/components/editor-tabs.astro | 0 .../components/homepage/data-validation-hero-illustration.astro | 2 +- .../src/components/homepage/openapi3-hero-illustration.astro | 2 +- website/src/pages/data-validation.astro | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename {website => packages/astro-utils}/src/components/editor-tabs.astro (100%) diff --git a/website/src/components/editor-tabs.astro b/packages/astro-utils/src/components/editor-tabs.astro similarity index 100% rename from website/src/components/editor-tabs.astro rename to packages/astro-utils/src/components/editor-tabs.astro diff --git a/website/src/components/homepage/data-validation-hero-illustration.astro b/website/src/components/homepage/data-validation-hero-illustration.astro index c1cbdea91df..43237010dda 100644 --- a/website/src/components/homepage/data-validation-hero-illustration.astro +++ b/website/src/components/homepage/data-validation-hero-illustration.astro @@ -3,7 +3,7 @@ import commonLibSharedTsp from "@site/src/assets/tsp-samples/data-validation/com import commonLibMainTsp from "@site/src/assets/tsp-samples/data-validation/common-lib/main.tsp?raw"; import { Code } from "@astrojs/starlight/components"; import { TabItem } from "@astrojs/starlight/components"; -import EditorTabs from "../editor-tabs.astro"; +import EditorTabs from "@typespec/astro-utils/components/editor-tabs.astro"; --- diff --git a/website/src/components/homepage/openapi3-hero-illustration.astro b/website/src/components/homepage/openapi3-hero-illustration.astro index f70f82aa301..9c26634c4a7 100644 --- a/website/src/components/homepage/openapi3-hero-illustration.astro +++ b/website/src/components/homepage/openapi3-hero-illustration.astro @@ -3,7 +3,7 @@ import heroMainTsp from "@site/src/assets/tsp-samples/openapi3/hero/main.tsp?raw import heroOpenAPIYaml from "@site/src/assets/tsp-samples/openapi3/hero/out/openapi.yaml?raw"; import { Code } from "@astrojs/starlight/components"; import { TabItem } from "@astrojs/starlight/components"; -import EditorTabs from "../editor-tabs.astro"; +import EditorTabs from "@typespec/astro-utils/components/editor-tabs.astro"; ---