🚀 Features
- codeSamples: Replace hardcoded language maps with extensible central LanguageConfig - by @JulianVallee in #317 (891b5)
Refactor code samples to use a single, extensible LanguageConfig interface as the source of truth for language definitions. Each language now declares its own target, client, highlighter, and display metadata, removing the need for separate hardcoded mapping dictionaries.
Shiki now loads only core languages (json, xml, markdown) on init and loads additional highlighter languages on demand via ensureLanguage(), reducing initial bundle overhead.
BREAKING CHANGES:
codeSamples.langsconfig option has been removed; the set of displayed is now driven entirely bycodeSamples.availableLanguages.getCodeSamplesLangs()has been removed from the useTheme composable.LanguageConfiginterface now requirestargetandclientproperties used by @scalar/snippetz for code generation).- The
GeneratorFunctionsignature changed from(lang: string, request: OARequest)to
(langConfig: LanguageConfig, request: OARequest). - The
codeSamplesprop has been removed from theOACodeSamplescomponent.