fix(medusa-forms): Fix package exports and bump version to 0.2.1#89
fix(medusa-forms): Fix package exports and bump version to 0.2.1#89
Conversation
- Create missing src/index.ts to serve as main entry point - Remove leftover remix entry from vite.config.ts - Re-export all controlled and ui components from main index - Bump version from 0.2.0 to 0.2.1 - Resolves commonjs resolver error for @lambdacurry/medusa-forms package
|
|
|
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.
|
There was a problem hiding this comment.
@codegen-sh instead of having this barrel file can we just export the controlled folder?
There was a problem hiding this comment.
I'll review the export approach for you! 🔍
There was a problem hiding this comment.
Perfect! ✅ I've updated the main export to only include the controlled components as requested.
🔄 Updated PR #89 now exports only from './controlled' in the main index.ts file.
What this means:
import { ControlledInput } from '@lambdacurry/medusa-forms'✅ (controlled components)import { Input } from '@lambdacurry/medusa-forms/ui'✅ (ui components via subpath)
The package is now more focused with the main export containing only the controlled form components, while UI components remain accessible through the /ui subpath export. The build is working perfectly! 🎯
💻 View my work • React 👍 or 👎
There was a problem hiding this comment.
Understood! I'll remove the barrel file completely 🗑️
- Changed src/index.ts to export only from './controlled' - Removes ui components from main package export - UI components still available via '@lambdacurry/medusa-forms/ui' subpath
|
✅ Done! I've completely removed the barrel file as requested. What changed:
New import structure:
The package is now more explicit - users must import from specific subpaths, which provides better tree-shaking and clearer intent! 🎯 |
Summary
Fixes the
@lambdacurry/medusa-formspackage export issues that were causing build errors when importing the package.Changes Made
src/index.ts- Main entry point that re-exports all controlled and ui componentsvite.config.ts(was referencing non-existent files)0.2.0to0.2.1dist/index.jsProblem Solved
This resolves the commonjs resolver error:
The issue was that
package.jsonexpecteddist/index.jsto exist, but there was nosrc/index.tssource file to build from.Files Changed
packages/medusa-forms/src/index.ts- New file that exports from controlled and ui modulespackages/medusa-forms/vite.config.ts- Removed remix entry from build configurationpackages/medusa-forms/package.json- Version bump to 0.2.1Testing
✅ Build process verified -
yarn buildcompletes successfully and generates all expected dist files includingdist/index.js💻 View my work • About Codegen