Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,20 @@ async function analyzeFiles(directory) {

For more examples, check the source code at [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts) which demonstrates how repomix.com uses the library.

### Bundling

When bundling repomix with tools like Rolldown or esbuild, some dependencies must remain external and WASM files need to be copied:

**External dependencies (cannot be bundled):**
- `tinypool` - Spawns worker threads using file paths
- `tiktoken` - Loads WASM files dynamically at runtime

**WASM files to copy:**
- `web-tree-sitter.wasm` → Same directory as bundled JS (required for code compression feature)
- Tree-sitter language files → Directory specified by `REPOMIX_WASM_DIR` environment variable

For a working example, see [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## 🤝 Contribution

We welcome contributions from the community! To get started, please refer to our [Contributing Guide](CONTRIBUTING.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Bündelung

Beim Bündeln von Repomix mit Tools wie Rolldown oder esbuild müssen einige Abhängigkeiten extern bleiben und WASM-Dateien müssen kopiert werden:

**Externe Abhängigkeiten (können nicht gebündelt werden):**
- `tinypool` - Startet Worker-Threads unter Verwendung von Dateipfaden
- `tiktoken` - Lädt WASM-Dateien dynamisch zur Laufzeit

**Zu kopierende WASM-Dateien:**
- `web-tree-sitter.wasm` → Gleiches Verzeichnis wie das gebündelte JS (erforderlich für die Code-Komprimierungsfunktion)
- Tree-sitter-Sprachdateien → Verzeichnis, das durch die Umgebungsvariable `REPOMIX_WASM_DIR` angegeben wird

Ein funktionierendes Beispiel finden Sie unter [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Reales Beispiel

Die Repomix-Website ([repomix.com](https://repomix.com)) verwendet Repomix als Bibliothek zur Verarbeitung von Remote-Repositories. Sie können die Implementierung in [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts) sehen.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Bundling

When bundling repomix with tools like Rolldown or esbuild, some dependencies must remain external and WASM files need to be copied:

**External dependencies (cannot be bundled):**
- `tinypool` - Spawns worker threads using file paths
- `tiktoken` - Loads WASM files dynamically at runtime

**WASM files to copy:**
- `web-tree-sitter.wasm` → Same directory as bundled JS (required for code compression feature)
- Tree-sitter language files → Directory specified by `REPOMIX_WASM_DIR` environment variable

For a working example, see [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Real-World Example

The Repomix website ([repomix.com](https://repomix.com)) uses Repomix as a library to process remote repositories. You can see the implementation in [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Empaquetado

Al empaquetar repomix con herramientas como Rolldown o esbuild, algunas dependencias deben permanecer externas y los archivos WASM deben copiarse:

**Dependencias externas (no se pueden empaquetar):**
- `tinypool` - Genera hilos de trabajo usando rutas de archivos
- `tiktoken` - Carga archivos WASM dinámicamente en tiempo de ejecución

**Archivos WASM a copiar:**
- `web-tree-sitter.wasm` → Mismo directorio que el JS empaquetado (requerido para la función de compresión de código)
- Archivos de lenguaje Tree-sitter → Directorio especificado por la variable de entorno `REPOMIX_WASM_DIR`

Para un ejemplo funcional, consulta [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Ejemplo del Mundo Real

El sitio web de Repomix ([repomix.com](https://repomix.com)) utiliza Repomix como biblioteca para procesar repositorios remotos. Puedes ver la implementación en [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Bundling

Lors du bundling de repomix avec des outils comme Rolldown ou esbuild, certaines dépendances doivent rester externes et les fichiers WASM doivent être copiés :

**Dépendances externes (ne peuvent pas être bundlées) :**
- `tinypool` - Lance des threads de travail en utilisant des chemins de fichiers
- `tiktoken` - Charge les fichiers WASM dynamiquement à l'exécution

**Fichiers WASM à copier :**
- `web-tree-sitter.wasm` → Même répertoire que le JS bundlé (requis pour la fonctionnalité de compression de code)
- Fichiers de langage Tree-sitter → Répertoire spécifié par la variable d'environnement `REPOMIX_WASM_DIR`

Pour un exemple fonctionnel, consultez [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Exemple concret

Le site web de Repomix ([repomix.com](https://repomix.com)) utilise Repomix comme bibliothèque pour traiter les dépôts distants. Vous pouvez consulter l'implémentation dans [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ async function processInBrowser() {
}
```

## बंडलिंग

Rolldown या esbuild जैसे टूल्स के साथ repomix को बंडल करते समय, कुछ डिपेंडेंसी को external रखना होगा और WASM फाइलों को कॉपी करना होगा:

**External डिपेंडेंसी (बंडल नहीं की जा सकती):**
- `tinypool` - फाइल पाथ का उपयोग करके वर्कर थ्रेड्स स्पॉन करता है
- `tiktoken` - रनटाइम पर WASM फाइलें डायनामिकली लोड करता है

**कॉपी करने के लिए WASM फाइलें:**
- `web-tree-sitter.wasm` → बंडल किए गए JS के समान डायरेक्टरी (कोड कंप्रेशन फीचर के लिए आवश्यक)
- Tree-sitter लैंग्वेज फाइलें → `REPOMIX_WASM_DIR` एनवायरनमेंट वेरिएबल द्वारा निर्दिष्ट डायरेक्टरी

एक कार्यशील उदाहरण के लिए, [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs) देखें।

## अगला क्या है?

- [विकास गाइड](index.md) पढ़ें
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,17 @@ interface PackResult {
```

Untuk informasi lebih lanjut tentang API, lihat [kode sumber Repomix](https://github.com/yamadashy/repomix).

## Bundling

Saat membundle repomix dengan tools seperti Rolldown atau esbuild, beberapa dependency harus tetap external dan file WASM perlu disalin:

**Dependency external (tidak dapat dibundle):**
- `tinypool` - Memulai worker thread menggunakan path file
- `tiktoken` - Memuat file WASM secara dinamis saat runtime

**File WASM yang perlu disalin:**
- `web-tree-sitter.wasm` → Direktori yang sama dengan JS yang dibundle (diperlukan untuk fitur kompresi kode)
- File bahasa Tree-sitter → Direktori yang ditentukan oleh variabel lingkungan `REPOMIX_WASM_DIR`

Untuk contoh yang berfungsi, lihat [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Bundling

Quando si effettua il bundling di repomix con strumenti come Rolldown o esbuild, alcune dipendenze devono rimanere esterne e i file WASM devono essere copiati:

**Dipendenze esterne (non possono essere bundled):**
- `tinypool` - Avvia thread worker utilizzando percorsi di file
- `tiktoken` - Carica file WASM dinamicamente a runtime

**File WASM da copiare:**
- `web-tree-sitter.wasm` → Stessa directory del JS bundled (richiesto per la funzionalità di compressione del codice)
- File di linguaggio Tree-sitter → Directory specificata dalla variabile d'ambiente `REPOMIX_WASM_DIR`

Per un esempio funzionante, consulta [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Esempio Reale

Il sito web di Repomix ([repomix.com](https://repomix.com)) usa Repomix come libreria per elaborare repository remoti. Puoi consultare l'implementazione in [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## バンドル

RolldownやesbuildなどのツールでRepomixをバンドルする場合、一部の依存関係はexternalにする必要があり、WASMファイルのコピーも必要です:

**external必須の依存関係(バンドル不可):**
- `tinypool` - ファイルパスを使用してワーカースレッドを起動
- `tiktoken` - 実行時にWASMファイルを動的に読み込み

**コピーが必要なWASMファイル:**
- `web-tree-sitter.wasm` → バンドルされたJSと同じディレクトリ(コード圧縮機能に必要)
- Tree-sitter言語ファイル → `REPOMIX_WASM_DIR`環境変数で指定したディレクトリ

実際の例は[website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs)を参照してください。

## 実世界の例

Repomixウェブサイト([repomix.com](https://repomix.com))では、ライブラリとしてRepomixを使用してリモートリポジトリを処理しています。実装は[website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts)で確認できます。
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## 번들링

Rolldown이나 esbuild 같은 도구로 repomix를 번들링할 때, 일부 의존성은 external로 유지해야 하며 WASM 파일을 복사해야 합니다:

**External 의존성 (번들 불가):**
- `tinypool` - 파일 경로를 사용하여 워커 스레드 생성
- `tiktoken` - 런타임에 WASM 파일을 동적으로 로드

**복사해야 할 WASM 파일:**
- `web-tree-sitter.wasm` → 번들된 JS와 동일한 디렉토리 (코드 압축 기능에 필요)
- Tree-sitter 언어 파일 → `REPOMIX_WASM_DIR` 환경 변수로 지정된 디렉토리

실제 예제는 [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs)를 참조하세요.

## 실제 사례

Repomix 웹사이트([repomix.com](https://repomix.com))는 원격 저장소를 처리하기 위해 라이브러리로 Repomix를 사용합니다. [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts)에서 구현을 확인할 수 있습니다.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Bundling

Ao fazer bundle do repomix com ferramentas como Rolldown ou esbuild, algumas dependências devem permanecer externas e arquivos WASM precisam ser copiados:

**Dependências externas (não podem ser bundled):**
- `tinypool` - Cria threads de worker usando caminhos de arquivo
- `tiktoken` - Carrega arquivos WASM dinamicamente em tempo de execução

**Arquivos WASM a copiar:**
- `web-tree-sitter.wasm` → Mesmo diretório do JS bundled (necessário para o recurso de compressão de código)
- Arquivos de linguagem Tree-sitter → Diretório especificado pela variável de ambiente `REPOMIX_WASM_DIR`

Para um exemplo funcional, consulte [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Exemplo do Mundo Real

O site do Repomix ([repomix.com](https://repomix.com)) usa o Repomix como biblioteca para processar repositórios remotos. Você pode ver a implementação em [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## Бандлинг

При бандлинге repomix с помощью инструментов вроде Rolldown или esbuild, некоторые зависимости должны оставаться внешними, и WASM-файлы необходимо скопировать:

**Внешние зависимости (не могут быть забандлены):**
- `tinypool` - Запускает рабочие потоки, используя пути к файлам
- `tiktoken` - Динамически загружает WASM-файлы во время выполнения

**WASM-файлы для копирования:**
- `web-tree-sitter.wasm` → В ту же директорию, что и забандленный JS (требуется для функции сжатия кода)
- Языковые файлы Tree-sitter → Директория, указанная переменной окружения `REPOMIX_WASM_DIR`

Рабочий пример можно посмотреть в [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Реальный пример

Сайт Repomix ([repomix.com](https://repomix.com)) использует Repomix как библиотеку для обработки удалённых репозиториев. Вы можете увидеть реализацию в [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts).
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@ async function safelyPackRepo() {
}
```

## Bundling

Khi đóng gói repomix bằng các công cụ như Rolldown hoặc esbuild, một số dependency phải giữ là external và các tệp WASM cần được sao chép:

**Dependency external (không thể đóng gói):**
- `tinypool` - Sinh worker thread sử dụng đường dẫn tệp
- `tiktoken` - Tải tệp WASM động trong runtime

**Tệp WASM cần sao chép:**
- `web-tree-sitter.wasm` → Cùng thư mục với JS đã đóng gói (cần thiết cho tính năng nén mã)
- Tệp ngôn ngữ Tree-sitter → Thư mục được chỉ định bởi biến môi trường `REPOMIX_WASM_DIR`

Để xem ví dụ thực tế, tham khảo [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs).

## Tiếp theo là gì?

- [Đóng góp cho Repomix](./index.md): Tìm hiểu cách đóng góp cho dự án
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## 打包

使用 Rolldown 或 esbuild 等工具打包 repomix 时,某些依赖项必须保持为 external,并且需要复制 WASM 文件:

**External 依赖项(无法打包):**
- `tinypool` - 使用文件路径生成 worker 线程
- `tiktoken` - 在运行时动态加载 WASM 文件

**需要复制的 WASM 文件:**
- `web-tree-sitter.wasm` → 与打包后的 JS 相同的目录(代码压缩功能需要)
- Tree-sitter 语言文件 → `REPOMIX_WASM_DIR` 环境变量指定的目录

有关实际示例,请参阅 [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs)。

## 实际示例

Repomix 网站([repomix.com](https://repomix.com))使用 Repomix 作为库来处理远程仓库。您可以在 [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts) 中查看实现。
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ async function analyzeFiles(directory) {
}
```

## 打包

使用 Rolldown 或 esbuild 等工具打包 repomix 時,某些依賴項必須保持為 external,並且需要複製 WASM 文件:

**External 依賴項(無法打包):**
- `tinypool` - 使用文件路徑生成 worker 線程
- `tiktoken` - 在運行時動態加載 WASM 文件

**需要複製的 WASM 文件:**
- `web-tree-sitter.wasm` → 與打包後的 JS 相同的目錄(代碼壓縮功能需要)
- Tree-sitter 語言文件 → `REPOMIX_WASM_DIR` 環境變數指定的目錄

有關實際示例,請參閱 [website/server/scripts/bundle.mjs](https://github.com/yamadashy/repomix/blob/main/website/server/scripts/bundle.mjs)。

## 實際示例

Repomix 網站([repomix.com](https://repomix.com))使用 Repomix 作為庫來處理遠端倉庫。您可以在 [website/server/src/remoteRepo.ts](https://github.com/yamadashy/repomix/blob/main/website/server/src/remoteRepo.ts) 中查看實現。
Loading