Commit Graph

3 Commits

Author SHA1 Message Date
Claude Bot
794073d62f Disable environment variable expansion in process.loadEnvFile
- Change Parser.parse expand parameter from true to false
- Update test to verify that variable expansion is disabled
- Variables like $VAR and ${VAR} are now treated as literal strings
- All tests still pass (7/7)

This ensures process.loadEnvFile behaves as a simple key-value parser
without performing variable substitution.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 03:58:19 +00:00
autofix-ci[bot]
082d9d61bf [autofix.ci] apply automated fixes 2025-08-28 03:52:07 +00:00
Claude Bot
8391ea10e3 Implement process.loadEnvFile for Node.js compatibility
Add process.loadEnvFile() method that loads environment variables from .env files
and returns them as a JavaScript object.

Features:
- Loads and parses .env files with support for:
  - Basic key=value pairs
  - Quoted strings (single and double quotes)
  - Multiline values
  - Variable expansion
  - Export statements
  - Comments and empty lines
- Returns parsed variables as a JavaScript object
- Proper error handling for invalid files or arguments
- Memory-safe implementation using VM allocator

Implementation:
- Added jsFunctionProcessLoadEnvFile to BunProcess.cpp function table
- Implemented parsing logic in src/env_loader.zig using existing env parser
- Added comprehensive test suite covering all supported features
- All tests pass (7/7)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-28 03:50:27 +00:00