Skip to content

chore: migrating codebase to typescript#3

Merged
dcharles525 merged 4 commits intomainfrom
chore/TRAIL-33_migrate_to_typescript
Jan 15, 2026
Merged

chore: migrating codebase to typescript#3
dcharles525 merged 4 commits intomainfrom
chore/TRAIL-33_migrate_to_typescript

Conversation

@Hannahbird
Copy link
Collaborator

@Hannahbird Hannahbird commented Jan 12, 2026

Summary

Migrated the entire component library from JavaScript to TypeScript, improving type safety and developer experience for consumers.

Changes

TypeScript Migration

  • Converted all 6 components to TypeScript (.js → .ts)
  • Added comprehensive type definitions and interfaces for all components
  • Configured tsconfig.json with Lit-optimized settings
  • Added type checking scripts (typecheck, typecheck:watch)

Build & Distribution Updates

  • Updated build process to compile TypeScript (npm run build)
  • Changed distribution to emit compiled .js files with .d.ts type declarations
  • Updated package.json exports to point to dist/ directory
  • Added prepublishOnly script to ensure build runs before publishing

Type Definitions Added

  • DataTableColumn, RowData interfaces for data-table component
  • ToggleChangedDetail interface for toggle-switch component
  • ActionMenuItem, ResourceData interfaces for action-menu component
  • ButtonProps, HeaderProps interfaces for Storybook components

Developer Experience

  • Consumers now get full IntelliSense and type checking when using the library
  • Backward compatibility maintained - no breaking changes to component APIs
  • Better IDE support with autocomplete and inline documentation

Testing

  • ✅ TypeScript compilation passes with 0 errors
  • ✅ All components build successfully
  • ✅ Storybook stories updated and working

Version

Bumped to v1.4.1 (minor version for feature addition)

@Hannahbird
Copy link
Collaborator Author

You can test the implementation on Epinio in this PR epinio/ui#485

Copy link
Member

@dcharles525 dcharles525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dcharles525 dcharles525 merged commit 84c1d54 into main Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants