refactor: migrated environment variable access from process.env to Bun.env across 71 files
- Migrated all environment variable access from Node.js `process.env` to Bun runtime `Bun.env` API across the entire codebase. - Updated 71 files including source code, tests, documentation, and configuration to use Bun's native environment variable API. - Added comprehensive environment variables documentation in `packages/coding-agent/docs/environment-variables.md` covering 100+ environment variables organized by category. - Updated CHANGELOG entries to reflect migration from `process.env` to `Bun.env` and environment variable prefix changes (PI_* vs OMP_*). - Maintained identical behavior and logic across all changes - only the environment variable access method was updated.
This commit is contained in:
@@ -7,9 +7,9 @@ const rustDir = path.join(repoRoot, "crates/pi-natives");
|
||||
const nativeDir = path.join(import.meta.dir, "../native");
|
||||
|
||||
const isDev = process.argv.includes("--dev");
|
||||
const crossTarget = process.env.CROSS_TARGET;
|
||||
const targetPlatform = process.env.TARGET_PLATFORM || process.platform;
|
||||
const targetArch = process.env.TARGET_ARCH || process.arch;
|
||||
const crossTarget = Bun.env.CROSS_TARGET;
|
||||
const targetPlatform = Bun.env.TARGET_PLATFORM || process.platform;
|
||||
const targetArch = Bun.env.TARGET_ARCH || process.arch;
|
||||
const isCrossCompile =
|
||||
Boolean(crossTarget) ||
|
||||
targetPlatform !== process.platform ||
|
||||
@@ -79,7 +79,7 @@ if (buildResult.exitCode !== 0) {
|
||||
|
||||
const profile = isDev ? "debug" : "release";
|
||||
const targetRoots = [
|
||||
process.env.CARGO_TARGET_DIR ? path.resolve(process.env.CARGO_TARGET_DIR) : undefined,
|
||||
Bun.env.CARGO_TARGET_DIR ? path.resolve(Bun.env.CARGO_TARGET_DIR) : undefined,
|
||||
path.join(repoRoot, "target"),
|
||||
path.join(rustDir, "target"),
|
||||
].filter((v): v is string => Boolean(v));
|
||||
|
||||
@@ -12,8 +12,8 @@ if (reset) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const targetPlatform = process.env.TARGET_PLATFORM || process.platform;
|
||||
const targetArch = process.env.TARGET_ARCH || process.arch;
|
||||
const targetPlatform = Bun.env.TARGET_PLATFORM || process.platform;
|
||||
const targetArch = Bun.env.TARGET_ARCH || process.arch;
|
||||
const platformTag = `${targetPlatform}-${targetArch}`;
|
||||
const addonFilename = `pi_natives.${platformTag}.node`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user