fix(activitypub): add Like vocab import in activity dispatcher patch
On fresh installs where the old wrong patch was never applied, Like was absent from the @fedify/fedify/vocab imports, causing a ReferenceError at startup. The dispatcher patch now adds Like to the import block if missing, making it self-contained and install-order independent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,11 @@ for (const filePath of candidates) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure Like is imported from @fedify/fedify/vocab (may be absent on fresh installs)
|
||||
if (!source.includes(" Like,")) {
|
||||
source = source.replace(" Note,", " Like,\n Note,");
|
||||
}
|
||||
|
||||
source = source.replace(OLD_SNIPPET, NEW_SNIPPET);
|
||||
await writeFile(filePath, source, "utf8");
|
||||
patched += 1;
|
||||
|
||||
Reference in New Issue
Block a user