Skip to content

Commit 4a8a61c

Browse files
committed
feat(objectql): initialize ObjectQL engine with schema registry and plugin support
- Added package.json for ObjectQL with build and test scripts. - Implemented ObjectQL class with methods for plugin registration, driver management, and data access. - Created SchemaRegistry for managing metadata types including objects, apps, and plugins. - Added TypeScript configuration for the ObjectQL package.
1 parent 949fd82 commit 4a8a61c

File tree

9 files changed

+429
-13
lines changed

9 files changed

+429
-13
lines changed

packages/objectql/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@objectstack/objectql",
3+
"version": "0.1.0",
4+
"description": "Isomorphic ObjectQL Engine for ObjectStack",
5+
"main": "src/index.ts",
6+
"types": "src/index.ts",
7+
"scripts": {
8+
"build": "tsc",
9+
"test": "vitest"
10+
},
11+
"dependencies": {
12+
"@objectstack/spec": "workspace:*"
13+
},
14+
"devDependencies": {
15+
"typescript": "^5.0.0",
16+
"vitest": "^1.0.0"
17+
}
18+
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
import { DriverInterface, DriverOptions, QueryAST, ObjectStackManifest, ManifestSchema } from '@objectstack/spec';
1+
import { DriverInterface, DriverOptions, QueryAST, ObjectStackManifest } from '@objectstack/spec';
22
import { SchemaRegistry } from './registry';
33

4+
// Export Registry for consumers
5+
export { SchemaRegistry } from './registry';
6+
47
/**
58
* Host Context provided to plugins
69
*/
@@ -17,7 +20,6 @@ export interface PluginContext {
1720
export class ObjectQL {
1821
private drivers = new Map<string, DriverInterface>();
1922
private defaultDriver: string | null = null;
20-
private plugins = new Map<string, any>();
2123

2224
// Host provided context additions (e.g. Server router)
2325
private hostContext: Record<string, any> = {};
@@ -110,7 +112,7 @@ export class ObjectQL {
110112
/**
111113
* Helper to get the target driver
112114
*/
113-
private getDriver(object: string): DriverInterface {
115+
private getDriver(_object: string): DriverInterface {
114116
// TODO: Look up Object definition to see if it specifies a specific datasource/driver
115117
// For now, always return default
116118
if (!this.defaultDriver) {

packages/objectql/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"include": ["src/**/*"],
4+
"exclude": ["node_modules", "dist"],
5+
"compilerOptions": {
6+
"outDir": "dist",
7+
"rootDir": "src"
8+
}
9+
}

packages/runtime/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"dev": "tsc -w"
1010
},
1111
"dependencies": {
12+
"@objectstack/objectql": "workspace:*",
1213
"@objectstack/spec": "workspace:*"
1314
},
1415
"devDependencies": {

packages/runtime/src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// Export core engine
2-
export { ObjectQL } from './engine';
3-
export { SchemaRegistry } from './registry';
2+
export { ObjectQL, SchemaRegistry } from '@objectstack/objectql';
43
export { ObjectStackKernel } from './kernel';
54
export { ObjectStackRuntimeProtocol } from './protocol';
65

7-
8-
9-
// Re-export common types from spec for convenience
10-
export type { DriverInterface, DriverOptions, QueryAST } from '@objectstack/spec';
11-
126
export * from './types';
137

packages/runtime/src/kernel.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ServiceObject } from '@objectstack/spec';
2-
import { SchemaRegistry } from './registry';
3-
import { ObjectQL } from './engine';
2+
import { SchemaRegistry, ObjectQL } from '@objectstack/objectql';
43

54
/**
65
* ObjectStack Kernel (Microkernel)

packages/runtime/src/protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SchemaRegistry } from './registry';
1+
import { SchemaRegistry } from '@objectstack/objectql';
22
import { ObjectStackKernel } from './kernel';
33

44
export interface ApiRequest {

0 commit comments

Comments
 (0)