devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Rename the file to `.devbox.json`

Open skorokithakis opened this issue 3 years ago • 3 comments
trafficstars

This is a bit of a personal choice and OCD, but I don't like files scattered about the root of my repo. The situation would be a bit better if the file were hidden, so I'd like to propose that the file be renamed to .devbox.json.

skorokithakis avatar Aug 27 '22 15:08 skorokithakis

@skorokithakis Definitely understand the perspective of not wanting to pollute the root.

I'm unsure whether to hide the file by default for everyone: I see it analogous to package.json in yarn, and think some people will want to edit devbox.json manually – and I believe that's aided by ensuring the file is discoverable.

That said, how would you feel if we looked for both devbox.json and .devbox.json, so in the event you do want to hide it, you can rename it to the hidden version and everything would still work?

Another option is to let you specify the location of the file via a flag: devbox shell --config=my/dir/.devbox.json but that would mean you have to pass that flag every time which, depending on your use-case, might get annoying.

loreto avatar Aug 28 '22 12:08 loreto

Yeah, understandable. I agree that the flag would be annoying, I think looking for both files would be excellent. It would mean that every tool would have to look for the filename twice, but I think that's a small inconvenience for the ability to hide the file.

I agree that it's analogous to package.json or other files, but I don't like seeing those in the root either :stuck_out_tongue:

skorokithakis avatar Aug 28 '22 12:08 skorokithakis

I see adding the flag as the better long-term solution, as it would add support for a number of different use cases.

It seems the devbox.json is intended to be a replacement for a Dockerfile when building containers with devbox. I work in a couple of projects that have separate Dockerfiles for dev and production images (i.e., with and without debugging tools) so the --config flag would be crucial to adopting devbox there.

Having to specify it every time wouldn't be a huge concern in my case since there's likely already a shell script for setting up the local dev environment or the containers are being built in CI, in both situations the flag is codified.

morey-tech avatar Sep 05 '22 17:09 morey-tech

--config flag was added in a previous PR, but as of right now we are not planning to allow the renaming of devbox.json

Lagoja avatar Jan 26 '23 00:01 Lagoja