Skip to content

Commit 9fb8bac

Browse files
committed
Refactor package.json and Vite config for improved exports and entry points
- Simplified the exports structure in package.json by removing unnecessary nested import objects. - Updated Vite config to streamline entry points for remix-hook-form and ui components. - Enhanced index.ts to explicitly export Textarea from both remix-hook-form and ui to resolve naming conflicts. These changes improve clarity and maintainability of the component library's structure.
1 parent 4219a74 commit 9fb8bac

3 files changed

Lines changed: 17 additions & 25 deletions

File tree

packages/components/package.json

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,16 @@
66
"types": "./dist/index.d.ts",
77
"exports": {
88
".": {
9-
"import": {
10-
"types": "./dist/index.d.ts",
11-
"default": "./dist/index.js"
12-
}
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/index.js"
1311
},
1412
"./remix-hook-form": {
15-
"import": {
16-
"types": "./dist/remix-hook-form/index.d.ts",
17-
"default": "./dist/remix-hook-form/index.js"
18-
}
13+
"types": "./dist/remix-hook-form/index.d.ts",
14+
"import": "./dist/remix-hook-form/index.js"
1915
},
2016
"./ui": {
21-
"import": {
22-
"types": "./dist/ui/index.d.ts",
23-
"default": "./dist/ui/index.js"
24-
}
25-
},
26-
"./data-table": {
27-
"import": {
28-
"types": "./dist/data-table/index.d.ts",
29-
"default": "./dist/data-table/index.js"
30-
}
17+
"types": "./dist/ui/index.d.ts",
18+
"import": "./dist/ui/index.js"
3119
}
3220
},
3321
"files": [

packages/components/src/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
// Main entry point for @lambdacurry/forms
2-
// Export UI components first
3-
export * from './ui';
1+
// Main exports from both remix-hook-form and ui directories
42

5-
// Export remix-hook-form components (some may override UI components intentionally)
3+
// Export all components from remix-hook-form
64
export * from './remix-hook-form';
5+
6+
// Explicitly export Textarea from both locations to handle naming conflicts
7+
// The remix-hook-form Textarea is a form-aware wrapper
8+
export { Textarea as RemixTextarea } from './remix-hook-form/textarea';
9+
10+
// The ui Textarea is the base component
11+
export { Textarea } from './ui/textarea';

packages/components/vite.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ export default defineConfig({
1717
lib: {
1818
entry: {
1919
index: './src/index.ts',
20-
'remix-hook-form/index': './src/remix-hook-form/index.ts',
21-
'ui/index': './src/ui/index.ts',
22-
'data-table/index': './src/data-table/index.ts',
20+
'remix-hook-form': './src/remix-hook-form/index.ts',
21+
ui: './src/ui/index.ts',
2322
},
2423
formats: ['es'],
2524
},

0 commit comments

Comments
 (0)