From 983c6382d15145a2c03ea016748dac24f74bb897 Mon Sep 17 00:00:00 2001 From: Hugo Richard Date: Sat, 10 May 2025 19:52:01 +0200 Subject: [PATCH] docs(llms): handle prose props in `llms-full.txt` (#4111) --- docs/server/plugins/llms.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/server/plugins/llms.ts b/docs/server/plugins/llms.ts index 6a3d20ae..c5fbdec7 100644 --- a/docs/server/plugins/llms.ts +++ b/docs/server/plugins/llms.ts @@ -351,6 +351,7 @@ export default defineNitroPlugin((nitroApp) => { visitAndReplace(doc, 'component-props', (node) => { const attributes = node[1] as Record const mdcSpecificName = attributes?.name + const isProse = parseBoolean(attributes[':prose']) const finalComponentName = mdcSpecificName ? camelCase(mdcSpecificName) : componentName @@ -358,11 +359,13 @@ export default defineNitroPlugin((nitroApp) => { if (!componentMeta?.props) return + const interfaceName = isProse ? `Prose${pascalCaseName}Props` : `${pascalCaseName}Props` + const interfaceCode = generateTSInterface( - `${pascalCaseName}Props`, + interfaceName, Object.values(componentMeta.props), propItemHandler, - `Props for the ${pascalCaseName} component` + `Props for the ${isProse ? 'Prose' : ''}${pascalCaseName} component` ) replaceNodeWithPre(node, 'ts', interfaceCode) })