@oh-my-pi/pi-utils 18.1.12 → 18.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/src/env.ts +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.1.13] - 2026-09-07
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed `filterChildShellEnv` applying the omp process's own launch-environment provenance (the pre-dotenv `NODE_ENV` and launcher-owned names read from `/proc/self/environ`) to caller-supplied environment objects; launch provenance now only applies when filtering the live `process.env`/`Bun.env`, and an explicit env resolves its dotenv mode from its own `NODE_ENV`.
|
|
10
|
+
|
|
5
11
|
## [18.1.11] - 2026-09-05
|
|
6
12
|
|
|
7
13
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-utils",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.14",
|
|
4
4
|
"description": "Shared utilities for pi packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@oh-my-pi/pi-natives": "18.1.
|
|
57
|
+
"@oh-my-pi/pi-natives": "18.1.14"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/bun": "^1.3.14"
|
package/src/env.ts
CHANGED
|
@@ -112,9 +112,10 @@ export function filterChildShellEnv(
|
|
|
112
112
|
env: Record<string, string | undefined>,
|
|
113
113
|
cwd: string = process.cwd(),
|
|
114
114
|
): Record<string, string> {
|
|
115
|
+
const runtimeLaunchEnvValues = env === Bun.env || env === process.env ? launchEnvValues : undefined;
|
|
115
116
|
const result = filterProcessEnv(env);
|
|
116
117
|
const projectEnv = parseEnvFile(path.join(cwd, ".env"));
|
|
117
|
-
const launchNodeEnv =
|
|
118
|
+
const launchNodeEnv = runtimeLaunchEnvValues ? runtimeLaunchEnvValues.get("NODE_ENV") : env.NODE_ENV;
|
|
118
119
|
const nodeEnvName = `.env.${launchNodeEnv || "development"}`;
|
|
119
120
|
const modeEnv = parseEnvFile(path.join(cwd, nodeEnvName));
|
|
120
121
|
const localEnv = parseEnvFile(path.join(cwd, ".env.local"));
|
|
@@ -128,7 +129,7 @@ export function filterChildShellEnv(
|
|
|
128
129
|
};
|
|
129
130
|
let fallbackLaunchEnv: Record<string, string> | undefined;
|
|
130
131
|
let expandedFallbackLaunchEnv: Record<string, string> | undefined;
|
|
131
|
-
if (!
|
|
132
|
+
if (!runtimeLaunchEnvValues && nodeEnvName !== ".env.development") {
|
|
132
133
|
const fallbackModeEnv = parseEnvFile(path.join(cwd, ".env.development"));
|
|
133
134
|
const fallbackModeLocalEnv = parseEnvFile(path.join(cwd, ".env.development.local"));
|
|
134
135
|
const candidate = { ...projectEnv, ...fallbackModeEnv, ...localEnv, ...fallbackModeLocalEnv };
|
|
@@ -147,7 +148,7 @@ export function filterChildShellEnv(
|
|
|
147
148
|
}
|
|
148
149
|
const allLaunchEnv = fallbackLaunchEnv ? { ...launchEnv, ...fallbackLaunchEnv } : launchEnv;
|
|
149
150
|
for (const key in allLaunchEnv) {
|
|
150
|
-
const launchValue =
|
|
151
|
+
const launchValue = runtimeLaunchEnvValues?.get(key);
|
|
151
152
|
if (launchValue !== undefined) {
|
|
152
153
|
// Launcher-owned name: it keeps the launcher's own value. Bun overwrites
|
|
153
154
|
// an empty launcher value with the dotenv one, so restore the launcher
|
|
@@ -163,7 +164,7 @@ export function filterChildShellEnv(
|
|
|
163
164
|
}
|
|
164
165
|
continue;
|
|
165
166
|
}
|
|
166
|
-
if (
|
|
167
|
+
if (runtimeLaunchEnvValues || projectEnvNamesLoadedByOmp.has(key)) {
|
|
167
168
|
// Strong provenance: the launch environment is known and this name is
|
|
168
169
|
// absent from it, or OMP itself injected the value — either way it came
|
|
169
170
|
// from a project dotenv file, not the parent shell.
|