File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ import { TodoTask } from './src/domains/todo/task.object';
44
55// Runtime Plugins
66import { ObjectQLPlugin } from '@objectstack/objectql' ;
7- import { AppPlugin , DriverPlugin } from '@objectstack/runtime' ;
7+ import { DriverPlugin } from '@objectstack/runtime' ;
88import { InMemoryDriver } from '@objectstack/driver-memory' ;
99
10- const stackConfig = defineStack ( {
10+ export default defineStack ( {
1111 objects : [
1212 TodoTask
1313 ] ,
@@ -54,16 +54,10 @@ const stackConfig = defineStack({
5454 ]
5555 }
5656 ]
57- }
58- } ) ;
59-
60- // Export with Runtime Plugins injected
61- export default {
62- ...stackConfig ,
57+ } ,
6358 plugins : [
6459 new ObjectQLPlugin ( ) ,
65- new DriverPlugin ( new InMemoryDriver ( ) ) ,
66- new AppPlugin ( stackConfig )
60+ new DriverPlugin ( new InMemoryDriver ( ) )
6761 ]
68- } ;
62+ } ) ;
6963
Original file line number Diff line number Diff line change 2222 "author" : " Steedos" ,
2323 "license" : " MIT" ,
2424 "dependencies" : {
25- "@objectstack/spec" : " workspace:*" ,
2625 "@objectstack/core" : " workspace:*" ,
2726 "@objectstack/plugin-hono-server" : " workspace:*" ,
27+ "@objectstack/runtime" : " workspace:^" ,
28+ "@objectstack/spec" : " workspace:*" ,
2829 "bundle-require" : " ^5.1.0" ,
2930 "chalk" : " ^5.3.0" ,
3031 "commander" : " ^11.1.0" ,
Original file line number Diff line number Diff line change @@ -96,6 +96,17 @@ export const serveCommand = new Command('serve')
9696 logger : loggerConfig
9797 } ) ;
9898
99+ // Auto-register AppPlugin if config contains app definitions
100+ if ( config . objects || config . manifest || config . apps ) {
101+ try {
102+ const { AppPlugin } = await import ( '@objectstack/runtime' ) ;
103+ kernel . use ( new AppPlugin ( config ) ) ;
104+ console . log ( chalk . green ( ` ✓ Registered App Plugin (auto-detected)` ) ) ;
105+ } catch ( e : any ) {
106+ console . warn ( chalk . yellow ( ` ⚠ Could not auto-load AppPlugin: ${ e . message } ` ) ) ;
107+ }
108+ }
109+
99110 // Load plugins from configuration
100111 let plugins = config . plugins || [ ] ;
101112
You can’t perform that action at this time.
0 commit comments