Skip to content

Commit 07bcbba

Browse files
Merge pull request #133 from objectstack-ai/copilot/upgrade-objectstack-to-latest
2 parents c90a47e + a25effd commit 07bcbba

File tree

13 files changed

+1126
-11690
lines changed

13 files changed

+1126
-11690
lines changed

package-lock.json

Lines changed: 0 additions & 9594 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
"sqlite3",
99
"@nestjs/core",
1010
"esbuild"
11-
]
11+
],
12+
"patchedDependencies": {
13+
"@objectstack/objectql@0.6.1": "patches/@objectstack__objectql@0.6.1.patch",
14+
"@objectstack/runtime@0.6.1": "patches/@objectstack__runtime@0.6.1.patch"
15+
}
1216
},
1317
"scripts": {
1418
"dev": "pnpm --filter @objectos/server dev",
@@ -45,7 +49,7 @@
4549
"@objectql/platform-node": "^3.0.1",
4650
"@objectql/starter-basic": "^1.8.4",
4751
"@objectql/starter-enterprise": "^1.8.4",
48-
"@objectstack/spec": "0.6.0",
52+
"@objectstack/spec": "0.6.1",
4953
"build": "^0.1.4"
5054
}
5155
}

packages/kernel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@objectql/core": "^3.0.1",
1313
"@objectql/types": "^3.0.1",
14-
"@objectstack/spec": "0.6.0",
14+
"@objectstack/spec": "0.6.1",
1515
"fast-glob": "^3.3.2",
1616
"js-yaml": "^4.1.0"
1717
},

packages/server/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919
"@nestjs/mapped-types": "^2.1.0",
2020
"@nestjs/platform-express": "^10.0.0",
2121
"@nestjs/serve-static": "^4.0.2",
22-
"@objectos/kernel": "workspace:*",
23-
"@objectos/preset-base": "workspace:*",
24-
"@objectstack/runtime": "workspace:*",
22+
"@objectstack/runtime": "0.6.1",
23+
"@objectstack/objectql": "0.6.1",
2524
"@objectql/core": "^3.0.1",
2625
"@objectql/driver-sql": "^3.0.1",
2726
"@objectql/driver-mongo": "^3.0.1",
2827
"@objectql/server": "^3.0.1",
29-
"@objectstack/spec": "0.6.0",
28+
"@objectstack/spec": "0.6.1",
3029
"better-auth": "^1.4.10",
3130
"better-sqlite3": "^12.6.0",
3231
"mongodb": "^7.0.0",

packages/server/src/app.module.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { AppService } from './app.service.js';
44
import { ObjectQLModule } from './objectql/objectql.module.js';
55
import { AuthModule } from './auth/auth.module.js';
66
import { AuthMiddleware } from './auth/auth.middleware.js';
7-
import { ObjectOS } from '@objectos/kernel';
87
import { createRESTHandler, createMetadataHandler, createNodeHandler } from '@objectql/server';
98

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

