This repository was archived by the owner on Mar 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
Critical TypeScript Declaration Issues Blocking Development - @etherisc/ui-kit v0.4.0 #44
Copy link
Copy link
Closed
Description
Critical TypeScript Declaration Issues in @etherisc/ui-kit v0.4.0
Severity: CRITICAL - Blocks TypeScript development
Package Version: 0.4.0
Impact: All TypeScript projects using this package cannot compile
Problem Summary
The @etherisc/ui-kit package has fundamental TypeScript declaration issues that prevent proper development. Components exist and work at runtime but TypeScript cannot see them due to package build problems.
Evidence
TypeScript Compilation Errors
# Testing basic import shows 19 TypeScript errors
echo 'import { Select, Button, StatusBadge, DataTable } from "@etherisc/ui-kit"; console.log(Select);' > temp-test.ts
npx tsc --noEmit temp-test.ts
# Output shows missing modules: @radix-ui/react-select, @tanstack/react-table, etc.Runtime vs TypeScript Mismatch
// Runtime - Works perfectly ✅
const { Select } = require('@etherisc/ui-kit');
console.log(typeof Select); // "object"
// TypeScript - Fails ❌
import { Select } from '@etherisc/ui-kit'; // Error: no exported member 'Select'Root Cause Analysis
- Missing Dependencies: Package references @radix-ui packages that aren't installed in consumers
- React Import Issues: Using incompatible
import Reactinstead ofimport * as React - Module Resolution Problems: Dependencies can't be resolved by TypeScript
- Interface Property Mismatches: Component interfaces don't match runtime behavior
Specific Issues Found
1. Component Import Failures
Selectcomponent exists at runtime but TypeScript reports "no exported member 'Select'"- Same issue affects
Button,StatusBadge,DataTable, etc.
2. Interface Inconsistencies
Button: TypeScript doesn't recognizeintentprop but it works at runtimeStatusBadge: TypeScript doesn't recognizevariantprop but it works at runtimeSelect: UsesonValueChange(notonChange) but TypeScript interface is incorrectDataTable: MissingpageSizeprop in TypeScript interface
3. Missing Peer Dependencies
Package should declare these as peerDependencies:
{
"peerDependencies": {
"@radix-ui/react-select": "^1.0.0",
"@radix-ui/react-checkbox": "^1.0.0",
"@tanstack/react-table": "^8.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
}
}Solution Proposals
1. Fix Package Build Configuration
tsconfig.json updates:
{
"compilerOptions": {
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"jsx": "react-jsx"
}
}package.json updates:
{
"peerDependencies": {
"@radix-ui/react-select": "^1.0.0",
"@radix-ui/react-checkbox": "^1.0.0",
"@tanstack/react-table": "^8.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
}
}2. Standardize Component Interfaces
Consistent prop naming:
- Standardize on either
variantORintentacross all components - Use
onValueChangeconsistently for form components - Ensure all runtime props are declared in TypeScript interfaces
Correct Select interface:
interface SelectProps {
label?: string;
options: Array<{ value: string; label: string; disabled?: boolean }>;
value?: string;
onValueChange?: (value: string) => void; // Not onChange!
placeholder?: string;
error?: string;
className?: string;
}3. Build Process Fixes
- Ensure TypeScript compilation during build
- Validate that declaration files match runtime exports
- Bundle or properly reference all dependencies
- Test package installation in clean environment
4. Add Automated Testing
// Type-level tests
import { Select, Button, StatusBadge, DataTable } from '@etherisc/ui-kit';
// Runtime validation tests
const components = { Select, Button, StatusBadge, DataTable };
Object.entries(components).forEach(([name, component]) => {
expect(component).toBeDefined();
expect(typeof component).toBe('object');
});Implementation Priority
- IMMEDIATE: Fix missing peer dependencies and module resolution
- SHORT-TERM: Correct TypeScript interfaces to match runtime
- MEDIUM-TERM: Standardize component prop patterns
- LONG-TERM: Add comprehensive build validation
Impact Assessment
Current State:
- ❌ TypeScript development completely blocked
- ❌ Poor developer experience
- ❌ No type safety
- ❌ Broken IDE support
After Fixes:
- ✅ Full TypeScript support
- ✅ Excellent developer experience
- ✅ Complete type safety
- ✅ Perfect IDE integration
Temporary Workaround
For immediate unblocking, developers can use:
// Runtime import workaround
const UIKit = require('@etherisc/ui-kit');
const Select = UIKit.Select as React.ComponentType<{
onValueChange?: (value: string) => void;
// ... other props
}>;Request
Please prioritize fixing these fundamental package issues as they block all TypeScript development using @etherisc/ui-kit. Happy to provide additional details or testing assistance.
Environment
- Node.js: v20.19.2
- TypeScript: Latest
- Package Manager: pnpm
- Build Tool: Vite
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels