Skip to content

Commit f955f7b

Browse files
chore(deps): migrate dirs_next to dirs (#9929)
1 parent e6e17ad commit f955f7b

File tree

14 files changed

+78
-57
lines changed

14 files changed

+78
-57
lines changed

.changes/dirs-next-dirs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"tauri": patch:deps
3+
"tauri-build": patch:deps
4+
"tauri-bundler": patch:deps
5+
"tauri-cli": patch:deps
6+
"@tauri-apps/cli": patch:deps
7+
---
8+
9+
Switch from `dirs_next` to `dirs` as `dirs_next` is now unmaintained while `dirs` is

Cargo.lock

Lines changed: 20 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/tauri-build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ json-patch = "1.2"
3838
walkdir = "2"
3939
tauri-winres = "0.1"
4040
semver = "1"
41-
dirs-next = "2"
41+
dirs = "5"
4242
glob = "0.3"
4343
toml = "0.8"
4444
schemars = { version = "0.8.18", features = [ "preserve_order" ] }

core/tauri-build/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> {
198198
framework
199199
));
200200
}
201-
if let Some(home_dir) = dirs_next::home_dir() {
201+
if let Some(home_dir) = dirs::home_dir() {
202202
if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
203203
continue;
204204
}

core/tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ getrandom = "0.2"
5959
serde_repr = "0.1"
6060
state = "0.6"
6161
http = "1.1"
62-
dirs-next = "2.0"
62+
dirs = "5"
6363
percent-encoding = "2.3"
6464
reqwest = { version = "0.12", default-features = false, features = [ "json", "stream" ] }
6565
bytes = { version = "1", features = [ "serde" ] }

core/tauri/src/path/desktop.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl<R: Runtime> PathResolver<R> {
1818
/// - **macOS:** Resolves to `$HOME/Music`.
1919
/// - **Windows:** Resolves to `{FOLDERID_Music}`.
2020
pub fn audio_dir(&self) -> Result<PathBuf> {
21-
dirs_next::audio_dir().ok_or(Error::UnknownPath)
21+
dirs::audio_dir().ok_or(Error::UnknownPath)
2222
}
2323

2424
/// Returns the path to the user's cache directory.
@@ -29,7 +29,7 @@ impl<R: Runtime> PathResolver<R> {
2929
/// - **macOS:** Resolves to `$HOME/Library/Caches`.
3030
/// - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.
3131
pub fn cache_dir(&self) -> Result<PathBuf> {
32-
dirs_next::cache_dir().ok_or(Error::UnknownPath)
32+
dirs::cache_dir().ok_or(Error::UnknownPath)
3333
}
3434

3535
/// Returns the path to the user's config directory.
@@ -40,7 +40,7 @@ impl<R: Runtime> PathResolver<R> {
4040
/// - **macOS:** Resolves to `$HOME/Library/Application Support`.
4141
/// - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.
4242
pub fn config_dir(&self) -> Result<PathBuf> {
43-
dirs_next::config_dir().ok_or(Error::UnknownPath)
43+
dirs::config_dir().ok_or(Error::UnknownPath)
4444
}
4545

4646
/// Returns the path to the user's data directory.
@@ -51,7 +51,7 @@ impl<R: Runtime> PathResolver<R> {
5151
/// - **macOS:** Resolves to `$HOME/Library/Application Support`.
5252
/// - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.
5353
pub fn data_dir(&self) -> Result<PathBuf> {
54-
dirs_next::data_dir().ok_or(Error::UnknownPath)
54+
dirs::data_dir().ok_or(Error::UnknownPath)
5555
}
5656

5757
/// Returns the path to the user's local data directory.
@@ -62,7 +62,7 @@ impl<R: Runtime> PathResolver<R> {
6262
/// - **macOS:** Resolves to `$HOME/Library/Application Support`.
6363
/// - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.
6464
pub fn local_data_dir(&self) -> Result<PathBuf> {
65-
dirs_next::data_local_dir().ok_or(Error::UnknownPath)
65+
dirs::data_local_dir().ok_or(Error::UnknownPath)
6666
}
6767

6868
/// Returns the path to the user's desktop directory.
@@ -73,7 +73,7 @@ impl<R: Runtime> PathResolver<R> {
7373
/// - **macOS:** Resolves to `$HOME/Desktop`.
7474
/// - **Windows:** Resolves to `{FOLDERID_Desktop}`.
7575
pub fn desktop_dir(&self) -> Result<PathBuf> {
76-
dirs_next::desktop_dir().ok_or(Error::UnknownPath)
76+
dirs::desktop_dir().ok_or(Error::UnknownPath)
7777
}
7878

7979
/// Returns the path to the user's document directory.
@@ -84,7 +84,7 @@ impl<R: Runtime> PathResolver<R> {
8484
/// - **macOS:** Resolves to `$HOME/Documents`.
8585
/// - **Windows:** Resolves to `{FOLDERID_Documents}`.
8686
pub fn document_dir(&self) -> Result<PathBuf> {
87-
dirs_next::document_dir().ok_or(Error::UnknownPath)
87+
dirs::document_dir().ok_or(Error::UnknownPath)
8888
}
8989

9090
/// Returns the path to the user's download directory.
@@ -95,7 +95,7 @@ impl<R: Runtime> PathResolver<R> {
9595
/// - **macOS:** Resolves to `$HOME/Downloads`.
9696
/// - **Windows:** Resolves to `{FOLDERID_Downloads}`.
9797
pub fn download_dir(&self) -> Result<PathBuf> {
98-
dirs_next::download_dir().ok_or(Error::UnknownPath)
98+
dirs::download_dir().ok_or(Error::UnknownPath)
9999
}
100100

101101
/// Returns the path to the user's executable directory.
@@ -106,7 +106,7 @@ impl<R: Runtime> PathResolver<R> {
106106
/// - **macOS:** Not supported.
107107
/// - **Windows:** Not supported.
108108
pub fn executable_dir(&self) -> Result<PathBuf> {
109-
dirs_next::executable_dir().ok_or(Error::UnknownPath)
109+
dirs::executable_dir().ok_or(Error::UnknownPath)
110110
}
111111

112112
/// Returns the path to the user's font directory.
@@ -117,7 +117,7 @@ impl<R: Runtime> PathResolver<R> {
117117
/// - **macOS:** Resolves to `$HOME/Library/Fonts`.
118118
/// - **Windows:** Not supported.
119119
pub fn font_dir(&self) -> Result<PathBuf> {
120-
dirs_next::font_dir().ok_or(Error::UnknownPath)
120+
dirs::font_dir().ok_or(Error::UnknownPath)
121121
}
122122

123123
/// Returns the path to the user's home directory.
@@ -128,7 +128,7 @@ impl<R: Runtime> PathResolver<R> {
128128
/// - **macOS:** Resolves to `$HOME`.
129129
/// - **Windows:** Resolves to `{FOLDERID_Profile}`.
130130
pub fn home_dir(&self) -> Result<PathBuf> {
131-
dirs_next::home_dir().ok_or(Error::UnknownPath)
131+
dirs::home_dir().ok_or(Error::UnknownPath)
132132
}
133133

134134
/// Returns the path to the user's picture directory.
@@ -139,7 +139,7 @@ impl<R: Runtime> PathResolver<R> {
139139
/// - **macOS:** Resolves to `$HOME/Pictures`.
140140
/// - **Windows:** Resolves to `{FOLDERID_Pictures}`.
141141
pub fn picture_dir(&self) -> Result<PathBuf> {
142-
dirs_next::picture_dir().ok_or(Error::UnknownPath)
142+
dirs::picture_dir().ok_or(Error::UnknownPath)
143143
}
144144

145145
/// Returns the path to the user's public directory.
@@ -150,7 +150,7 @@ impl<R: Runtime> PathResolver<R> {
150150
/// - **macOS:** Resolves to `$HOME/Public`.
151151
/// - **Windows:** Resolves to `{FOLDERID_Public}`.
152152
pub fn public_dir(&self) -> Result<PathBuf> {
153-
dirs_next::public_dir().ok_or(Error::UnknownPath)
153+
dirs::public_dir().ok_or(Error::UnknownPath)
154154
}
155155

156156
/// Returns the path to the user's runtime directory.
@@ -161,7 +161,7 @@ impl<R: Runtime> PathResolver<R> {
161161
/// - **macOS:** Not supported.
162162
/// - **Windows:** Not supported.
163163
pub fn runtime_dir(&self) -> Result<PathBuf> {
164-
dirs_next::runtime_dir().ok_or(Error::UnknownPath)
164+
dirs::runtime_dir().ok_or(Error::UnknownPath)
165165
}
166166

167167
/// Returns the path to the user's template directory.
@@ -172,7 +172,7 @@ impl<R: Runtime> PathResolver<R> {
172172
/// - **macOS:** Not supported.
173173
/// - **Windows:** Resolves to `{FOLDERID_Templates}`.
174174
pub fn template_dir(&self) -> Result<PathBuf> {
175-
dirs_next::template_dir().ok_or(Error::UnknownPath)
175+
dirs::template_dir().ok_or(Error::UnknownPath)
176176
}
177177

178178
/// Returns the path to the user's video dir
@@ -183,7 +183,7 @@ impl<R: Runtime> PathResolver<R> {
183183
/// - **macOS:** Resolves to `$HOME/Movies`.
184184
/// - **Windows:** Resolves to `{FOLDERID_Videos}`.
185185
pub fn video_dir(&self) -> Result<PathBuf> {
186-
dirs_next::video_dir().ok_or(Error::UnknownPath)
186+
dirs::video_dir().ok_or(Error::UnknownPath)
187187
}
188188

189189
/// Returns the path to the resource directory of this app.
@@ -196,7 +196,7 @@ impl<R: Runtime> PathResolver<R> {
196196
///
197197
/// Resolves to [`config_dir`](self.config_dir)`/${bundle_identifier}`.
198198
pub fn app_config_dir(&self) -> Result<PathBuf> {
199-
dirs_next::config_dir()
199+
dirs::config_dir()
200200
.ok_or(Error::UnknownPath)
201201
.map(|dir| dir.join(&self.0.config().identifier))
202202
}
@@ -205,7 +205,7 @@ impl<R: Runtime> PathResolver<R> {
205205
///
206206
/// Resolves to [`data_dir`](self.data_dir)`/${bundle_identifier}`.
207207
pub fn app_data_dir(&self) -> Result<PathBuf> {
208-
dirs_next::data_dir()
208+
dirs::data_dir()
209209
.ok_or(Error::UnknownPath)
210210
.map(|dir| dir.join(&self.0.config().identifier))
211211
}
@@ -214,7 +214,7 @@ impl<R: Runtime> PathResolver<R> {
214214
///
215215
/// Resolves to [`local_data_dir`](self.local_data_dir)`/${bundle_identifier}`.
216216
pub fn app_local_data_dir(&self) -> Result<PathBuf> {
217-
dirs_next::data_local_dir()
217+
dirs::data_local_dir()
218218
.ok_or(Error::UnknownPath)
219219
.map(|dir| dir.join(&self.0.config().identifier))
220220
}
@@ -223,7 +223,7 @@ impl<R: Runtime> PathResolver<R> {
223223
///
224224
/// Resolves to [`cache_dir`](self.cache_dir)`/${bundle_identifier}`.
225225
pub fn app_cache_dir(&self) -> Result<PathBuf> {
226-
dirs_next::cache_dir()
226+
dirs::cache_dir()
227227
.ok_or(Error::UnknownPath)
228228
.map(|dir| dir.join(&self.0.config().identifier))
229229
}
@@ -237,12 +237,12 @@ impl<R: Runtime> PathResolver<R> {
237237
/// - **Windows:** Resolves to [`data_local_dir`](self.data_local_dir)`/${bundle_identifier}/logs`.
238238
pub fn app_log_dir(&self) -> Result<PathBuf> {
239239
#[cfg(target_os = "macos")]
240-
let path = dirs_next::home_dir()
240+
let path = dirs::home_dir()
241241
.ok_or(Error::UnknownPath)
242242
.map(|dir| dir.join("Library/Logs").join(&self.0.config().identifier));
243243

244244
#[cfg(not(target_os = "macos"))]
245-
let path = dirs_next::data_local_dir()
245+
let path = dirs::data_local_dir()
246246
.ok_or(Error::UnknownPath)
247247
.map(|dir| dir.join(&self.0.config().identifier).join("logs"));
248248

core/tauri/src/path/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'de> Deserialize<'de> for SafePathBuf {
6666
/// The base directory is the optional root of a file system operation.
6767
/// If informed by the API call, all paths will be relative to the path of the given directory.
6868
///
69-
/// For more information, check the [`dirs_next` documentation](https://docs.rs/dirs_next/).
69+
/// For more information, check the [`dirs` documentation](https://docs.rs/dirs/).
7070
#[derive(Serialize_repr, Deserialize_repr, Clone, Copy, Debug)]
7171
#[repr(u16)]
7272
#[non_exhaustive]

tooling/bundler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ walkdir = "2"
3030
handlebars = "5.1"
3131
tempfile = "3.10.1"
3232
log = { version = "0.4.21", features = [ "kv" ] }
33-
dirs-next = "2.0"
33+
dirs = "5"
3434
os_pipe = "1"
3535
ureq = { version = "2.9.6", default-features = false, features = [ "socks-proxy" ] }
3636
native-tls = { version = "0.2", optional = true }

tooling/bundler/src/bundle/linux/appimage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
6060
sh_map.insert("app_name", settings.product_name());
6161
sh_map.insert("app_name_uppercase", &upcase_app_name);
6262
sh_map.insert("appimage_filename", &appimage_filename);
63-
let tauri_tools_path = dirs_next::cache_dir().map_or_else(
63+
let tauri_tools_path = dirs::cache_dir().map_or_else(
6464
|| output_path.to_path_buf(),
6565
|mut p| {
6666
p.push("tauri");

tooling/bundler/src/bundle/macos/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ fn copy_frameworks_to_bundle(
407407
framework
408408
)));
409409
}
410-
if let Some(home_dir) = dirs_next::home_dir() {
410+
if let Some(home_dir) = dirs::home_dir() {
411411
if copy_framework_from(&dest_dir, framework, &home_dir.join("Library/Frameworks/"))? {
412412
continue;
413413
}

0 commit comments

Comments
 (0)