Skip to content

Commit a43a448

Browse files
committed
feat: add ObjectQLPlugin to enable repository and query service; update package.json and pnpm-lock.yaml for @objectql/core integration
1 parent 8821557 commit a43a448

4 files changed

Lines changed: 65 additions & 0 deletions

File tree

objectql.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { ValidatorPlugin } from '@objectql/plugin-validator';
1111
import { GraphQLPlugin } from '@objectql/protocol-graphql';
1212
import { ODataV4Plugin } from '@objectql/protocol-odata-v4';
1313
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
14+
import { ObjectQLPlugin } from '@objectql/core';
1415
import * as fs from 'fs';
1516
import * as path from 'path';
1617
import * as yaml from 'js-yaml';
@@ -49,6 +50,10 @@ export default {
4950
plugins: [
5051
new HonoServerPlugin({
5152
}),
53+
new ObjectQLPlugin({
54+
enableRepository: true,
55+
enableQueryService: true
56+
}),
5257
new ObjectQLSecurityPlugin({
5358
enableAudit: false
5459
}),

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@changesets/cli": "^2.29.8",
2525
"@eslint/js": "^9.39.2",
2626
"@objectql/cli": "workspace:*",
27+
"@objectql/core": "workspace:*",
2728
"@objectql/example-enterprise-erp": "workspace:*",
2829
"@objectql/example-project-tracker": "workspace:*",
2930
"@objectql/plugin-security": "workspace:*",

packages/foundation/core/src/plugin.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,26 @@ export class ObjectQLPlugin implements RuntimePlugin {
181181
console.log(`[${this.name}] Starting plugin...`);
182182
// Additional startup logic can be added here
183183
}
184+
185+
// --- Adapter for @objectstack/core compatibility ---
186+
async init(kernel: any): Promise<void> {
187+
// The new core passes the kernel instance directly
188+
// We wrap it to match the old RuntimeContext interface
189+
const ctx = {
190+
engine: kernel,
191+
getKernel: () => kernel
192+
};
193+
return this.install(ctx);
194+
}
195+
196+
async start(kernel: any): Promise<void> {
197+
const ctx = {
198+
engine: kernel,
199+
getKernel: () => kernel
200+
};
201+
return this.onStart(ctx);
202+
}
203+
// ---------------------------------------------------
184204

185205
/**
186206
* Register the Repository pattern

pnpm-lock.yaml

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)