Remove dotenv dependency#704
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #704 +/- ##
==========================================
- Coverage 93.05% 93.04% -0.01%
==========================================
Files 86 86
Lines 1396 1394 -2
Branches 216 216
==========================================
- Hits 1299 1297 -2
Misses 92 92
Partials 5 5 ☔ View full report in Codecov by Sentry. |
| // TODO: reconsider use of '.env.test' if or when | ||
| // https://github.com/ThomWright/postgres-migrations/pull/93 gets merged/fixed. | ||
| dotenv.config({ path: '.env.test' }); |
There was a problem hiding this comment.
Oh - this seems relevant! Currently my .env.test is pointing at a different database than my .env. Is that still necessary? In #611 we switched to a fork of postgres-migrations which fixes the schema issue, and it looks like that PR starts making use of the new functionality. Is it safe to point the tests at the same database as my local dev instance?
There was a problem hiding this comment.
@jasonaowen yes indeed you can use the local dev instance!
The dotenv package is primarily useful for helping developers manage their local environment variables (in deployment contexts we populate environment variables directly via our provisioning processes). There are other tools that developers can use for managing their local environment, and instead of having that live in the code base we should have our devs use whatever tool they find most convenient. Issue #640 Remove dotenv
a3a246b to
3f0e8c8
Compare
reefdog
left a comment
There was a problem hiding this comment.
This is the worst code I have ever seen in my life. Approved.
|
For some reason this merge broke the automated deployment to the test environment yesterday. Ah, |
|
I thought it would be as simple as removing |
|
@bickelj Great catch! Re: I know Dan uses direnv to load these automatically, and I intend to set it up as well. You can do whatever you'd like locally. |
This PR removes dotenv from the repository. Developers who don't want to manually source their
.envfile might consider populating required variables themselves using a tool like direnv.To test:
source .env)npm inpm run testnpm run start:devResolves #640