Repository navigation
1.2.0
@cross/dir 1.2.0
Linux: user directories now work out of the box
download, document, audio, picture, video, desktop, public and template previously only resolved if
their XDG_*_DIR environment variable was set, which most desktop sessions don't do. They are now also read from
the xdg-user-dirs file $XDG_CONFIG_HOME/user-dirs.dirs
(default ~/.config/user-dirs.dirs). Environment variables still take precedence.
Entries pointing to the home directory itself (e.g. XDG_DESKTOP_DIR="$HOME/") are treated as disabled, per the
xdg-user-dirs spec, and still throw.
New directory types
projects(Linux): resolvesXDG_PROJECTS_DIR, added in xdg-user-dirs 0.19.state(all platforms): for persistent application state such as logs and history.- Linux:
$XDG_STATE_HOME, falling back to~/.local/state - macOS:
~/Library/Application Support - Windows:
%LOCALAPPDATA%
- Linux:
Fixes
- Windows: the PowerShell fallback for
config(dir("config", true)withAPPDATAunset) now returns the
roamingApplicationDatafolder instead ofLocalApplicationData, consistent withAPPDATAanddata. - Windows:
tmpnow falls back toTEMPwhenTMPis unset.
Internal
- Added a test suite (
deno task test), including a platform smoke test that resolves every directory type. - Removed the unused
@cross/deepmergedependency. - Fixed the
check-depstask flag (--ignore-unused→--allow-unused) sodeno task checkpasses. - README: added error handling and development sections, and fixed the usage example's missing
DirectoryTypesimport.
Upgrade impact: nothing needs to change for most people. The one exception is a Windows call to dir("config", true) on a machine where APPDATA isn't set. Before, that returned ...\AppData\Local; now it returns ...\AppData\Roaming. That's rare, since Windows normally sets APPDATA, but anyone who relied on the old path would stop finding files they stored there.