update builder

This commit is contained in:
Raven Scott
2025-12-18 02:07:51 -05:00
parent 1e9115d599
commit a3ea306a76
2 changed files with 11 additions and 13 deletions
+10 -12
View File
@@ -160,20 +160,18 @@ async function buildHyperDBDefinition(pluginDir, schemaDir, dbDir, hyperdbConfig
if (parts.length === 2 && parts[0] === `@${namespaceName}`) {
const identifier = parts[1];
// Check if identifier is a collection name (correct format)
if (collectionNameMap.has(identifier)) {
// Already in correct format: @namespace/collection-name
// Check if it's a schema identifier first (e.g., @peerchat/message)
// Resolve to collection name (e.g., @peerchat/messages)
const collectionName = schemaToCollectionMap.get(collectionRef);
if (collectionName) {
collectionRef = `@${namespaceName}/${collectionName}`;
} else if (collectionNameMap.has(identifier)) {
// Already in correct collection format: @namespace/collection-name
// Keep as-is
} else {
// It's a schema identifier (e.g., @peerchat/message)
// Resolve to collection name (e.g., @peerchat/messages)
const collectionName = schemaToCollectionMap.get(collectionRef);
if (collectionName) {
collectionRef = `@${namespaceName}/${collectionName}`;
} else {
// Try treating it as collection name already
// No change needed
}
// Try treating it as collection name already
// No change needed
}
}
} else {