Skip to content
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

BREAKING(dotenv): remove defaultsPath option from load[Sync]() #5451

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jul 16, 2024

What's changed

The defaultsPath option has been removed from @std/dotenv/load.

Motivation

See details in #5464

Migration

To migrate, if you want to define default values for environment variables, do so in-code.

import "@std/dotenv/load";

+ if (!Deno.env.has("FOO")) {
+   Deno.env.set("FOO", "bar");
+ }

Related

Closes #5464

@iuioiua iuioiua marked this pull request as ready for review July 17, 2024 07:11
@iuioiua iuioiua requested a review from kt3k as a code owner July 17, 2024 07:11
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.32%. Comparing base (2759686) to head (8e3e718).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5451      +/-   ##
==========================================
- Coverage   96.33%   96.32%   -0.01%     
==========================================
  Files         463      463              
  Lines       37669    37651      -18     
  Branches     5555     5543      -12     
==========================================
- Hits        36289    36268      -21     
- Misses       1338     1341       +3     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly to #5450, this handling of .env.default file seems opinionated, and it doesn't seem very common in the ecosystem.

I think it's reasonable to remove this feature from std/dotenv.

@iuioiua iuioiua merged commit ff60cef into main Jul 19, 2024
17 checks passed
@iuioiua iuioiua deleted the dotenv-remove-defaultPath branch July 19, 2024 04:08
@PutziSan
Copy link

Noticed a small typo in the PR description: it states defaultPath was removed, but the actual name is defaultsPath. Just noting here in case anyone else searches for this change in the future.

@kt3k kt3k changed the title BREAKING(dotenv): remove defaultPath option from load[Sync]() BREAKING(dotenv): remove defaultsPath option from load[Sync]() Oct 31, 2024
@kt3k
Copy link
Member

kt3k commented Oct 31, 2024

Thanks! Updated the PR title and description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proposal: remove defaultPath from @std/dotenv/load
3 participants