Skip to content

refactor: replace dotenvy with deno_dotenv#32263

Merged
Tango992 merged 5 commits intodenoland:mainfrom
Tango992:dotenv
Feb 23, 2026
Merged

refactor: replace dotenvy with deno_dotenv#32263
Tango992 merged 5 commits intodenoland:mainfrom
Tango992:dotenv

Conversation

@Tango992
Copy link
Copy Markdown
Contributor

@Tango992 Tango992 commented Feb 22, 2026

A follow up to #32183 so that we don't need to keep 2 dotenv parsers

@Tango992 Tango992 marked this pull request as draft February 22, 2026 12:00
@Tango992 Tango992 marked this pull request as ready for review February 22, 2026 14:13
@@ -1 +1 @@
ANOTHER_BAR
ANOTHER_${FOO}
Copy link
Copy Markdown
Contributor Author

@Tango992 Tango992 Feb 22, 2026

Choose a reason for hiding this comment

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

This is the related env file:

FOO=BAR
ANOTHER_FOO=ANOTHER_${FOO}
MULTILINE="First Line
Second Line"

Currently dotenvy automatically replaces ${FOO} with the value of FOO. Do we wan't to keep this behavior? We don't have this documented on our docs, and popular env parsers like npm:dotenv and Node.js env file implementation don't implement this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably ok if node.js doesn't do this.

Copy link
Copy Markdown
Contributor

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1 +1 @@
ANOTHER_BAR
ANOTHER_${FOO}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably ok if node.js doesn't do this.

@Tango992 Tango992 merged commit 43b1c85 into denoland:main Feb 23, 2026
111 checks passed
@Tango992 Tango992 deleted the dotenv branch February 23, 2026 02:01
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Mar 13, 2026
When dotenvy was replaced with deno_dotenv in denoland#32263, the parent
directory traversal behavior of `dotenvy::from_filename()` was lost.
This caused `--env-file` to no longer find .env files in parent
directories when running from a subdirectory.

Adds `find_env_file()` which walks up parent directories looking for
the named file, restoring the previous behavior.

Closes denoland#32683

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants