aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/Cargo.toml
Commit message (Collapse)AuthorAgeFilesLines
* fix(modpack): 将 CurseForge API Key 改为编译期可选常量 (#118)Begonia, HE2026-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # fix(modpack): 将 CurseForge API Key 改为编译期可选常量 修复 `env!()` 宏在开发者本地无 `CURSEFORGE_API_KEY` 时导致编译失败的问题,改用 `option_env!()` + build.rs 中的 `dotenvy` 读取 .env 文件,实现编译期嵌入、缺失时优雅降级。 ## 更改类型 - [x] Bug 修复(修复问题的非破坏性更改) - [ ] 新功能(添加功能的非破坏性更改) - [ ] 破坏性更改(会导致现有功能无法正常工作的修复或功能) - [ ] 文档更新 - [ ] UI/UX 改进 - [ ] 性能优化 - [ ] 代码重构(无功能性更改) - [x] 配置更改 - [ ] 测试添加或更新 ## LLM 生成代码声明 - [x] 此 PR 不包含 LLM 生成的代码,我**提供**质量担保 ## 相关 Issue 相关 #110 #117 ## 更改内容 ### 后端 (Rust) - modpack.rs:将 `env!("CURSEFORGE_API_KEY")` 替换为 `const CURSEFORGE_API_KEY: Option<&str> = option_env!("CURSEFORGE_API_KEY")`,key 不存在时编译为 `None`,调用 CurseForge 功能时返回友好错误而非 panic - build.rs:添加 `dotenvy::dotenv()` 调用,允许通过 .env 文件在编译期注入 key,并注册 `cargo:rerun-if-changed` / `cargo:rerun-if-env-changed` 确保增量构建正确 ### 前端 (Svelte) - 无 ### 配置 - Cargo.toml:在 `[build-dependencies]` 中添加 `dotenvy = { version = "0.15", default-features = false }` - .gitignore:添加 .env / `.env.local` 忽略规则,防止 key 被意外提交 - .env.example:新增示例文件,说明可选配置项及获取方式 ## 测试 ### 测试环境 - **操作系统**:Fedora Linux 6.19.6-300.fc44.x86_64 x86_64 - **DropOut 版本**:0.2.0-alpha.5 - **测试的 Minecraft 版本**:N/A - **Mod 加载器**:N/A ### 测试用例 - [ ] 已在 Windows 上测试 - [ ] 已在 macOS 上测试 - [x] 已在 Linux 上测试 - [ ] 已测试原版 Minecraft - [ ] 已测试 Fabric - [ ] 已测试 Forge - [ ] 已测试游戏启动 - [ ] 已测试登录流程 - [ ] 已测试 Java 检测/下载 ### 测试步骤 1. 不设置 `CURSEFORGE_API_KEY`,不创建 .env 文件,直接执行 `cargo check` → 应编译通过(无报错) 2. 创建 .env 文件并写入 `CURSEFORGE_API_KEY=test_key`,执行 `cargo check` → 应编译通过,key 被嵌入二进制 3. 不含 key 的构建中触发 CurseForge modpack 导入 → 应返回友好错误提示而非 panic ## 检查清单 ### 代码质量 - [x] 我的代码遵循项目的代码风格指南 - [x] 我已对自己的代码进行了自审 - [ ] 我已对难以理解的区域添加了注释 - [x] 我的更改没有产生新的警告或错误 ### 测试验证 - [x] 我已在本地测试了我的更改 - [ ] 我已添加测试来证明我的修复有效或功能正常工作 - [x] 新的和现有的单元测试在本地通过 - [x] 我至少在一个目标平台上进行了测试 ### 文档更新 - [ ] 我已相应地更新了文档 - [ ] 如有需要,我已更新 README - [ ] 我已在必要处添加/更新代码注释 ### 依赖项 - [x] 我已检查没有添加不必要的依赖项 - [x] 所有新依赖项都已正确记录 - [x] Cargo.lock 已更新 ## 附加说明 `dotenvy` 仅作为 **build-dependency**,不会进入最终二进制。官方发布构建通过 CI 环境变量注入 key,普通开发者无需任何操作即可正常编译和运行。 Co-authored-by: 简律纯 <i@jyunko.cn>
* chore(release): bump versionsgithub-actions[bot]2026-03-021-1/+1
|
* chore(release): bump versionsgithub-actions[bot]2026-02-261-1/+1
|
* chore(release): bump versionsgithub-actions[bot]2026-02-251-1/+1
|
* Revert "chore(release): bump versions"苏向夜2026-02-251-1/+1
|
* chore(release): bump versionsgithub-actions[bot]2026-02-251-1/+1
|
* revert: revert release manually苏向夜2026-02-251-1/+1
|
* chore(release): bump versionsgithub-actions[bot]2026-02-241-1/+1
|
* Revert "chore(release): bump versions"苏向夜2026-02-251-1/+1
|
* chore(release): bump versionsgithub-actions[bot]2026-02-241-1/+1
|
* chore: use semifold to release aur苏向夜2026-02-251-1/+0
|
* chore(release): bump versionsgithub-actions[bot]2026-02-241-2/+2
|
* Clean up Cargo.toml by removing unused sections简律纯2026-02-231-7/+0
| | | Removed Debian package metadata and dependencies.
* Merge branch 'main' into refactor/migrate-to-react简律纯2026-02-231-0/+10
|\
* | refactor(client): rewrite macros to generate client苏向夜2026-02-181-1/+4
| |
| * Fix Windows MinGW linker error with COFF resource compilation (#96)Copilot2026-02-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Description MinGW linker fails on `resource.lib` because `tauri-build` generates MSVC-format resources. MinGW requires COFF format. This PR adds conditional resource compilation using `embed-resource` for GNU targets. ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] UI/UX improvement - [ ] Performance improvement - [ ] Code refactoring (no functional changes) - [ ] Configuration change - [ ] Test addition or update ## LLM-Generated Code Disclosure - [x] This PR contains LLM-generated code, and I **provide** quality assurance - [ ] This PR contains LLM-generated code, and I **do not provide** quality assurance - [ ] This PR does not contain LLM-generated code ## Related Issues Fixes the Windows x86_64-pc-windows-gnu build failure in CI (Job ID: 63620685213) ## Changes Made ### Backend (Rust) - N/A ### Frontend (Svelte) - N/A ### Configuration - **src-tauri/Cargo.toml**: Added `embed-resource = "2.4"` as target-specific build dependency for `cfg(all(windows, target_env = "gnu"))` - **src-tauri/build.rs**: Added conditional resource compilation - calls `embed_resource::compile()` for MinGW, preserves `tauri_build::build()` for all targets - **src-tauri/icon.rc**: Created Windows resource file referencing `icons/icon.ico` **Key implementation**: ```rust fn main() { #[cfg(all(windows, target_env = "gnu"))] { embed_resource::compile("icon.rc", embed_resource::NONE); } tauri_build::build() } ``` **Impact**: MSVC builds unchanged, Linux/macOS unaffected (dependency not loaded), MinGW builds now generate COFF-compatible resources. ## Testing ### Test Environment - **OS**: Ubuntu 22.04 (Linux validation) - **DropOut Version**: 0.2.0-alpha.1 - **Minecraft Version Tested**: N/A (build-only fix) - **Mod Loader**: N/A ### Test Cases - [ ] Tested on Windows - [ ] Tested on macOS - [x] Tested on Linux - [ ] Tested with vanilla Minecraft - [ ] Tested with Fabric - [ ] Tested with Forge - [ ] Tested game launch - [ ] Tested authentication flow - [ ] Tested Java detection/download ### Steps to Test 1. Run `cargo check` on Linux (verified - passes) 2. CI validation pending: `semifold-ci.yaml` "Windows x86_64 (GNU)" job should complete without linker errors 3. Manual Windows MinGW build verification recommended ## Checklist ### Code Quality - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings or errors ### Testing Verification - [x] I have tested my changes locally - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] I have tested on at least one target platform ### Documentation - [x] I have updated the documentation accordingly - [ ] I have updated the README if needed - [x] I have added/updated code comments where necessary ### Dependencies - [x] I have checked that no unnecessary dependencies were added - [x] All new dependencies are properly documented - [x] `Cargo.lock` and/or `pnpm-lock.yaml` are updated (if dependencies changed) ## Screenshots / Videos N/A - build configuration change only ## Additional Notes - Target-specific dependency prevents unnecessary bloat on non-Windows platforms - `embed-resource` generates COFF format compatible with `x86_64-w64-mingw32-gcc` - No runtime code changes - purely build-time fix ## Breaking Changes None. Fully backward compatible. --- **For Maintainers:** - [ ] Code review completed - [ ] CI checks passing - [ ] Ready to merge <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > ## Problem > > The Windows x86_64-pc-windows-gnu build is failing in the CI/CD pipeline with a linker error: > > ``` > error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 > note: D:\a\DropOut\DropOut\target\x86_64-pc-windows-gnu\release\build\dropout-d2b2a5095bbadd51\out\resource.lib: file not recognized: file format not recognized > ``` > > This occurs because `tauri-build` generates `resource.lib` in a format incompatible with the MinGW (GNU) toolchain. The file is likely being created in MSVC format instead of the COFF format required by MinGW. > > **Failing Job:** https://github.com/HydroRoll-Team/DropOut/actions (Job ID: 63620685213) > **Commit:** e6eb1bd0111d40b3b1fd39fafd583ce5dbf30f03 > **Target:** x86_64-pc-windows-gnu > > ## Solution > > Update the `build.rs` file to conditionally use `embed-resource` crate when building for the GNU toolchain, which properly generates MinGW-compatible resource files. > > ### Changes Required > > 1. **Update `src-tauri/Cargo.toml`**: Add `embed-resource` as a build dependency for Windows GNU targets > 2. **Update `src-tauri/build.rs`**: Implement conditional resource compilation: > - Use `embed-resource` for `x86_64-pc-windows-gnu` target > - Continue using default `tauri-build` for MSVC targets > > ### Implementation Details > > **src-tauri/Cargo.toml** - Add to `[build-dependencies]`: > ```toml > [build-dependencies] > tauri-build = { version = "2.0", features = [] } > embed-resource = "2.4" > ``` > > **src-tauri/build.rs** - Replace current content: > ```rust > fn main() { > // For MinGW targets, use embed-resource to generate proper COFF format > #[cfg(all(windows, target_env = "gnu"))] > { > embed_resource::compile("icon.rc", embed_resource::NONE); > } > > tauri_build::build() > } > ``` > > If `icon.rc` doesn't exist, create **src-tauri/icon.rc**: > ```rc > 1 ICON "icons/icon.ico" > ``` > > ### Testing > > After this fix: > - Windows MSVC builds should continue working as before > - Windows GNU (MinGW) builds should successfully link without the "file format not recognized" error > - The generated resource.lib will be in COFF format compatible with `x86_64-w64-mingw32-gcc` > > ### References > > - Tauri issue tracker (similar issues): https://github.com/tauri-apps/tauri/issues > - embed-resource crate: https://crates.io/crates/embed-resource > - MinGW resource compilation: https://sourceforge.net/p/mingw-w64/wiki2/windres/ > </details> <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created from Copilot chat.* > <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/HydroRoll-Team/DropOut/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: HsiangNianian <44714368+HsiangNianian@users.noreply.github.com>
* | merge: dev苏向夜2026-02-151-27/+33
| |
* | feat(ts-bindings): fix ts bindings naming convention苏向夜2026-01-231-0/+1
| |
* | fix(deps): Update ts-rs dependency to include serde-compat featureHsiangNianian2026-01-211-1/+1
| |
* | chore(deps): Add ts-rs dependency version 11.1.0HsiangNianian2026-01-201-0/+1
|/
* Merge branch 'main' into chore/migrate-repository苏向夜2026-01-191-7/+3
|\
| * chore(release): bump versionsgithub-actions[bot]2026-01-191-1/+1
| |
* | chore: migrate repository from HsiangNianian to HydroRoll-TeamBegonia, HE2026-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Updated repository URL in Cargo.toml - Updated GitHub API endpoint in main.rs - Updated commit links in HomeView.svelte - Updated issue template links in config.yml Reviewed-by: Claude Sonnet 4.5
| * chore(tauri): mark tauri crate as private苏向夜2026-01-191-0/+1
| |
| * ci(semifold): prepare for alpha release苏向夜2026-01-181-7/+1
| |
| * chore: add regex dependency version 1.12.2 to Cargo.tomlHsiangNianian2026-01-181-0/+1
|/
* chore: bump version to 0.1.26 in Cargo.toml and tauri.conf.jsonv0.1.26HsiangNianian2026-01-161-1/+1
| | | | Updated the version number in both Cargo.toml and tauri.conf.json to reflect the new release version 0.1.26. This change ensures consistency across project configuration files.
* feat: implement instance management features and enhance game launch processHsiangNianian2026-01-161-0/+1
| | | | Added functionality for managing game instances, including creating, deleting, updating, and duplicating instances. Integrated instance selection into the game launch process, allowing users to specify the instance when starting a game. Updated the main application logic to handle instance states and paths, ensuring proper directory management for each instance. Introduced a new module for instance management and updated relevant commands to support instance-specific operations.
* feat: enhance Java version management for Minecraft versionsHsiangNianian2026-01-161-0/+1
| | | | Added functionality to determine and validate the required Java version for Minecraft versions, including checks for compatibility with older versions. Implemented event emissions for version installation and deletion, and updated the UI to reflect Java version requirements and installation status. Improved version metadata handling and added support for deleting versions.
* chore: bump version in tauri configuration to 0.1.25v0.1.25HsiangNianian2026-01-161-1/+1
|
* chore: apply prek auto-fixes [skip ci]HsiangNianian2026-01-161-1/+0
|
* chore: update plugin-dialog dependency versions in Cargo.toml and package.jsonHsiangNianian2026-01-161-1/+1
| | | | Bumped the version of tauri-plugin-dialog in Cargo.toml and @tauri-apps/plugin-dialog in package.json from 2.5.0 to 2.6.0 to incorporate the latest features and improvements.
* chore: update version to 0.1.24 in Cargo.toml and tauri.conf.jsonv0.1.24HsiangNianian2026-01-161-1/+1
| | | | Bumped the version number in both Cargo.toml and tauri.conf.json to reflect the new release version 0.1.24.
* chore: Bump version to 0.1.23 in Cargo.toml and tauri.conf.json for releasev0.1.23HsiangNianian2026-01-151-1/+1
|
* chore: Bump version to 0.1.22 in Cargo.toml and tauri.conf.json for releasev0.1.22HsiangNianian2026-01-151-1/+1
|
* chore: Update reqwest dependency to version 0.11 with additional multipart ↵HsiangNianian2026-01-151-1/+2
| | | | feature and add tauri-plugin-fs version 2.4.5 in Cargo.toml
* chore: Bump version to 0.1.21 in Cargo.toml and tauri.conf.jsonv0.1.21HsiangNianian2026-01-151-1/+1
|
* chore: Update version number to 0.1.20 in Cargo.toml and tauri.conf.jsonv0.1.20HsiangNianian2026-01-151-1/+1
|
* feat(java): Implement Java catalog management and download featuresBegonia, HE2026-01-151-1/+1
| | | | | | | | - Added commands to fetch and refresh the Java catalog, cancel downloads, and manage pending downloads. - Enhanced the Java download modal in the UI to support version selection, download progress, and pending downloads. - Introduced new types for Java catalog, download progress, and pending downloads. - Updated settings store to handle Java catalog state, download progress, and pending downloads. - Improved user experience with loading states, error handling, and status notifications for Java installations.
* Merge main into feat/download-java-rtBegonia, HE2026-01-141-1/+2
|\ | | | | | | | | | | | | - Integrate latest main branch changes (Fabric, Forge support, new UI) - Keep Adoptium Java download feature with SHA256 support - Merge improved download progress tracking with checksum verification - Update dependencies and build configuration
| * chore: update version to 0.1.19 in Cargo.toml and tauri.conf.jsonv0.1.19HsiangNianian2026-01-141-1/+1
| |
| * chore: update version to 0.1.18 in Cargo.tomlv0.l.18HsiangNianian2026-01-141-1/+1
| |
| * chore: update version to 0.1.17 in Cargo.tomlv0.1.17HsiangNianian2026-01-141-1/+1
| |
| * chore: bump version to 0.1.16 in Cargo.toml and tauri.conf.jsonv0.1.16HsiangNianian2026-01-141-1/+1
| |
| * feat: Enhance UI components and add visual effectsHsiangNianian2026-01-141-0/+1
| | | | | | | | | | | | | | | | | | - Updated Sidebar component styles for improved aesthetics and usability. - Refactored VersionsView component with a new layout and enhanced version filtering. - Improved DownloadMonitor and GameConsole components for better performance and visual consistency. - Added new settings for GPU acceleration and visual effects in settings store. - Introduced ParticleBackground component with customizable effects (Constellation and Saturn). - Implemented ConstellationEffect and SaturnEffect classes for dynamic background animations.
| * chore: update version to 0.1.15 in Cargo.toml and tauri.conf.jsonv0.1.15HsiangNianian2026-01-141-1/+1
| |
| * chore: bump version to 0.1.15-a1 in Cargo.tomlHsiangNianian2026-01-141-1/+1
| |
| * chore: bump version to 0.1.14 in Cargo.tomlHsiangNianian2026-01-141-1/+1
| |
* | Merge branch 'main' into feat/download-java-rtBegonia, HE2026-01-141-1/+1
|\|
| * chore: update version to 0.1.13 in Cargo.toml and tauri.conf.jsonHsiangNianian2026-01-141-1/+1
| |