update builder
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user