@applitools/eyes-results 0.2.1 → 0.2.2
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 +7 -0
- package/dist/lib/env.js +6 -8
- package/package.json +1 -1
- package/types/lib/env.d.ts +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.2](https://github.com/Applitools-Dev/sdk/compare/js/eyes-results@0.2.1...js/eyes-results@0.2.2) (2026-08-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* discover the project .env so the family read/write keys resolve | AD-15678 ([#4131](https://github.com/Applitools-Dev/sdk/issues/4131)) ([316f39f](https://github.com/Applitools-Dev/sdk/commit/316f39fd15fd516b3d266b8aa8deccddfabd0921))
|
|
9
|
+
|
|
3
10
|
## [0.2.1](https://github.com/Applitools-Dev/sdk/compare/js/eyes-results@0.2.0...js/eyes-results@0.2.1) (2026-08-24)
|
|
4
11
|
|
|
5
12
|
|
package/dist/lib/env.js
CHANGED
|
@@ -5,22 +5,20 @@ export const defaultLoadEnvDeps = {
|
|
|
5
5
|
existsSync: fs.existsSync,
|
|
6
6
|
configDotenv: dotenv.config,
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Walks up from `startDir` (default: the current working directory) looking for a `.env`
|
|
10
|
-
* file, loading the first one found via `dotenv`. Mirrors the behavior every skill's own
|
|
11
|
-
* `main.ts` used to inline directly.
|
|
12
|
-
*/
|
|
13
8
|
export function loadEnvFromCwd(startDir = process.cwd(), deps = defaultLoadEnvDeps) {
|
|
14
9
|
let dir = startDir;
|
|
15
10
|
while (true) {
|
|
16
11
|
const envPath = path.join(dir, '.env');
|
|
17
12
|
if (deps.existsSync(envPath)) {
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const preset = new Set(Object.keys(process.env));
|
|
14
|
+
const result = deps.configDotenv({ path: envPath });
|
|
15
|
+
const parsed = result?.parsed ?? {};
|
|
16
|
+
const applied = Object.keys(parsed).filter(name => !preset.has(name));
|
|
17
|
+
return { path: envPath, applied, parsed };
|
|
20
18
|
}
|
|
21
19
|
const parent = path.dirname(dir);
|
|
22
20
|
if (parent === dir)
|
|
23
|
-
return;
|
|
21
|
+
return undefined;
|
|
24
22
|
dir = parent;
|
|
25
23
|
}
|
|
26
24
|
}
|
package/package.json
CHANGED
package/types/lib/env.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export interface LoadEnvDeps {
|
|
|
6
6
|
}) => unknown;
|
|
7
7
|
}
|
|
8
8
|
export declare const defaultLoadEnvDeps: LoadEnvDeps;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare function loadEnvFromCwd(startDir?: string, deps?: LoadEnvDeps):
|
|
9
|
+
export interface LoadedEnv {
|
|
10
|
+
path: string;
|
|
11
|
+
applied: string[];
|
|
12
|
+
parsed: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export declare function loadEnvFromCwd(startDir?: string, deps?: LoadEnvDeps): LoadedEnv | undefined;
|