feat: support $XDG_CONFIG_HOME for user config directory#352
feat: support $XDG_CONFIG_HOME for user config directory#352theoephraim merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 585ce62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
varlock-website | 585ce62 | Commit Preview URL Branch Preview URL |
Mar 12 2026, 01:57 AM |
philmillman
left a comment
There was a problem hiding this comment.
it probably doesn't hurt to add a test case for the 3 possible cases here:
- XDG
- new file
- existing file
|
@copilot - lets check how the plugin cache interacts with this. Specifically in the case where the user has no home folder, like in docker. Its ok if the config isnt there because we can skip telemetry, but the plugin cache needs to be written somewhere. It could be in the current folder, or in /tmp - although within docker the user may need to copy those files to another layer. Figure out what makes the most sense for this docker-with-no-home-folder case |
|
@theoephraim I've opened a new pull request, #375, to work on those changes. Once the pull request is ready, I'll request review from you. |
27c57fd to
585ce62
Compare
Closes #348
Adds support for the XDG Base Directory Specification for the user-level varlock config directory.
Resolution order
$XDG_CONFIG_HOMEis set →$XDG_CONFIG_HOME/varlock~/.varlockexists →~/.varlock(backwards compatibility)~/.config/varlock(XDG default)Changes
packages/varlock/src/lib/user-config-dir.ts— shared utility for resolving the user config dirtelemetry.ts,telemetry.command.ts,plugins.ts— use the new utility instead of hardcoded~/.varlockinstall.sh— mirrors the same XDG resolution logic in shelllogin.command.ts— updated TODO comments