@@ -48,6 +48,15 @@ export const serveCommand = new Command('serve')
4848 objects : config . objects || { } ,
4949 } ) ;
5050
51+ const supportsUse = typeof ( kernel as any ) . use === 'function' ;
52+ const supportsBootstrap = typeof ( kernel as any ) . bootstrap === 'function' ;
53+
54+ if ( ! supportsUse || ! supportsBootstrap ) {
55+ throw new Error (
56+ 'Incompatible @objectstack/core version. Please use @objectstack/core@^0.8.0 or newer.'
57+ ) ;
58+ }
59+
5160 // Load plugins from configuration
5261 const plugins = config . plugins || [ ] ;
5362
@@ -56,7 +65,7 @@ export const serveCommand = new Command('serve')
5665
5766 for ( const plugin of plugins ) {
5867 try {
59- kernel . registerPlugin ( plugin ) ;
68+ kernel . use ( plugin ) ;
6069 const pluginName = plugin . name || plugin . constructor ?. name || 'unnamed' ;
6170 console . log ( chalk . green ( ` ✓ Registered plugin: ${ pluginName } ` ) ) ;
6271 } catch ( e : any ) {
@@ -70,7 +79,7 @@ export const serveCommand = new Command('serve')
7079 try {
7180 const { HonoServerPlugin } = await import ( '@objectstack/plugin-hono-server' ) ;
7281 const serverPlugin = new HonoServerPlugin ( { port : parseInt ( options . port ) } ) ;
73- kernel . registerPlugin ( serverPlugin ) ;
82+ kernel . use ( serverPlugin ) ;
7483 console . log ( chalk . green ( ` ✓ Registered HTTP server plugin (port: ${ options . port } )` ) ) ;
7584 } catch ( e : any ) {
7685 console . warn ( chalk . yellow ( ` ⚠ HTTP server plugin not available: ${ e . message } ` ) ) ;
@@ -79,7 +88,7 @@ export const serveCommand = new Command('serve')
7988
8089 // Boot the kernel
8190 console . log ( chalk . yellow ( `\n🚀 Starting ObjectStack...` ) ) ;
82- await kernel . boot ( ) ;
91+ await kernel . bootstrap ( ) ;
8392
8493 console . log ( chalk . green ( `\n✅ ObjectStack server is running!` ) ) ;
8594 console . log ( chalk . dim ( ` Press Ctrl+C to stop\n` ) ) ;
0 commit comments