Skip to content

Conversation

Patrick-Ehimen
Copy link

Overview

This PR restructures the Storacha UI packages into a modular architecture that provides better developer experience, tree-shaking support, and framework-agnostic utilities. The implementation introduces a meta-package system with subpath exports for granular imports.

Key Features

✅ Subpath Exports: @storacha/ui/react/components/Authenticator
✅ Tree-Shakeable: Component-level imports for optimal bundle sizes
✅ TypeScript Project References: Improved build performance
✅ Tailwind Integration: Complete theming system with CSS custom properties
✅ Framework Agnostic: Core utilities work in any JavaScript framework

Usage Examples

  1. Meta-Package (Recommended)
import { Authenticator, Uploader } from '@storacha/ui'
  1. Tree-Shakeable Imports
import { Authenticator } from '@storacha/ui/react/components/Authenticator'
import { Uploader } from '@storacha/ui/react/components/Uploader'
  1. Tailwind Integration
// tailwind.config.js
module.exports = {
  plugins: [require('@storacha/ui-tailwind')]
}
  1. Theme System
import { applyTheme, useAutoTheme } from '@storacha/ui/theme'

// Auto theme based on system preference
useAutoTheme()

// Manual theme switching
applyTheme('dark')

Testing & Validation

  • Package Structure Tests: ✅ All packages properly configured
  • Import Resolution: ✅ All export paths working correctly
  • Component Exports: ✅ Tree-shakeable imports functional
  • Theme System: ✅ Dark/light mode switching working
  • Tailwind Plugin: ✅ CSS variables and design tokens loading
  • Build System: ✅ TypeScript project references configured

Breaking Changes

Components moved from root to src/components/ directory
Test imports updated to reflect new component locations
Enhanced TypeScript configuration for composite builds
Note: Existing imports continue to work through backward compatibility in the meta-package.

Acceptance Criteria

  • npm install @storacha/ui works with subpath exports
  • Component-level imports supported for tree-shaking
  • Package setup with build scripts and validation
  • Tailwind plugin with CSS variables and design tokens
  • Type-safe public APIs with enhanced TypeScript support
  • Framework-agnostic core utilities separated from React bindings
  • Modular component organization with proper exports

This PR closes UI Packaging and Theming

@Patrick-Ehimen Patrick-Ehimen requested a review from travis as a code owner October 2, 2025 16:31
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.

UI Packaging and Theming

1 participant