Skip to content

Conversation

@rushi
Copy link
Member

@rushi rushi commented Dec 7, 2025

Converts the icons package (src/icons) to TypeScript and separates it from the main UI Kit package.

Changes

  • Migrated all icon components from .jsx to .tsx with proper TypeScript types
  • Removed icon exports from @xola/ui-kit package - icons now only available via @xola/icons
  • Updated UI Kit components to import icons directly from the icons folder
  • Added verification script to ensure all icons are properly exported

Package Sizes

  • Icons package: 1.7MB → 1.4MB (node_modules size)
  • UI Kit package: 576 KiB → 358 KiB (build size, excluding icons)

Published

This @xola/icons package is already published on NPM as v1.2.4 and raised as a PR in the Seller app: https://github.com/xola/x2-seller/pull/6360

Copilot AI review requested due to automatic review settings December 7, 2025 08:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the icons package (src/icons folder only) to TypeScript. The package has been published as v1.2.1 and is already in use in the Seller app. The conversion adds proper type safety for React SVG components while maintaining backward compatibility.

Key Changes:

  • Converted helper files from JavaScript to TypeScript with proper type definitions
  • Added TypeScript types to all icon components (props: React.SVGProps)
  • Added build configuration (tsconfig.json, vite.config.js) for TypeScript compilation
  • Maintained existing functionality while adding type safety

Reviewed changes

Copilot reviewed 21 out of 243 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/icons/tsconfig.json TypeScript configuration for the icons package with React support
src/icons/vite.config.js Build configuration using Vite with TypeScript plugin for declaration generation
src/icons/postcss.config.js PostCSS configuration for Tailwind CSS processing
src/icons/src/helpers/icon.tsx Converted to TypeScript with proper type definitions for IconProps and IconComponent
src/icons/src/helpers/iconSizes.ts Converted to TypeScript with const assertion for type safety
src/icons/src/helpers/classnames.js New utility function for merging Tailwind classes
src/icons/src/images/*.tsx All image components updated with React.SVGProps types
src/icons/src/*.tsx All icon components updated with proper TypeScript types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rushi added 12 commits December 7, 2025 14:41
- Change React peerDependency from ^18.3.1 to >=17
- Allows icons package to work with React 17, 18, 19, and future versions
- Provides better compatibility for projects on different React versions
- Downgraded Vite to v4.5.3 for Node 16 support
- Downgraded vite-plugin-dts, @xola/jslint, and eslint to compatible versions
- Added postcss-load-config override to ensure Node 16 compatibility
- Converted postcss.config.js from ES module to CommonJS format
- Package now exports both CJS and ESM formats for maximum compatibility
Update all icon imports from `from "../../icons"` to `from "../../icons/index.js"`
to prevent Vite from treating src/icons as a package during build.
- Added ignorePatterns to .xo-config.json for src/icons and src/stories
- Simplified lint scripts in package.json by removing redundant --ignore flags
- Configuration now centralized in .xo-config.json file
- Fixed import order in ComboBox.jsx
- Changed clsx import to named export in LocalizedDayPicker.tsx
- Auto-fixed formatting issues (spacing, line breaks)
- Auto-fixed switch case braces in GooglePlacesAutocomplete.jsx
- Auto-fixed prefer-at and prefer-string-replace-all issues
- Auto-fixed import type issues in TypeScript files
@rushi rushi force-pushed the convert-icons-to-typescript branch from 45e9344 to 951609b Compare December 7, 2025 10:40
@rushi rushi requested a review from manojx031 January 2, 2026 06:33
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.

1 participant