-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug-registry.ts
More file actions
38 lines (28 loc) · 1.29 KB
/
debug-registry.ts
File metadata and controls
38 lines (28 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { ObjectKernel, DriverPlugin, AppPlugin } from '@objectstack/runtime';
import { SchemaRegistry, ObjectQL, ObjectQLPlugin } from '@objectstack/objectql';
import { InMemoryDriver } from '@objectstack/driver-memory';
import TodoApp from '@example/app-todo/objectstack.config';
(async () => {
console.log('--- Debug Registry ---');
console.log('Apps:', [TodoApp.name]);
console.log('Objects inside App:', TodoApp.objects?.map((o: any) => o.name));
const kernel = new ObjectKernel();
kernel
.use(new ObjectQLPlugin())
.use(new DriverPlugin(new InMemoryDriver(), 'memory'))
.use(new AppPlugin(TodoApp));
await kernel.bootstrap();
console.log('--- Post Start ---');
// Check Registry directly
const obj = SchemaRegistry.getObject('todo_task');
console.log('Registry "todo_task":', obj ? 'FOUND' : 'MISSING');
// Check Registry via Engine
try {
// Access private engine map if possible or simulate query
// The engine doesn't expose a 'hasObject' method easily, but we can inspect internal logic
// Actually SchemaRegistry is static, so if it's there, it's there.
} catch (e) {
console.error(e);
}
})();