Skip to content

Commit

Permalink
simplify component gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Jul 13, 2021
1 parent 3541540 commit f9491bb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/make-vscode-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ function getAllComponents() {
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');
module.declarations?.map(declaration => {
if (declaration.customElement) {
const component = declaration;

if (component) {
allComponents.push(Object.assign(component, { className, tagName }));
allComponents.push(component);
}
}
});
Expand Down

0 comments on commit f9491bb

Please sign in to comment.