commits
## Summary
Remove the `Dir` struct and move all directory resolution methods to
module-level functions, simplifying the API from `Dir::config_home()` to
`config_home()`.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [x] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## What Changed?
- **Removed `Dir` struct entirely** - All static methods have been moved
to module-level functions
- **Updated all function calls** - Changed from `Dir::config_home()` to
`config_home()` pattern for all 19 directory functions
- **Updated documentation** - All examples in lib.rs, README.md, and
function docs now use the new API
- **Updated tests** - All test modules now use direct function calls
instead of `Dir::` prefixed calls
- **Version bump** - Updated to v0.5.0 in Cargo.toml to reflect breaking
changes
- **CHANGELOG updated** - Added comprehensive v0.5.0 entry documenting
all breaking changes
- **Migration guide created** - Added detailed migration guide at
`docs/migration_guides/0.4.x-0.5.0.md`
## Why?
1. **Simpler API** - Removes redundant `Dir::` prefix, making function
calls more concise
2. **More idiomatic Rust** - Module-level functions are more common than
static methods on empty structs
3. **Better discoverability** - IDE autocomplete shows all available
functions directly when importing the crate
4. **Cleaner imports** - Users can import specific functions they need:
`use dir_spec::{config_home, cache_home};`
5. **Reduced cognitive overhead** - No need to remember to use `Dir::`
prefix for every call
## How Has This Been Tested?
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality - All existing tests updated
to use new API
- [x] Manual testing performed - Verified examples in docs work
correctly
- [x] Code follows style guidelines (`mise lint`)
Additional verification:
- [x] `cargo check` - Compilation verified
- [x] `cargo doc` - Documentation builds successfully
- [x] All 19 directory functions tested across Linux/macOS/Windows
- [x] XDG environment variable handling unchanged
- [x] Platform-specific fallbacks unchanged
- [x] No `Dir::` references remain in codebase (verified with grep)
## Screenshots/Demo
**Before (v0.4.0):**
```rust
use dir_spec::Dir;
let config = Dir::config_home();
let cache = Dir::cache_home();
```
**After (v0.5.0):**
```rust
use dir_spec::{config_home, cache_home};
let config = config_home();
let cache = cache_home();
```
## Additional Notes
- **Migration is straightforward** - Mostly find/replace of
`Dir::function_name(` with `function_name(`
- **No functional changes** - All directory resolution logic remains
identical
- **Comprehensive migration guide** - Includes automated migration
scripts and complete examples
- **Backward compatibility** - This is intentionally a breaking change
to clean up the API before 1.0
The core functionality remains exactly the same - this is purely an API
ergonomics improvement that makes the library more pleasant to use and
more idiomatic Rust.
<!-- Remember: We're building financial freedom one commit at a time.
Every contribution matters! 🚀-->
Bump version to 0.5.0 in `Cargo.toml` and `Cargo.lock`. Update
`CHANGELOG.md` and `SECURITY.md` to reflect the new release.
Introduce a comprehensive migration guide outlining the changes from
`dir_spec` v0.4.x to v0.5.0. Details include breaking changes,
updated API usage, complete migration examples, automated migration
scripts, and benefits of the new design. Documentation and examples
have been updated for consistency with the module-level function API.
Refactor `Dir` into standalone functions, simplifying the library's
API surface while maintaining all previous functionality. This
transition improves usability by eliminating the need for struct
instantiation and better aligns with typical Rust idioms.
Additionally, the API documentation and example usage were updated
for consistency with the new function-based design.
Introduce `LLMS.md` to provide detailed guidance on the project’s
architecture, development commands, and testing strategies. Ensures
clear instructions for contributors, including platform-specific
module organization and zero-dependency rationale.
Remove windows for the time being as there appears to be some
compatibility issues with how we manage our mise tasks.
Update `pipx` and `yamllint` configurations to explicitly define
supported operating systems (`linux` and `macos`). Improves clarity
and ensures consistency across platforms.
Upgrade from version `v2` to `v3` for the `mise-action` in the setup
workflow. Ensures compatibility with the latest features and fixes
provided by the action.
Documents the version support change, marking `0.4.0` as supported and
removing references to versions prior to `0.2.0`. Ensures up-to-date
information for users regarding the project's supported versions.
Refactor development scripts, CI workflows, and configurations to
enhance maintainability and adherence to project standards.
- Replace `bin/doc` and `bin/test` with modular restructuring:
`bin/test/_default` and `bin/test/coverage`.
- Introduce `.editorconfig` and `.yamllint.yml` for consistent
formatting.
- Add YAML, TOML, and shell linting with new scripts under `bin/lint`.
- Update `.github/workflows` to align with new linting and testing
workflows.
- Enhance `mise.toml` with new dependencies and tools.
- Refactor `.gitignore` and other setup scripts to include additional
coverage and lint outputs.
- Adjust documentation for consistency with new workflow changes.
Ensures smoother development workflows, improved linting, and better
consistency across environments.
Introduce a build matrix for `ubuntu-latest`, `windows-latest`, and
`macos-latest` in the GitHub Actions workflow. Update README.md to
include a build status badge linking to the workflow.
## Summary
Refactor `Dir` to delegate directory resolution to platform-specific
modules (`linux`, `macos`, `windows`) for improved code organization.
- Move XDG logic into a new `xdg` module.
- Implement platform-specific behavior in separate modules.
- Replace platform-dependent code in `Dir` with calls to unified
interfaces (`os::*`).
- Simplify XDG variable resolution and fallback mechanisms.
Enables easier extensibility and maintenance by isolating
platform-specific logic.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [ ] 🧪 Test improvements
## What Changed?
- Extracted XDG Base Directory Specification logic into a dedicated
`xdg.rs` module with `resolve_path()` and `resolve_path_with_fallback()`
functions
- Created platform-specific modules:
- `linux.rs` - Linux-specific directory implementations
- `macos.rs` - macOS-specific directory implementations
- `windows.rs` - Windows-specific directory implementations
- Replaced inline conditional compilation (`#[cfg(target_os = "...")]`)
scattered throughout `lib.rs` with clean module delegation using `use
platform as os`
- Consolidated platform-specific helper functions within their
respective modules
- Maintained identical public API - all existing function signatures
remain unchanged
## Why?
The previous single-file approach had several maintainability issues:
- Platform-specific logic was scattered across every public method with
`#[cfg]` blocks
- Difficult to locate and modify behavior for a specific platform
- Code duplication in helper functions trying to abstract conditional
compilation
- Poor readability due to nested conditional compilation throughout
functions
- Hard to test platform-specific logic in isolation
This refactor follows Rust best practices for platform-specific code
organization, similar to how the standard library handles cross-platform
differences.
## How Has This Been Tested?
- [x] Existing tests pass (`mise test`)
- [ ] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
All existing tests continue to pass, ensuring no behavioral changes. The
refactor is purely organizational - the public API and functionality
remain identical.
## Additional Notes
This refactor makes the codebase significantly easier to maintain and
extend:
- Adding support for new platforms now only requires creating a new
module file
- Platform-specific bugs can be fixed by editing a single, focused file
- Each platform's logic is self-contained and easier to understand
- Follows established Rust conventions for cross-platform libraries
The change is completely backwards compatible - no breaking changes to
the public API.
## Summary
This adds a substantial refactor to our test suite as well as tooling
for coverage and nicer test runner with nextest.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
Introduce `cargo-llvm-cov` and `cargo-nextest` for enhanced testing and
coverage visualization. Update `setup` and `test` scripts to use new
tools. Adjust `.gitignore` and `mise.toml` to account for generated
coverage reports and dependencies. Enable additional Rust components
via `rust-toolchain.toml` for seamless integration.
Introduce modular, comprehensive test cases for `Dir` methods, covering
various platform-specific paths. New tests ensure accurate handling of
environmental variables, relative paths, platform defaults, and fallback
strategies:
- Add test suites for `bin_home`, `cache_home`, `config_home`,
`data_home`, `desktop`, `documents`, `downloads`, `fonts`, `home`,
`music`, `pictures`, `preferences`, `publicshare`, `runtime`,
`state_home`, and `templates`.
- Validate correct behavior for both Windows and Unix environments.
- Utilize `temp_env` for scoped environment variable handling.
- Ensure fallbacks to platform-specific directory standards when
variables are unset or paths are invalid.
Refactor existing tests to match the added modular structure.
## Summary
- Introduce `config_local()` for non-roaming config directory
resolution.
- Add `data_local()` for non-roaming data directory resolution.
- Add `fonts()` for user-installed fonts directory retrieval.
- Add `preferences()` for platform-specific preferences directory.
Update README, CHANGELOG, and tests to reflect the new functionality.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [x] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [ ] 🧪 Test improvements
## What Changed?
* `config_local()` - Returns user's local (non-roaming) config
directory. On Windows uses `%LOCALAPPDATA%`, identical
to `config_home()` on other platforms
* `data_local()` - Returns user's local (non-roaming) data directory. On
Windows uses `%LOCALAPPDATA%`, identical to
`data_home()` on other platforms
* `fonts()` - Returns user's fonts directory
(`~/.local/share/fonts` on Linux, `~/Library/Fonts` on macOS, `None` on
Windows)
* `preferences()` - Returns user's preferences directory. On macOS
returns `~/Library/Preferences` for .plist files,
identical to `config_home()` on other platforms
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
## Summary
- Introduce `temp-env` crate (v0.3) to simplify environment variable
handling in tests.
- Replace custom `env::set_var`/`env::remove_var` calls with `temp_env`
utility methods.
- Eliminate unsafe code in test cases by leveraging `temp_env`'s scoped
modification functions.
- Update `Cargo.toml` and `Cargo.lock` to reflect the new development
dependency.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## What Changed?
This refactors tests to use temp-env instead of using unsafe code
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to
5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update actions checkout to use node 24 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li>
<li>Prepare v5.0.0 release by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2238">actions/checkout#2238</a></li>
</ul>
<h2>⚠️ Minimum Compatible Runner Version</h2>
<p><strong>v2.327.1</strong><br />
<a
href="https://github.com/actions/runner/releases/tag/v2.327.1">Release
Notes</a></p>
<p>Make sure your runner is updated to this version or newer to use this
release.</p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4...v5.0.0">https://github.com/actions/checkout/compare/v4...v5.0.0</a></p>
<h2>v4.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>docs: update README.md by <a
href="https://github.com/motss"><code>@motss</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li>Add internal repos for checking out multiple repositories by <a
href="https://github.com/mouismail"><code>@mouismail</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li>Documentation update - add recommended permissions to Readme by <a
href="https://github.com/benwells"><code>@benwells</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li>Adjust positioning of user email note and permissions heading by <a
href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li>
<li>Update README.md by <a
href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li>Update CODEOWNERS for actions by <a
href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li>
<li>Update package dependencies by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
<li>Prepare release v4.3.0 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2237">actions/checkout#2237</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/motss"><code>@motss</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li><a href="https://github.com/mouismail"><code>@mouismail</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li><a href="https://github.com/benwells"><code>@benwells</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li><a href="https://github.com/nebuk89"><code>@nebuk89</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li><a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4...v4.3.0">https://github.com/actions/checkout/compare/v4...v4.3.0</a></p>
<h2>v4.2.2</h2>
<h2>What's Changed</h2>
<ul>
<li><code>url-helper.ts</code> now leverages well-known environment
variables by <a href="https://github.com/jww3"><code>@jww3</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li>
<li>Expand unit test coverage for <code>isGhes</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4.2.1...v4.2.2">https://github.com/actions/checkout/compare/v4.2.1...v4.2.2</a></p>
<h2>v4.2.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Check out other refs/* by commit if provided, fall back to ref by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Jcambass"><code>@Jcambass</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1919">actions/checkout#1919</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4.2.0...v4.2.1">https://github.com/actions/checkout/compare/v4.2.0...v4.2.1</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>V5.0.0</h2>
<ul>
<li>Update actions checkout to use node 24 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li>
</ul>
<h2>V4.3.0</h2>
<ul>
<li>docs: update README.md by <a
href="https://github.com/motss"><code>@motss</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li>Add internal repos for checking out multiple repositories by <a
href="https://github.com/mouismail"><code>@mouismail</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li>Documentation update - add recommended permissions to Readme by <a
href="https://github.com/benwells"><code>@benwells</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li>Adjust positioning of user email note and permissions heading by <a
href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li>
<li>Update README.md by <a
href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li>Update CODEOWNERS for actions by <a
href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li>
<li>Update package dependencies by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
</ul>
<h2>v4.2.2</h2>
<ul>
<li><code>url-helper.ts</code> now leverages well-known environment
variables by <a href="https://github.com/jww3"><code>@jww3</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li>
<li>Expand unit test coverage for <code>isGhes</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li>
</ul>
<h2>v4.2.1</h2>
<ul>
<li>Check out other refs/* by commit if provided, fall back to ref by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li>
</ul>
<h2>v4.2.0</h2>
<ul>
<li>Add Ref and Commit outputs by <a
href="https://github.com/lucacome"><code>@lucacome</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li>
<li>Dependency updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a>- <a
href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>,
<a
href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li>
</ul>
<h2>v4.1.7</h2>
<ul>
<li>Bump the minor-npm-dependencies group across 1 directory with 4
updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li>
<li>Bump actions/checkout from 3 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li>
<li>Check out other refs/* by commit by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li>
<li>Pin actions/checkout's own workflows to a known, good, stable
version. by <a href="https://github.com/jww3"><code>@jww3</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li>
</ul>
<h2>v4.1.6</h2>
<ul>
<li>Check platform to set archive extension appropriately by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li>
</ul>
<h2>v4.1.5</h2>
<ul>
<li>Update NPM dependencies by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1703">actions/checkout#1703</a></li>
<li>Bump github/codeql-action from 2 to 3 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1694">actions/checkout#1694</a></li>
<li>Bump actions/setup-node from 1 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1696">actions/checkout#1696</a></li>
<li>Bump actions/upload-artifact from 2 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1695">actions/checkout#1695</a></li>
<li>README: Suggest <code>user.email</code> to be
<code>41898282+github-actions[bot]@users.noreply.github.com</code> by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1707">actions/checkout#1707</a></li>
</ul>
<h2>v4.1.4</h2>
<ul>
<li>Disable <code>extensions.worktreeConfig</code> when disabling
<code>sparse-checkout</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1692">actions/checkout#1692</a></li>
<li>Add dependabot config by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1688">actions/checkout#1688</a></li>
<li>Bump the minor-actions-dependencies group with 2 updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1693">actions/checkout#1693</a></li>
<li>Bump word-wrap from 1.2.3 to 1.2.5 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1643">actions/checkout#1643</a></li>
</ul>
<h2>v4.1.3</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/actions/checkout/commit/08c6903cd8c0fde910a37f88322edcfb5dd907a8"><code>08c6903</code></a>
Prepare v5.0.0 release (<a
href="https://redirect.github.com/actions/checkout/issues/2238">#2238</a>)</li>
<li><a
href="https://github.com/actions/checkout/commit/9f265659d3bb64ab1440b03b12f4d47a24320917"><code>9f26565</code></a>
Update actions checkout to use node 24 (<a
href="https://redirect.github.com/actions/checkout/issues/2226">#2226</a>)</li>
<li>See full diff in <a
href="https://github.com/actions/checkout/compare/v4...v5">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Remove manual `actions/cache` setup for caching Cargo dependencies.
- Add `Swatinem/rust-cache@v2` for simpler and more efficient caching.
- Simplifies action configuration and reduces boilerplate.
- Bump version to 0.2.0 in `Cargo.toml` and `Cargo.lock`.
- Update `SECURITY.md` support matrix for version 0.2.0.
- Add release notes for 0.2.0 in `CHANGELOG.md`.
## Summary
Eliminate the `libc` dependency by simplifying the Linux runtime
directory fallback logic to use standard environment variables instead
of unsafe UID lookup.
## Type of Change
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
## What Changed?
- **Removed libc dependency**: Eliminated the unsafe `libc::getuid()`
call in the `runtime()` method
- **Unified Linux/macOS behavior**: Both platforms now use `$TMPDIR`
then `/tmp` fallback for runtime directories
- **Updated documentation**: Reflects the simplified fallback behavior
in method docs and README
- **Updated migration guide**: Documents the runtime directory behavior
change
- **Updated changelog**: Added entry for the libc dependency removal
## Why?
1. **Eliminate unsafe code**: The `libc::getuid()` call required unsafe
code that can be avoided
2. **Reduce dependencies**: Runtime directories are temporary by nature,
so using system temp directories is more appropriate
3. **Simplify implementation**: Unifying Linux and macOS behavior
reduces platform-specific complexity
4. **Better fallback strategy**: `$TMPDIR` and `/tmp` are more
universally available than constructing `/run/user/{uid}`
The original approach of constructing `/run/user/{uid}` was overly
complex for a fallback case - when `XDG_RUNTIME_DIR` is not set, using
the system's temporary directory is a more appropriate fallback.
## How Has This Been Tested?
- [x] Existing tests pass (updated to handle new behavior)
- [x] Manual testing performed on Linux, macOS, and Windows
- [x] Code follows style guidelines
- [x] Verified runtime directory resolution works correctly across
platforms
**Specific Testing:**
- Confirmed `XDG_RUNTIME_DIR` is still respected when set
- Verified fallback to `$TMPDIR` on Linux/macOS works correctly
- Tested fallback to `/tmp` when `$TMPDIR` is not set
- Ensured Windows behavior unchanged (`%TEMP%` fallback)
## Screenshots/Demo
N/A - This is an internal implementation change without user-visible
behavior changes (except for the specific fallback case).
## Related Issues
Part of the broader effort to simplify the crate's API and reduce
dependencies leading up to v0.2.0.
## Additional Notes
**Breaking Change Impact:**
This is technically a breaking change in behavior for Linux systems
where:
1. `XDG_RUNTIME_DIR` is not set, AND
2. The system doesn't have `$TMPDIR` set
In such cases, the runtime directory will now be `/tmp` instead of
`/run/user/{uid}`. However, this is an edge case since properly
configured Linux systems should have `XDG_RUNTIME_DIR` set.
**Dependency Impact:**
- Cargo.toml can now remove `libc = "1.0.0-alpha.1"` dependency
- Crate is now truly zero-dependency (only uses `std`)
- Binary size will be smaller due to no external dependencies
- Compilation will be faster with fewer dependencies to resolve
This change makes the crate more lightweight and eliminates all unsafe
code.
- Update README to reflect the removal of deprecated `*_dir()` methods
and the transition to `Option<PathBuf>` return types.
- Add migration guide to help users upgrade from 0.1.x to 0.2.0.
- Document dependency removals (`libc`, `eyre`) and simplified error
handling.
- Highlight `runtime()` fallback behavior changes for Linux.
- Ensure consistency in examples and method descriptions across all
documentation.
The libc dependency was unused and has been removed to streamline
the crate's dependency tree. This reduces maintenance overhead
and eliminates unnecessary inclusions.
Replace Linux-specific UID lookup with standard temporary directory
fallback. On Linux, now uses $TMPDIR then /tmp instead of constructing
/run/user/{uid}, unifying behavior with macOS and eliminating the need
for unsafe libc calls.
- Remove unsafe libc::getuid() call
- Unify Linux and macOS runtime directory fallback logic
- Update documentation to reflect simplified behavior
- Enables removal of libc dependency entirely
Introduce caching for Cargo dependencies in the `setup` action to
improve build times. Cache includes Cargo binaries, registry, git
database, and target directory keyed by OS, Rust version, and
`Cargo.lock` hash.
Include relevant tags and categories for improved discoverability on
crates.io. This helps users locate the crate more easily by related
topics or functionality.
Simplify API by changing all methods to return `Option<PathBuf>` instead
of `Result<PathBuf>`, removing the eyre dependency and aligning with
`std::env::home_dir()` conventions. This change also removes all
deprecated `*_dir()` method variants.
## Type of Change
- [x] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
## What Changed?
- **API Simplification**: All public methods now return
`Option<PathBuf>` instead of `Result<PathBuf>`
- **Dependency Reduction**: Removed `eyre` dependency from public API
surface
- **Method Cleanup**: Removed all deprecated `*_dir()` method variants
(`desktop_dir()`, `documents_dir()`, etc.)
- **Home Directory Fix**: Updated `home()` method to use
`std::env::home_dir()` directly (was previously deprecated but has since
been undeprecated)
- **Error Handling**: Simplified error handling by returning `None`
instead of `Result::Err`
- **Helper Methods**: Updated internal helper methods to return
`Option<PathBuf>`
- **Documentation**: Comprehensive updates to README, CHANGELOG, and
migration guide
## Why?
1. **Consistency**: Aligns with `std::env::home_dir()` return type that
we now use internally
2. **Simplicity**: `Option<PathBuf>` is more appropriate for this use
case than `Result<PathBuf>`
3. **Reduced Dependencies**: Removes `eyre` from public API, reducing
dependency footprint
4. **Better Performance**: Eliminates overhead from error type
conversions
5. **Cleaner API**: Removes deprecated methods to provide a focused,
clean interface
## How Has This Been Tested?
- [x] Existing tests pass (updated to handle new return types)
- [x] New tests added for Option handling patterns
- [x] Manual testing performed across platforms
- [x] Code follows style guidelines
**Test Updates Made:**
- Updated all test assertions to handle `Option<PathBuf>` return type
- Added tests for `None` cases where directories cannot be resolved
- Verified XDG compliance still works correctly
- Confirmed platform-specific fallbacks function properly
## Screenshots/Demo
N/A - This is an API change without visual components
## Related Issues
Addresses the issue where `std::env::home_dir()` was initially avoided
due to deprecation, but has since been undeprecated. This change
modernizes the entire API to be consistent with standard library
conventions.
## Additional Notes
**Migration Support:**
- Created comprehensive migration guide (`MIGRATE_0.1.x-0.2.0.md`) with
before/after examples
- Updated README with new usage patterns and migration section
- Added detailed CHANGELOG entry documenting all breaking changes
**Breaking Changes:**
- All method signatures changed from `-> Result<PathBuf>` to `->
Option<PathBuf>`
- Removed 9 deprecated `*_dir()` methods
- Removed `eyre` from public API
This is a significant breaking change that requires a major version
bump, but provides a much cleaner and more idiomatic Rust API going
forward.
- Add `no-duplicate-heading.siblings_only` rule to `.markdownlint.yml`
- Restricts duplicate heading checks to siblings, improving flexibility
- Update README.md with new Option<PathBuf> API and migration guidance
- Add CHANGELOG.md entry documenting all breaking changes in v0.2.0
- Create MIGRATE_0.1.x-0.2.0.md with detailed migration examples
Documentation now reflects the simplified Option-based API and provides
clear upgrade paths for existing users.
This aligns with the simplified error handling approach from recent
updates, reducing unnecessary dependencies and improving
maintainability.
This is a major breaking change that aligns the API with
std::env::home_dir() and simplifies error handling by removing the eyre
dependency.
Breaking changes:
- All public methods now return Option<PathBuf> instead of
Result<PathBuf>
- Removed eyre dependency from public API
- Removed all deprecated *_dir() method variants
- Methods return None instead of errors when directories cannot be
resolved
Benefits:
- Consistent with std::env::home_dir() return type
- Simpler error handling using Option pattern matching
- Reduced dependencies (no longer requires eyre)
- Cleaner API surface without deprecated methods
Migration guide:
- Replace `Dir::config_home()?` with `Dir::config_home().ok_or(...)?`
- Replace `match Dir::config_home() { Ok(path) => ... }` with `if let
Some(path) = Dir::config_home() { ... }`
- Update deprecated method calls: `desktop_dir()` → `desktop()`, etc.
Previously avoided `std::env::home_dir()` due to its deprecated status,
but it has since been undeprecated. This change replaces the complex
platform-specific logic with the standard library function, eliminating
unsafe code and significantly reducing complexity.
- Removes platform-specific conditional compilation
- Eliminates unsafe libc calls on Unix systems
- Removes manual environment variable handling on Windows
- Improves code maintainability and readability
* Collapse duplicated directory resolvers into a single `Dir` impl in
lib.rs with small helpers for platform defaults and XDG resolution.
* Add new, cleaner methods (`desktop`, `documents`, `downloads`,
`music`, `pictures`, `publicshare`, `runtime`, `templates`, `videos`)
and deprecate the old `*_dir` variants (kept for compatibility).
respect XDG spec absolute-path requirement
* Only honor XDG_* env vars when they are absolute paths; ignore
relative values per the XDG Base Directory Specification.
bump crate to 0.1.0; switch to `license = "MIT"`; enable clippy/rust
lints
* Add targeted clippy lints and Rust `dead_code`, `unsafe_code`, etc.
add coverage for XDG absolute/relative behavior and platform defaults
## Summary
Remove the `Dir` struct and move all directory resolution methods to
module-level functions, simplifying the API from `Dir::config_home()` to
`config_home()`.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [x] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## What Changed?
- **Removed `Dir` struct entirely** - All static methods have been moved
to module-level functions
- **Updated all function calls** - Changed from `Dir::config_home()` to
`config_home()` pattern for all 19 directory functions
- **Updated documentation** - All examples in lib.rs, README.md, and
function docs now use the new API
- **Updated tests** - All test modules now use direct function calls
instead of `Dir::` prefixed calls
- **Version bump** - Updated to v0.5.0 in Cargo.toml to reflect breaking
changes
- **CHANGELOG updated** - Added comprehensive v0.5.0 entry documenting
all breaking changes
- **Migration guide created** - Added detailed migration guide at
`docs/migration_guides/0.4.x-0.5.0.md`
## Why?
1. **Simpler API** - Removes redundant `Dir::` prefix, making function
calls more concise
2. **More idiomatic Rust** - Module-level functions are more common than
static methods on empty structs
3. **Better discoverability** - IDE autocomplete shows all available
functions directly when importing the crate
4. **Cleaner imports** - Users can import specific functions they need:
`use dir_spec::{config_home, cache_home};`
5. **Reduced cognitive overhead** - No need to remember to use `Dir::`
prefix for every call
## How Has This Been Tested?
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality - All existing tests updated
to use new API
- [x] Manual testing performed - Verified examples in docs work
correctly
- [x] Code follows style guidelines (`mise lint`)
Additional verification:
- [x] `cargo check` - Compilation verified
- [x] `cargo doc` - Documentation builds successfully
- [x] All 19 directory functions tested across Linux/macOS/Windows
- [x] XDG environment variable handling unchanged
- [x] Platform-specific fallbacks unchanged
- [x] No `Dir::` references remain in codebase (verified with grep)
## Screenshots/Demo
**Before (v0.4.0):**
```rust
use dir_spec::Dir;
let config = Dir::config_home();
let cache = Dir::cache_home();
```
**After (v0.5.0):**
```rust
use dir_spec::{config_home, cache_home};
let config = config_home();
let cache = cache_home();
```
## Additional Notes
- **Migration is straightforward** - Mostly find/replace of
`Dir::function_name(` with `function_name(`
- **No functional changes** - All directory resolution logic remains
identical
- **Comprehensive migration guide** - Includes automated migration
scripts and complete examples
- **Backward compatibility** - This is intentionally a breaking change
to clean up the API before 1.0
The core functionality remains exactly the same - this is purely an API
ergonomics improvement that makes the library more pleasant to use and
more idiomatic Rust.
<!-- Remember: We're building financial freedom one commit at a time.
Every contribution matters! 🚀-->
Introduce a comprehensive migration guide outlining the changes from
`dir_spec` v0.4.x to v0.5.0. Details include breaking changes,
updated API usage, complete migration examples, automated migration
scripts, and benefits of the new design. Documentation and examples
have been updated for consistency with the module-level function API.
Refactor `Dir` into standalone functions, simplifying the library's
API surface while maintaining all previous functionality. This
transition improves usability by eliminating the need for struct
instantiation and better aligns with typical Rust idioms.
Additionally, the API documentation and example usage were updated
for consistency with the new function-based design.
Refactor development scripts, CI workflows, and configurations to
enhance maintainability and adherence to project standards.
- Replace `bin/doc` and `bin/test` with modular restructuring:
`bin/test/_default` and `bin/test/coverage`.
- Introduce `.editorconfig` and `.yamllint.yml` for consistent
formatting.
- Add YAML, TOML, and shell linting with new scripts under `bin/lint`.
- Update `.github/workflows` to align with new linting and testing
workflows.
- Enhance `mise.toml` with new dependencies and tools.
- Refactor `.gitignore` and other setup scripts to include additional
coverage and lint outputs.
- Adjust documentation for consistency with new workflow changes.
Ensures smoother development workflows, improved linting, and better
consistency across environments.
## Summary
Refactor `Dir` to delegate directory resolution to platform-specific
modules (`linux`, `macos`, `windows`) for improved code organization.
- Move XDG logic into a new `xdg` module.
- Implement platform-specific behavior in separate modules.
- Replace platform-dependent code in `Dir` with calls to unified
interfaces (`os::*`).
- Simplify XDG variable resolution and fallback mechanisms.
Enables easier extensibility and maintenance by isolating
platform-specific logic.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [ ] 🧪 Test improvements
## What Changed?
- Extracted XDG Base Directory Specification logic into a dedicated
`xdg.rs` module with `resolve_path()` and `resolve_path_with_fallback()`
functions
- Created platform-specific modules:
- `linux.rs` - Linux-specific directory implementations
- `macos.rs` - macOS-specific directory implementations
- `windows.rs` - Windows-specific directory implementations
- Replaced inline conditional compilation (`#[cfg(target_os = "...")]`)
scattered throughout `lib.rs` with clean module delegation using `use
platform as os`
- Consolidated platform-specific helper functions within their
respective modules
- Maintained identical public API - all existing function signatures
remain unchanged
## Why?
The previous single-file approach had several maintainability issues:
- Platform-specific logic was scattered across every public method with
`#[cfg]` blocks
- Difficult to locate and modify behavior for a specific platform
- Code duplication in helper functions trying to abstract conditional
compilation
- Poor readability due to nested conditional compilation throughout
functions
- Hard to test platform-specific logic in isolation
This refactor follows Rust best practices for platform-specific code
organization, similar to how the standard library handles cross-platform
differences.
## How Has This Been Tested?
- [x] Existing tests pass (`mise test`)
- [ ] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
All existing tests continue to pass, ensuring no behavioral changes. The
refactor is purely organizational - the public API and functionality
remain identical.
## Additional Notes
This refactor makes the codebase significantly easier to maintain and
extend:
- Adding support for new platforms now only requires creating a new
module file
- Platform-specific bugs can be fixed by editing a single, focused file
- Each platform's logic is self-contained and easier to understand
- Follows established Rust conventions for cross-platform libraries
The change is completely backwards compatible - no breaking changes to
the public API.
## Summary
This adds a substantial refactor to our test suite as well as tooling
for coverage and nicer test runner with nextest.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
Introduce `cargo-llvm-cov` and `cargo-nextest` for enhanced testing and
coverage visualization. Update `setup` and `test` scripts to use new
tools. Adjust `.gitignore` and `mise.toml` to account for generated
coverage reports and dependencies. Enable additional Rust components
via `rust-toolchain.toml` for seamless integration.
Introduce modular, comprehensive test cases for `Dir` methods, covering
various platform-specific paths. New tests ensure accurate handling of
environmental variables, relative paths, platform defaults, and fallback
strategies:
- Add test suites for `bin_home`, `cache_home`, `config_home`,
`data_home`, `desktop`, `documents`, `downloads`, `fonts`, `home`,
`music`, `pictures`, `preferences`, `publicshare`, `runtime`,
`state_home`, and `templates`.
- Validate correct behavior for both Windows and Unix environments.
- Utilize `temp_env` for scoped environment variable handling.
- Ensure fallbacks to platform-specific directory standards when
variables are unset or paths are invalid.
Refactor existing tests to match the added modular structure.
## Summary
- Introduce `config_local()` for non-roaming config directory
resolution.
- Add `data_local()` for non-roaming data directory resolution.
- Add `fonts()` for user-installed fonts directory retrieval.
- Add `preferences()` for platform-specific preferences directory.
Update README, CHANGELOG, and tests to reflect the new functionality.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [x] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🧹 Code cleanup or refactoring
- [ ] 🔧 Build system or dependency changes
- [ ] 🧪 Test improvements
## What Changed?
* `config_local()` - Returns user's local (non-roaming) config
directory. On Windows uses `%LOCALAPPDATA%`, identical
to `config_home()` on other platforms
* `data_local()` - Returns user's local (non-roaming) data directory. On
Windows uses `%LOCALAPPDATA%`, identical to
`data_home()` on other platforms
* `fonts()` - Returns user's fonts directory
(`~/.local/share/fonts` on Linux, `~/Library/Fonts` on macOS, `None` on
Windows)
* `preferences()` - Returns user's preferences directory. On macOS
returns `~/Library/Preferences` for .plist files,
identical to `config_home()` on other platforms
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
## Summary
- Introduce `temp-env` crate (v0.3) to simplify environment variable
handling in tests.
- Replace custom `env::set_var`/`env::remove_var` calls with `temp_env`
utility methods.
- Eliminate unsafe code in test cases by leveraging `temp_env`'s scoped
modification functions.
- Update `Cargo.toml` and `Cargo.lock` to reflect the new development
dependency.
## Type of Change
<!-- Mark with an `x` all that apply -->
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [ ] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
- [x] 🧪 Test improvements
## What Changed?
This refactors tests to use temp-env instead of using unsafe code
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [x] Existing tests pass (`mise test`)
- [x] New tests added for new functionality
- [x] Manual testing performed
- [x] Code follows style guidelines (`mise lint`)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to
5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update actions checkout to use node 24 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li>
<li>Prepare v5.0.0 release by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2238">actions/checkout#2238</a></li>
</ul>
<h2>⚠️ Minimum Compatible Runner Version</h2>
<p><strong>v2.327.1</strong><br />
<a
href="https://github.com/actions/runner/releases/tag/v2.327.1">Release
Notes</a></p>
<p>Make sure your runner is updated to this version or newer to use this
release.</p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4...v5.0.0">https://github.com/actions/checkout/compare/v4...v5.0.0</a></p>
<h2>v4.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>docs: update README.md by <a
href="https://github.com/motss"><code>@motss</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li>Add internal repos for checking out multiple repositories by <a
href="https://github.com/mouismail"><code>@mouismail</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li>Documentation update - add recommended permissions to Readme by <a
href="https://github.com/benwells"><code>@benwells</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li>Adjust positioning of user email note and permissions heading by <a
href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li>
<li>Update README.md by <a
href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li>Update CODEOWNERS for actions by <a
href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li>
<li>Update package dependencies by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
<li>Prepare release v4.3.0 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2237">actions/checkout#2237</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/motss"><code>@motss</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li><a href="https://github.com/mouismail"><code>@mouismail</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li><a href="https://github.com/benwells"><code>@benwells</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li><a href="https://github.com/nebuk89"><code>@nebuk89</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li><a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4...v4.3.0">https://github.com/actions/checkout/compare/v4...v4.3.0</a></p>
<h2>v4.2.2</h2>
<h2>What's Changed</h2>
<ul>
<li><code>url-helper.ts</code> now leverages well-known environment
variables by <a href="https://github.com/jww3"><code>@jww3</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li>
<li>Expand unit test coverage for <code>isGhes</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4.2.1...v4.2.2">https://github.com/actions/checkout/compare/v4.2.1...v4.2.2</a></p>
<h2>v4.2.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Check out other refs/* by commit if provided, fall back to ref by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Jcambass"><code>@Jcambass</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1919">actions/checkout#1919</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v4.2.0...v4.2.1">https://github.com/actions/checkout/compare/v4.2.0...v4.2.1</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>V5.0.0</h2>
<ul>
<li>Update actions checkout to use node 24 by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li>
</ul>
<h2>V4.3.0</h2>
<ul>
<li>docs: update README.md by <a
href="https://github.com/motss"><code>@motss</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li>Add internal repos for checking out multiple repositories by <a
href="https://github.com/mouismail"><code>@mouismail</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li>Documentation update - add recommended permissions to Readme by <a
href="https://github.com/benwells"><code>@benwells</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li>Adjust positioning of user email note and permissions heading by <a
href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li>
<li>Update README.md by <a
href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li>Update CODEOWNERS for actions by <a
href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li>
<li>Update package dependencies by <a
href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
</ul>
<h2>v4.2.2</h2>
<ul>
<li><code>url-helper.ts</code> now leverages well-known environment
variables by <a href="https://github.com/jww3"><code>@jww3</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li>
<li>Expand unit test coverage for <code>isGhes</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li>
</ul>
<h2>v4.2.1</h2>
<ul>
<li>Check out other refs/* by commit if provided, fall back to ref by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li>
</ul>
<h2>v4.2.0</h2>
<ul>
<li>Add Ref and Commit outputs by <a
href="https://github.com/lucacome"><code>@lucacome</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li>
<li>Dependency updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a>- <a
href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>,
<a
href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li>
</ul>
<h2>v4.1.7</h2>
<ul>
<li>Bump the minor-npm-dependencies group across 1 directory with 4
updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li>
<li>Bump actions/checkout from 3 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li>
<li>Check out other refs/* by commit by <a
href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li>
<li>Pin actions/checkout's own workflows to a known, good, stable
version. by <a href="https://github.com/jww3"><code>@jww3</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li>
</ul>
<h2>v4.1.6</h2>
<ul>
<li>Check platform to set archive extension appropriately by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li>
</ul>
<h2>v4.1.5</h2>
<ul>
<li>Update NPM dependencies by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1703">actions/checkout#1703</a></li>
<li>Bump github/codeql-action from 2 to 3 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1694">actions/checkout#1694</a></li>
<li>Bump actions/setup-node from 1 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1696">actions/checkout#1696</a></li>
<li>Bump actions/upload-artifact from 2 to 4 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1695">actions/checkout#1695</a></li>
<li>README: Suggest <code>user.email</code> to be
<code>41898282+github-actions[bot]@users.noreply.github.com</code> by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1707">actions/checkout#1707</a></li>
</ul>
<h2>v4.1.4</h2>
<ul>
<li>Disable <code>extensions.worktreeConfig</code> when disabling
<code>sparse-checkout</code> by <a
href="https://github.com/jww3"><code>@jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1692">actions/checkout#1692</a></li>
<li>Add dependabot config by <a
href="https://github.com/cory-miller"><code>@cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1688">actions/checkout#1688</a></li>
<li>Bump the minor-actions-dependencies group with 2 updates by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1693">actions/checkout#1693</a></li>
<li>Bump word-wrap from 1.2.3 to 1.2.5 by <a
href="https://github.com/dependabot"><code>@dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1643">actions/checkout#1643</a></li>
</ul>
<h2>v4.1.3</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/actions/checkout/commit/08c6903cd8c0fde910a37f88322edcfb5dd907a8"><code>08c6903</code></a>
Prepare v5.0.0 release (<a
href="https://redirect.github.com/actions/checkout/issues/2238">#2238</a>)</li>
<li><a
href="https://github.com/actions/checkout/commit/9f265659d3bb64ab1440b03b12f4d47a24320917"><code>9f26565</code></a>
Update actions checkout to use node 24 (<a
href="https://redirect.github.com/actions/checkout/issues/2226">#2226</a>)</li>
<li>See full diff in <a
href="https://github.com/actions/checkout/compare/v4...v5">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Summary
Eliminate the `libc` dependency by simplifying the Linux runtime
directory fallback logic to use standard environment variables instead
of unsafe UID lookup.
## Type of Change
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
## What Changed?
- **Removed libc dependency**: Eliminated the unsafe `libc::getuid()`
call in the `runtime()` method
- **Unified Linux/macOS behavior**: Both platforms now use `$TMPDIR`
then `/tmp` fallback for runtime directories
- **Updated documentation**: Reflects the simplified fallback behavior
in method docs and README
- **Updated migration guide**: Documents the runtime directory behavior
change
- **Updated changelog**: Added entry for the libc dependency removal
## Why?
1. **Eliminate unsafe code**: The `libc::getuid()` call required unsafe
code that can be avoided
2. **Reduce dependencies**: Runtime directories are temporary by nature,
so using system temp directories is more appropriate
3. **Simplify implementation**: Unifying Linux and macOS behavior
reduces platform-specific complexity
4. **Better fallback strategy**: `$TMPDIR` and `/tmp` are more
universally available than constructing `/run/user/{uid}`
The original approach of constructing `/run/user/{uid}` was overly
complex for a fallback case - when `XDG_RUNTIME_DIR` is not set, using
the system's temporary directory is a more appropriate fallback.
## How Has This Been Tested?
- [x] Existing tests pass (updated to handle new behavior)
- [x] Manual testing performed on Linux, macOS, and Windows
- [x] Code follows style guidelines
- [x] Verified runtime directory resolution works correctly across
platforms
**Specific Testing:**
- Confirmed `XDG_RUNTIME_DIR` is still respected when set
- Verified fallback to `$TMPDIR` on Linux/macOS works correctly
- Tested fallback to `/tmp` when `$TMPDIR` is not set
- Ensured Windows behavior unchanged (`%TEMP%` fallback)
## Screenshots/Demo
N/A - This is an internal implementation change without user-visible
behavior changes (except for the specific fallback case).
## Related Issues
Part of the broader effort to simplify the crate's API and reduce
dependencies leading up to v0.2.0.
## Additional Notes
**Breaking Change Impact:**
This is technically a breaking change in behavior for Linux systems
where:
1. `XDG_RUNTIME_DIR` is not set, AND
2. The system doesn't have `$TMPDIR` set
In such cases, the runtime directory will now be `/tmp` instead of
`/run/user/{uid}`. However, this is an edge case since properly
configured Linux systems should have `XDG_RUNTIME_DIR` set.
**Dependency Impact:**
- Cargo.toml can now remove `libc = "1.0.0-alpha.1"` dependency
- Crate is now truly zero-dependency (only uses `std`)
- Binary size will be smaller due to no external dependencies
- Compilation will be faster with fewer dependencies to resolve
This change makes the crate more lightweight and eliminates all unsafe
code.
- Update README to reflect the removal of deprecated `*_dir()` methods
and the transition to `Option<PathBuf>` return types.
- Add migration guide to help users upgrade from 0.1.x to 0.2.0.
- Document dependency removals (`libc`, `eyre`) and simplified error
handling.
- Highlight `runtime()` fallback behavior changes for Linux.
- Ensure consistency in examples and method descriptions across all
documentation.
Replace Linux-specific UID lookup with standard temporary directory
fallback. On Linux, now uses $TMPDIR then /tmp instead of constructing
/run/user/{uid}, unifying behavior with macOS and eliminating the need
for unsafe libc calls.
- Remove unsafe libc::getuid() call
- Unify Linux and macOS runtime directory fallback logic
- Update documentation to reflect simplified behavior
- Enables removal of libc dependency entirely
Simplify API by changing all methods to return `Option<PathBuf>` instead
of `Result<PathBuf>`, removing the eyre dependency and aligning with
`std::env::home_dir()` conventions. This change also removes all
deprecated `*_dir()` method variants.
## Type of Change
- [x] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 📚 Documentation update
- [x] 🧹 Code cleanup or refactoring
- [x] 🔧 Build system or dependency changes
## What Changed?
- **API Simplification**: All public methods now return
`Option<PathBuf>` instead of `Result<PathBuf>`
- **Dependency Reduction**: Removed `eyre` dependency from public API
surface
- **Method Cleanup**: Removed all deprecated `*_dir()` method variants
(`desktop_dir()`, `documents_dir()`, etc.)
- **Home Directory Fix**: Updated `home()` method to use
`std::env::home_dir()` directly (was previously deprecated but has since
been undeprecated)
- **Error Handling**: Simplified error handling by returning `None`
instead of `Result::Err`
- **Helper Methods**: Updated internal helper methods to return
`Option<PathBuf>`
- **Documentation**: Comprehensive updates to README, CHANGELOG, and
migration guide
## Why?
1. **Consistency**: Aligns with `std::env::home_dir()` return type that
we now use internally
2. **Simplicity**: `Option<PathBuf>` is more appropriate for this use
case than `Result<PathBuf>`
3. **Reduced Dependencies**: Removes `eyre` from public API, reducing
dependency footprint
4. **Better Performance**: Eliminates overhead from error type
conversions
5. **Cleaner API**: Removes deprecated methods to provide a focused,
clean interface
## How Has This Been Tested?
- [x] Existing tests pass (updated to handle new return types)
- [x] New tests added for Option handling patterns
- [x] Manual testing performed across platforms
- [x] Code follows style guidelines
**Test Updates Made:**
- Updated all test assertions to handle `Option<PathBuf>` return type
- Added tests for `None` cases where directories cannot be resolved
- Verified XDG compliance still works correctly
- Confirmed platform-specific fallbacks function properly
## Screenshots/Demo
N/A - This is an API change without visual components
## Related Issues
Addresses the issue where `std::env::home_dir()` was initially avoided
due to deprecation, but has since been undeprecated. This change
modernizes the entire API to be consistent with standard library
conventions.
## Additional Notes
**Migration Support:**
- Created comprehensive migration guide (`MIGRATE_0.1.x-0.2.0.md`) with
before/after examples
- Updated README with new usage patterns and migration section
- Added detailed CHANGELOG entry documenting all breaking changes
**Breaking Changes:**
- All method signatures changed from `-> Result<PathBuf>` to `->
Option<PathBuf>`
- Removed 9 deprecated `*_dir()` methods
- Removed `eyre` from public API
This is a significant breaking change that requires a major version
bump, but provides a much cleaner and more idiomatic Rust API going
forward.
- Update README.md with new Option<PathBuf> API and migration guidance
- Add CHANGELOG.md entry documenting all breaking changes in v0.2.0
- Create MIGRATE_0.1.x-0.2.0.md with detailed migration examples
Documentation now reflects the simplified Option-based API and provides
clear upgrade paths for existing users.
This is a major breaking change that aligns the API with
std::env::home_dir() and simplifies error handling by removing the eyre
dependency.
Breaking changes:
- All public methods now return Option<PathBuf> instead of
Result<PathBuf>
- Removed eyre dependency from public API
- Removed all deprecated *_dir() method variants
- Methods return None instead of errors when directories cannot be
resolved
Benefits:
- Consistent with std::env::home_dir() return type
- Simpler error handling using Option pattern matching
- Reduced dependencies (no longer requires eyre)
- Cleaner API surface without deprecated methods
Migration guide:
- Replace `Dir::config_home()?` with `Dir::config_home().ok_or(...)?`
- Replace `match Dir::config_home() { Ok(path) => ... }` with `if let
Some(path) = Dir::config_home() { ... }`
- Update deprecated method calls: `desktop_dir()` → `desktop()`, etc.
Previously avoided `std::env::home_dir()` due to its deprecated status,
but it has since been undeprecated. This change replaces the complex
platform-specific logic with the standard library function, eliminating
unsafe code and significantly reducing complexity.
- Removes platform-specific conditional compilation
- Eliminates unsafe libc calls on Unix systems
- Removes manual environment variable handling on Windows
- Improves code maintainability and readability
* Collapse duplicated directory resolvers into a single `Dir` impl in
lib.rs with small helpers for platform defaults and XDG resolution.
* Add new, cleaner methods (`desktop`, `documents`, `downloads`,
`music`, `pictures`, `publicshare`, `runtime`, `templates`, `videos`)
and deprecate the old `*_dir` variants (kept for compatibility).
respect XDG spec absolute-path requirement
* Only honor XDG_* env vars when they are absolute paths; ignore
relative values per the XDG Base Directory Specification.
bump crate to 0.1.0; switch to `license = "MIT"`; enable clippy/rust
lints
* Add targeted clippy lints and Rust `dead_code`, `unsafe_code`, etc.
add coverage for XDG absolute/relative behavior and platform defaults