v0.2.32

yamadashy/repomixv0.2.32Mar 1, 2025by yamadashy

AI Summary

Enhanced code compression feature that now includes comments, import statements, and complete type definitions for better code context preservation.

Key Highlights

  • Preserves both single-line and multi-line comments
  • Keeps import/require statements for better context
  • Full type definition support for TypeScript, Python, and Go
  • Enhanced function signature preservation

New Features

  • Enhanced code compression with comments and imports

Full Release Notes

The code compression feature introduced in [v0.2.28](https://github.com/yamadashy/repomix/releases/tag/v0.2.28) has been enhanced! šŸš€ 

# Improvements ⚔

## Enhanced Code Compression (#380)
- Now includes comments and import statements in compression output:
  - Preserves both single-line and multi-line comments
  - Keeps import/require statements for better code context
- Complete type definition support for TypeScript, Python, and Go:
  - Full inclusion of interface and type definitions
- Enhanced function signature preservation:
  - Captures complete function signatures including arguments spanning multiple lines
  - Ensures accurate preservation of all function parameters


### Example
Using compression via CLI:
```bash
repomix --compress
```

Before:
```typescript
import { ShoppingItem } from './shopping-item';

/**
 * Calculate the total price of shopping items
 */
const calculateTotal = (
  items: ShoppingItem[]
) => {
  let total = 0;
  for (const item of items) {
    total += item.price * item.quantity;
  }
  return total;
}

// Shopping item interface
interface Item {
  name: string;
  price: number;
  quantity: number;
}
```

After compression:
```typescript
import { ShoppingItem } from './shopping-item';
ā‹®----
/**
 * Calculate the total price of shopping items
 */
const calculateTotal = (
  items: ShoppingItem[]
) => {
ā‹®----
// Shopping item interface
interface Item {
  name: string;
  price: number;
  quantity: number;
}
```


# How to Update

```bash
npm update -g repomix
```

---

As always, if you encounter any issues or have suggestions, please let us know through our GitHub issues or join our [Discord community](https://discord.gg/wNYzTwZFku) for support.