alibaba / alibaba/lowcode-engine
[Feature] lowcode-material-parser 建议暴露 react-docgen-typescript Parser的配置
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
# 背景
react-docgen-typescript会解析组件props包括这个props extend的interface. 例如你用antd Select自定义XXSelect, 不仅会解析出XXSelect的props还有antd select和rc-select. rc-select中大部分的props是不太可能在低代码编辑器上配置, 可以不生成.
# 实现建议
第二个参数可以传入配置, 过滤掉不想要的props
https://github.com/alibaba/lowcode-engine/blob/d7132fa027d1e919de161b70e07a1cba728da7ea/modules/material-parser/src/parse/ts/index.ts#L519
eg:
``` ts
const parser = new MyParser(program, {
propFilter: props => {
// rc-xxx 组件的props太杂了,一般不会配置
if (props?.parent?.fileName?.includes('rc-')) {
return false;
}
return true;
},
});
```
建议`lowcode-material-parser`暴露这个配置
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.