import{ServerRoutes as i}from"../../constants/index.js";import{installDevRoutes as c,installProdRoutes as n}from"./routes/index.js";import{createRouter as p}from"./router.js";import{readStaticAsset as f}from"./node-asset-reader.js";import{startHttpServer as l}from"./http.js";import{listenStore as u}from"./store-ws.js";import{ejectComponentDataHandler as v}from"./routes/eject.js";import{attachWsServer as R}from"./ws.js";import{logger as S}from"../utils/index.js";import{telemetry as d}from"../../cli/telemetry/index.js";async function O(t,o,a){const{port:m=4e3}=a,e=p();e.get(i.EJECT_COMPONENT,v(t)),c(e,t),n(e,t,{readStaticAsset:f,resolveRouteData:r=>t.resolveRouteStaticData(r,o)});try{await t.userCodeReady;const r=await l(e,m),s=R(r);u(t,s)}catch(r){d.send("cli_error_caught",{message:r.message}),S.panic(r)}}export{O as startDevServer};
