Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,594 changes: 0 additions & 9,594 deletions package-lock.json

This file was deleted.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"sqlite3",
"@nestjs/core",
"esbuild"
]
],
"patchedDependencies": {
"@objectstack/objectql@0.6.1": "patches/@objectstack__objectql@0.6.1.patch",
"@objectstack/runtime@0.6.1": "patches/@objectstack__runtime@0.6.1.patch"
}
},
"scripts": {
"dev": "pnpm --filter @objectos/server dev",
Expand Down Expand Up @@ -45,7 +49,7 @@
"@objectql/platform-node": "^3.0.1",
"@objectql/starter-basic": "^1.8.4",
"@objectql/starter-enterprise": "^1.8.4",
"@objectstack/spec": "0.6.0",
"@objectstack/spec": "0.6.1",
"build": "^0.1.4"
}
}
2 changes: 1 addition & 1 deletion packages/kernel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@objectql/core": "^3.0.1",
"@objectql/types": "^3.0.1",
"@objectstack/spec": "0.6.0",
"@objectstack/spec": "0.6.1",
"fast-glob": "^3.3.2",
"js-yaml": "^4.1.0"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"@nestjs/mapped-types": "^2.1.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/serve-static": "^4.0.2",
"@objectos/kernel": "workspace:*",
"@objectos/preset-base": "workspace:*",
"@objectstack/runtime": "workspace:*",
"@objectstack/runtime": "0.6.1",
"@objectstack/objectql": "0.6.1",
"@objectql/core": "^3.0.1",
"@objectql/driver-sql": "^3.0.1",
"@objectql/driver-mongo": "^3.0.1",
"@objectql/server": "^3.0.1",
"@objectstack/spec": "0.6.0",
"@objectstack/spec": "0.6.1",
"better-auth": "^1.4.10",
"better-sqlite3": "^12.6.0",
"mongodb": "^7.0.0",
Expand Down
9 changes: 4 additions & 5 deletions packages/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AppService } from './app.service.js';
import { ObjectQLModule } from './objectql/objectql.module.js';
import { AuthModule } from './auth/auth.module.js';
import { AuthMiddleware } from './auth/auth.middleware.js';
import { ObjectOS } from '@objectos/kernel';
import { createRESTHandler, createMetadataHandler, createNodeHandler } from '@objectql/server';

