docs(api): Update nitro to latest version (#4102)

* update nitro

* try this?

* Try this

* update vercel output

* Add await

* Fix endpoints

* Adjust 404 catch all

* Fix output

* Adjust react in api

* Fix types

* Remove @resvg/resvg-wasm

* Format code

* Fix failing check

* Apply feedback

* Format code
This commit is contained in:
Eric Fennis
2026-03-05 14:03:27 +01:00
committed by GitHub
parent 0ea8780434
commit e6c7d7d495
27 changed files with 1205 additions and 1325 deletions

View File

@@ -1,5 +1,4 @@
import { bundledLanguages, type ThemeRegistration } from 'shiki';
import { createHighlighter } from 'shiki';
import { highLightCode } from './createCodeExamples';
type CodeExampleType = {
title: string;
@@ -116,34 +115,6 @@ import { $CamelCase } from '@lucide/lab';
];
};
export type ThemeOptions =
| ThemeRegistration
| { light: ThemeRegistration; dark: ThemeRegistration };
const highLightCode = async (code: string, lang: string, active?: boolean) => {
const highlighter = await createHighlighter({
themes: ['github-light', 'github-dark'],
langs: Object.keys(bundledLanguages),
});
const highlightedCode = highlighter
.codeToHtml(code, {
lang,
themes: {
light: 'github-light',
dark: 'github-dark',
},
defaultColor: false,
})
.replace('shiki-themes', 'shiki-themes vp-code');
return `<div class="language-${lang} ${active ? 'active' : ''}">
<button title="Copy Code" class="copy"></button>
<span class="lang">${lang}</span>
${highlightedCode}
</div>`;
};
export default async function createCodeExamples() {
const codes = getIconCodes();