Skip to content

Commit 3889259

Browse files
Copilothuangyiirene
andcommitted
Update dependencies and import plugin types from @objectstack/spec
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent a94c215 commit 3889259

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

packages/foundation/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@objectql/types": "workspace:*",
26-
"@objectstack/spec": "^0.1.2",
26+
"@objectstack/spec": "^0.2.0",
2727
"@objectstack/runtime": "^0.1.1",
2828
"@objectstack/objectql": "^0.1.1",
2929
"js-yaml": "^4.1.0",

packages/foundation/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"test": "jest --passWithNoTests"
2828
},
2929
"dependencies": {
30-
"@objectstack/spec": "^0.1.2"
30+
"@objectstack/spec": "^0.2.0"
3131
},
3232
"devDependencies": {
3333
"ts-json-schema-generator": "^2.4.0"

packages/foundation/types/src/plugin.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@
88

99
import { IObjectQL } from './app';
1010

11+
// Import plugin types from @objectstack/spec (the protocol standard)
12+
export type {
13+
PluginContextData,
14+
PluginLifecycleHooks,
15+
PluginDefinition,
16+
} from '@objectstack/spec';
17+
18+
/**
19+
* @deprecated Legacy plugin interface. Use PluginDefinition from @objectstack/spec instead.
20+
*
21+
* This interface is maintained for backward compatibility with existing plugins.
22+
* New plugins should implement PluginDefinition with lifecycle hooks (onEnable, onDisable, etc.)
23+
* instead of the legacy setup() method.
24+
*
25+
* @example Migration from legacy to new:
26+
* // Old way (deprecated):
27+
* export class MyPlugin implements ObjectQLPlugin {
28+
* name = 'my-plugin';
29+
* setup(app: IObjectQL) { ... }
30+
* }
31+
*
32+
* // New way (recommended):
33+
* export default {
34+
* id: 'my-plugin',
35+
* onEnable: async (context) => { ... }
36+
* } satisfies PluginDefinition;
37+
*/
1138
export interface ObjectQLPlugin {
1239
name: string;
1340
setup(app: IObjectQL): void | Promise<void>;

0 commit comments

Comments
 (0)