Skip to content

Less statics#18

Open
tomerqodo wants to merge 2 commits intocoderabbit_combined_20260121_augment_sentry_coderabbit_1_base_less_statics_pr142from
coderabbit_combined_20260121_augment_sentry_coderabbit_1_head_less_statics_pr142
Open

Less statics#18
tomerqodo wants to merge 2 commits intocoderabbit_combined_20260121_augment_sentry_coderabbit_1_base_less_statics_pr142from
coderabbit_combined_20260121_augment_sentry_coderabbit_1_head_less_statics_pr142

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 22, 2026

Benchmark PR from qodo-benchmark#142

Summary by CodeRabbit

  • Refactor
    • Reduced internal use of static directory and configuration handling. Directory paths and configuration are now passed explicitly through function signatures instead of relying on global state management, improving code maintainability and testability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 22, 2026

Walkthrough

The PR refactors Tauri CLI's internal directory and configuration handling by replacing global static path resolution functions with an explicit Dirs struct returned from resolve_dirs(). Additionally, configuration access is simplified by removing the ConfigHandle wrapper and passing ConfigMetadata directly. Helper function names are updated (getget_config, reloadreload_config, merge_withmerge_config_with), and the new dirs and configuration parameters are threaded through numerous function signatures across the codebase.

Changes

Cohort / File(s) Summary
Core helpers refactoring
crates/tauri-cli/src/helpers/app_paths.rs, crates/tauri-cli/src/helpers/config.rs, crates/tauri-cli/src/helpers/mod.rs
Introduced public Dirs struct containing tauri and frontend paths; replaced resolve() with resolve_dirs() returning Dirs; removed public tauri_dir() and frontend_dir() accessors; removed ConfigHandle type and renamed config functions with _config suffix; updated run_hook to accept frontend_dir parameter
Top-level commands
crates/tauri-cli/src/add.rs, crates/tauri-cli/src/build.rs, crates/tauri-cli/src/bundle.rs, crates/tauri-cli/src/dev.rs, crates/tauri-cli/src/icon.rs, crates/tauri-cli/src/inspect.rs, crates/tauri-cli/src/remove.rs
Updated to resolve directories via resolve_dirs() and thread dirs through command and internal function calls; replaced direct tauri_dir() calls with dirs.tauri; adapted config access patterns to use ConfigMetadata directly
Info command
crates/tauri-cli/src/info/mod.rs, crates/tauri-cli/src/info/app.rs, crates/tauri-cli/src/info/plugins.rs
Updated app::items() signature to accept config: &ConfigMetadata instead of tauri_dir parameter; adjusted config loading to occur only when tauri_dir is available
Interface and AppSettings
crates/tauri-cli/src/interface/mod.rs, crates/tauri-cli/src/interface/rust.rs, crates/tauri-cli/src/interface/rust/desktop.rs, crates/tauri-cli/src/interface/rust/manifest.rs
Added tauri_dir: &Path parameter to trait methods (new, build, get_bundle_settings, app_binary_path, get_binaries, out_dir); extended signatures with dirs: &Dirs where applicable; updated internal manifest and config resolution to use passed parameters
ACL commands
crates/tauri-cli/src/acl/capability/new.rs, crates/tauri-cli/src/acl/permission/ls.rs
Replaced direct tauri_dir() and resolve() usage with resolve_dirs() and dirs.tauri for path construction
Mobile Android
crates/tauri-cli/src/mobile/android/mod.rs, crates/tauri-cli/src/mobile/android/build.rs, crates/tauri-cli/src/mobile/android/dev.rs, crates/tauri-cli/src/mobile/android/run.rs, crates/tauri-cli/src/mobile/android/android_studio_script.rs
Added dirs: &Dirs parameter to command flows; wrapped tauri_config in Mutex<ConfigMetadata>; updated config access from lock-based patterns to direct references; renamed config import aliases to use *_config naming
Mobile iOS
crates/tauri-cli/src/mobile/ios/mod.rs, crates/tauri-cli/src/mobile/ios/build.rs, crates/tauri-cli/src/mobile/ios/dev.rs, crates/tauri-cli/src/mobile/ios/run.rs, crates/tauri-cli/src/mobile/ios/xcode_script.rs
Added dirs: &Dirs parameter to command and build flows; replaced ConfigHandle with ConfigMetadata; updated signatures for get_config, synchronize_project_config, and related functions to accept tauri_dir: &Path
Mobile shared
crates/tauri-cli/src/mobile/init.rs, crates/tauri-cli/src/mobile/mod.rs
Added dirs: &Dirs parameter to initialization and helper functions; updated get_app and ensure_init to accept tauri_dir; changed use_network_address_for_dev_url to accept mutable ConfigMetadata and tauri_dir
Migration utilities
crates/tauri-cli/src/migrate/mod.rs, crates/tauri-cli/src/migrate/migrations/v1/mod.rs, crates/tauri-cli/src/migrate/migrations/v2_beta.rs
Updated migration entry points to accept dirs: &Dirs parameter; replaced direct path function calls with dirs.tauri and dirs.frontend; updated manifest and cargo operations to use passed directory context
Manifest helpers
crates/tauri-cli/src/helpers/cargo_manifest.rs
Updated get_workspace_dir call to accept tauri_dir as argument
Changelog
.changes/reduce-internal-statics.md
Added changelog entry documenting internal refactoring with no user-facing changes

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🐰 Hopping through the code paths clear,
The rabbit fixed what once was drear—
No globals lost in static night,
Just params passed, the way feels right!
Config flows like carrot juice,
Each directory finds its proper use! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.10% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "Less statics" is vague and does not clearly convey the main purpose of the changes, which is a significant refactor to reduce internal use of static directory resolution helpers by introducing an explicit Dirs struct parameter. Consider a more descriptive title such as "Refactor: Replace static directory helpers with explicit Dirs parameter" to better communicate the scope and intent of this substantial refactor.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tomerqodo
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @.changes/reduce-internal-statics.md:
- Line 6: Update the phrase "user facing changes" in the
.changes/reduce-internal-statics.md diff to the hyphenated form "user-facing
changes"; locate the string "user facing changes" and replace it with
"user-facing changes" to correct the compound adjective grammar.

