chore: add .envrc so direnv loads .env.local on cd#2456
Conversation
direnv reads .env.local on entry, which surfaces PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN (and any other locals) into the shell before bun reads bunfig.toml — removing the manual `export ... && bun install` two-step for fresh checkouts. No secrets in this file; .env.local is already gitignored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesEnvironment Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a direnv configuration so repository-local environment variables from .env.local are automatically exported when entering the repo, supporting workflows where tooling needs env vars present at process startup (e.g., Bun config resolution).
Changes:
- Add
.envrcwithdotenv_if_exists .env.localto load.env.localvia direnv oncd.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1 @@ | |||
| dotenv_if_exists .env.local | |||
Summary
.envrc(dotenv_if_exists .env.local) so direnv auto-exports the contents of.env.localwhenever youcdinto the repo.export PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN=... && bun installtwo-step thatconfigure-deps.tscurrently nudges you toward — the token is already in.env.localfor runtime, and direnv promotes it into the parent shell before bun readsbunfig.toml.Why
bunfig.tomlresolves\$PACKRAT_NATIVEWIND_UI_GITHUB_TOKENat bun process startup, before the preinstall hook runs, so the env must be present in the parent shell..env.localalone can't satisfy that. direnv fills the gap cleanly without per-shell exports.No secrets
.envrcitself contains no secrets — just the directive..env.localis already in.gitignore.Test plan
direnv allowin the repo root.cdout and back in; direnv printsloading ~/Code/PackRat/.envrcandexport +PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN.bun installsucceeds with no manual export.🤖 Generated with Claude Code
Summary by CodeRabbit