Include user relays in repo announcement event

This commit is contained in:
Alex Gleason committed 2025-12-25 00:34:46 -06:00
1 parent 83fec3f6d6
commit 5ef848b45e
2 files changed
+16 -5

No files matched your search

@@ -70,8 +70,17 @@ export function ConfigureRepoStep({
const cloneUrl = new URL(`/${npub}/${projectId}.git`, `https://${relayUrl.host}`);
cloneUrls.add(cloneUrl.href);
} catch (err) {
console.warn(`Failed to parse Nostr git relay URL: ${graspRelay.url}`, err);
} catch {
// fallthrough
}
}
for (const relay of config.relayMetadata.relays.filter(r => r.write)) {
try {
const relayUrl = new URL(relay.url);
relays.add(relayUrl.href);
} catch {
// fallthrough
}
}
@@ -103,8 +112,8 @@ export function ConfigureRepoStep({
name,
description,
webUrls,
cloneUrls: [...cloneUrls],
relays: [...relays],
cloneUrls: [...cloneUrls].slice(0, 10), // Limit to first 10 clone URLs
relays: [...relays].slice(0, 10), // Limit to first 10 relays
tTags: tTags.length > 0 ? tTags : undefined,
earliestCommit,
});
+3 -1
View File
@@ -62,7 +62,7 @@ export function createRepositoryAnnouncementEvent(
): EventTemplate {
// Build tags array per NIP-34
const tags: string[][] = [
['d', data.repoId.trim()], // Required: repository identifier
['d', data.repoId], // Required: repository identifier
];
if (data.name?.trim()) {
@@ -110,6 +110,8 @@ export function createRepositoryAnnouncementEvent(
tags.push(['r', data.earliestCommit.trim(), 'euc']);
}
tags.push(['alt', `git repository: ${data.repoId}`]);
// Create repository announcement event (kind 30617)
return {
kind: 30617,