Skip to content

Add support for DOTFILES_PATH environment variable#5039

Closed
FezVrasta wants to merge 1 commit intobabel:masterfrom
FezVrasta:FezVrasta-dotfiles_path
Closed

Add support for DOTFILES_PATH environment variable#5039
FezVrasta wants to merge 1 commit intobabel:masterfrom
FezVrasta:FezVrasta-dotfiles_path

Conversation

@FezVrasta
Copy link

Q A
Patch: Bug Fix? no
Major: Breaking Change? no
Minor: New Feature? yes
Deprecations? no
Spec Compliancy? no
Tests Added/Pass? no
Fixed Tickets
License MIT
Doc PR
Dependency Changes

The purpose of this edit is to provide a commonly accepted environment variable used by the JavaScript/npm scripts where to look for their dotfiles (config files).

This is an attempt to resolve the problem with the high number of "dotfiles" stored in the root directory of the projects.

I don't expect this PR to be merged, but I wanted to raise attention to the problem and see if you have feedbacks.

The purpose of this edit is to provide a commonly accepted environment variable used by the JavaScript/npm scripts where to look for their dotfiles (config files).

This is an attempt to resolve the problem with the high number of "dotfiles" stored in the root directory of the projects.
@codecov-io
Copy link

codecov-io commented Dec 25, 2016

Current coverage is 89.15% (diff: 100%)

Merging #5039 into master will increase coverage by <.01%

@@             master      #5039   diff @@
==========================================
  Files           203        203          
  Lines          9821       9822     +1   
  Methods        1072       1072          
  Messages          0          0          
  Branches       2614       2615     +1   
==========================================
+ Hits           8756       8757     +1   
  Misses         1065       1065          
  Partials          0          0          

Powered by Codecov. Last update b2e6926...ea1e6d1

@xtuc
Copy link
Member

xtuc commented Dec 25, 2016

high number of "dotfiles" stored in the root directory of the projects

I agree, but in my case I don't care because they aren't visibile by default (Vim or whatever).

if you setup a custom directory to store all of your dotfiles, wouldn't be the same issue? Could you tell use more about your use case.

@FezVrasta
Copy link
Author

FezVrasta commented Dec 25, 2016

So, if I have a config directory, I can put all the config files there, and keep the root of the directory clean and easy to read.

If I have everything in the root directory, there will be a lot of configuration files put there, along with the structure of the repository and its folders (with maybe a config directory with all the configurations like webpack, rollup etc)

Example:
https://github.com/ReactTraining/react-router

As you can see, they have 8 config files in the root folder, along with the README, CONTRIBUTING etc. It would be much easier to read if they could put all the config files in a given folder, and leave in the root directory just the folders plus the various .md files (that help the onboarding of the new contributors)

Edit in reply to your edit:
For sure, dotfiles are hidden by Finder, Nautilus and major *unix file explorers, but most of the IDEs, GitHub, and text editors will (correctly) show them. I'm not sure about you, but I rarely open a project folder with Finder, I usually open it directly with Atom (and, first, I see the repository on GitHub)

@xtuc
Copy link
Member

xtuc commented Dec 25, 2016

It would be awesome to have a such common pattern!

There are some project which aren't using "dotfiles". I think we could extend this to CONFIG_PATH.

/cc @hzoo What do you think about this for Babel?

@xtuc
Copy link
Member

xtuc commented Dec 28, 2016

@FezVrasta I looked at your discussion for this in eslint. Do you still want it for Babel or can I close this?

I would suggest you to store your Babel configuration in your package.json.

@FezVrasta
Copy link
Author

FezVrasta commented Dec 28, 2016

I still hope to get something like what I propose in the most common libraries.

If not an environment variable, maybe a variable inside the package.json that points to the folder where the config is stored. Or something similar.

I don't see package.json the right place where to put this kind of configuration, and the reasons of the maintainer of ESlint don't seem valid to me. One can't just reject to improve the way the configuration is managed simply because it would be too difficult to do.

@xtuc
Copy link
Member

xtuc commented Dec 28, 2016

Here is the documentation: https://babeljs.io/docs/usage/babelrc/#use-via-package-json

@FezVrasta
Copy link
Author

FezVrasta commented Dec 28, 2016

@xtuc yup I'm aware of this option, I just don't think that it makes sense to use package.json (used to configure the package dependencies) as a "multi purpose / I do all the things" file.

Especially because as you can see, adding a behavior like the one I'm suggesting is just few lines of code.

@hzoo
Copy link
Member

hzoo commented Jun 27, 2017

I think we are going to defer doing this - not a common thing to do at the moment, but thanks for the PR!

@hzoo hzoo closed this Jun 27, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants