fraim-framework 2.0.46 → 2.0.47
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/dist/src/cli/commands/sync.js +54 -31
- package/package.json +1 -1
|
@@ -170,18 +170,18 @@ async function checkAndUpdateCLI() {
|
|
|
170
170
|
try {
|
|
171
171
|
console.log(chalk_1.default.blue('🔍 Checking for FRAIM CLI updates...'));
|
|
172
172
|
const currentVersion = (0, version_utils_1.getFraimVersion)();
|
|
173
|
-
const latestVersion = await
|
|
173
|
+
const latestVersion = await getLatestNpmVersionHttp('fraim-framework');
|
|
174
174
|
if (!latestVersion) {
|
|
175
175
|
console.log(chalk_1.default.yellow('⚠️ Could not check for updates. Continuing with current version.'));
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
if (currentVersion
|
|
178
|
+
if (isVersionUpToDate(currentVersion, latestVersion)) {
|
|
179
179
|
console.log(chalk_1.default.green(`✅ FRAIM CLI is up to date (${currentVersion})`));
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
console.log(chalk_1.default.yellow(`📦 New version available: ${currentVersion} → ${latestVersion}`));
|
|
183
183
|
console.log(chalk_1.default.blue('🔄 Auto-updating FRAIM CLI...'));
|
|
184
|
-
const success = await
|
|
184
|
+
const success = await updateGlobalPackageHttp('fraim-framework', latestVersion);
|
|
185
185
|
if (success) {
|
|
186
186
|
console.log(chalk_1.default.green(`✅ Successfully updated to FRAIM ${latestVersion}`));
|
|
187
187
|
console.log(chalk_1.default.gray(' Restart may be required for some changes to take effect.'));
|
|
@@ -194,42 +194,65 @@ async function checkAndUpdateCLI() {
|
|
|
194
194
|
console.log(chalk_1.default.yellow('⚠️ Could not check for updates. Continuing with current version.'));
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
async function
|
|
198
|
-
|
|
199
|
-
// Use
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
async function getLatestNpmVersionHttp(packageName) {
|
|
198
|
+
try {
|
|
199
|
+
// Use Node.js built-in https module instead of spawn
|
|
200
|
+
const https = require('https');
|
|
201
|
+
return new Promise((resolve) => {
|
|
202
|
+
const req = https.get(`https://registry.npmjs.org/${packageName}/latest`, {
|
|
203
|
+
timeout: 5000,
|
|
204
|
+
headers: {
|
|
205
|
+
'User-Agent': 'fraim-framework-cli'
|
|
206
|
+
}
|
|
207
|
+
}, (res) => {
|
|
208
|
+
let data = '';
|
|
209
|
+
res.on('data', (chunk) => {
|
|
210
|
+
data += chunk;
|
|
211
|
+
});
|
|
212
|
+
res.on('end', () => {
|
|
213
|
+
try {
|
|
214
|
+
const packageInfo = JSON.parse(data);
|
|
215
|
+
resolve(packageInfo.version || null);
|
|
216
|
+
}
|
|
217
|
+
catch (e) {
|
|
218
|
+
resolve(null);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
req.on('error', () => {
|
|
213
223
|
resolve(null);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
});
|
|
225
|
+
req.on('timeout', () => {
|
|
226
|
+
req.destroy();
|
|
227
|
+
resolve(null);
|
|
228
|
+
});
|
|
218
229
|
});
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function isVersionUpToDate(current, latest) {
|
|
236
|
+
// Simple version comparison - assumes semantic versioning
|
|
237
|
+
const currentParts = current.split('.').map(n => parseInt(n, 10));
|
|
238
|
+
const latestParts = latest.split('.').map(n => parseInt(n, 10));
|
|
239
|
+
for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) {
|
|
240
|
+
const currentPart = currentParts[i] || 0;
|
|
241
|
+
const latestPart = latestParts[i] || 0;
|
|
242
|
+
if (currentPart < latestPart)
|
|
243
|
+
return false;
|
|
244
|
+
if (currentPart > latestPart)
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
return true; // Versions are equal
|
|
225
248
|
}
|
|
226
|
-
async function
|
|
249
|
+
async function updateGlobalPackageHttp(packageName, version) {
|
|
227
250
|
return new Promise((resolve) => {
|
|
228
251
|
console.log(chalk_1.default.gray(` Running: npm install -g ${packageName}@${version}`));
|
|
229
252
|
// Use npm.cmd on Windows, npm on Unix
|
|
230
253
|
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
231
254
|
const npmProcess = (0, child_process_1.spawn)(npmCommand, ['install', '-g', `${packageName}@${version}`], {
|
|
232
|
-
stdio: ['ignore', '
|
|
255
|
+
stdio: ['ignore', 'ignore', 'ignore'] // Suppress output for cleaner experience
|
|
233
256
|
});
|
|
234
257
|
npmProcess.on('close', (code) => {
|
|
235
258
|
resolve(code === 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fraim-framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.47",
|
|
4
4
|
"description": "FRAIM v2: Framework for Rigor-based AI Management - Transform from solo developer to AI manager orchestrating production-ready code with enterprise-grade discipline",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|