@cccarv82/freya 3.7.0 → 3.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/cli/auto-update.js +15 -8
- package/package.json +1 -1
package/cli/auto-update.js
CHANGED
|
@@ -44,14 +44,17 @@ function setWorkspaceVersion(workspaceDir, version) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function needsNpmInstall(workspaceDir) {
|
|
47
|
-
// Check if
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
// Check if ALL required dependencies are installed in the workspace's node_modules
|
|
48
|
+
const requiredDeps = ['sql.js', '@huggingface/transformers'];
|
|
49
|
+
for (const dep of requiredDeps) {
|
|
50
|
+
const depPath = path.join(workspaceDir, 'node_modules', dep);
|
|
51
|
+
try {
|
|
52
|
+
fs.accessSync(depPath);
|
|
53
|
+
} catch {
|
|
54
|
+
return true; // At least one dependency missing
|
|
55
|
+
}
|
|
54
56
|
}
|
|
57
|
+
return false;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
function runNpmInstall(workspaceDir) {
|
|
@@ -85,8 +88,12 @@ async function autoUpdate(workspaceDir) {
|
|
|
85
88
|
const installedVersion = getInstalledVersion();
|
|
86
89
|
const workspaceVersion = getWorkspaceVersion(workspaceDir);
|
|
87
90
|
|
|
88
|
-
// Already in sync
|
|
91
|
+
// Already in sync — but still check if deps are missing (e.g. new dep added in same version)
|
|
89
92
|
if (workspaceVersion === installedVersion) {
|
|
93
|
+
if (needsNpmInstall(workspaceDir)) {
|
|
94
|
+
console.log('[FREYA] Missing workspace dependencies detected, installing...');
|
|
95
|
+
runNpmInstall(workspaceDir);
|
|
96
|
+
}
|
|
90
97
|
return { updated: false, version: installedVersion };
|
|
91
98
|
}
|
|
92
99
|
|
package/package.json
CHANGED