@@ -4,7 +4,7 @@ const require = createRequire(import.meta.url);
44// @ts -ignore
55globalThis . require = require ;
66
7- import { sharedConfig , appConfigs , setupAppConfig } from './objectstack.shared' ;
7+ import { sharedConfig , appConfigs } from './objectstack.shared' ;
88
99// @ts -ignore
1010import * as MSWPluginPkg from '@objectstack/plugin-msw' ;
@@ -13,6 +13,10 @@ import * as ObjectQLPluginPkg from '@objectstack/objectql';
1313// @ts -ignore
1414import * as HonoServerPluginPkg from '@objectstack/plugin-hono-server' ;
1515// @ts -ignore
16+ import * as AuthPluginPkg from '@objectstack/plugin-auth' ;
17+ // @ts -ignore
18+ import * as SetupPluginPkg from '@objectstack/plugin-setup' ;
19+ // @ts -ignore
1620import * as DriverMemoryPkg from '@objectstack/driver-memory' ;
1721// @ts -ignore
1822import * as RuntimePkg from '@objectstack/runtime' ;
@@ -25,6 +29,8 @@ const InMemoryDriver = DriverMemoryPkg.InMemoryDriver || (DriverMemoryPkg as any
2529const DriverPlugin = RuntimePkg . DriverPlugin || ( RuntimePkg as any ) . default ?. DriverPlugin || ( RuntimePkg as any ) . default ;
2630const AppPlugin = RuntimePkg . AppPlugin || ( RuntimePkg as any ) . default ?. AppPlugin || ( RuntimePkg as any ) . default ;
2731const HonoServerPlugin = HonoServerPluginPkg . HonoServerPlugin || ( HonoServerPluginPkg as any ) . default ?. HonoServerPlugin || ( HonoServerPluginPkg as any ) . default ;
32+ const AuthPlugin = AuthPluginPkg . AuthPlugin || ( AuthPluginPkg as any ) . default ?. AuthPlugin || ( AuthPluginPkg as any ) . default ;
33+ const SetupPlugin = SetupPluginPkg . SetupPlugin || ( SetupPluginPkg as any ) . default ?. SetupPlugin || ( SetupPluginPkg as any ) . default ;
2834const createMemoryI18n = CorePkg . createMemoryI18n || ( CorePkg as any ) . default ?. createMemoryI18n ;
2935
3036import { ConsolePlugin } from './plugin' ;
@@ -70,15 +76,23 @@ class MemoryI18nPlugin {
7076 *
7177 * MemoryI18nPlugin MUST come before AppPlugin so that the i18n service
7278 * exists when AppPlugin.start() → loadTranslations() runs.
79+ *
80+ * SetupPlugin MUST load before AuthPlugin so that the setupNav service
81+ * is registered and available when AuthPlugin.init() tries to contribute menu items.
7382 */
7483const plugins : any [ ] = [
7584 new MemoryI18nPlugin ( ) ,
7685 new ObjectQLPlugin ( ) ,
7786 new DriverPlugin ( new InMemoryDriver ( ) , 'memory' ) ,
7887 // Each example stack loaded as an independent AppPlugin
7988 ...appConfigs . map ( ( config : any ) => new AppPlugin ( config ) ) ,
80- // Setup App registered via AppPlugin so ObjectQLPlugin discovers it
81- new AppPlugin ( setupAppConfig ) ,
89+ // SetupPlugin must come before AuthPlugin (setupNav service dependency)
90+ new SetupPlugin ( ) ,
91+ // AuthPlugin contributes to setupNav during init, so it must come AFTER SetupPlugin
92+ new AuthPlugin ( {
93+ secret : process . env . AUTH_SECRET || 'objectui-server-secret' ,
94+ baseUrl : process . env . BASE_URL || 'http://localhost:3000' ,
95+ } ) ,
8296 new HonoServerPlugin ( { port : 3000 } ) ,
8397 new ConsolePlugin ( ) ,
8498] ;
0 commit comments