@Module({
Expand All @@ -16,12 +15,12 @@ import { createRESTHandler, createMetadataHandler, createNodeHandler } from '@ob
providers: [AppService],
})
export class AppModule implements NestModule {
constructor(@Inject(ObjectOS) private objectos: ObjectOS) {}
constructor(@Inject('OBJECTQL') private objectql: any) {}

configure(consumer: MiddlewareConsumer) {
const restHandler = createRESTHandler(this.objectos);
const metadataHandler = createMetadataHandler(this.objectos);
const objectQLHandler = createNodeHandler(this.objectos);
const restHandler = createRESTHandler(this.objectql);
const metadataHandler = createMetadataHandler(this.objectql);
const objectQLHandler = createNodeHandler(this.objectql);

const stripPrefix = (prefix: string, handler: any) => {
return (req: any, res: any, next: any) => {
Expand Down
17 changes: 5 additions & 12 deletions packages/server/src/objectql/objectql.provider.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Provider } from '@nestjs/common';
import { ObjectKernel, ObjectQLPlugin, DriverPlugin } from '@objectstack/runtime';
import { ObjectOS } from '@objectos/kernel';
import { ObjectKernel, DriverPlugin } from '@objectstack/runtime';
import { ObjectQLPlugin } from '@objectstack/objectql';
import { KnexDriver } from '@objectql/driver-sql';
import * as path from 'path';
import * as fs from 'fs';

export const objectQLProvider: Provider = {
provide: ObjectOS,
provide: 'OBJECTQL',
useFactory: async () => {
let config: any = {};

Expand Down Expand Up @@ -43,12 +43,8 @@ export const objectQLProvider: Provider = {
// Create the ObjectKernel
const kernel = new ObjectKernel();

// Create ObjectOS with presets
const presets = config.presets || ['@objectos/preset-base'];
const objectos = new ObjectOS({ presets });

// Register ObjectOS as ObjectQL plugin
kernel.use(new ObjectQLPlugin(objectos));
// Register ObjectQL plugin - it will create its own ObjectQL instance
kernel.use(new ObjectQLPlugin());

// Map config to drivers and register them
if (config.datasource) {
Expand Down Expand Up @@ -100,9 +96,6 @@ export const objectQLProvider: Provider = {
return ql;
} catch (error) {
console.error('Failed to bootstrap ObjectKernel:', error);
if (error instanceof Error && error.message.includes('preset')) {
console.error(`Hint: Ensure preset packages are installed: ${presets.join(', ')}`);
}
throw error;
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
},
"exclude": ["node_modules", "test", "dist", "**/*.spec.ts", "**/*.test.ts"],
"references": [
{ "path": "../kernel" },
{ "path": "../runtime" }
{ "path": "../kernel" }
]
}
66 changes: 66 additions & 0 deletions patches/@objectstack__objectql@0.6.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
diff --git a/dist/engine.js b/dist/engine.js
index 4299ac8abcdbb8509b886b6b82f797d918ba58a2..78892252d84828d4181615648d414285c31015aa 100644
--- a/dist/engine.js
+++ b/dist/engine.js
@@ -1,4 +1,4 @@
-import { SchemaRegistry } from './registry';
+import { SchemaRegistry } from './registry.js';
/**
* ObjectQL Engine
*
diff --git a/dist/index.js b/dist/index.js
index d73fffe7e74fa7cd88064863063d47ba8a2c9791..756efa2a2bca303cbb031e49ed4cd36fbd471dde 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,9 +1,9 @@
// Export Registry
-export { SchemaRegistry } from './registry';
+export { SchemaRegistry } from './registry.js';
// Export Protocol Implementation
-export { ObjectStackProtocolImplementation } from './protocol';
+export { ObjectStackProtocolImplementation } from './protocol.js';
// Export Engine
-export { ObjectQL } from './engine';
+export { ObjectQL } from './engine.js';
// Export Plugin Shim
-export { ObjectQLPlugin } from './plugin';
+export { ObjectQLPlugin } from './plugin.js';
// Moved logic to engine.ts
diff --git a/dist/plugin.js b/dist/plugin.js
index d64ba1e8d60cb58ce26cee76555e975bb02cc04c..aa58449a4f6cbe3183a2c7db8603eb685d95f615 100644
--- a/dist/plugin.js
+++ b/dist/plugin.js
@@ -1,5 +1,5 @@
-import { ObjectQL } from './engine';
-import { ObjectStackProtocolImplementation } from './protocol';
+import { ObjectQL } from './engine.js';
+import { ObjectStackProtocolImplementation } from './protocol.js';
export class ObjectQLPlugin {
constructor(ql, hostContext) {
this.name = 'com.objectstack.engine.objectql';
diff --git a/dist/protocol.js b/dist/protocol.js
index baf99313260c07734ebcaae8d61a2054feb74d4b..d7967c8e066f1b07c4cc800c1bd11909cf70e69b 100644
--- a/dist/protocol.js
+++ b/dist/protocol.js
@@ -1,5 +1,5 @@
// We import SchemaRegistry directly since this class lives in the same package
-import { SchemaRegistry } from './registry';
+import { SchemaRegistry } from './registry.js';
export class ObjectStackProtocolImplementation {
constructor(engine) {
this.engine = engine;
diff --git a/package.json b/package.json
index ac3f9a0bc646f9e6e9f6e37577a49832a4a2b4a2..9badd29dfbfdbf1c2708416dde69a065e9607585 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
"name": "@objectstack/objectql",
"version": "0.6.1",
"description": "Isomorphic ObjectQL Engine for ObjectStack",
- "main": "src/index.ts",
- "types": "src/index.ts",
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
"dependencies": {
"@objectstack/core": "0.6.1",
"@objectstack/spec": "0.6.1",
14 changes: 14 additions & 0 deletions patches/@objectstack__runtime@0.6.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/dist/index.js b/dist/index.js
index 831428320436f81e6d1c4f2698d55335fa72f900..418b677ba1dd68ae107a39bc7f646d1316236463 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,7 +1,7 @@
// Export Kernels
export { ObjectKernel } from '@objectstack/core';
// Export Plugins
-export { DriverPlugin } from './driver-plugin';
-export { AppPlugin } from './app-plugin';
+export { DriverPlugin } from './driver-plugin.js';
+export { AppPlugin } from './app-plugin.js';
// Export Types
export * from '@objectstack/core';
Loading
Loading