entkapp 5.7.0 → 5.7.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/README.md +1 -1
- package/bin/cli.js +1 -1
- package/bin/cli.mjs +15 -5
- package/package.json +1 -1
- package/src/healing/GitSandbox.mjs +24 -14
- package/src/index.mjs +1137 -64
- package/src/resolution/ConfigLoader.mjs +6 -5
|
@@ -4,7 +4,6 @@ import path from 'path';
|
|
|
4
4
|
/**
|
|
5
5
|
* ConfigLoader
|
|
6
6
|
* Loads and merges entkapp configuration from multiple sources:
|
|
7
|
-
* - entkapp.json (root config)
|
|
8
7
|
* - entkapp/config.json (project config)
|
|
9
8
|
* - entkapp.config.js / entkapp.config.mjs (JS config)
|
|
10
9
|
* - package.json "entkapp" key
|
|
@@ -31,15 +30,17 @@ export class ConfigLoader {
|
|
|
31
30
|
const jsonConfigPath = path.join(this.cwd, 'entkapp', 'config.json');
|
|
32
31
|
try {
|
|
33
32
|
const raw = await fs.readFile(jsonConfigPath, 'utf8');
|
|
33
|
+
// Strip comments from JSON (JSONC support)
|
|
34
34
|
const stripped = raw.replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
35
35
|
const parsed = JSON.parse(stripped);
|
|
36
36
|
config = this._merge(config, parsed);
|
|
37
37
|
} catch (e) {}
|
|
38
38
|
|
|
39
|
-
//
|
|
40
|
-
for (const configFile of ['entkapp.config.mjs', 'entkapp.config.
|
|
39
|
+
// 2. Try entkapp.config.js / entkapp.config.mjs
|
|
40
|
+
for (const configFile of ['entkapp.config.mjs', 'entkapp.config.mjs', 'entkapp.config.cjs']) {
|
|
41
41
|
let jsConfigPath = path.join(this.cwd, configFile);
|
|
42
42
|
try {
|
|
43
|
+
// FIX: Windows compatibility for dynamic imports
|
|
43
44
|
if (process.platform === 'win32') {
|
|
44
45
|
jsConfigPath = 'file://' + jsConfigPath.replace(/\\/g, '/');
|
|
45
46
|
}
|
|
@@ -52,7 +53,7 @@ export class ConfigLoader {
|
|
|
52
53
|
} catch (e) {}
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
//
|
|
56
|
+
// 3. Try package.json "entkapp" key
|
|
56
57
|
const pkgPath = path.join(this.cwd, 'package.json');
|
|
57
58
|
try {
|
|
58
59
|
const pkg = JSON.parse(await fs.readFile(pkgPath, 'utf8'));
|
|
@@ -61,7 +62,7 @@ export class ConfigLoader {
|
|
|
61
62
|
}
|
|
62
63
|
} catch (e) {}
|
|
63
64
|
|
|
64
|
-
//
|
|
65
|
+
// 4. Apply CLI overrides
|
|
65
66
|
config = this._merge(config, overrides);
|
|
66
67
|
|
|
67
68
|
return config;
|