Skip to content

Adds .env support#280

Merged
arcanis merged 4 commits intomainfrom
mael/env
Apr 13, 2026
Merged

Adds .env support#280
arcanis merged 4 commits intomainfrom
mael/env

Conversation

@arcanis
Copy link
Copy Markdown
Member

@arcanis arcanis commented Apr 13, 2026

Add support for autoloading .env files as per the rules in Berry.


Note

Medium Risk
Introduces new startup-time behavior that reads .env files, mutates the process environment, and injects variables into all spawned subprocesses, which can affect runtime behavior and error modes if files are missing or malformed.

Overview
Adds support for auto-loading and injecting environment variables from project .env files (defaulting to optional .env.yarn?) into any subprocess spawned by Yarn.

Configuration loading is refactored into a multi-phase flow: pre-read rc files, minimally parse injectEnvironmentFiles, load/parse env files (with new error cases), temporarily set variables in the process environment to enable ${VAR} interpolation during config deserialization, and store the loaded env map on Configuration for later injection.

Updates schema to include injectEnvironmentFiles (and initScope), adds the dotenvy dependency, injects config.env_files into ScriptEnvironment::with_project, and tweaks the dotenv acceptance test to quote an interpolated value.

Reviewed by Cursor Bugbot for commit b1ff469. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

⏱️ Benchmark Results

gatsby install-full-cold

Metric Base Head Difference
Mean 2.441s 2.443s +0.09% ⚠️
Median 2.444s 2.441s -0.10% ✅
Min 2.371s 2.377s
Max 2.498s 2.513s
Std Dev 0.028s 0.034s
📊 Raw benchmark data (gatsby install-full-cold)

Base times: 2.429s, 2.411s, 2.425s, 2.449s, 2.461s, 2.460s, 2.417s, 2.440s, 2.435s, 2.485s, 2.495s, 2.457s, 2.424s, 2.477s, 2.419s, 2.412s, 2.371s, 2.429s, 2.498s, 2.413s, 2.466s, 2.448s, 2.444s, 2.445s, 2.443s, 2.447s, 2.450s, 2.457s, 2.389s, 2.444s

Head times: 2.496s, 2.427s, 2.443s, 2.433s, 2.426s, 2.427s, 2.377s, 2.441s, 2.451s, 2.513s, 2.472s, 2.404s, 2.491s, 2.431s, 2.431s, 2.409s, 2.433s, 2.396s, 2.412s, 2.451s, 2.462s, 2.460s, 2.441s, 2.479s, 2.406s, 2.442s, 2.461s, 2.399s, 2.504s, 2.484s


gatsby install-cache-and-lock (warm, with lockfile)

Metric Base Head Difference
Mean 0.359s 0.366s +2.07% ⚠️
Median 0.357s 0.367s +2.87% ⚠️
Min 0.349s 0.356s
Max 0.399s 0.375s
Std Dev 0.010s 0.005s
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))

Base times: 0.370s, 0.359s, 0.368s, 0.354s, 0.358s, 0.364s, 0.362s, 0.371s, 0.371s, 0.357s, 0.351s, 0.351s, 0.356s, 0.356s, 0.359s, 0.360s, 0.399s, 0.350s, 0.350s, 0.351s, 0.357s, 0.352s, 0.359s, 0.351s, 0.354s, 0.351s, 0.357s, 0.354s, 0.357s, 0.349s

Head times: 0.366s, 0.372s, 0.367s, 0.359s, 0.357s, 0.364s, 0.361s, 0.367s, 0.365s, 0.363s, 0.367s, 0.356s, 0.367s, 0.375s, 0.368s, 0.361s, 0.367s, 0.364s, 0.373s, 0.364s, 0.371s, 0.369s, 0.369s, 0.362s, 0.364s, 0.368s, 0.364s, 0.369s, 0.369s, 0.375s

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0aa5b47. Configure here.

@arcanis arcanis merged commit 2d2db3f into main Apr 13, 2026
19 checks passed
@arcanis arcanis deleted the mael/env branch April 13, 2026 21:08
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.

1 participant