diff --git a/custom-elements-manifest.config.js b/custom-elements-manifest.config.js index d3db18319..0d4be0ff4 100644 --- a/custom-elements-manifest.config.js +++ b/custom-elements-manifest.config.js @@ -22,17 +22,11 @@ export default { analyzePhase({ ts, node, moduleDoc, context }) { switch (node.kind) { case ts.SyntaxKind.ClassDeclaration: - const hasDefaultModifier = node?.modifiers?.some(mod => ts.SyntaxKind.DefaultKeyword === mod.kind); - const className = hasDefaultModifier ? 'default' : node?.name?.getText(); + const className = node.name.getText(); const classDoc = moduleDoc?.declarations?.find(declaration => declaration.name === className); const customTags = ['animation', 'dependency', 'since', 'status']; let customComments = '/**'; - // We only care about custom tags on classes - if (!classDoc) { - return; - } - node.jsDoc?.forEach(jsDoc => { jsDoc?.tags?.forEach(tag => { const tagName = tag.tagName.getText(); diff --git a/docs/assets/plugins/metadata/metadata.js b/docs/assets/plugins/metadata/metadata.js index e62a5836b..9dfb3fdeb 100644 --- a/docs/assets/plugins/metadata/metadata.js +++ b/docs/assets/plugins/metadata/metadata.js @@ -248,17 +248,10 @@ function getAllComponents(metadata) { const allComponents = []; - - metadata.modules.map(module => { - module.exports.map(ex => { - if (ex.kind === 'custom-element-definition') { - const tagName = ex.name; - const className = ex.declaration.name; - const component = module?.declarations.find(dec => dec.name === 'default'); - - if (component) { - allComponents.push(Object.assign(component, { className, tagName })); - } + metadata.modules?.map(module => { + module.declarations?.map(declaration => { + if (declaration.customElement) { + allComponents.push(declaration); } }); }); @@ -327,7 +320,7 @@ result += `
- <${component.tagName}> | ${component.className} + <${component.tagName}> | ${component.name}