refactor: Centralize app path configuration and separate dev + prod paths for most configs #37
No reviewers
Labels
No labels
bug
chore
CI/CD
Code Cleanup
duplicate
DX
enhancement
help wanted
invalid
packaging
question
UI
UX
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#38 refactor: Create application container
waycasthq/waycast
Reference
waycasthq/waycast!37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/separate-dev-and-prod-sockets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #35
An unintended consequence of the last refactor is that the way we acquired the lock to determine whether to show the UI or start the daemon would conflict during development if you were already running waycast on your machine.
This exposed a deeper issue with the design where paths for config files and such were resolved all over the place, instead of resolved once, which made it harder to separate dev and prod builds.
This PR addresses this in the following ways:
AppConfigandAppDirectoriesincore/config.rs. These are containers that hold the directories the app can use, allowing us to separate default and development paths.WaycastSocketServerandWaycastSocketListenerabstractions. This cleans up usage. They also take a path as an argument meaning we can resolve it at the top level.There will be a future ongoing effort to centralize more of the config resolution at the top level, and trickle down the necessary parts downwards to the pieces that needed. That already started on this PR by resolving the database path at the
AppConfiglevel and passing it to the daemon from there, as well as passing it to the UI instead of having it resolve it on its own.LGTM 💯