aios-core 4.4.2 → 4.4.4
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/.aios-core/core/doctor/checks/npm-packages.js +53 -10
- package/.aios-core/data/entity-registry.yaml +863 -785
- package/.aios-core/development/scripts/code-quality-improver.js +29 -12
- package/.aios-core/development/scripts/refactoring-suggester.js +15 -6
- package/.aios-core/install-manifest.yaml +12 -12
- package/.aios-core/package.json +9 -5
- package/README.md +3 -1
- package/bin/utils/validate-publish.js +26 -3
- package/package.json +1 -1
- package/packages/installer/src/installer/aios-core-installer.js +4 -1
- package/packages/installer/src/wizard/i18n.js +3 -0
- package/packages/installer/src/wizard/index.js +36 -21
- package/packages/installer/src/wizard/pro-setup.js +79 -10
- package/packages/installer/tests/unit/doctor/doctor-checks.test.js +1 -1
- package/scripts/validate-aios-core-deps.js +161 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Doctor Check: npm Packages
|
|
3
3
|
*
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates:
|
|
5
|
+
* 1. node_modules/ exists in project root (quick sanity check)
|
|
6
|
+
* 2. (INS-4.12) .aios-core/node_modules/ exists and contains all declared deps
|
|
5
7
|
*
|
|
6
8
|
* @module aios-core/doctor/checks/npm-packages
|
|
7
|
-
* @story INS-4.1
|
|
9
|
+
* @story INS-4.1, INS-4.12
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
const path = require('path');
|
|
@@ -14,21 +16,62 @@ const name = 'npm-packages';
|
|
|
14
16
|
|
|
15
17
|
async function run(context) {
|
|
16
18
|
const nodeModulesPath = path.join(context.projectRoot, 'node_modules');
|
|
17
|
-
|
|
18
|
-
if (fs.existsSync(nodeModulesPath)) {
|
|
19
|
+
// Check 1: Project node_modules
|
|
20
|
+
if (!fs.existsSync(nodeModulesPath)) {
|
|
19
21
|
return {
|
|
20
22
|
check: name,
|
|
21
|
-
status: '
|
|
22
|
-
message: 'node_modules
|
|
23
|
-
fixCommand:
|
|
23
|
+
status: 'FAIL',
|
|
24
|
+
message: 'node_modules not found',
|
|
25
|
+
fixCommand: 'npm install',
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
// Check 2 (INS-4.12): .aios-core/node_modules/ completeness
|
|
30
|
+
const aiosCoreDir = path.join(context.projectRoot, '.aios-core');
|
|
31
|
+
const aiosCorePackageJson = path.join(aiosCoreDir, 'package.json');
|
|
32
|
+
const aiosCoreNodeModules = path.join(aiosCoreDir, 'node_modules');
|
|
33
|
+
|
|
34
|
+
if (fs.existsSync(aiosCorePackageJson)) {
|
|
35
|
+
if (!fs.existsSync(aiosCoreNodeModules)) {
|
|
36
|
+
return {
|
|
37
|
+
check: name,
|
|
38
|
+
status: 'FAIL',
|
|
39
|
+
message: 'node_modules present, but .aios-core/node_modules/ missing',
|
|
40
|
+
fixCommand: 'cd .aios-core && npm install --production',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Verify all declared deps are installed
|
|
45
|
+
try {
|
|
46
|
+
const pkg = JSON.parse(fs.readFileSync(aiosCorePackageJson, 'utf8'));
|
|
47
|
+
const deps = Object.keys(pkg.dependencies || {});
|
|
48
|
+
const missing = [];
|
|
49
|
+
|
|
50
|
+
for (const dep of deps) {
|
|
51
|
+
const depPath = path.join(aiosCoreNodeModules, dep);
|
|
52
|
+
if (!fs.existsSync(depPath)) {
|
|
53
|
+
missing.push(dep);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (missing.length > 0) {
|
|
58
|
+
return {
|
|
59
|
+
check: name,
|
|
60
|
+
status: 'FAIL',
|
|
61
|
+
message: `node_modules present, but .aios-core missing deps: ${missing.join(', ')}`,
|
|
62
|
+
fixCommand: 'cd .aios-core && npm install --production',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
} catch {
|
|
66
|
+
// If we can't parse package.json, just check existence passed above
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
27
70
|
return {
|
|
28
71
|
check: name,
|
|
29
|
-
status: '
|
|
30
|
-
message: 'node_modules
|
|
31
|
-
fixCommand:
|
|
72
|
+
status: 'PASS',
|
|
73
|
+
message: 'node_modules present' + (fs.existsSync(aiosCoreNodeModules) ? ', .aios-core deps complete' : ''),
|
|
74
|
+
fixCommand: null,
|
|
32
75
|
};
|
|
33
76
|
}
|
|
34
77
|
|