Remove legacy codes
parent
9f4fe4a2e5
commit
9eaaa9b632
|
@ -680,74 +680,6 @@ if (project) {
|
|||
});
|
||||
});
|
||||
|
||||
const module_designtokens_group = module.groups?.find((g) => g.title === 'DesignTokens');
|
||||
|
||||
module_designtokens_group &&
|
||||
module_designtokens_group.children.forEach((event) => {
|
||||
const event_props_description = event.comment && event.comment.summary.map((s) => s.text || '').join(' ');
|
||||
let component_prop = '';
|
||||
|
||||
if (event.comment && event.comment.getTag('@see')) {
|
||||
const tag = event.comment.getTag('@see');
|
||||
const content = tag.content[0];
|
||||
|
||||
if (content.text.includes("['")) {
|
||||
component_prop = `${content.target.name}${content.text}`;
|
||||
} else {
|
||||
component_prop = `${content.text === content.target?.name ? content.target.parent.name : content.target?.name}.${content.text}`;
|
||||
}
|
||||
}
|
||||
|
||||
!doc[name]['tokens'] &&
|
||||
(doc[name]['tokens'] = {
|
||||
description: staticMessages['tokens'],
|
||||
values: {}
|
||||
});
|
||||
|
||||
const props = [];
|
||||
|
||||
const setProps = (_declaration, _name) => {
|
||||
if (_declaration?.groups) {
|
||||
const event_props_group = _declaration.groups.find((g) => g.title === 'Properties');
|
||||
|
||||
event_props_group &&
|
||||
event_props_group.children.forEach((prop) => {
|
||||
if (prop.type?.declaration) {
|
||||
setProps(prop.type?.declaration, prop.name);
|
||||
} else if (prop.comment?.getTag('@designToken')) {
|
||||
props.push({
|
||||
name: _name ? `${_name}.${prop.name}` : prop.name,
|
||||
token: prop.comment.getTag('@designToken').content[0]?.text || '',
|
||||
optional: prop.flags.isOptional,
|
||||
readonly: prop.flags.isReadonly,
|
||||
type: prop.type.toString(),
|
||||
default: prop.comment && prop.comment.getTag('@defaultValue') ? prop.comment.getTag('@defaultValue').content[0]?.text || '' : '', // TODO: Check
|
||||
description:
|
||||
prop.comment &&
|
||||
prop.comment.summary
|
||||
.map((s) => {
|
||||
if (s.text.indexOf('[here]') > -1) {
|
||||
return `${s.text.slice(0, s.text.indexOf('[here]'))} <a target="_blank" href="${s.text.slice(s.text.indexOf('(') + 1, s.text.indexOf(')'))}">here</a> ${s.text.slice(s.text.indexOf(')') + 1)}`;
|
||||
}
|
||||
|
||||
return s.text || '';
|
||||
})
|
||||
.join(' '),
|
||||
deprecated: prop.comment && prop.comment.getTag('@deprecated') ? parseText(prop.comment.getTag('@deprecated').content[0]?.text) : undefined
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
setProps(event);
|
||||
|
||||
doc[name]['tokens'].values[event.name] = {
|
||||
description: event_props_description,
|
||||
props
|
||||
};
|
||||
});
|
||||
|
||||
// app.generateJson(module, `./api-generator/module-typedoc.json`);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue