mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
update helper functions
This commit is contained in:
@@ -9,20 +9,19 @@ import mkdirp from 'mkdirp';
|
||||
|
||||
const metadata = JSON.parse(fs.readFileSync('./dist/custom-elements.json', 'utf8'));
|
||||
|
||||
function getAllComponents() {
|
||||
function getAllComponents(metadata) {
|
||||
const allComponents = [];
|
||||
|
||||
metadata.modules.map(module => {
|
||||
module.exports.find(ex => {
|
||||
module.exports.map(ex => {
|
||||
if (ex.kind === 'custom-element-definition') {
|
||||
const tagName = ex.name;
|
||||
const className = ex.declaration.name;
|
||||
const component = Object.assign(
|
||||
{ className, tagName },
|
||||
module?.declarations.find(dec => dec.name === 'default')
|
||||
);
|
||||
const component = module?.declarations.find(dec => dec.name === 'default');
|
||||
|
||||
allComponents.push(component);
|
||||
if (component) {
|
||||
allComponents.push(Object.assign(component, { className, tagName }));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user