Closed mixmix closed 3 months ago
@vitropy we're making another pass at this XDG thing.
There's a question we need to answer which is: "We have a good pattern for Linux... but what should it be for OSX, Windows?"
Do you know about where we're putting files for other projects on OSX/Windows? It would be good to get some alignment across teams
The library env-paths suggests those locations should be:
$XDG_CONFIG_HOME/entropy-cryptography/entropy-cli.json
~/.config/entropy-cryptography/entropy-cli.json
(default)~/Library/Preferences/entropy-cryptography/entropy-cli.json
%APPDATA%\entropy-cryptography\Config\entropy-cli.json
C:\Users\USERNAME\AppData\Roaming\entropy-cryptography\Config\entropy-cli.json
(default)@johnnymatthews raised a good question which was "Isn't having different location on different OS gonna be bad DX?". I've used these standards in another project, and he's not wrong. But ... standards? We need to decide which is the higher priority - standards, or cross-platform DX :sob:
@vitropy we're making another pass at this XDG thing.
There's a question we need to answer which is: "We have a good pattern for Linux... but what should it be for OSX, Windows?"
Do you know about where we're putting files for other projects on OSX/Windows? It would be good to get some alignment across teams
What we do now is:
What I think we should do at a minimum is:
This ☝🏻is also what my original PR did.
That said, I personally don't agree with @johnnymatthews that it's an especially bad developer experience to use what env-paths
suggests for paths and have them be different for each major OS. After all, users of each operating system typically know what to expect for their OS. I also don't think it's an especially bad DX to just "KISS it" and use XDG everywhere because this is so plainly a Unix-y project.
If I were in your shoes and it were last week I'd have just merged the original PR as proposed and not bothered with any additional complexity. But today I'd stick to env-paths
's choices. I didn't originally include anything like env-paths
because I didn't want to deal with all this complexity at the time. But since that objection is now moot, I say do the "correct" thing and build your tool to be the "best" it can be.
In the interest of not bike shedding this into oblivion, let's go with the proposal from @vitropy.
It makes the job of documenting stuff marginally more difficult, but it's not the end of the world. MacOS is already a pain anyway.
Thanks for your input @vitropy @johnnymatthews
Is there somewhere we should document this choice, so that we can help any Entropy projects align with this?
Notably Vi, I think you have scripts which use XDG standards, which would mean your scripts would put files in a different location now that this PR with env-paths
. Not a huge deal but it would nice to be together and aligned with all our tools.
we need to write tests for that aye @rh0delta
TODO: merge this when https://github.com/entropyxyz/cli/pull/108 is ready
merge squash is so annoying for branch which branch off branches. every time it just generates merge conflicts because now the history has diverged. Probably need to discuss this as a team
@rh0delta can you re-review, and if good to go, merge? <3
Depends on : https://github.com/entropyxyz/cli/pull/108
This PR moves the config to new location
TODO: