Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
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

@christoph2806

Description

@christoph2806

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

  1. Missing Dependencies: Package references @radix-ui packages that aren't installed in consumers
  2. React Import Issues: Using incompatible import React instead of import * as React
  3. Module Resolution Problems: Dependencies can't be resolved by TypeScript
  4. Interface Property Mismatches: Component interfaces don't match runtime behavior

Specific Issues Found

1. Component Import Failures

  • Select component exists at runtime but TypeScript reports "no exported member 'Select'"
  • Same issue affects Button, StatusBadge, DataTable, etc.

2. Interface Inconsistencies

  • Button: TypeScript doesn't recognize intent prop but it works at runtime
  • StatusBadge: TypeScript doesn't recognize variant prop but it works at runtime
  • Select: Uses onValueChange (not onChange) but TypeScript interface is incorrect
  • DataTable: Missing pageSize prop 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 variant OR intent across all components
  • Use onValueChange consistently 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

  1. Ensure TypeScript compilation during build
  2. Validate that declaration files match runtime exports
  3. Bundle or properly reference all dependencies
  4. 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

  1. IMMEDIATE: Fix missing peer dependencies and module resolution
  2. SHORT-TERM: Correct TypeScript interfaces to match runtime
  3. MEDIUM-TERM: Standardize component prop patterns
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions