-
-
Notifications
You must be signed in to change notification settings - Fork 360
support custom dotenv path #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
0d5e13e
to
7cdab3a
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@wzrdtales have you had a chance to look at this PR? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@wzrdtales any thoughts? |
I wouldn't like to introduce this dependency to do that. Maybe via rc configs + a command line param. |
Thanks for the reply. I'm not sure what you mean by "Maybe via rc configs + a command line param." Could you elaborate? Or were you thinking you'd provide an alternate implementation? I don't understand enough from that to revise this PR, and I still think monorepo support seems pretty important. Is there a reason you're hesitant to introduce the |
Yes, the reason is, I don't want 1 trillion ways to configure db-migrate. I added already rc https://www.npmjs.com/package/rc to cover the need of dynamic environmental configuration. So rc itself covers pretty much everything dotenv covers and more. But dotenv has been there for long and has some standing in the developer community, which is the only reason beneath a breaking change, that I did not removed it. So if there is a custom option to enable these rather get this via the already existing integrated rc module, see the modules docs for that. |
rc configs are by the way the oldest standard for user configs in the unix universe, so you probably already now how to handle it :) |
So, are you proposing that a monorepo setup not use .dotenv, but rather use an .rc file? Or are you saying that we should use an .rc file to config .env? |
both is a valid answer. if there is a need to configure an option for .env files do it via a command line param + from the rc configs. |
7cdab3a
to
d03f0b6
Compare
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
Signed-off-by: Jared Henderson <[email protected]>
d03f0b6
to
aef82c3
Compare
@wzrdtales updated, per your recommendation. Now you can do something like:
or put it in a |
Whoops, my example should have read:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@wzrdtales did you have a chance to look at the PR? I think I did what you asked. |
Went under the radar, I'm completely fine with this |
When I pass this argument in version |
Fixes #517.
Uses
pkg-conf
to allow this sort of thing in thepackage.json
:The above example allows for usage in a typical monorepo setup, which has packages in
<root>/packages/*
and typically a single.env
file in the monorepo root.I didn't add any tests because I was a bit intimidated by the tests in
api_test.js
-- Lab is not a framework I'm familiar with at all, and the complexity of the setup/mocking/spy etc. was sort of formidable. But the change here is really straightforward, and I think would help a lot of folks.