In `@crates/tauri-cli/src/add.rs`:
- Line 119: The install is being run in the wrong directory: PackageManager is
detected using frontend_dir but manager.install(&[npm_spec], dirs.tauri) uses
dirs.tauri as the working directory; change the second argument to the frontend
directory (frontend_dir) so PackageManager::install() runs npm in the frontend
project (refer to manager.install, PackageManager::install, frontend_dir and
dirs.tauri when updating the call).

In `@crates/tauri-cli/src/remove.rs`:
- Around line 47-50: The npm uninstall is being run from the wrong directory:
change the call to PackageManager::remove so it uses the frontend directory
(frontend_dir) as the working dir instead of dirs.tauri; specifically update the
manager.remove(&[npm_name], dirs.tauri)? invocation to pass the resolved
frontend_dir (or dirs.frontend) so PackageManager::remove runs the npm command
in the directory containing package.json.
🧹 Nitpick comments (4)
crates/tauri-cli/src/remove.rs (1)

21-29: Consider using dirs.frontend instead of calling resolve_frontend_dir() separately.

resolve_dirs() at line 21 already resolves and caches the frontend directory. You could use Some(dirs.frontend.clone()) or adjust the logic to avoid the redundant resolution, though resolve_frontend_dir() returns Option<PathBuf> which is needed for the conditional at line 47.

crates/tauri-cli/src/mobile/mod.rs (1)

434-488: Avoid a duplicate PathBuf clone here.
You already materialize tauri_dir once; reuse it to prevent an extra allocation.

♻️ Suggested tweak
-  let tauri_dir = tauri_dir.to_path_buf();
-  App::from_raw(tauri_dir.to_path_buf(), raw)
+  let tauri_dir = tauri_dir.to_path_buf();
+  App::from_raw(tauri_dir.clone(), raw)
crates/tauri-cli/src/helpers/config.rs (1)

257-279: Consider updating the extensions map when merging configs.

The merge_config_with function updates config.inner and sets TAURI_CONFIG env var, but does not update config.extensions to reflect the merged config. This could lead to find_bundle_identifier_overwriter() returning incorrect results if called after merge_config_with.

