{"id":26095253,"url":"https://github.com/lisniuse/codebundle","last_synced_at":"2025-07-11T05:41:43.961Z","repository":{"id":280144799,"uuid":"941037175","full_name":"lisniuse/CodeBundle","owner":"lisniuse","description":"CodeBundle","archived":false,"fork":false,"pushed_at":"2025-03-01T16:11:48.000Z","size":1206,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T13:15:13.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lisniuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-01T10:31:13.000Z","updated_at":"2025-03-01T16:11:52.000Z","dependencies_parsed_at":"2025-03-01T15:27:25.045Z","dependency_job_id":"f0253347-7812-4279-9aeb-99644b6e2097","html_url":"https://github.com/lisniuse/CodeBundle","commit_stats":null,"previous_names":["lisniuse/codebundle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisniuse%2FCodeBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisniuse%2FCodeBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisniuse%2FCodeBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisniuse%2FCodeBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lisniuse","download_url":"https://codeload.github.com/lisniuse/CodeBundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisniuse%2FCodeBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259262639,"owners_count":22830560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-09T13:15:17.963Z","updated_at":"2025-06-11T12:10:32.754Z","avatar_url":"https://github.com/lisniuse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeBundle\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\r\n\r\n[English Version](#CodeBundle) | [中文版本](/README-zh.md)\r\n\r\n\u003ca name=\"CodeBundle\"\u003e\u003c/a\u003e\r\n\r\n## CodeBundle (English Version)\r\n\r\n**CodeBundle** is a desktop application, built with Electron, React, and Vite, designed to effortlessly export source code from a project directory into a single, consolidated text file. It's perfect for sharing code snippets, creating backups, or preparing code for reviews. The application prioritizes simplicity, speed, and customizability.\r\n\r\n### Features\r\n\r\n*   **Directory Selection:** Easily select any project directory for code export.\r\n*   **File Type Filtering:** Specify which file extensions (e.g., `.js`, `.py`, `.java`) to include in the exported bundle.\r\n*   **Ignore List:** Define files and directories to exclude, with support for wildcards (e.g., `*.log`, `temp/`).\r\n*   **.gitignore Integration:**  Leverage your project's `.gitignore` file to automatically exclude files and directories.\r\n*   **Customizable Output:** Choose the destination and filename for the generated code bundle.\r\n*   **Persistent Configuration:** Saves export settings (selected extensions, ignore list, `.gitignore` usage, output path) in a `.CodeBundle` file within the project directory for convenient reuse.\r\n*   **Multi-language Support:** Offers both English and Simplified Chinese user interfaces.  The application automatically detects the system language, with an option for manual switching.\r\n*   **Robust Error Handling:** Presents clear, user-friendly error messages for common issues (e.g., invalid directory, export failure).\r\n*   **Optimized Builds:** Supports both development (with hot-reloading) and production builds (optimized for distribution).\r\n\r\n### Prerequisites\r\n\r\n*   Node.js (LTS version recommended)\r\n*   npm (or yarn)\r\n\r\n### Installation\r\n\r\n1.  **Clone the repository:**\r\n\r\n    ```bash\r\n    git clone https://github.com/lisniuse/CodeBundle.git\r\n    cd CodeBundle\r\n    ```\r\n\r\n2.  **Install dependencies:**\r\n\r\n    ```bash\r\n    npm install\r\n    ```\r\n\r\n### Usage\r\n\r\n#### Development\r\n\r\nRun the application in development mode (with hot-reloading for rapid development):\r\n\r\n```bash\r\nnpm run dev\r\n```\r\n\r\nThis command starts the Vite development server and launches the Electron application.  You'll see Vite's output in the console, and the Electron window will display the application.\r\n\r\n#### Production\r\n\r\n1.  **Build for Production:**\r\n\r\n    ```bash\r\n    npm run build\r\n    ```\r\n    This generates an optimized production build in the `build` directory.\r\n\r\n2. **Create Distributable Packages**\r\n   To create platform-specific distributable packages (Windows, macOS, Linux):\r\n   * Windows: `npm run build:win`\r\n   * macOS: `npm run build:mac`\r\n   * Linux: `npm run build:linux`\r\n   * All platforms: `npm run build:all`\r\n\r\n   The resulting packages will be placed in the `dist` directory.\r\n\r\n#### Running the Packaged Application\r\n\r\nAfter building, you can directly run the packaged application.  For example, on Windows, execute the `.exe` file found in the `dist` directory.\r\n\r\n### In-App Usage\r\n\r\n1.  **Select Project Directory:** Click \"Browse\" and choose the root directory of the project you intend to export.\r\n2.  **Select File Types:** Check the boxes corresponding to the file extensions you wish to include.\r\n3.  **Configure Ignore List:** Add filenames or directory names to exclude them (e.g., `node_modules`, `*.tmp`). Wildcards are supported.\r\n4.  **Use .gitignore:** Toggle the \"Use .gitignore rules\" switch to automatically exclude files and directories based on your project's `.gitignore` file.\r\n5.  **Set Export Location:** Click \"Browse\" in the \"Export Settings\" section to specify the output file's path.\r\n6.  **Confirm Export:** Click the \"Confirm Export\" button to generate the code bundle.\r\n\r\n### Project Structure\r\n\r\n```\r\nCodeBundle/\r\n├── public/           # Static assets\r\n│   └── index.html    # Main HTML\r\n├── src/\r\n│   ├── main/         # Electron main process\r\n│   │   ├── main.js   # Main process entry point\r\n│   │   └── preload.js # Preload script\r\n│   ├── renderer/     # React application (renderer process)\r\n│   │   ├── components/   # React components\r\n│   │   ├── locales/    # i18n translations\r\n│   │   ├── utils/      # Utility functions\r\n│   │   ├── index.jsx   # Renderer entry point\r\n│   │   ├── i18n.js      # i18n setup\r\n│   │   └── styles/    # Stylesheets\r\n│   └── index.html    # HTML template for renderer\r\n├── .gitignore        # Git ignore rules\r\n├── package.json      # Project metadata and scripts\r\n├── vite.config.js    # Vite configuration\r\n└── README.md         # This file\r\n```\r\n\r\n### Contributing\r\n\r\nContributions are highly encouraged!  Please adhere to the following steps:\r\n\r\n1.  Fork the repository.\r\n2.  Create a new branch: `git checkout -b feature/your-feature-name`\r\n3.  Implement your changes and commit them: `git commit -m \"Descriptive commit message\"`\r\n4.  Push your branch: `git push origin feature/your-feature-name`\r\n5.  Create a pull request targeting the `main` branch of this repository.\r\n\r\nEnsure your code aligns with the existing coding style and includes comprehensive tests.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](https://opensource.org/licenses/MIT) file for details.\r\n\r\n### Contact\r\n\r\nFor questions or suggestions, please open an issue on GitHub.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisniuse%2Fcodebundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flisniuse%2Fcodebundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisniuse%2Fcodebundle/lists"}