@lvnt/release-radar 1.9.13 → 1.9.15
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 +17 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -350,14 +350,15 @@ bot.onText(/\/generate/, async (msg) => {
|
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
const state = storage.load();
|
|
353
|
-
const
|
|
353
|
+
const mirrorUrls = storage.getAllMirrorUrls();
|
|
354
|
+
const versionsJson = generateVersionsJson(state.versions, downloadsConfig, mirrorUrls);
|
|
354
355
|
const outputPath = join(DATA_DIR, 'cli-versions.json');
|
|
355
356
|
writeFileSync(outputPath, JSON.stringify(versionsJson, null, 2));
|
|
356
357
|
await bot.sendMessage(CHAT_ID, `Generated versions.json with ${versionsJson.tools.length} tools.\nPath: ${outputPath}`);
|
|
357
358
|
});
|
|
358
359
|
// Helper to format CLI preview
|
|
359
|
-
function formatCliPreview(versions) {
|
|
360
|
-
const versionsJson = generateVersionsJson(versions, downloadsConfig);
|
|
360
|
+
function formatCliPreview(versions, mirrorUrls = {}) {
|
|
361
|
+
const versionsJson = generateVersionsJson(versions, downloadsConfig, mirrorUrls);
|
|
361
362
|
if (versionsJson.tools.length === 0) {
|
|
362
363
|
return 'No tools configured in downloads.json';
|
|
363
364
|
}
|
|
@@ -375,7 +376,8 @@ bot.onText(/\/clipreview/, async (msg) => {
|
|
|
375
376
|
return;
|
|
376
377
|
}
|
|
377
378
|
const state = storage.load();
|
|
378
|
-
const
|
|
379
|
+
const mirrorUrls = storage.getAllMirrorUrls();
|
|
380
|
+
const preview = formatCliPreview(state.versions, mirrorUrls);
|
|
379
381
|
await bot.sendMessage(validatedChatId, `📋 CLI Preview\n\n${preview}\n\nUse /publishcli to publish.`);
|
|
380
382
|
});
|
|
381
383
|
bot.onText(/\/publishcli/, async (msg) => {
|
|
@@ -387,7 +389,7 @@ bot.onText(/\/publishcli/, async (msg) => {
|
|
|
387
389
|
}
|
|
388
390
|
const state = storage.load();
|
|
389
391
|
const mirrorUrls = storage.getAllMirrorUrls();
|
|
390
|
-
const preview = formatCliPreview(state.versions);
|
|
392
|
+
const preview = formatCliPreview(state.versions, mirrorUrls);
|
|
391
393
|
await bot.sendMessage(validatedChatId, `📦 Publishing CLI...\n\n${preview}`);
|
|
392
394
|
const result = await cliPublisher.publish(state.versions, mirrorUrls);
|
|
393
395
|
if (result.success) {
|
|
@@ -457,19 +459,22 @@ bot.onText(/\/mirror(?:\s+(.+))?/, async (msg, match) => {
|
|
|
457
459
|
await bot.sendMessage(validatedChatId, 'Usage: /mirror <toolname> [version] [--force]\nExample: /mirror VSCode\nExample: /mirror VSCode --force\nExample: /mirror "Claude Code VSCode" 2.1.9\n\n--force: Delete existing release and re-mirror');
|
|
458
460
|
return;
|
|
459
461
|
}
|
|
460
|
-
// Check for --force flag
|
|
461
|
-
const force = args
|
|
462
|
-
const argsWithoutForce = args
|
|
462
|
+
// Check for --force flag and remove it from args
|
|
463
|
+
const force = /\s*--force\b/.test(args) || /\s+-f\b/.test(args);
|
|
464
|
+
const argsWithoutForce = args
|
|
465
|
+
.replace(/\s*--force\b/g, '')
|
|
466
|
+
.replace(/\s+-f\b/g, '')
|
|
467
|
+
.trim();
|
|
463
468
|
// Parse tool name and optional version
|
|
464
469
|
let toolName;
|
|
465
|
-
let version;
|
|
466
|
-
const quoteMatch = argsWithoutForce.match(/^"([^"]+)"(?:\s+(
|
|
470
|
+
let version = null;
|
|
471
|
+
const quoteMatch = argsWithoutForce.match(/^"([^"]+)"(?:\s+(\S+))?$/);
|
|
467
472
|
if (quoteMatch) {
|
|
468
473
|
toolName = quoteMatch[1];
|
|
469
|
-
version = quoteMatch[2]
|
|
474
|
+
version = quoteMatch[2] || null;
|
|
470
475
|
}
|
|
471
476
|
else {
|
|
472
|
-
const parts = argsWithoutForce.split(/\s+/);
|
|
477
|
+
const parts = argsWithoutForce.split(/\s+/).filter(p => p.length > 0);
|
|
473
478
|
toolName = parts[0];
|
|
474
479
|
version = parts[1] || null;
|
|
475
480
|
}
|