If this is intentional (e.g., merge_config_with is only used in contexts where extensions tracking isn't needed), consider adding a brief comment to clarify. Otherwise, consider updating the extensions map:

💡 Suggested addition
   merge(&mut value, &merge_config);
   config.inner = serde_json::from_value(value).context("failed to parse config")?;
+  config.extensions.insert(MERGE_CONFIG_EXTENSION_NAME.into(), merge_config);
   Ok(())
crates/tauri-cli/src/mobile/android/build.rs (1)

120-132: Consider whether the Mutex wrapper is necessary here.

The command function wraps tauri_config in a Mutex, but run() immediately locks it on line 154 and holds the lock for the entire function duration. If the config doesn't need concurrent access within this build flow, passing ConfigMetadata directly (as done in other files like android_studio_script.rs) would be simpler.

The Mutex pattern may be intentional for consistency with other entry points that share the config across threads, but it adds unnecessary synchronization overhead in this synchronous build path.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efb4137 and 5b06550.

📒 Files selected for processing (36)
  • .changes/reduce-internal-statics.md
  • crates/tauri-cli/src/acl/capability/new.rs
  • crates/tauri-cli/src/acl/permission/ls.rs
  • crates/tauri-cli/src/add.rs
  • crates/tauri-cli/src/build.rs
  • crates/tauri-cli/src/bundle.rs
  • crates/tauri-cli/src/dev.rs
  • crates/tauri-cli/src/helpers/app_paths.rs
  • crates/tauri-cli/src/helpers/cargo_manifest.rs
  • crates/tauri-cli/src/helpers/config.rs
  • crates/tauri-cli/src/helpers/mod.rs
  • crates/tauri-cli/src/icon.rs
  • crates/tauri-cli/src/info/app.rs
  • crates/tauri-cli/src/info/mod.rs
  • crates/tauri-cli/src/info/plugins.rs
  • crates/tauri-cli/src/inspect.rs
  • crates/tauri-cli/src/interface/mod.rs
  • crates/tauri-cli/src/interface/rust.rs
  • crates/tauri-cli/src/interface/rust/desktop.rs
  • crates/tauri-cli/src/interface/rust/manifest.rs
  • crates/tauri-cli/src/migrate/migrations/v1/mod.rs
  • crates/tauri-cli/src/migrate/migrations/v2_beta.rs
  • crates/tauri-cli/src/migrate/mod.rs
  • crates/tauri-cli/src/mobile/android/android_studio_script.rs
  • crates/tauri-cli/src/mobile/android/build.rs
  • crates/tauri-cli/src/mobile/android/dev.rs
  • crates/tauri-cli/src/mobile/android/mod.rs
  • crates/tauri-cli/src/mobile/android/run.rs
  • crates/tauri-cli/src/mobile/init.rs
  • crates/tauri-cli/src/mobile/ios/build.rs
  • crates/tauri-cli/src/mobile/ios/dev.rs
  • crates/tauri-cli/src/mobile/ios/mod.rs
  • crates/tauri-cli/src/mobile/ios/run.rs
  • crates/tauri-cli/src/mobile/ios/xcode_script.rs
  • crates/tauri-cli/src/mobile/mod.rs
  • crates/tauri-cli/src/remove.rs
🧰 Additional context used
🧬 Code graph analysis (21)
crates/tauri-cli/src/acl/permission/ls.rs (1)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/info/app.rs (3)
crates/tauri-cli/src/info/plugins.rs (1)
  • items (107-139)
crates/tauri-cli/src/info/packages_nodejs.rs (1)
  • items (133-151)
crates/tauri-cli/src/info/packages_rust.rs (1)
  • items (12-67)
crates/tauri-cli/src/mobile/ios/run.rs (2)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/mobile/android/run.rs (1)
  • options (84-88)
crates/tauri-cli/src/dev.rs (3)
crates/tauri-cli/src/helpers/config.rs (2)
  • get_config (239-245)
  • reload_config (247-255)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/interface/mod.rs (1)
  • new (112-112)
crates/tauri-cli/src/acl/capability/new.rs (1)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/icon.rs (1)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/helpers/cargo_manifest.rs (1)
crates/tauri-cli/src/interface/rust.rs (1)
  • get_workspace_dir (1282-1288)
crates/tauri-cli/src/interface/rust/desktop.rs (1)
crates/tauri-cli/src/interface/rust.rs (3)
  • out_dir (1202-1204)
  • options (223-223)
  • options (279-279)
crates/tauri-cli/src/mobile/android/mod.rs (1)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/interface/mod.rs (1)
crates/tauri-cli/src/interface/rust.rs (10)
  • app_binary_path (934-959)
  • options (223-223)
  • options (279-279)
  • get_binaries (961-1049)
  • new (140-178)
  • new (1081-1193)
  • out_dir (1202-1204)
  • target (1195-1200)
  • get_cargo_metadata (1213-1231)
  • build (184-193)
crates/tauri-cli/src/remove.rs (2)
crates/tauri-cli/src/helpers/app_paths.rs (2)
  • resolve_frontend_dir (146-167)
  • resolve_dirs (130-144)
crates/tauri-cli/src/helpers/npm.rs (1)
  • from_project (69-74)
crates/tauri-cli/src/helpers/app_paths.rs (1)
crates/tauri-utils/src/config/parse.rs (1)
  • into_file_name (43-49)
crates/tauri-cli/src/mobile/init.rs (4)
crates/tauri-cli/src/mobile/android/mod.rs (1)
  • get_config (127-191)
crates/tauri-cli/src/mobile/ios/mod.rs (1)
  • get_config (124-284)
crates/tauri-cli/src/mobile/mod.rs (4)
  • get_app (434-491)
  • new (60-65)
  • default (167-175)
  • default (190-200)
crates/tauri-cli/src/interface/mod.rs (1)
  • new (112-112)
crates/tauri-cli/src/mobile/ios/build.rs (3)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/build.rs (2)
  • command (84-138)
  • options (101-101)
crates/tauri-cli/src/interface/mod.rs (2)
  • new (112-112)
  • build (115-115)
crates/tauri-cli/src/mobile/mod.rs (2)
crates/tauri-cli/src/mobile/init.rs (1)
  • config (59-59)
crates/tauri-cli/src/helpers/config.rs (1)
  • reload_config (247-255)
crates/tauri-cli/src/mobile/android/android_studio_script.rs (5)
crates/tauri-cli/src/helpers/config.rs (3)
  • get_config (239-245)
  • reload_config (247-255)
  • merge_config_with (258-279)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/mobile/android/run.rs (1)
  • options (84-88)
crates/tauri-cli/src/mobile/mod.rs (3)
  • read_options (395-432)
  • get_app (434-491)
  • new (60-65)
crates/tauri-cli/src/interface/mod.rs (1)
  • new (112-112)
crates/tauri-cli/src/mobile/android/dev.rs (2)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/mobile/android/build.rs (4)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/interface/mod.rs (2)
  • new (112-112)
  • env (114-114)
crates/tauri-cli/src/mobile/android/run.rs (1)
  • options (84-88)
crates/tauri-cli/src/add.rs (1)
crates/tauri-cli/src/helpers/app_paths.rs (2)
  • resolve_frontend_dir (146-167)
  • resolve_dirs (130-144)
crates/tauri-cli/src/inspect.rs (3)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/interface/mod.rs (1)
  • new (112-112)
crates/tauri-cli/src/build.rs (8)
crates/tauri-cli/src/helpers/config.rs (1)
  • get_config (239-245)
crates/tauri-cli/src/helpers/app_paths.rs (1)
  • resolve_dirs (130-144)
crates/tauri-cli/src/interface/mod.rs (3)
  • new (112-112)
  • env (114-114)
  • app_settings (113-113)
crates/tauri-cli/src/bundle.rs (2)
  • options (133-133)
  • bundle (163-224)
crates/tauri-cli/src/mobile/android/build.rs (1)
  • options (124-128)
crates/tauri-cli/src/mobile/android/run.rs (1)
  • options (84-88)
crates/tauri-cli/src/mobile/ios/run.rs (1)
  • options (103-103)
crates/tauri-utils/src/lib.rs (1)
  • display_path (377-381)
🪛 LanguageTool
.changes/reduce-internal-statics.md

[grammar] ~6-~6: Use a hyphen to join words.
Context: ...config and directory resolvings, no user facing changes, please report any regres...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (115)
crates/tauri-cli/src/acl/permission/ls.rs (1)

26-33: LGTM! Clean refactoring to use explicit Dirs struct.

The change correctly replaces the old tauri_dir() global helper with resolve_dirs(), aligning with the PR's goal of removing static path resolution. The path construction for acl_manifests_path remains functionally equivalent.

crates/tauri-cli/src/icon.rs (1)

238-241: LGTM!

The refactor correctly replaces the previous tauri_dir() call with the new resolve_dirs() pattern, obtaining the Tauri directory from the Dirs struct and joining it with "icons" for the default output path.

crates/tauri-cli/src/interface/rust/manifest.rs (1)

272-274: LGTM!

The signature change to accept an explicit tauri_dir: &Path parameter aligns with the PR's goal of removing internal static path resolution. The manifest path is correctly computed from the provided directory.

crates/tauri-cli/src/helpers/cargo_manifest.rs (1)

59-62: LGTM!

The workspace directory lookup now correctly passes tauri_dir to get_workspace_dir, aligning with the updated function signature that requires explicit directory context.

crates/tauri-cli/src/mobile/ios/run.rs (2)

78-106: LGTM!

The refactor correctly:

  1. Resolves directories using resolve_dirs()
  2. Passes &dirs to the build command
  3. Obtains config using get_tauri_config with dirs.tauri
  4. Wraps config in Mutex for thread-safe access in the watcher

This aligns with the pattern used in other platform-specific run commands.


131-139: LGTM!

The watch invocation correctly passes both the mutex-wrapped config and dirs references, enabling config-driven watching behavior with the new directory-aware approach.

crates/tauri-cli/src/acl/capability/new.rs (2)

35-35: LGTM!

The directory resolution correctly uses the new resolve_dirs() function.


109-115: LGTM!

The default capabilities path is correctly constructed from dirs.tauri.join("capabilities"), aligning with the new directory-aware approach.

crates/tauri-cli/src/info/plugins.rs (1)

114-136: LGTM! Clean refactor of plugin item generation.

The restructured control flow is cleaner—gating on tauri_dir first, then conditionally adding Node.js items when frontend_dir is available. The early continue pattern (lines 126-128) keeps the loop readable.

crates/tauri-cli/src/info/mod.rs (1)

312-316: LGTM! Config-driven app item generation.

The refactor properly gates app item population on successful config loading. Silently continuing when config fails is appropriate for an info command—other sections (environment, packages, plugins) still display useful information.

crates/tauri-cli/src/helpers/mod.rs (1)

74-86: LGTM! Clean dependency injection for hook working directory.

Adding frontend_dir as an explicit parameter removes the hidden dependency on global state. The default working directory logic (line 86) remains correct—using the provided frontend directory when script_cwd isn't specified in the hook configuration.

crates/tauri-cli/src/add.rs (2)

42-46: LGTM! Clean separation of command entry point and logic.

Splitting command() (resolves dirs) from run() (accepts dirs as parameter) enables reuse in migration contexts and improves testability.


145-148: LGTM! Consistent path construction for Rust entry points.

Using dirs.tauri for src/main.rs and src/lib.rs paths is correct—these files reside in the Tauri crate directory.

crates/tauri-cli/src/mobile/android/run.rs (2)

81-91: LGTM! Proper config initialization and thread-safe sharing.

Loading config once at command start and wrapping in Mutex enables safe sharing with the watch callback. The config merge from CLI options (lines 84-88) is correctly applied before the mutex wrap.


155-163: LGTM! Config and dirs propagation to watch flow.

Threading &tauri_config and &dirs through to interface.watch enables config-aware watching and consistent path handling during hot-reload cycles.

crates/tauri-cli/src/mobile/android/mod.rs (1)

107-117: LGTM!

The refactor correctly introduces resolve_dirs() to obtain the Dirs struct and threads it through to init_command. This aligns with the broader PR goal of replacing global static path resolution with explicit directory context.

crates/tauri-cli/src/interface/rust/desktop.rs (3)

15-15: LGTM!

Import correctly updated to include Path for the new tauri_dir: &Path parameter.


155-164: LGTM!

The build() function signature is correctly updated to accept tauri_dir: &Path, and the out_dir and app_binary_path calls properly thread this parameter through. This aligns with the broader refactor to make path resolution explicit.


185-187: LGTM!

The universal-apple-darwin branch correctly uses the same tauri_dir parameter for per-triple out_dir computation, maintaining consistency with the main build path.

crates/tauri-cli/src/migrate/mod.rs (3)

7-7: LGTM!

Import correctly updated to include crate_version from cargo_manifest, which is now used for version resolution.


17-30: LGTM!

The migration command correctly:

  1. Resolves directories via resolve_dirs()
  2. Uses dirs.tauri for manifest path construction
  3. Passes dirs.tauri to get_workspace_dir

Error messages properly reference the correct paths.


42-54: LGTM!

The crate_version call correctly receives dirs.tauri, and both migration entry points (v1::run and v2_beta::run) properly receive &dirs as per their updated signatures.

crates/tauri-cli/src/migrate/migrations/v2_beta.rs (2)

7-7: LGTM!

Import correctly updated to include Dirs from app_paths module.


16-28: LGTM!

The run() function is correctly refactored to:

  1. Accept dirs: &Dirs parameter
  2. Derive manifest_path from dirs.tauri
  3. Pass dirs.tauri to migrate_permissions
  4. Pass dirs.frontend to migrate_npm_dependencies

This provides better testability and aligns with the broader directory abstraction refactor.

crates/tauri-cli/src/mobile/ios/build.rs (5)

14-15: LGTM!

Imports correctly updated to:

  1. Add Dirs for the new directory abstraction
  2. Rename get_config to get_tauri_config for clarity
  3. Add ConfigMetadata for direct config access

170-207: LGTM!

The command() function is correctly refactored to:

  1. Accept dirs: &Dirs parameter
  2. Pass dirs.tauri to get_tauri_config, AppInterface::new, get_app, and get_config
  3. Use dirs.tauri for set_current_dir

This properly threads the directory context through the iOS build flow.


216-238: LGTM!

Resource injection and Info.plist handling correctly updated to:

  1. Pass &tauri_config directly to inject_resources
  2. Use dirs.tauri for Info.plist path existence checks
  3. Access tauri_config.bundle.ios.info_plist directly

329-329: LGTM!

The run_build call correctly passes &dirs to thread directory context through the build execution.


344-383: LGTM!

The run_build function is correctly refactored to:

  1. Accept ConfigMetadata directly instead of a guarded handle
  2. Accept dirs: &Dirs for directory context
  3. Pass dirs to crate::build::setup
  4. Use dirs.tauri for out_dir computation
  5. Pass &tauri_config to write_options

This simplifies config access and maintains consistent directory handling.

crates/tauri-cli/src/info/app.rs (2)

6-8: LGTM!

Import correctly updated to include ConfigMetadata and simplify path imports to just PathBuf.


10-50: LGTM!

The items() function is cleanly refactored to:

  1. Accept ConfigMetadata directly instead of loading config internally
  2. Derive build-type, CSP, frontendDist, and devUrl from the config
  3. Preserve framework/bundler inference from package.json when frontend_dir is provided

This simplifies the function by removing the need for runtime config loading and aligns with the config-centric flow introduced in this PR.

crates/tauri-cli/src/inspect.rs (4)

4-4: Path import aligns with the new dir-aware signature.


25-28: Explicit dir resolution in the command flow looks good.


32-36: Config loading and AppInterface now correctly use the tauri_dir context.


47-52: Direct config access for WiX override is cleaner than the prior lock path.

crates/tauri-cli/src/helpers/app_paths.rs (2)

26-29: Dirs container makes path context explicit and easy to thread.


130-143: resolve_dirs caches and returns both paths consistently.

crates/tauri-cli/src/migrate/migrations/v1/mod.rs (1)

5-29: Dirs propagation through the v1 migration flow looks solid.

crates/tauri-cli/src/mobile/init.rs (2)

7-68: Dirs is threaded cleanly through command/exec and config loading.


136-167: Platform config setup now consistently uses tauri_config refs (and dirs.tauri for iOS).

crates/tauri-cli/src/mobile/ios/xcode_script.rs (3)

8-129: Dirs-based config loading/reload and AppInterface wiring is consistent.


140-148: In-place config merge after ensure_init is clear and contained.


236-284: Interface creation and out_dir resolution now use dirs.tauri consistently.

crates/tauri-cli/src/mobile/mod.rs (4)

5-32: Imports updated appropriately for ConfigMetadata and Path usage.


217-219: Explicit handling for “no external IP” is clearer.


249-297: reload_config now threads tauri_dir through dev URL adjustments—nice.


495-516: ensure_init now reads identifier from ConfigMetadata directly—LGTM.

crates/tauri-cli/src/mobile/android/android_studio_script.rs (6)

8-8: LGTM!

Import aliases correctly updated to use the new function names (get_configget_tauri_config, reload_configreload_tauri_config), maintaining consistency with the broader refactor while avoiding name collision with the local get_config from the super module.


41-41: LGTM!

Correct usage of the new resolve_dirs() function to obtain the Dirs struct, replacing the previous global static path resolution pattern.


49-72: LGTM!

The config initialization and reload flow is correctly refactored:

  • get_tauri_config returns ConfigMetadata directly (no more Mutex wrapper)
  • read_options accepts &ConfigMetadata reference
  • reload_tauri_config takes a mutable reference to update config in place
  • dirs.tauri is correctly passed through the call chain

The pattern of conditionally reloading config when CLI options contain additional configs is preserved correctly.


65-78: LGTM!

The get_config and AppInterface::new calls correctly use the new signatures with &tauri_config (direct reference) and dirs.tauri for path context. The get_app helper also receives the updated parameters.


88-96: LGTM!

merge_config_with correctly takes a mutable reference to tauri_config and the config slice, aligning with the new API that mutates the config in place.


101-102: LGTM!

Direct field access on tauri_config.build.dev_url is correct since ConfigMetadata implements Deref<Target = Config>, eliminating the previous .lock().unwrap().as_ref().unwrap() chain.

crates/tauri-cli/src/helpers/config.rs (6)

16-18: LGTM!

Necessary imports added: Path for the new tauri_dir parameter, and OnceLock for the schema validator (correctly using OnceLock per the MSRV constraint noted in the comment on line 143).


74-76: LGTM!

Minor formatting adjustment for the fips_compliant field initialization using environment variable lookup.


152-157: LGTM!

The load_config function signature correctly updated to accept tauri_dir: &Path as an explicit parameter, replacing the previous global state access. This enables directory-aware config loading throughout the codebase.


231-236: LGTM!

load_config now returns ConfigMetadata directly via Ok(...) instead of storing it in a global static, completing the transition from Mutex-based global state to explicit value passing.


239-245: LGTM!

get_config is now a clean public API that delegates to load_config with reload: false. The signature correctly requires target, merge_configs, and tauri_dir parameters.


247-255: LGTM!

reload_config correctly preserves the target from the existing config before reloading, then replaces the entire config in place. This maintains the target context across reloads.

crates/tauri-cli/src/mobile/ios/mod.rs (5)

33-33: LGTM!

Import correctly updated from ConfigHandle to ConfigMetadata, aligning with the refactored config handling approach.


105-116: LGTM!

The command routing correctly obtains dirs via resolve_dirs() and passes &dirs to the Init and Build subcommands. The Dev and Run commands don't receive dirs here, suggesting they resolve directories internally (which is consistent with their implementation patterns).


129-129: LGTM!

The get_config function signature correctly updated to accept tauri_dir: &Path as the new parameter for directory-aware configuration.


547-556: LGTM!

The synchronize_project_config function correctly updated to accept &ConfigMetadata instead of &ConfigHandle. The direct field access (tauri_config.identifier, tauri_config.product_name) works because ConfigMetadata implements Deref<Target = Config>, eliminating the previous lock/unwrap pattern.


272-272: The review comment is based on an inaccurate premise and should be dismissed.

The code at line 272 (features: Some(ios_options.features)) is not a behavior change. The CliOptions::features field is defined as Vec<String> (not Option<Vec<String>>), and consistently defaults to Vec::new(). Both the iOS implementation (lines 229 and 272) and the Android implementation (lines 137 and 158) follow the identical pattern of always wrapping features in Some().

The distinction between "no features specified" (None) vs "empty features list" (Some(vec![])) cannot exist here because ios_options.features is a Vec, not an Option. If the field type were Option<Vec<String>>, then the distinction would matter, but that's not the case in this codebase.

Likely an incorrect or invalid review comment.

crates/tauri-cli/src/mobile/android/build.rs (7)

13-14: LGTM!

Correct imports added for the new Dirs type and ConfigMetadata type, along with the config getter function alias.


30-31: LGTM!

Standard library imports added for Path (used in tauri_dir parameter) and Mutex (used for config synchronization).


134-139: LGTM!

The new run function signature correctly accepts dirs: &Dirs and tauri_config: &Mutex<ConfigMetadata>, enabling the build flow to be called from different entry points with varying config sources.


154-168: LGTM!

The config is correctly locked and dereferenced. The subsequent calls to AppInterface::new, get_app, and get_config correctly use the new signatures with dirs.tauri and direct config references.


176-191: LGTM!

Directory context correctly propagated:

  • set_current_dir uses dirs.tauri
  • ensure_init receives tauri_config reference
  • generate_tauri_properties receives tauri_config reference
  • crate::build::setup receives dirs reference

All calls align with the updated function signatures.


236-246: LGTM!

The run_build function signature correctly updated to accept tauri_config: &ConfigMetadata (not Mutex, since lock is already held by caller) and tauri_dir: &Path for directory-aware operations.


261-275: LGTM!

Internal calls correctly updated:

  • app_settings.out_dir receives tauri_dir
  • write_options receives tauri_config reference
  • inject_resources receives tauri_config reference

All aligned with the new API signatures.

crates/tauri-cli/src/bundle.rs (6)

19-20: LGTM!

Correct imports added for the new Dirs type and ConfigMetadata type used throughout the bundling flow.


121-121: LGTM!

resolve_dirs() correctly called at the command entry point to obtain the Dirs struct for subsequent operations.


131-148: LGTM!

The bundling setup correctly uses the new APIs:

  • get_config receives dirs.tauri for directory-aware config loading
  • AppInterface::new receives config reference and dirs.tauri
  • set_current_dir uses dirs.tauri
  • Direct field access on config.bundle.macos.minimum_system_version works via Deref
  • app_settings.out_dir receives dirs.tauri

All calls align with the refactored signatures.


150-159: LGTM!

The bundle function call correctly passes &config (direct reference) and &dirs for the directory context, aligning with the updated function signature.


171-171: LGTM!

The bundle function signature correctly updated to accept dirs: &Dirs as an additional parameter for directory-aware operations.


190-209: LGTM!

Hook and settings calls correctly updated:

  • helpers::run_hook receives dirs.frontend for the beforeBundleCommand working directory
  • app_settings.get_bundler_settings receives dirs.tauri for path context in binary/settings resolution

Both calls align with the new parameter requirements.

crates/tauri-cli/src/interface/mod.rs (4)

12-18: LGTM!

Imports correctly updated:

  • Mutex added for thread-safe config access in dev/watch flows
  • Dirs, Config, and ConfigMetadata imported from helpers for the new parameter types

The import organization is clean and brings in all necessary types.


32-46: LGTM!

The AppSettings trait correctly updated with tauri_dir: &Path parameters for:

  • get_bundle_settings - needs tauri_dir for resource path resolution
  • app_binary_path - needs tauri_dir for output directory calculation
  • get_binaries - needs tauri_dir for binary discovery

These changes enable directory-aware operations throughout the build/bundle pipeline.


50-96: LGTM!

The get_bundler_settings default implementation correctly propagates tauri_dir:

  • Line 70: self.get_binaries(&options, tauri_dir)
  • Line 78: self.get_bundle_settings(&options, config, &enabled_features, tauri_dir)
  • Line 86: rust::get_cargo_metadata(tauri_dir) for local tools directory

All internal calls correctly receive the directory context.


109-136: LGTM!

The Interface trait correctly updated with the new parameter patterns:

  • new requires tauri_dir: &Path for initialization
  • build requires dirs: &Dirs (no config mutation needed)
  • dev, mobile_dev, watch require config: &Mutex<ConfigMetadata> and dirs: &Dirs to support hot-reload scenarios where config may be mutated

The distinction between build (immutable config) and dev/watch (mutable config via Mutex) is intentional and appropriate for their use cases.

crates/tauri-cli/src/dev.rs (5)

8-14: LGTM: Import changes align with the new directory abstraction.

The updated imports correctly bring in Dirs, get_config, reload_config, and ConfigMetadata to support the new explicit directory context pattern.


99-136: LGTM: Clean threading of Dirs through the command flow.

The refactoring correctly:

  1. Resolves directories once at the entry point (command)
  2. Passes Dirs by value to command_internal (appropriate since Dirs holds references)
  3. Uses dirs.tauri for config loading and AppInterface initialization
  4. Wraps config in Mutex for thread-safe access during dev workflow

138-148: LGTM: Updated setup signature with explicit directory context.

The function now accepts &Dirs making the directory dependencies explicit. Using references is appropriate here since setup doesn't need ownership.


144-160: LGTM: Correct path usage for mismatched packages check and beforeDevCommand.

  • dirs.frontend is correctly used for the mismatched packages check (line 145) and as the default working directory for beforeDevCommand (line 160)
  • dirs.tauri is correctly used for set_current_dir (line 150)

264-268: LGTM: Config reload correctly uses dirs.tauri.

The reload_config call properly passes dirs.tauri for resolving the configuration file path after the built-in dev server modifies the config.

crates/tauri-cli/src/mobile/ios/dev.rs (6)

13-14: LGTM: Imports align with the new config and directory patterns.

The aliased import get_config as get_tauri_config avoids naming collision with the local get_config from the iOS module.


141-149: LGTM: Entry point correctly resolves and threads Dirs.

Consistent with the pattern in dev.rs - directories resolved once and passed through the call chain.


187-206: LGTM: Config and interface initialization correctly use dirs.tauri.

The get_tauri_config, AppInterface::new, get_app, and get_config calls all correctly receive dirs.tauri for path resolution.


223-231: LGTM: Info.plist path resolution correctly uses dirs.tauri.

All three plist file checks (Info.plist, Info.ios.plist, and the config's info_plist) properly use dirs.tauri as the base path.


273-307: LGTM: run_dev signature and config handling.

The function correctly:

  1. Takes ConfigMetadata directly (not wrapped in Mutex initially)
  2. Mutates config as needed before concurrent access
  3. Wraps in Mutex at line 307 before passing to concurrent code paths

308-371: LGTM: Consistent threading of dirs and locked config through mobile dev workflow.

The InterfaceOptions, mobile_dev, and closure callbacks correctly use dirs.tauri for path resolution and the mutex-locked config for concurrent access.

crates/tauri-cli/src/build.rs (5)

10-11: LGTM: Build imports updated for directory abstraction.

Clean import of Dirs and the renamed config accessors.


84-137: LGTM: Build command correctly threads Dirs through the workflow.

The build flow properly:

  1. Resolves directories once at entry
  2. Passes dirs.tauri to config loading and interface initialization
  3. Passes &dirs to setup, build, and bundle operations
  4. Uses config.bundle directly (no longer through a handle/lock)

140-158: LGTM: Setup function uses correct paths for each operation.

  • dirs.frontend and dirs.tauri for mismatched packages check (both are needed for comprehensive checking)
  • dirs.tauri for set_current_dir

188-195: LGTM: beforeBuildCommand hook correctly uses dirs.frontend.

The frontend directory is the appropriate working directory context for the before-build hook, consistent with how beforeDevCommand is handled in dev.rs.


221-223: LGTM: Cargo target directory resolution uses dirs.tauri.

Correct since cargo metadata should be resolved from the Tauri project directory.

crates/tauri-cli/src/mobile/android/dev.rs (6)

13-14: LGTM: Android dev imports updated consistently.

Same pattern as iOS dev - Dirs and ConfigMetadata with aliased get_tauri_config.


134-142: LGTM: Entry point pattern matches other command flows.

Consistent directory resolution and threading pattern.


187-200: LGTM: Config and interface initialization correctly use dirs.tauri.

All path-dependent operations properly receive dirs.tauri.


223-259: LGTM: run_dev correctly handles config mutation and Mutex wrapping.

Same pattern as iOS: mutate config before wrapping in Mutex for concurrent access.


268-273: LGTM: Out directory and tauri properties generation use correct paths.

out_dir correctly uses dirs.tauri, and generate_tauri_properties receives the locked config.


308-351: LGTM: Mobile dev callback and directory threading.

The mobile_dev call correctly threads the locked config and dirs through the mobile development workflow.

crates/tauri-cli/src/interface/rust.rs (12)

34-35: LGTM: Interface imports updated for directory and config types.

Clean addition of Dirs and updated config type imports.


140-178: LGTM: Interface::new correctly accepts and uses tauri_dir.

The constructor properly:

  1. Uses tauri_dir for Cargo.toml watcher setup
  2. Passes tauri_dir to rewrite_manifest
  3. Passes tauri_dir to RustAppSettings::new

184-237: LGTM: build and dev methods correctly thread Dirs.

Both methods accept &Dirs and properly pass dirs.tauri to downstream functions.


240-288: LGTM: mobile_dev and watch methods consistently updated.

Both methods follow the same pattern of accepting config mutex and dirs references.


462-514: LGTM: get_watch_folders correctly uses tauri_dir.

The function properly:

  1. Gets workspace path from tauri_dir
  2. Uses tauri_dir as the base watch folder
  3. Resolves relative additional watch folders from tauri_dir

542-628: LGTM: run_dev_watcher correctly handles config reload and path display.

Key observations:

  • Line 555: get_watch_folders uses dirs.tauri
  • Lines 596-598: reload_config and rewrite_manifest use dirs.tauri
  • Line 609: dirs.frontend used for user-friendly path display (stripping the frontend prefix from changed file paths)

853-932: LGTM: AppSettings trait methods correctly accept tauri_dir.

get_bundle_settings, the bundler configuration, properly threads tauri_dir through to tauri_config_to_bundle_settings.


934-1049: LGTM: Binary path resolution methods correctly use tauri_dir.

app_binary_path and get_binaries properly use tauri_dir for:

  1. Resolving out_dir
  2. Looking up binaries in src/bin directory
  3. Checking for src/main.rs

1081-1205: LGTM: RustAppSettings::new and out_dir correctly thread tauri_dir.

The constructor uses tauri_dir for:

  1. Loading CargoSettings
  2. Getting workspace directory
  3. Loading CargoConfig

And out_dir correctly passes tauri_dir to get_target_dir.


1213-1288: LGTM: Cargo metadata and workspace functions correctly use tauri_dir.

All cargo-related path resolution functions (get_cargo_metadata, get_cargo_target_dir, get_target_dir, get_workspace_dir) consistently use tauri_dir as the current directory context.


1306-1637: LGTM: Bundle settings correctly use tauri_dir for path resolution.

Key paths properly resolved from tauri_dir:

  • Line 1592: Info.plist path
  • Line 1634: License file path

1769-1848: LGTM: Tests updated to use resolve_dirs().

The tests correctly:

  1. Call resolve_dirs() to get the Dirs struct
  2. Use dirs.tauri for path-dependent test assertions

This ensures tests validate the new API correctly.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

"tauri-cli": patch:changes
---

Refactored internal use of static on config and directory resolvings, no user facing changes, please report any regressions if you encounter any
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor grammar fix: hyphenate "user-facing".

When used as a compound adjective before a noun, "user-facing" should be hyphenated.

📝 Suggested fix
-Refactored internal use of static on config and directory resolvings, no user facing changes, please report any regressions if you encounter any
+Refactored internal use of static on config and directory resolvings, no user-facing changes, please report any regressions if you encounter any
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Refactored internal use of static on config and directory resolvings, no user facing changes, please report any regressions if you encounter any
Refactored internal use of static on config and directory resolvings, no user-facing changes, please report any regressions if you encounter any
🧰 Tools
🪛 LanguageTool

[grammar] ~6-~6: Use a hyphen to join words.
Context: ...config and directory resolvings, no user facing changes, please report any regres...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In @.changes/reduce-internal-statics.md at line 6, Update the phrase "user
facing changes" in the .changes/reduce-internal-statics.md diff to the
hyphenated form "user-facing changes"; locate the string "user facing changes"
and replace it with "user-facing changes" to correct the compound adjective
grammar.

_ => crate::error::bail!("Only one of --tag, --rev and --branch can be specified"),
};
manager.install(&[npm_spec], tauri_dir)?;
manager.install(&[npm_spec], dirs.tauri)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the add.rs file around lines 97 and 119
head -130 crates/tauri-cli/src/add.rs | tail -40

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 224


🏁 Script executed:

# Check PackageManager::install implementation
rg -n -B5 -A15 'pub fn install\(' crates/tauri-cli/src/helpers/npm.rs

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 66


🏁 Script executed:

# Check how PackageManager is initialized and if cwd is set during creation
rg -n -B3 -A10 'PackageManager::new\|fn new\(' crates/tauri-cli/src/helpers/npm.rs | head -50

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 66


🏁 Script executed:

# Look at remove.rs to compare the pattern
rg -n -B5 -A5 'manager\.install\|PackageManager' crates/tauri-cli/src/remove.rs | head -60

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 66


🏁 Script executed:

cat -n crates/tauri-cli/src/add.rs | sed -n '85,130p'

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 2024


🏁 Script executed:

cat -n crates/tauri-cli/src/helpers/npm.rs | sed -n '1,200p'

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 6885


🏁 Script executed:

cat -n crates/tauri-cli/src/remove.rs | sed -n '85,135p'

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 66


Fix NPM install directory mismatch.

The PackageManager is detected from frontend_dir (line 97), but manager.install() at line 119 is called with dirs.tauri. This will execute npm in the wrong directory. Since PackageManager::install() uses its second parameter as the working directory (via current_dir), npm will attempt to add the plugin to the Tauri crate directory instead of the frontend project where the dependency should be installed.

Pass the frontend directory to install() instead of dirs.tauri.

🤖 Prompt for AI Agents
In `@crates/tauri-cli/src/add.rs` at line 119, The install is being run in the
wrong directory: PackageManager is detected using frontend_dir but
manager.install(&[npm_spec], dirs.tauri) uses dirs.tauri as the working
directory; change the second argument to the frontend directory (frontend_dir)
so PackageManager::install() runs npm in the frontend project (refer to
manager.install, PackageManager::install, frontend_dir and dirs.tauri when
updating the call).

Comment on lines 47 to 50
if let Some(manager) = frontend_dir.map(PackageManager::from_project) {
let npm_name = format!("@tauri-apps/plugin-{plugin}");
manager.remove(&[npm_name], tauri_dir)?;
manager.remove(&[npm_name], dirs.tauri)?;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, find the PackageManager implementation and the remove method signature
find . -type f -name "*.rs" | xargs grep -l "impl PackageManager" | head -5

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 121


🏁 Script executed:

#!/bin/bash
# Search for the remove method in PackageManager
rg -A10 "fn remove\(" --type rust | grep -A10 "PackageManager" | head -30

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 250


🏁 Script executed:

#!/bin/bash
# Check all usages of manager.remove to see the pattern
rg "manager\.remove" --type rust -B2 -A2

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 614


🏁 Script executed:

#!/bin/bash
# Look at the context of the remove.rs file to understand dirs.tauri vs frontend_dir
cat -n crates/tauri-cli/src/remove.rs | head -60

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 2127


🏁 Script executed:

#!/bin/bash
# Now look at the PackageManager implementation and remove method
cat -n crates/tauri-cli/src/helpers/npm.rs | head -100

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 3648


🏁 Script executed:

#!/bin/bash
# Get more of the npm.rs file to see the remove method
wc -l crates/tauri-cli/src/helpers/npm.rs

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 123


🏁 Script executed:

#!/bin/bash
# Search for the remove method in npm.rs
rg -n "fn remove" crates/tauri-cli/src/helpers/npm.rs -A15

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 547


🏁 Script executed:

#!/bin/bash
# Get the full remove method implementation
sed -n '168,220p' crates/tauri-cli/src/helpers/npm.rs

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 1381


🏁 Script executed:

#!/bin/bash
# Check what resolve_frontend_dir returns
rg -A10 "fn resolve_frontend_dir" crates/tauri-cli/src/helpers/app_paths.rs

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 421


🏁 Script executed:

#!/bin/bash
# Check what resolve_dirs returns and what dirs.tauri is
rg -A20 "pub struct Dirs" crates/tauri-cli/src/helpers/app_paths.rs | head -30

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 741


🏁 Script executed:

#!/bin/bash
# Let's verify the full resolve_dirs function to understand what dirs.tauri and dirs.frontend are
rg -A30 "pub fn resolve_dirs" crates/tauri-cli/src/helpers/app_paths.rs

Repository: qodo-benchmark/tauri-combined-coderabbit

Length of output: 1205


Incorrect directory passed to npm package removal.

The PackageManager::remove() method (defined in npm.rs:168-172) expects the frontend directory as its second parameter and uses it as the working directory for the npm command. However, line 49 passes dirs.tauri (the Tauri project directory) instead of the frontend directory where package.json resides. This will cause the npm uninstall command to fail. Pass frontend_dir (already resolved on line 29) or dirs.frontend instead.

🤖 Prompt for AI Agents
In `@crates/tauri-cli/src/remove.rs` around lines 47 - 50, The npm uninstall is
being run from the wrong directory: change the call to PackageManager::remove so
it uses the frontend directory (frontend_dir) as the working dir instead of
dirs.tauri; specifically update the manager.remove(&[npm_name], dirs.tauri)?
invocation to pass the resolved frontend_dir (or dirs.frontend) so
PackageManager::remove runs the npm command in the directory containing
package.json.

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