V13-FE-005: Complete KBX v60 frontend components, T01-T12 screen recipes, and WBS progress tracker
This commit is contained in:
@@ -22,7 +22,13 @@ for (const name of exported) {
|
||||
const componentPath = path.join(root, 'src', 'shared', 'ui', 'components', `${name}.vue`)
|
||||
if (!fs.existsSync(componentPath)) continue
|
||||
const source = fs.readFileSync(componentPath, 'utf8')
|
||||
const propsBlock = source.match(/defineProps\s*<\s*\{([\s\S]*?)\}\s*>/)?.[1] ?? ''
|
||||
const interfaceName = source.match(/export\s+interface\s+(\w+Props)/)?.[1]
|
||||
let propsBlock = ''
|
||||
if (interfaceName) {
|
||||
propsBlock = source.match(new RegExp(`interface\\s+${interfaceName}\\s*\\{([\\s\\S]*?)\\}`))?.[1] ?? ''
|
||||
} else {
|
||||
propsBlock = source.match(/defineProps\s*<\s*\{([\s\S]*?)\}\s*>/)?.[1] ?? ''
|
||||
}
|
||||
componentProps.set(name, new Set([...propsBlock.matchAll(/([A-Za-z_$][\w$]*)\s*\??\s*:/g)].map(match => match[1])))
|
||||
}
|
||||
for (const file of files) {
|
||||
|
||||
Reference in New Issue
Block a user