{
+ this.start(label)
+ const result = await fn()
+ this.end(label)
+ return result
+ }
+}
+
+// Test data generators
+export class TestDataGenerator {
+ static generateComponentName(): string {
+ const prefixes = ['Test', 'Mock', 'Sample', 'Demo']
+ const suffixes = ['Component', 'Widget', 'Element', 'Item']
+ const prefix = prefixes[Math.floor(Math.random() * prefixes.length)]
+ const suffix = suffixes[Math.floor(Math.random() * suffixes.length)]
+ return `${prefix}${suffix}`
+ }
+
+ static generateRegistryItem(name?: string): any {
+ return {
+ name: name || this.generateComponentName(),
+ type: 'registry:ui',
+ description: `Test component: ${name || 'Generated'}`,
+ files: [
+ {
+ path: `components/ui/${name || 'test'}.tsx`,
+ content: `export function ${name || 'Test'}() { return Test Component
}`,
+ type: 'registry:ui'
+ }
+ ]
+ }
+ }
+
+ static generateStyleVariantTest(baseComponent: string, variants: string[]): any[] {
+ return variants.map(variant => ({
+ name: baseComponent,
+ type: 'registry:ui',
+ description: `${baseComponent} with ${variant} style`,
+ files: [
+ {
+ path: `components/ui/${variant}/${baseComponent}.tsx`,
+ content: `export function ${baseComponent}() { return ${variant} ${baseComponent}
}`,
+ type: 'registry:ui'
+ }
+ ]
+ }))
+ }
+}
+
+// Global performance monitor instance
+export const performanceMonitor = new PerformanceMonitor()