e2e-ai 1.2.0 → 1.3.0
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/README.md +241 -16
- package/agents/feature-analyzer-agent.md +81 -0
- package/agents/scenario-planner-agent.md +68 -0
- package/dist/cli-6c0wsk32.js +165 -0
- package/dist/cli-cqabyzv3.js +64 -0
- package/dist/cli-fgp618yt.js +13610 -0
- package/dist/cli.js +3892 -3
- package/dist/config/schema.js +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp.js +3 -3
- package/package.json +2 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
E2eAiConfigSchema
|
|
3
|
+
} from "./cli-fgp618yt.js";
|
|
4
|
+
|
|
5
|
+
// src/config/loader.ts
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { dirname, join, resolve } from "node:path";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
var CONFIG_FILENAMES = ["e2e-ai.config.ts", "e2e-ai.config.js", "e2e-ai.config.mjs"];
|
|
10
|
+
var cachedConfig = null;
|
|
11
|
+
var cachedProjectRoot = null;
|
|
12
|
+
function findConfigDir(startDir) {
|
|
13
|
+
let dir = resolve(startDir);
|
|
14
|
+
const root = dirname(dir) === dir ? dir : undefined;
|
|
15
|
+
while (true) {
|
|
16
|
+
for (const name of CONFIG_FILENAMES) {
|
|
17
|
+
if (existsSync(join(dir, name))) {
|
|
18
|
+
return dir;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const parent = dirname(dir);
|
|
22
|
+
if (parent === dir || dir === root)
|
|
23
|
+
return null;
|
|
24
|
+
dir = parent;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getProjectRoot() {
|
|
28
|
+
if (cachedProjectRoot)
|
|
29
|
+
return cachedProjectRoot;
|
|
30
|
+
const found = findConfigDir(process.cwd());
|
|
31
|
+
cachedProjectRoot = found ?? process.cwd();
|
|
32
|
+
return cachedProjectRoot;
|
|
33
|
+
}
|
|
34
|
+
function getPackageRoot() {
|
|
35
|
+
let dir = import.meta.dirname;
|
|
36
|
+
while (!existsSync(join(dir, "package.json"))) {
|
|
37
|
+
const parent = dirname(dir);
|
|
38
|
+
if (parent === dir)
|
|
39
|
+
return dir;
|
|
40
|
+
dir = parent;
|
|
41
|
+
}
|
|
42
|
+
return dir;
|
|
43
|
+
}
|
|
44
|
+
async function loadConfig() {
|
|
45
|
+
if (cachedConfig)
|
|
46
|
+
return cachedConfig;
|
|
47
|
+
const projectRoot = getProjectRoot();
|
|
48
|
+
let userConfig = {};
|
|
49
|
+
for (const name of CONFIG_FILENAMES) {
|
|
50
|
+
const configPath = join(projectRoot, name);
|
|
51
|
+
if (existsSync(configPath)) {
|
|
52
|
+
try {
|
|
53
|
+
const fileUrl = pathToFileURL(configPath).href;
|
|
54
|
+
const mod = await import(fileUrl);
|
|
55
|
+
userConfig = mod.default ?? mod;
|
|
56
|
+
break;
|
|
57
|
+
} catch {}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
cachedConfig = E2eAiConfigSchema.parse(userConfig);
|
|
61
|
+
return cachedConfig;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { getProjectRoot, getPackageRoot, loadConfig };
|