mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-25 06:04:54 +00:00
- Introduced `menu.json` for menu component structure with bindings for trigger and content. - Created `password-input.json` for password input handling visibility and value changes. - Added `popover.json` for popover component with trigger and content bindings. feat: Implement custom hooks for UI interactions - Added `useAccordion` for managing accordion state with single/multiple item support. - Created `useBindingEditor` for managing bindings in a dynamic editor. - Implemented `useCopyState` for clipboard copy functionality with feedback. - Developed `useFileUpload` for handling file uploads with drag-and-drop support. - Introduced `useFocusState` for managing focus state in components. - Created `useImageState` for handling image loading and error states. - Added `useMenuState` for managing menu interactions and item clicks. - Implemented `usePasswordVisibility` for toggling password visibility. - Developed `usePopoverState` for managing popover visibility and interactions. feat: Add constants and interfaces for JSON UI components - Introduced constants for sizes, placements, styles, and object-fit handling. - Created interfaces for various components including Accordion, Binding Editor, Copy Button, Data Source Editor, File Upload, and more. - Added type definitions for menu items, popover props, and other UI elements to enhance type safety and maintainability.
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
#!/usr/bin/env tsx
|
|
/**
|
|
* Fix index.ts files to only export existing TSX files
|
|
*/
|
|
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
import { globSync } from 'fs'
|
|
|
|
const ROOT_DIR = path.resolve(process.cwd())
|
|
const COMPONENTS_DIR = path.join(ROOT_DIR, 'src/components')
|
|
|
|
const categories = ['atoms', 'molecules', 'organisms']
|
|
|
|
for (const category of categories) {
|
|
const categoryDir = path.join(COMPONENTS_DIR, category)
|
|
const indexPath = path.join(categoryDir, 'index.ts')
|
|
|
|
if (!fs.existsSync(indexPath)) continue
|
|
|
|
// Find all TSX files in this category
|
|
const tsxFiles = globSync(path.join(categoryDir, '*.tsx'))
|
|
const basenames = tsxFiles.map(f => path.basename(f, '.tsx'))
|
|
|
|
console.log(`\n📁 ${category}/`)
|
|
console.log(` Found ${basenames.length} TSX files`)
|
|
|
|
// Generate new exports
|
|
const exports = basenames
|
|
.sort()
|
|
.map(name => `export { ${name} } from './${name}'`)
|
|
.join('\n')
|
|
|
|
// Write new index file
|
|
const content = `// Auto-generated - only exports existing TSX files\n${exports}\n`
|
|
fs.writeFileSync(indexPath, content)
|
|
|
|
console.log(` ✅ Updated ${category}/index.ts`)
|
|
}
|
|
|
|
console.log('\n✨ All index files updated!')
|