From c3984f74d1025c7658a174e5ee0226c75578c724 Mon Sep 17 00:00:00 2001 From: Darius Cepulis Date: Wed, 22 Apr 2026 10:18:05 -0500 Subject: [PATCH] fix(site): add astro check CI and reduce errors/hints (#1109) Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/website-tests.yml | 36 +++++ pnpm-lock.yaml | 25 +++- site/astro.config.mjs | 43 ++++-- .../edge-functions/markdown-negotiation.ts | 2 +- site/package.json | 1 + .../api-docs-builder/src/core-handler.ts | 4 +- .../api-docs-builder/src/css-vars-handler.ts | 4 +- .../src/data-attrs-handler.ts | 4 +- .../scripts/api-docs-builder/src/formatter.ts | 2 +- .../packages/html/src/player/create-player.ts | 2 +- .../packages/react/src/player/context.tsx | 2 +- .../react/src/player/create-player.ts | 2 +- .../html/controllers/snapshot-controller.ts | 2 +- .../store/src/react/hooks/use-store.ts | 2 +- .../api-docs-builder/src/util-handler.ts | 23 +-- site/scripts/build-ejected-skins.ts | 7 - site/src/components/Code/Shared.tsx | 8 +- site/src/components/JsonLd.astro | 3 + site/src/components/NavBar/NavBar.astro | 3 +- site/src/components/ThemeInit.astro | 3 + .../src/components/blog/AuthorSocialLinks.tsx | 2 + site/src/components/blog/BlogPostCard.astro | 4 +- site/src/components/docs/DocsLink.astro | 2 +- .../docs/api-reference/DetailRow.astro | 2 +- .../html-create-player/html/css/BasicUsage.ts | 6 +- .../player-controller/html/css/BasicUsage.ts | 33 +++-- .../demos/use-button/react/css/BasicUsage.tsx | 3 +- .../demos/use-media/react/css/BasicUsage.css | 36 ----- .../demos/use-media/react/css/BasicUsage.tsx | 50 ------- site/src/components/home/Demo/Demo.astro | 2 + .../components/installation/JSPicker.astro | 5 +- .../installation/JSPickerClient.tsx | 6 +- .../installation/MuxUploaderPanel.tsx | 8 +- site/src/components/typography/Img.astro | 25 ++-- site/src/content/docs/reference/use-media.mdx | 23 --- site/src/layouts/Docs.astro | 1 - site/src/middleware/__tests__/index.test.ts | 3 +- site/src/pages/auth/success.astro | 2 +- .../docs/framework/[framework]/index.astro | 6 +- site/src/pages/docs/framework/index.astro | 6 +- site/src/pages/docs/index.astro | 6 +- site/src/pages/support.astro | 4 +- site/src/utils/auth.ts | 2 + ...nceModel.js => componentReferenceModel.ts} | 140 +++++++++++------- site/src/utils/docs/renderInlineMarkdown.ts | 2 +- .../src/utils/mux/__tests__/auth-flow.test.ts | 22 +-- site/src/utils/mux/__tests__/polling.test.ts | 26 ++-- .../tests/componentReferenceModel.test.ts | 4 +- .../utils/tests/utilReferenceModel.test.ts | 37 ++++- ...eferenceModel.js => utilReferenceModel.ts} | 74 ++++++--- site/tsconfig.json | 2 +- site/vitest.config.ts | 2 +- 52 files changed, 385 insertions(+), 339 deletions(-) delete mode 100644 site/src/components/docs/demos/use-media/react/css/BasicUsage.css delete mode 100644 site/src/components/docs/demos/use-media/react/css/BasicUsage.tsx rename site/src/utils/{componentReferenceModel.js => componentReferenceModel.ts} (56%) rename site/src/utils/{utilReferenceModel.js => utilReferenceModel.ts} (61%) diff --git a/.github/workflows/website-tests.yml b/.github/workflows/website-tests.yml index 1e762273..1f8e9138 100644 --- a/.github/workflows/website-tests.yml +++ b/.github/workflows/website-tests.yml @@ -36,3 +36,39 @@ jobs: - name: Run website tests run: pnpm exec turbo run test --filter=site + + astro-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: 22 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Cache turbo build setup + uses: actions/cache@v5 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + + - name: Build packages + run: pnpm build:packages + + - name: Generate site content + run: cd site && pnpm api-docs && pnpm ejected-skins + + - name: Astro check + run: cd site && pnpm astro check --minimumSeverity warning diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d55ab856..ccfc65fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -640,6 +640,9 @@ importers: '@testing-library/user-event': specifier: ^14.6.1 version: 14.6.1(@testing-library/dom@10.4.1) + '@types/jsdom': + specifier: ^28.0.1 + version: 28.0.1 '@types/react': specifier: ^19.2.2 version: 19.2.14 @@ -3332,6 +3335,9 @@ packages: '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/jsdom@28.0.1': + resolution: {integrity: sha512-GJq2QE4TAZ5ajSoCasn5DOFm8u1mI3tIFvM5tIq3W5U/RTB6gsHwc6Yhpl91X9VSDOUVblgXmG+2+sSvFQrdlw==} + '@types/jsesc@2.5.1': resolution: {integrity: sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==} @@ -3397,6 +3403,9 @@ packages: '@types/tedious@4.0.14': resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==} + '@types/tough-cookie@4.0.5': + resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/triple-beam@1.3.5': resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} @@ -7459,6 +7468,9 @@ packages: undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + undici-types@7.25.0: + resolution: {integrity: sha512-AXNgS1Byr27fTI+2bsPEkV9CxkT8H6xNyRI68b3TatlZo3RkzlqQBLL+w7SmGPVpokjHbcuNVQUWE7FRTg+LRA==} + undici@6.23.0: resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==} engines: {node: '>=18.17'} @@ -10932,6 +10944,13 @@ snapshots: dependencies: '@types/unist': 3.0.3 + '@types/jsdom@28.0.1': + dependencies: + '@types/node': 22.19.15 + '@types/tough-cookie': 4.0.5 + parse5: 7.3.0 + undici-types: 7.25.0 + '@types/jsesc@2.5.1': {} '@types/jsonfile@6.1.4': @@ -11010,6 +11029,8 @@ snapshots: dependencies: '@types/node': 22.19.15 + '@types/tough-cookie@4.0.5': {} + '@types/triple-beam@1.3.5': {} '@types/turndown@5.0.6': {} @@ -11310,7 +11331,7 @@ snapshots: sirv: 3.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.1.0 - vitest: 4.1.0(@opentelemetry/api@1.9.1)(@types/node@24.12.2)(@vitest/browser-playwright@4.1.0)(@vitest/ui@4.1.0)(happy-dom@18.0.1)(jsdom@27.4.0)(vite@7.3.2(@types/node@24.12.2)(jiti@2.6.1)(lightningcss@1.32.0)(tsx@4.21.0)(yaml@2.8.2)) + vitest: 4.1.0(@opentelemetry/api@1.9.1)(@types/node@24.12.2)(@vitest/browser-playwright@4.1.0)(@vitest/ui@4.1.0)(happy-dom@18.0.1)(jsdom@27.4.0)(vite@8.0.0(@types/node@24.12.2)(esbuild@0.27.3)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.2)) '@vitest/utils@4.1.0': dependencies: @@ -15916,6 +15937,8 @@ snapshots: undici-types@7.16.0: {} + undici-types@7.25.0: {} + undici@6.23.0: {} unicode-trie@2.0.0: diff --git a/site/astro.config.mjs b/site/astro.config.mjs index 7c825cc8..30478bea 100644 --- a/site/astro.config.mjs +++ b/site/astro.config.mjs @@ -9,6 +9,19 @@ import sitemap from '@astrojs/sitemap'; import sentry from '@sentry/astro'; import tailwindcss from '@tailwindcss/vite'; import { defineConfig, envField, fontProviders } from 'astro/config'; +import astro from 'shiki/langs/astro.mjs'; +import bash from 'shiki/langs/bash.mjs'; +import css from 'shiki/langs/css.mjs'; +import html from 'shiki/langs/html.mjs'; +import http from 'shiki/langs/http.mjs'; +import javascript from 'shiki/langs/javascript.mjs'; +import json from 'shiki/langs/json.mjs'; +import jsx from 'shiki/langs/jsx.mjs'; +import markdown from 'shiki/langs/markdown.mjs'; +import mdxLang from 'shiki/langs/mdx.mjs'; +import ts from 'shiki/langs/ts.mjs'; +import tsx from 'shiki/langs/tsx.mjs'; +import yaml from 'shiki/langs/yaml.mjs'; import svgr from 'vite-plugin-svgr'; import llmsMarkdown from './integrations/llms-markdown'; import rehypePrepareCodeBlocks from './src/utils/rehypePrepareCodeBlocks'; @@ -37,7 +50,7 @@ export default defineConfig({ site: SITE_URL, trailingSlash: 'never', adapter: netlify({ - devFeatures: { images: false, environmentVariables: true }, + devFeatures: { images: false, environmentVariables: false }, }), // Server-only secrets read at runtime (not inlined at build time). // All optional — the site degrades gracefully without auth/Mux configured. @@ -113,21 +126,21 @@ export default defineConfig({ // Pre-declare only the languages used in MDX code fences. Without this, // Astro ships a highlighter that lazily loads grammars on first use, // which serializes per-block initialization during build. + // `js`/`cjs`/`mjs` are auto-registered as aliases of `javascript` by Shiki. langs: [ - 'tsx', - 'ts', - 'css', - 'html', - 'js', - 'jsx', - 'javascript', - 'bash', - 'markdown', - 'mdx', - 'json', - 'yaml', - 'http', - 'astro', + ...tsx, + ...ts, + ...css, + ...html, + ...jsx, + ...javascript, + ...bash, + ...markdown, + ...mdxLang, + ...json, + ...yaml, + ...http, + ...astro, ], transformers: [shikiTransformMetadata, ...shikiNotationTransformers], }, diff --git a/site/netlify/edge-functions/markdown-negotiation.ts b/site/netlify/edge-functions/markdown-negotiation.ts index dededbe8..9a95411c 100644 --- a/site/netlify/edge-functions/markdown-negotiation.ts +++ b/site/netlify/edge-functions/markdown-negotiation.ts @@ -1,6 +1,6 @@ import type { Config, Context } from '@netlify/edge-functions'; -export default async (request: Request, context: Context) => { +export default async (request: Request, _context: Context) => { const url = new URL(request.url); const path = url.pathname.replace(/\/$/, ''); diff --git a/site/package.json b/site/package.json index e83e5c77..804ca750 100644 --- a/site/package.json +++ b/site/package.json @@ -63,6 +63,7 @@ "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.0", "@testing-library/user-event": "^14.6.1", + "@types/jsdom": "^28.0.1", "@types/react": "^19.2.2", "@types/react-dom": "^19.2.1", "@types/turndown": "^5.0.6", diff --git a/site/scripts/api-docs-builder/src/core-handler.ts b/site/scripts/api-docs-builder/src/core-handler.ts index 7bdfa126..28a812cc 100644 --- a/site/scripts/api-docs-builder/src/core-handler.ts +++ b/site/scripts/api-docs-builder/src/core-handler.ts @@ -73,7 +73,7 @@ export function extractDefaultProps( const defaultProps: Record = {}; - function visit(node: ts.Node) { + const visit = (node: ts.Node) => { // Look for class declaration if (ts.isClassDeclaration(node) && node.name?.text === `${componentName}Core`) { for (const member of node.members) { @@ -103,7 +103,7 @@ export function extractDefaultProps( } ts.forEachChild(node, visit); - } + }; visit(sourceFile); diff --git a/site/scripts/api-docs-builder/src/css-vars-handler.ts b/site/scripts/api-docs-builder/src/css-vars-handler.ts index 271bf61a..8f158f37 100644 --- a/site/scripts/api-docs-builder/src/css-vars-handler.ts +++ b/site/scripts/api-docs-builder/src/css-vars-handler.ts @@ -42,7 +42,7 @@ export function extractCSSVars(filePath: string, program: ts.Program, componentN const vars: Array<{ name: string; description: string }> = []; const expectedName = `${componentName}CSSVars`; - function visit(node: ts.Node) { + const visit = (node: ts.Node) => { if (ts.isVariableStatement(node)) { for (const decl of node.declarationList.declarations) { if (!ts.isIdentifier(decl.name) || decl.name.text !== expectedName || !decl.initializer) { @@ -74,7 +74,7 @@ export function extractCSSVars(filePath: string, program: ts.Program, componentN } ts.forEachChild(node, visit); - } + }; visit(sourceFile); diff --git a/site/scripts/api-docs-builder/src/data-attrs-handler.ts b/site/scripts/api-docs-builder/src/data-attrs-handler.ts index f69bc478..20883031 100644 --- a/site/scripts/api-docs-builder/src/data-attrs-handler.ts +++ b/site/scripts/api-docs-builder/src/data-attrs-handler.ts @@ -88,7 +88,7 @@ export function extractDataAttrs( // Common naming patterns for data attributes exports const possibleNames = [`${componentName}DataAttrs`, `${componentName}DataAttributes`]; - function visit(node: ts.Node) { + const visit = (node: ts.Node) => { // Look for variable declaration like: export const PlayButtonDataAttrs = { ... } if (ts.isVariableStatement(node)) { for (const decl of node.declarationList.declarations) { @@ -136,7 +136,7 @@ export function extractDataAttrs( } ts.forEachChild(node, visit); - } + }; visit(sourceFile); diff --git a/site/scripts/api-docs-builder/src/formatter.ts b/site/scripts/api-docs-builder/src/formatter.ts index 3be3a559..746d51c1 100644 --- a/site/scripts/api-docs-builder/src/formatter.ts +++ b/site/scripts/api-docs-builder/src/formatter.ts @@ -106,7 +106,7 @@ export function formatProperties(props: tae.PropertyNode[], allExports?: tae.Exp const entry: PropDef = { type: abbreviated ?? expandedType }; if (abbreviated && expandedType !== abbreviated) entry.detailedType = expandedType; - if (prop.documentation?.defaultValue !== undefined) entry.default = prop.documentation.defaultValue; + if (prop.documentation?.defaultValue !== undefined) entry.default = String(prop.documentation.defaultValue); if (!prop.optional) entry.required = true; if (prop.documentation?.description !== undefined) entry.description = prop.documentation.description; diff --git a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/html/src/player/create-player.ts b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/html/src/player/create-player.ts index cca094b6..82eb92e6 100644 --- a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/html/src/player/create-player.ts +++ b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/html/src/player/create-player.ts @@ -8,6 +8,6 @@ interface HtmlPlayerOptions { } /** Create an HTML player instance. */ -export function createPlayer(options: HtmlPlayerOptions): HtmlPlayerInstance { +export function createPlayer(_options: HtmlPlayerOptions): HtmlPlayerInstance { return {} as HtmlPlayerInstance; } diff --git a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/context.tsx b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/context.tsx index 481bafc8..7979ffa4 100644 --- a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/context.tsx +++ b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/context.tsx @@ -11,6 +11,6 @@ interface StoreState { /** Access the player store or select state from it. */ export function usePlayer(): PlayerStore; export function usePlayer(selector: (state: StoreState) => R): R; -export function usePlayer(selector?: (state: StoreState) => R): PlayerStore | R { +export function usePlayer(_selector?: (state: StoreState) => R): PlayerStore | R { return {} as PlayerStore | R; } diff --git a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/create-player.ts b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/create-player.ts index 282dcb07..d3c475d7 100644 --- a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/create-player.ts +++ b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/react/src/player/create-player.ts @@ -8,6 +8,6 @@ interface PlayerOptions { } /** Create a React player instance. */ -export function createPlayer(options?: PlayerOptions): PlayerInstance { +export function createPlayer(_options?: PlayerOptions): PlayerInstance { return {} as PlayerInstance; } diff --git a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/html/controllers/snapshot-controller.ts b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/html/controllers/snapshot-controller.ts index c1d5d26d..a2f43f29 100644 --- a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/html/controllers/snapshot-controller.ts +++ b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/html/controllers/snapshot-controller.ts @@ -25,7 +25,7 @@ export class SnapshotController implements ReactiveController { * @param state - The store to snapshot. */ constructor(host: ReactiveControllerHost, state: Store); - constructor(host: ReactiveControllerHost, state: Store, selector?: (state: S) => R) { + constructor(host: ReactiveControllerHost, _state: Store, _selector?: (state: S) => R) { host.addController(this); } diff --git a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/react/hooks/use-store.ts b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/react/hooks/use-store.ts index f0e987c3..46ea85c6 100644 --- a/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/react/hooks/use-store.ts +++ b/site/scripts/api-docs-builder/src/tests/fixtures/monorepo/packages/store/src/react/hooks/use-store.ts @@ -5,6 +5,6 @@ interface Store { /** Subscribe to a store. */ export function useStore(store: Store): S; export function useStore(store: Store, selector: (state: S) => R): R; -export function useStore(store: Store, selector?: (state: S) => R): S | R { +export function useStore(_store: Store, _selector?: (state: S) => R): S | R { return {} as S | R; } diff --git a/site/scripts/api-docs-builder/src/util-handler.ts b/site/scripts/api-docs-builder/src/util-handler.ts index 840d9c0e..96a26d05 100644 --- a/site/scripts/api-docs-builder/src/util-handler.ts +++ b/site/scripts/api-docs-builder/src/util-handler.ts @@ -395,12 +395,15 @@ function extractPublicMembers( for (const member of classDecl.members) { // Skip private, protected, static, constructor if ( - member.modifiers?.some( - (m) => - m.kind === ts.SyntaxKind.PrivateKeyword || - m.kind === ts.SyntaxKind.ProtectedKeyword || - m.kind === ts.SyntaxKind.StaticKeyword - ) + ts.canHaveModifiers(member) && + ts + .getModifiers(member) + ?.some( + (m: ts.ModifierLike) => + m.kind === ts.SyntaxKind.PrivateKeyword || + m.kind === ts.SyntaxKind.ProtectedKeyword || + m.kind === ts.SyntaxKind.StaticKeyword + ) ) continue; @@ -502,7 +505,7 @@ function getNodeJSDoc(node: ts.Node): string | undefined { if (typeof doc.comment === 'string') return doc.comment; // Handle JSDocComment array - return doc.comment.map((c: ts.JSDocText | ts.JSDocLink) => ('text' in c ? c.text : '')).join(''); + return doc.comment.map((c: ts.JSDocComment) => ('text' in c ? c.text : '')).join(''); } function getJSDocParamDescription(node: ts.Node, paramName: string): string | undefined { @@ -517,7 +520,7 @@ function getJSDocParamDescription(node: ts.Node, paramName: string): string | un const raw = typeof tag.comment === 'string' ? tag.comment - : tag.comment.map((c: ts.JSDocText | ts.JSDocLink) => ('text' in c ? c.text : '')).join(''); + : tag.comment.map((c: ts.JSDocComment) => ('text' in c ? c.text : '')).join(''); return raw.replace(/^\s*-\s+/, ''); } } @@ -550,7 +553,7 @@ function getJSDocTagValue(node: ts.Node, tagName: string): string | undefined { if (!tag.comment) return undefined; if (typeof tag.comment === 'string') return tag.comment.trim(); return tag.comment - .map((c: ts.JSDocText | ts.JSDocLink) => ('text' in c ? c.text : '')) + .map((c: ts.JSDocComment) => ('text' in c ? c.text : '')) .join('') .trim(); } @@ -947,7 +950,7 @@ function discoverUtilExports(monorepoRoot: string, program: ts.Program): UtilEnt for (const modulePath of modulesToScan) { if (!fs.existsSync(modulePath)) continue; - let ast: tae.Module; + let ast: tae.ModuleNode; try { ast = tae.parseFromProgram(modulePath, program); } catch { diff --git a/site/scripts/build-ejected-skins.ts b/site/scripts/build-ejected-skins.ts index ad0c616b..9e4f7584 100644 --- a/site/scripts/build-ejected-skins.ts +++ b/site/scripts/build-ejected-skins.ts @@ -265,13 +265,6 @@ function getStatementName(statement: ts.Statement): string | null { return null; } -function parseNames(raw: string): string[] { - return raw - .split(',') - .map((s) => s.trim()) - .filter(Boolean); -} - function isRelativeImport(specifier: string): boolean { return specifier.startsWith('./') || specifier.startsWith('../'); } diff --git a/site/src/components/Code/Shared.tsx b/site/src/components/Code/Shared.tsx index 2745b456..4a179c0d 100644 --- a/site/src/components/Code/Shared.tsx +++ b/site/src/components/Code/Shared.tsx @@ -12,8 +12,8 @@ export interface SharedProps { interface Highlighted { html: string; - preClassName: unknown; - codeClassName: unknown; + preClassName: string | undefined; + codeClassName: string | undefined; } // Build-time memo: identical (code, lang) pairs repeat across pages @@ -56,8 +56,8 @@ function highlight(code: string, lang: BundledLanguage, highlighter: Highlighter const result: Highlighted = { html: hastToHtml(hast), - preClassName: preProps.class, - codeClassName: codeProps.class, + preClassName: preProps.class as string | undefined, + codeClassName: codeProps.class as string | undefined, }; highlightCache.set(cacheKey, result); return result; diff --git a/site/src/components/JsonLd.astro b/site/src/components/JsonLd.astro index ce9cf6f0..e88fbba8 100644 --- a/site/src/components/JsonLd.astro +++ b/site/src/components/JsonLd.astro @@ -9,4 +9,7 @@ interface Props { const { schema } = Astro.props; --- +{ + /* astro(4000) is expected — JSON-LD is static data that should be inline (withastro/astro#3544) */ +}