@@ -16,12 +16,12 @@ import {
1616} from '../utils/format.js' ;
1717import {
1818 STUDIO_PATH ,
19- resolveConsolePath ,
20- hasConsoleDist ,
19+ resolveStudioPath ,
20+ hasStudioDist ,
2121 spawnViteDevServer ,
22- createConsoleProxyPlugin ,
23- createConsoleStaticPlugin ,
24- } from '../utils/console .js' ;
22+ createStudioProxyPlugin ,
23+ createStudioStaticPlugin ,
24+ } from '../utils/studio .js' ;
2525
2626// Helper to find available port
2727const getAvailablePort = async ( startPort : number ) : Promise < number > => {
@@ -53,7 +53,7 @@ export const serveCommand = new Command('serve')
5353 . argument ( '[config]' , 'Configuration file path' , 'objectstack.config.ts' )
5454 . option ( '-p, --port <port>' , 'Server port' , '3000' )
5555 . option ( '--dev' , 'Run in development mode (load devPlugins)' )
56- . option ( '--ui' , 'Enable Console UI at /_studio/' )
56+ . option ( '--ui' , 'Enable Studio UI at /_studio/' )
5757 . option ( '--no-server' , 'Skip starting HTTP server plugin' )
5858 . action ( async ( configPath , options ) => {
5959 let port = parseInt ( options . port ) ;
@@ -228,31 +228,31 @@ export const serveCommand = new Command('serve')
228228 }
229229 }
230230
231- // ── Console UI (--ui) ───────────────────────────────────────────
231+ // ── Studio UI (--ui) ─ ───────────────────────────────────────────
232232 let viteProcess : import ( 'child_process' ) . ChildProcess | null = null ;
233233
234234 if ( options . ui ) {
235- const consolePath = resolveConsolePath ( ) ;
236- if ( ! consolePath ) {
237- console . warn ( chalk . yellow ( ` ⚠ @objectstack/console not found — skipping UI` ) ) ;
235+ const studioPath = resolveStudioPath ( ) ;
236+ if ( ! studioPath ) {
237+ console . warn ( chalk . yellow ( ` ⚠ @objectstack/studio not found — skipping UI` ) ) ;
238238 } else if ( isDev ) {
239239 // Dev mode → spawn Vite dev server & proxy through Hono
240240 try {
241- const result = await spawnViteDevServer ( consolePath , { serverPort : port } ) ;
241+ const result = await spawnViteDevServer ( studioPath , { serverPort : port } ) ;
242242 viteProcess = result . process ;
243- await kernel . use ( createConsoleProxyPlugin ( result . port ) ) ;
244- trackPlugin ( 'ConsoleUI ' ) ;
243+ await kernel . use ( createStudioProxyPlugin ( result . port ) ) ;
244+ trackPlugin ( 'StudioUI ' ) ;
245245 } catch ( e : any ) {
246246 console . warn ( chalk . yellow ( ` ⚠ Console UI failed to start: ${ e . message } ` ) ) ;
247247 }
248248 } else {
249249 // Production mode → serve pre-built static files
250- const distPath = path . join ( consolePath , 'dist' ) ;
251- if ( hasConsoleDist ( consolePath ) ) {
252- await kernel . use ( createConsoleStaticPlugin ( distPath ) ) ;
253- trackPlugin ( 'ConsoleUI ' ) ;
250+ const distPath = path . join ( studioPath , 'dist' ) ;
251+ if ( hasStudioDist ( studioPath ) ) {
252+ await kernel . use ( createStudioStaticPlugin ( distPath ) ) ;
253+ trackPlugin ( 'StudioUI ' ) ;
254254 } else {
255- console . warn ( chalk . yellow ( ` ⚠ Console dist not found — run "pnpm --filter @objectstack/console build" first` ) ) ;
255+ console . warn ( chalk . yellow ( ` ⚠ Studio dist not found — run "pnpm --filter @objectstack/studio build" first` ) ) ;
256256 }
257257 }
258258 }
0 commit comments