@lvnt/release-radar 1.9.1 → 1.9.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/dist/index.js +52 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -397,6 +397,58 @@ bot.onText(/\/publishcli/, async (msg) => {
|
|
|
397
397
|
await bot.sendMessage(validatedChatId, `❌ CLI publish failed: ${result.error}`);
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
|
+
bot.onText(/\/mirrorall/, async (msg) => {
|
|
401
|
+
if (msg.chat.id.toString() !== validatedChatId)
|
|
402
|
+
return;
|
|
403
|
+
// Find all tools that need mirroring (have mirror config and use {{MIRROR_URL}})
|
|
404
|
+
const mirrorItems = [];
|
|
405
|
+
for (const [toolName, config] of Object.entries(downloadsConfig)) {
|
|
406
|
+
if (config.type === 'npm' || !('mirror' in config) || !config.mirror)
|
|
407
|
+
continue;
|
|
408
|
+
if (config.downloadUrl !== '{{MIRROR_URL}}')
|
|
409
|
+
continue;
|
|
410
|
+
const version = storage.getVersion(toolName);
|
|
411
|
+
if (!version) {
|
|
412
|
+
console.log(`[mirrorall] Skipping ${toolName}: no tracked version`);
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
mirrorItems.push({
|
|
416
|
+
toolName,
|
|
417
|
+
version,
|
|
418
|
+
config: config.mirror,
|
|
419
|
+
filenameTemplate: config.filename,
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
if (mirrorItems.length === 0) {
|
|
423
|
+
await bot.sendMessage(validatedChatId, 'No tools configured for mirroring (or no tracked versions).');
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const toolList = mirrorItems.map(i => `• ${i.toolName} v${i.version}`).join('\n');
|
|
427
|
+
await bot.sendMessage(validatedChatId, `🔄 Mirroring ${mirrorItems.length} tools...\n\n${toolList}`);
|
|
428
|
+
const result = await assetMirror.mirrorBatch(mirrorItems);
|
|
429
|
+
// Update storage with successful mirrors
|
|
430
|
+
let successCount = 0;
|
|
431
|
+
let failCount = 0;
|
|
432
|
+
const failures = [];
|
|
433
|
+
for (const [toolName, mirrorResult] of result.results) {
|
|
434
|
+
if (mirrorResult.success && mirrorResult.downloadUrl) {
|
|
435
|
+
storage.setMirrorUrl(toolName, mirrorResult.downloadUrl);
|
|
436
|
+
successCount++;
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
failCount++;
|
|
440
|
+
failures.push(`• ${toolName}: ${mirrorResult.error || 'Unknown error'}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
let message = `✅ Mirrored ${successCount}/${mirrorItems.length} tools`;
|
|
444
|
+
if (result.tag) {
|
|
445
|
+
message += `\nRelease: ${result.tag}`;
|
|
446
|
+
}
|
|
447
|
+
if (failCount > 0) {
|
|
448
|
+
message += `\n\n❌ ${failCount} failed:\n${failures.join('\n')}`;
|
|
449
|
+
}
|
|
450
|
+
await bot.sendMessage(validatedChatId, message);
|
|
451
|
+
});
|
|
400
452
|
bot.onText(/\/mirror(?:\s+(.+))?/, async (msg, match) => {
|
|
401
453
|
if (msg.chat.id.toString() !== validatedChatId)
|
|
402
454
|
return;
|