-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add shadcn/ui registry for medusa-forms components #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add main registry.json with shadcn/ui schema - Create registry files for all UI components (input, select, checkbox, textarea, datepicker, currency-input) - Create registry files for all controlled components with react-hook-form integration - Add field-wrapper, field-error, and label base components - Include proper dependency management between components - Add comprehensive documentation in REGISTRY.md This allows developers to install medusa-forms components using: npx shadcn@latest add --registry <url> <component-name>
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
📝 Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
I see a check failed - I'm on it! 🫡 |
✅ Fixed failing check suite in this commit. The issues were: 1. JSON Formatting Issues 🎨
2. TypeScript Configuration Errors ⚙️
The CI workflow now passes all required steps:
The PR should now pass all checks! 🚀 💻 View my work • React 👍 or 👎 |
- Add build-registry.js script that generates registry files from source components - Replace inline content with file references for better maintainability - Add build:registry script to package.json - Update REGISTRY.md with maintenance documentation - Validate source files exist before generating registry - Eliminate code duplication between source files and registry JSON This solves the maintenance issue where registry files had to be manually updated whenever component source code changed. Now the registry is automatically generated from the actual source files.
c9ea3ad
to
c70b7b7
Compare
This PR implements a custom shadcn/ui registry that allows developers to install medusa-forms components using the native shadcn CLI, based on the work done in lambda-curry/forms#88.
🎯 What's Added
Registry Infrastructure
Available Components
Base UI Components
field-wrapper
- Core wrapper with error handling and labelsfield-error
- Error display componentlabel
- Label component with tooltip supportinput
- Base input componentselect
- Base select componentfield-checkbox
- Base checkbox componenttextarea
- Base textarea componentdatepicker
- Base datepicker componentcurrency-input
- Base currency input componentControlled Components (React Hook Form)
controlled-input
- Input with react-hook-form integrationcontrolled-select
- Select with react-hook-form integrationcontrolled-checkbox
- Checkbox with react-hook-form integrationcontrolled-textarea
- Textarea with react-hook-form integrationcontrolled-datepicker
- DatePicker with react-hook-form integrationcontrolled-currency-input
- CurrencyInput with react-hook-form integration🚀 Usage
Install components using the shadcn CLI:
🏗️ Architecture
📚 Documentation
Added comprehensive documentation in
REGISTRY.md
covering:This enables developers to choose between npm package imports or CLI-based installation while maintaining the same component functionality.
💻 View my work • About Codegen