2120
configure(consumer: MiddlewareConsumer) {
22-
const restHandler = createRESTHandler(this.objectos);
23-
const metadataHandler = createMetadataHandler(this.objectos);
24-
const objectQLHandler = createNodeHandler(this.objectos);
21+
const restHandler = createRESTHandler(this.objectql);
22+
const metadataHandler = createMetadataHandler(this.objectql);
23+
const objectQLHandler = createNodeHandler(this.objectql);
2524

2625
const stripPrefix = (prefix: string, handler: any) => {
2726
return (req: any, res: any, next: any) => {

packages/server/src/objectql/objectql.provider.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Provider } from '@nestjs/common';
2-
import { ObjectKernel, ObjectQLPlugin, DriverPlugin } from '@objectstack/runtime';
3-
import { ObjectOS } from '@objectos/kernel';
2+
import { ObjectKernel, DriverPlugin } from '@objectstack/runtime';
3+
import { ObjectQLPlugin } from '@objectstack/objectql';
44
import { KnexDriver } from '@objectql/driver-sql';
55
import * as path from 'path';
66
import * as fs from 'fs';
77

88
export const objectQLProvider: Provider = {
9-
provide: ObjectOS,
9+
provide: 'OBJECTQL',
1010
useFactory: async () => {
1111
let config: any = {};
1212

@@ -43,12 +43,8 @@ export const objectQLProvider: Provider = {
4343
// Create the ObjectKernel
4444
const kernel = new ObjectKernel();
4545

46-
// Create ObjectOS with presets
47-
const presets = config.presets || ['@objectos/preset-base'];
48-
const objectos = new ObjectOS({ presets });
49-
50-
// Register ObjectOS as ObjectQL plugin
51-
kernel.use(new ObjectQLPlugin(objectos));
46+
// Register ObjectQL plugin - it will create its own ObjectQL instance
47+
kernel.use(new ObjectQLPlugin());
5248

5349
// Map config to drivers and register them
5450
if (config.datasource) {
@@ -100,9 +96,6 @@ export const objectQLProvider: Provider = {
10096
return ql;
10197
} catch (error) {
10298
console.error('Failed to bootstrap ObjectKernel:', error);
103-
if (error instanceof Error && error.message.includes('preset')) {
104-
console.error(`Hint: Ensure preset packages are installed: ${presets.join(', ')}`);
105-
}
10699
throw error;
107100
}
108101
}

packages/server/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
},
2222
"exclude": ["node_modules", "test", "dist", "**/*.spec.ts", "**/*.test.ts"],
2323
"references": [
24-
{ "path": "../kernel" },
25-
{ "path": "../runtime" }
24+
{ "path": "../kernel" }
2625
]
2726
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
diff --git a/dist/engine.js b/dist/engine.js
2+
index 4299ac8abcdbb8509b886b6b82f797d918ba58a2..78892252d84828d4181615648d414285c31015aa 100644
3+
--- a/dist/engine.js
4+
+++ b/dist/engine.js
5+
@@ -1,4 +1,4 @@
6+
-import { SchemaRegistry } from './registry';
7+
+import { SchemaRegistry } from './registry.js';
8+
/**
9+
* ObjectQL Engine
10+
*
11+
diff --git a/dist/index.js b/dist/index.js
12+
index d73fffe7e74fa7cd88064863063d47ba8a2c9791..756efa2a2bca303cbb031e49ed4cd36fbd471dde 100644
13+
--- a/dist/index.js
14+
+++ b/dist/index.js
15+
@@ -1,9 +1,9 @@
16+
// Export Registry
17+
-export { SchemaRegistry } from './registry';
18+
+export { SchemaRegistry } from './registry.js';
19+
// Export Protocol Implementation
20+
-export { ObjectStackProtocolImplementation } from './protocol';
21+
+export { ObjectStackProtocolImplementation } from './protocol.js';
22+
// Export Engine
23+
-export { ObjectQL } from './engine';
24+
+export { ObjectQL } from './engine.js';
25+
// Export Plugin Shim
26+
-export { ObjectQLPlugin } from './plugin';
27+
+export { ObjectQLPlugin } from './plugin.js';
28+
// Moved logic to engine.ts
29+
diff --git a/dist/plugin.js b/dist/plugin.js
30+
index d64ba1e8d60cb58ce26cee76555e975bb02cc04c..aa58449a4f6cbe3183a2c7db8603eb685d95f615 100644
31+
--- a/dist/plugin.js
32+
+++ b/dist/plugin.js
33+
@@ -1,5 +1,5 @@
34+
-import { ObjectQL } from './engine';
35+
-import { ObjectStackProtocolImplementation } from './protocol';
36+
+import { ObjectQL } from './engine.js';
37+
+import { ObjectStackProtocolImplementation } from './protocol.js';
38+
export class ObjectQLPlugin {
39+
constructor(ql, hostContext) {
40+
this.name = 'com.objectstack.engine.objectql';
41+
diff --git a/dist/protocol.js b/dist/protocol.js
42+
index baf99313260c07734ebcaae8d61a2054feb74d4b..d7967c8e066f1b07c4cc800c1bd11909cf70e69b 100644
43+
--- a/dist/protocol.js
44+
+++ b/dist/protocol.js
45+
@@ -1,5 +1,5 @@
46+
// We import SchemaRegistry directly since this class lives in the same package
47+
-import { SchemaRegistry } from './registry';
48+
+import { SchemaRegistry } from './registry.js';
49+
export class ObjectStackProtocolImplementation {
50+
constructor(engine) {
51+
this.engine = engine;
52+
diff --git a/package.json b/package.json
53+
index ac3f9a0bc646f9e6e9f6e37577a49832a4a2b4a2..9badd29dfbfdbf1c2708416dde69a065e9607585 100644
54+
--- a/package.json
55+
+++ b/package.json
56+
@@ -2,8 +2,8 @@
57+
"name": "@objectstack/objectql",
58+
"version": "0.6.1",
59+
"description": "Isomorphic ObjectQL Engine for ObjectStack",
60+
- "main": "src/index.ts",
61+
- "types": "src/index.ts",
62+
+ "main": "dist/index.js",
63+
+ "types": "dist/index.d.ts",
64+
"dependencies": {
65+
"@objectstack/core": "0.6.1",
66+
"@objectstack/spec": "0.6.1",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index 831428320436f81e6d1c4f2698d55335fa72f900..418b677ba1dd68ae107a39bc7f646d1316236463 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -1,7 +1,7 @@
6+
// Export Kernels
7+
export { ObjectKernel } from '@objectstack/core';
8+
// Export Plugins
9+
-export { DriverPlugin } from './driver-plugin';
10+
-export { AppPlugin } from './app-plugin';
11+
+export { DriverPlugin } from './driver-plugin.js';
12+
+export { AppPlugin } from './app-plugin.js';
13+
// Export Types
14+
export * from '@objectstack/core';

0 commit comments

Comments
 (0)