mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
Include nsite "a" tag in kind 31990 app events when deployment exists
This commit is contained in:
1 file changed
+19
@@ -1,6 +1,7 @@
|
||||
import git from 'isomorphic-git';
|
||||
import { DotAI } from './DotAI';
|
||||
import { NostrURI } from './NostrURI';
|
||||
import { readNsiteVfsConfig } from './nsiteConfig';
|
||||
import type { JSRuntimeFS } from './JSRuntime';
|
||||
|
||||
/** Input for building a kind 31990 app event. */
|
||||
@@ -97,6 +98,24 @@ export async function buildAppEvent(
|
||||
}
|
||||
}
|
||||
|
||||
// If an nsite deployment exists, add an "a" tag referencing the site manifest event
|
||||
if (opts?.fs && opts.cwd && opts.pubkey) {
|
||||
try {
|
||||
const nsiteConfig = await readNsiteVfsConfig(opts.fs, opts.cwd);
|
||||
if (nsiteConfig) {
|
||||
if (nsiteConfig.id) {
|
||||
// Named site: kind 35128 addressable event
|
||||
tags.push(['a', `35128:${opts.pubkey}:${nsiteConfig.id}`]);
|
||||
} else {
|
||||
// Root site: kind 15128 replaceable event
|
||||
tags.push(['a', `15128:${opts.pubkey}:`]);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// No nsite config found, skip
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
content: JSON.stringify(content),
|
||||
tags,
|
||||
|
||||
Reference in new issue
Block a user